Make sure we do not assert on value types not being
simple in getFauxShuffleMask when analysing operations
such as "v8i16 = truncate v8i24".
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
7554–7558 | Nice catch! We actually need to be more thorough, matching what we do for the extensions (further down the function): SDValue Src = N.getOperand(0); EVT SrcVT = Src.getValueType(); // Truncated source must be a simple vector. if (!SrcVT.isSimple() || (SrcVT.getSizeInBits() % 128) != 0 || (SrcVT.getScalarSizeInBits() % 8) != 0) return false; | |
llvm/test/CodeGen/X86/shuffle-combine-crash-3.ll | ||
61 | This can probably be reduced/cleaned up more? |
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
7554–7558 | Ok, I'll copy that. I was wondering if perhaps this whole thing should be avoided until we have legalized types? But maybe we want to do these combines earlier than that for some reason. But then I guess we still need the tests on bit sizes, so it wouldn't be enough. | |
llvm/test/CodeGen/X86/shuffle-combine-crash-3.ll | ||
61 | I did some attempts to reduce it (for example removing the first insertelement/shufflevector instructions using input arguments, but then I got a lot more asm instructions in the output). But given the feedback that the code change is reasonable, then I feel that I can invest some more time on reducing the test case. |
Nice catch! We actually need to be more thorough, matching what we do for the extensions (further down the function):