diff options
author | Hongtao Yu <hoy@fb.com> | 2023-04-17 13:44:39 -0700 |
---|---|---|
committer | Hongtao Yu <hoy@fb.com> | 2023-05-10 11:26:23 -0700 |
commit | 9272d0f07932d3b6804360cd6f3e754a07df4fb2 (patch) | |
tree | 5a35e9c06e5136d208aa1c3adee3544ce7c7ca50 /llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp | |
parent | 3977b77a6bb780b02559530a96597cdb1c0a5bf6 (diff) | |
download | llvm-9272d0f07932d3b6804360cd6f3e754a07df4fb2.zip llvm-9272d0f07932d3b6804360cd6f3e754a07df4fb2.tar.gz llvm-9272d0f07932d3b6804360cd6f3e754a07df4fb2.tar.bz2 |
[PseudoProbe] Clean up dwarf discriminator and avoid duplicating factor.
A pseudo probe is created with dwarf line information shared with its nearest instruction. If the instruction comes with a dwarf discriminator, it will be shared with the probe as well. This can confuse the later FS-AFDO discriminator assignment pass. To fix this, I'm cleaning up the discriminator fields for probes when they are inserted.
I also notice another possibility to change the discriminator field of pseudo probes in the pipeline before the FS discriminator assignment pass. That is the loop unroller, which assigns duplication factor to instruction being vectorized. I'm disabling that for pseudo probe intrinsics specifically, also for callsites with probes.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D148569
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp index ed8e34f..31b8cd3 100644 --- a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp @@ -347,7 +347,7 @@ llvm::UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount, !EnableFSDiscriminator) for (BasicBlock *BB : L->getBlocks()) for (Instruction &I : *BB) - if (!isa<DbgInfoIntrinsic>(&I)) + if (!I.isDebugOrPseudoInst()) if (const DILocation *DIL = I.getDebugLoc()) { auto NewDIL = DIL->cloneByMultiplyingDuplicationFactor(Count); if (NewDIL) |