[llvm] [LoopVersioningLICM] Do not let llvm.pseudoprobe block loop versioning (PR #209684)
chandan singh via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 19 23:02:37 PDT 2026
================
@@ -303,6 +305,15 @@ bool LoopVersioningLICM::instructionSafeForVersioning(Instruction *I) {
assert(I != nullptr && "Null instruction found!");
// Check function call safety
if (auto *Call = dyn_cast<CallBase>(I)) {
+ // Pseudo probe intrinsics are placeholders used for sample-based profiling.
+ // They are marked as accessing inaccessible memory so that the optimizer
+ // does not remove or move them, but they have no observable effect on the
+ // loop's memory accesses. Ignore them so that their presence under
+ // sample-based profiling (in the presence of -fpseudo-probe-for-profiling)
+ // does not block loop versioning.
+ if (isa<PseudoProbeInst>(Call))
----------------
chandankds wrote:
@efriedma-quic Thanks for the suggestions! I understand now onlyAccessesInaccessibleMemory() is a strict superset of doesNotAccessMemory() and I've updated the patch to use onlyAccessesInaccessibleMemory() and added the missing willReturn() check. Please review whenever you find some time.
https://github.com/llvm/llvm-project/pull/209684
More information about the llvm-commits
mailing list