[llvm] [VPlan] Handle VPWidenCastRecipe without underlying value in EVL transform (PR #120194)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 01:42:59 PST 2024


================
@@ -0,0 +1,31 @@
+; RUN: opt -passes=loop-vectorize -force-tail-folding-style=data-with-evl -prefer-predicate-over-epilogue=predicate-dont-vectorize -mtriple=riscv64 -mattr=+v -S %s
+
+; Make sure we don't crash when transforming a VPWidenCastRecipe created without
+; an underlying value to an EVL recipe. This occurs in this test via
+; VPlanTransforms::truncateToMinimalBitwidths
+
+define void @truncate_to_minimal_bitwidths_widen_cast_recipe(ptr %dst, ptr %src, i32 %mvx) {
+entry:
+  %cmp111 = icmp sgt i32 %mvx, 0
+  br i1 %cmp111, label %for.body13.preheader, label %for.cond.cleanup12
+
+for.body13.preheader:                             ; preds = %entry
+  %wide.trip.count = zext nneg i32 %mvx to i64
+  br label %for.body13
+
+for.body13:                                       ; preds = %for.body13.preheader, %for.body13
----------------
fhahn wrote:

```suggestion
loop: 
```

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


More information about the llvm-commits mailing list