bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest)
Only solve dest type is vector to avoid inverse transform in visitBitCast.
Differential D125951
[InstCombine] bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest) Chenbing.Zheng on May 19 2022, 12:51 AM. Authored by
Details bitcast (extractelement <1 x elt>, dest) -> bitcast(<1 x elt>, dest) Only solve dest type is vector to avoid inverse transform in visitBitCast.
Diff Detail
Unit Tests Event Timeline
Comment Actions Please pre-commit the baseline tests. But we also need tests with scalable vectors - the patch will crash on this example: define <2 x i32> @bitcast_extelt5_scalable(<vscale x 1 x i64> %A) { %ext = extractelement <vscale x 1 x i64> %A, i32 0 %bc = bitcast i64 %ext to <2 x i32> ret <2 x i32> %bc }
|
One-use should not be here - this transform replaces a value with an existing value, so it is always profitable.