[flang] [llvm] Reland [VPlan] Expand WidenInt inductions with nuw/nsw (PR #168354)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 06:13:46 PST 2025


alexey-bataev wrote:

Looks like it still crashes the compiler in some cases:
```
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @test() #0 {
.lr.ph.preheader:
  br label %.lr.ph5915

.lr.ph5915:                                       ; preds = %.lr.ph5906, %.lr.ph.preheader
  br label %.lr.ph5906

.lr.ph5906:                                       ; preds = %.lr.ph5906, %.lr.ph5915
  %.455335904 = phi i32 [ %.45533, %.lr.ph5906 ], [ 3, %.lr.ph5915 ]
  %0 = phi i64 [ %5, %.lr.ph5906 ], [ 1, %.lr.ph5915 ]
  %.45533.in5903 = phi i32 [ %.455335904, %.lr.ph5906 ], [ 0, %.lr.ph5915 ]
  %1 = sext i32 %.455335904 to i64
  %2 = getelementptr i8, ptr null, i64 %1
  store double 0.000000e+00, ptr %2, align 8
  %3 = sext i32 %.45533.in5903 to i64
  %4 = getelementptr i8, ptr null, i64 %3
  store double 0.000000e+00, ptr %4, align 8
  %5 = add i64 %0, -1
  %.45533 = add i32 %.455335904, 3
  %.not = icmp eq i64 %0, 0
  br i1 %.not, label %.lr.ph5915, label %.lr.ph5906
}

attributes #0 = { "target-cpu"="znver5" }

```
opt -S --passes=loop-vectorize ./repro.ll

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


More information about the llvm-commits mailing list