llvm-project
3a8a43f2 - [AArch64][GlobalISel] Fix matchUseVectorTruncate to check element order before folding (#185834)

Commit
15 days ago
[AArch64][GlobalISel] Fix matchUseVectorTruncate to check element order before folding (#185834) matchUseVectorTruncate incorrectly folded a G_UNMERGE_VALUES + G_TRUNC + G_BUILD_VECTOR sequence into a single vector G_TRUNC even when the BUILD_VECTOR operand order did not match the UNMERGE_VALUES result order. This silently dropped element reordering, producing a miscompile. Add an element-ordering check: BUILD_VECTOR position I must use UNMERGE_VALUES result I, otherwise the fold is rejected.
Author
Parents
Loading