[InstCombine] fold more shuffles with FP<->Int cast operands
authorSanjay Patel <spatel@rotateright.com>
Tue, 24 May 2022 19:07:24 +0000 (15:07 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 24 May 2022 19:11:38 +0000 (15:11 -0400)
commit05527b68a0be19fe49b884f3b22195701dc4b46f
tree081a444c2cf9f559a2fc464ed509a2543cc0fb33
parent6edbdf80cac119f8f30d2ae6fa2972d9e778510b
[InstCombine] fold more shuffles with FP<->Int cast operands

shuffle (cast X), (cast Y), Mask --> cast (shuffle X, Y, Mask)

This extends the transform added with 0353c2c996c5.

If the shuffle reduces vector length, the transform
reduces the width of the cast, so that should be a
win for most codegen (if not, it can be inverted).
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/vec_shuffle.ll