> On 15 Nov 2025, at 8:36 am, Kugan Vivekanandarajah <[email protected]> > wrote: > > External email: Use caution opening links or attachments > > > Hi, > >>> >>> I think we want to solve two problems >>> 1) Handle situation when statement is duplicated (unrolling, loop >>> header copying etc.) and thus different locations in program >>> corresponds to different copies. >>> >>> Current code simply picks address with maximal count (expecting that >>> the statemnt perhaps spans multiple BBs) while we should really sum >>> counts of execution of different copies. >>> 1) Handle situation where single address implies multiple executions >>> of the same statement (i.e. after vectorization) >>> > > Here is the revised patch-set. In this:2 > 1. I have dropped gcov changes to 32bit discriminator. Instead I have > changed autofdo tools to handle multiplicity and copy-id. > I have put-up a pull request to autfdo tools as > https://github.com/google/autofdo/pull/257. This means all the changes to > auto-profile pass is not needed for this. > We could still add 32bit support if there is a need as a follow up. > > I have the split the patch into > 1. Hierarchical discriminate support > 2. Change vectoriser to add hierarchal discriminator > 3. Adding hierarchical discriminate for loop versioning > 4. Adding hierarchical discriminate for loop unrolling >
This patch adds hierarchical discriminator support for vectorized loops.
Assigns copyid discriminators to distinguish vectorized and scalar versions.
gcc/ChangeLog:
* tree-vect-loop-manip.cc (vect_loop_versioning): Assign copyid
discriminators for vectorized and scalar loop versions.
* tree-vect-loop.cc (vect_transform_loop): Assign copyid
discriminators for vectorized and scalar loop versions.
gcc/testsuite/ChangeLog:
* gcc.dg/hierarchical-discriminator-vect-version.c: New test.
Signed-off-by: Kugan Vivekanandarajah <[email protected]>
Thanks.
Kugan
0002-AutoFDO-Add-hierarchical-discriminator-for-vectorize.patch
Description: 0002-AutoFDO-Add-hierarchical-discriminator-for-vectorize.patch
