[llvm] [VPlan] Materialize constant vector trip counts before final opts. (PR #142309)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 14:57:17 PDT 2025


================
@@ -112,8 +112,7 @@ define void @f(ptr noundef captures(none) %a, float noundef %x) {
 ; CHECK-NEXT:    [[MUL_7:%.*]] = fmul float [[X]], [[LOAD_7]]
 ; CHECK-NEXT:    store float [[MUL_7]], ptr [[ARRAYIDX_7]], align 4
 ; CHECK-NEXT:    [[IV_NEXT_7]] = add nuw nsw i64 [[IV]], 8
-; CHECK-NEXT:    [[COMP_7:%.*]] = icmp eq i64 [[IV_NEXT_7]], 1024
-; CHECK-NEXT:    br i1 [[COMP_7]], label %[[EXIT_LOOPEXIT:.*]], label %[[FOR_BODY]], !llvm.loop [[LOOP3:![0-9]+]]
+; CHECK-NEXT:    br i1 true, label %[[EXIT_LOOPEXIT:.*]], label %[[FOR_BODY]], !llvm.loop [[LOOP3:![0-9]+]]
----------------
fhahn wrote:

This is due to unrolling (run by the test) now being able to reason about the remaining iterations, after removing an incoming value from the phi.

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


More information about the llvm-commits mailing list