[DAGCombiner] Use `getAnyExtOrTrunc` instead of TRUNCATE in ExtractVectorElt combine
authorPierre van Houtryve <pierre.vanhoutryve@amd.com>
Fri, 28 Oct 2022 06:28:35 +0000 (06:28 +0000)
committerPierre van Houtryve <pierre.vanhoutryve@amd.com>
Fri, 28 Oct 2022 06:33:29 +0000 (06:33 +0000)
commit088a81682444839e58ed5deaad50175d956db777
tree67f71464db3a14763f1c4794397dad2ea2798693
parent21b825738b7e4f45a42cd5fb1b8480996677fc9e
[DAGCombiner] Use `getAnyExtOrTrunc` instead of TRUNCATE in ExtractVectorElt combine

ScalarVT isn't guaranteed to be smaller than the BCSrc.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D136849
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/dagcombine-v1i8-extractvecelt-crash.ll [new file with mode: 0644]