[llvm] [LICM] Ignore AA tags on conditional stores in scalar promotion. (PR #218031)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 22 00:34:24 PDT 2026


================
@@ -2356,7 +2364,22 @@ collectPromotionCandidates(MemorySSA *MSSA, AliasAnalysis *AA, Loop *L) {
   foreachMemoryAccess(MSSA, L, [&](Instruction *I) {
     if (IsPotentiallyPromotable(I)) {
       AttemptingPromotion.insert(I);
-      AST.add(I);
+      if (StoreInst *SI = dyn_cast<StoreInst>(I);
+          SI && !SafetyInfo->isGuaranteedToExecute(*SI, DT, L)) {
----------------
nikic wrote:

Ideally we would not call isGuaranteedToExecute() here in cases where AATags are empty in the first place.

https://github.com/llvm/llvm-project/pull/218031


More information about the llvm-commits mailing list