[llvm] [SLP]Support LShr as base for copyable elements (PR #153393)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 16 05:16:32 PDT 2025


alexey-bataev wrote:

> hi, this introduces crashes, even at head after the fixes:
> 
> ```
> $ cat /tmp/a.ll
> 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 @_RNvMs0_NtCsjIjFnkOzZDy_6object5writeNtB5_6Object4emit() {
> .loopexit381:
>   %0 = trunc i64 0 to i32
>   %1 = select i1 false, i32 %0, i32 0
>   %2 = trunc i64 0 to i32
>   %3 = select i1 false, i32 %2, i32 0
>   %4 = add i32 %2, 0
>   %5 = select i1 false, i32 %4, i32 0
>   br label %6
> 
> 6:                                                ; preds = %.loopexit381
>   %7 = getelementptr i8, ptr null, i64 12
>   store i32 %1, ptr %7, align 4
>   %8 = getelementptr i8, ptr null, i64 16
>   store i32 %1, ptr %8, align 4
>   %9 = getelementptr i8, ptr null, i64 20
>   store i32 %3, ptr %9, align 4
>   %10 = getelementptr i8, ptr null, i64 24
>   store i32 %5, ptr %10, align 4
>   ret void
> }
> $ build/rel/bin/opt -p slp-vectorizer -disable-output /tmp/a.ll
> opt: ../../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5048: int llvm::slpvectorizer::BoUpSLP::ScheduleCopyableData::incrementUnscheduledDeps(int): Assertion `UnscheduledDeps >= 0 && "invariant"' failed.
> ```

Checked the most recent version, cannot reproduce it

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


More information about the llvm-commits mailing list