[llvm] [ExpandMemCmp] Only narrow load sizes for targets that opt in (PR #215186)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 10:55:56 PDT 2026


lenary wrote:

Agreed, can we make `NumLoadsPerBlock` apply even when we're not comparing with zero?

Presumably this ends up with a sequence something like:
```
  a1 = load i8
  a2 = load i8
  a3 = load i8
  a4 = load i8
  a = pack a1, a2, a3, a4 ; (yes, not one instruction)
  b1 = load i8
  b2 = load i8
  b3 = load i8
  b4 = load i8
  b = pack b1, b2, b3, b4
  c = cmp a, b
  branch c ...
```

Which is what webassembly is currently expanding to if you gave it i32s that are align 1?

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


More information about the llvm-commits mailing list