aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnroll.cpp
diff options
context:
space:
mode:
authorHongtao Yu <hoy@fb.com>2023-04-17 13:44:39 -0700
committerHongtao Yu <hoy@fb.com>2023-05-10 11:26:23 -0700
commit9272d0f07932d3b6804360cd6f3e754a07df4fb2 (patch)
tree5a35e9c06e5136d208aa1c3adee3544ce7c7ca50 /llvm/lib/Transforms/Utils/LoopUnroll.cpp
parent3977b77a6bb780b02559530a96597cdb1c0a5bf6 (diff)
downloadllvm-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/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index ee6fd69..0a12885 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -516,7 +516,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
!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(ULO.Count);
if (NewDIL)