[llvm] [VPlan] Add VPlan-dump-based test for predication (PR #180794)

Andrei Elovikov via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 08:30:22 PST 2026


================
@@ -0,0 +1,389 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -disable-output < %s -p loop-vectorize -vplan-print-after=introduceMasksAndLinearize -vplan-print-limit-to-vector-region 2>&1 | FileCheck %s
+
+define void @diamond_phi(ptr %a) {
+; CHECK-LABEL: 'diamond_phi'
+; CHECK-NEXT:  <x1> vector loop: {
+; CHECK-NEXT:    vector.body:
+; CHECK-NEXT:      EMIT vp<[[VP3:%[0-9]+]]> = CANONICAL-INDUCTION ir<0>, vp<%index.next>
+; CHECK-NEXT:      ir<%iv> = WIDEN-INDUCTION nuw nsw ir<0>, ir<1>, vp<[[VP0:%[0-9]+]]>
+; CHECK-NEXT:      EMIT ir<%gep> = getelementptr ir<%a>, ir<%iv>
+; CHECK-NEXT:      EMIT ir<%c0> = icmp sle ir<%iv>, ir<0>
+; CHECK-NEXT:    Successor(s): bb2
+; CHECK-EMPTY:
+; CHECK-NEXT:    bb2:
----------------
eas wrote:

I'd actually want us to preserve the blocks at this point to make it easier to read the `CHECK`s and verify we did the right thing. That's another reason why I have matching `bbN`/`cN`/`addN` naming convention in all the subtests.

As a side note, I did think about assigning names like `%name.not` / `%bbN.mask` for the instructions we generate but that couldn't be done "uniformly" (e.g., one def might be *both* a `not` and a `mask`).

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


More information about the llvm-commits mailing list