[llvm] [X86][CodeGen] Fix crash when commute operands of Instruction for code size (PR #79245)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 00:44:18 PST 2024


KanRobert wrote:

> > Difficult for me to create a test for this, maybe @gulfemsavrun could provide a reproducer later.
> 
> ```
> $ cat tmp.ll
> define <4 x float> @foo(<4 x float> %a, <4 x float> %b) optsize {
>   %r = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
>   ret <4 x float> %r
> }
> 
> $ llc < tmp.ll -mattr=+avx2
>         .text
>         .file   "<stdin>"
> Unreachable!
> UNREACHABLE executed at /export/users/pengfeiw/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:2396!
> ```

Awesome! Just added.

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


More information about the llvm-commits mailing list