[llvm] [ValueTracking] Conservative nosync check prevents vectorization (PR #181345)
Kshitij Paranjape via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 13 12:50:50 PST 2026
================
@@ -716,10 +716,18 @@ bool llvm::willNotFreeBetween(const Instruction *Assume,
return true;
};
- // Make sure the current function cannot arrange for another thread to free on
- // its behalf.
- if (!CtxI->getFunction()->hasNoSync())
- return false;
+ // Helper to make sure the current function cannot arrange for
+ // another thread to free on its behalf.
+ auto hasNoSyncCalls = [](auto Range) {
+ for (const auto &[Idx, I] : enumerate(Range)) {
+ if (Idx > MaxInstrsToCheckForFree)
+ return false;
+ if (const auto *CB = dyn_cast<CallBase>(&I))
----------------
kshitijvp wrote:
Done
https://github.com/llvm/llvm-project/pull/181345
More information about the llvm-commits
mailing list