[all-commits] [llvm/llvm-project] 95ef1a: [SLP] Use the correct identity when combining bina...

Ryan Buchner via All-commits all-commits at lists.llvm.org
Thu Feb 12 09:35:06 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95ef1a5c3139c44bb171df225cb2b0aa17b50f1d
      https://github.com/llvm/llvm-project/commit/95ef1a5c3139c44bb171df225cb2b0aa17b50f1d
  Author: Ryan Buchner <rbuchner at qti.qualcomm.com>
  Date:   2026-02-12 (Thu, 12 Feb 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/X86/buildvector-postpone-for-dependency.ll
    M llvm/test/Transforms/SLPVectorizer/X86/bv-shuffle-mask.ll
    M llvm/test/Transforms/SLPVectorizer/X86/copyable-child-node-used-outside.ll
    A llvm/test/Transforms/SLPVectorizer/semanticly-same.ll

  Log Message:
  -----------
  [SLP] Use the correct identity when combining binary opcodes with AND/MUL (#180457)

Fixes #180456

Fix bug in the following SLP lowering:
```
define void @sub_mul(ptr %p, ptr %s) {
entry:
  %p1 = getelementptr i16, ptr %p, i64 1

  %l0 = load i16, ptr %p
  %l1 = load i16, ptr %p1

  %mul0 = sub i16 %l0, 0
  %mul1 = mul i16 %l1, 5

  %s1 = getelementptr i16, ptr %s, i64 1

  store i16 %mul0, ptr %s
  store i16 %mul1, ptr %s1
  ret void
}
```
to
```
define void @sub_mul(ptr %p, ptr %s) {
entry:
%tmp0 = load <2 x i16>, ptr %p, align 2
%tmp1 = mul <2 x i16> %tmp0, <i16 0, i16 5> -> updates to <i16 1, i16 5>
store <2 x i16> %tmp1, ptr %s, align 2
ret void
}
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list