[llvm] [SCEV] Extend isBasicBlockEntryGuardedByCond to handle merge block (PR #190602)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 09:37:25 PDT 2026


================
@@ -443,7 +443,7 @@ define i32 @computeSCEVAtScope(i32 %d.0) {
 ; CHECK-NEXT:    %inc3 = add nsw i32 %e.1, 1
 ; CHECK-NEXT:    --> {(1 + %d.0),+,1}<nw><%for.cond> U: full-set S: full-set Exits: 1 LoopDispositions: { %for.cond: Computable, %while.cond: Variant }
 ; CHECK-NEXT:    %f.1 = phi i32 [ %inc8, %for.body5 ], [ 0, %for.cond4.preheader ]
-; CHECK-NEXT:    --> {0,+,1}<nuw><nsw><%for.cond4> U: [0,1) S: [0,1) Exits: 0 LoopDispositions: { %for.cond4: Computable, %while.cond: Variant }
+; CHECK-NEXT:    --> {0,+,1}<%for.cond4> U: full-set S: full-set Exits: 0 LoopDispositions: { %for.cond4: Computable, %while.cond: Variant }
----------------
efriedma-quic wrote:

Are you saying that making isEntryBlockGuardedByCond succeed in more cases is triggering a suboptimal optimization elsewhere?  Which caller of isEntryBlockGuardedByCond is affected by this?

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


More information about the llvm-commits mailing list