This patch improves the 32-bit target i64 constant matching to detect the shuffle vector splats that are introduced by i64 vector shift vectorization (D8416).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
17157 ↗ | (On Diff #30079) | We should check that the SplatIndex is covered by the first operand of Amt, otherwise the following code is wrong. |
Hi Simon,
Thanks for the updated version. I have mixed feeling about it though. Indeed, I think the code is correct, but given how the lowering works, I believe we cannot reach it.
In other words, currently, I do not think we can produce a test case that covers this code. If you can add a test case to cover it, then awesome :).
How about not doing the transformation when the splat index is not covered by the first operand, so that if it happens we would have a test case to add with the code support it?
Other than that LGTM, no need to wait for a new review.
Thanks,
-Quentin
Yes the canonicalization in DAG.getVectorShuffle /should/ stop it happening. Would adding an assert to check the splat comes from the first operand be too harsh?