[llvm] [VPlan] Generalize licm-sink to strip zero-user bail (PR #187077)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 04:22:21 PDT 2026


================
@@ -38,6 +34,10 @@ define void @test1(ptr noalias nocapture %a, ptr noalias nocapture readonly %b)
 ; CHECK-NEXT:    [[TMP20:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
 ; CHECK-NEXT:    br i1 [[TMP20]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
 ; CHECK:       [[MIDDLE_BLOCK]]:
+; CHECK-NEXT:    [[TMP17:%.*]] = fcmp ogt float [[TMP10]], 1.000000e+02
+; CHECK-NEXT:    [[TMP18:%.*]] = fcmp ogt float [[TMP12]], 1.000000e+02
+; CHECK-NEXT:    tail call void @llvm.assume(i1 [[TMP17]])
+; CHECK-NEXT:    tail call void @llvm.assume(i1 [[TMP18]])
----------------
fhahn wrote:

is it possible to get a better test for this? Ideally assumes should not be sunk, as this sinking destroys information (no it only holds after the vector loop, previously for each iteartion)

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


More information about the llvm-commits mailing list