mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-12 02:47:10 +00:00
[DAGCombiner] Prevent the combine added in r367710 from creating illegal types after type legalization.
This is further fix for PR42880. Sanjay already disabled the X86 TLI hook for non-simple types, but we should really call isTypeLegal here if we're after type legalization. llvm-svn: 367768
This commit is contained in:
parent
fe37499207
commit
2edeb8a11a
@ -7631,7 +7631,7 @@ SDValue DAGCombiner::visitSRA(SDNode *N) {
|
||||
EVT TruncVT = EVT::getIntegerVT(Ctx, OpSizeInBits - ShiftAmt);
|
||||
if (VT.isVector())
|
||||
TruncVT = EVT::getVectorVT(Ctx, TruncVT, VT.getVectorNumElements());
|
||||
if (TLI.isTruncateFree(VT, TruncVT)) {
|
||||
if (isTypeLegal(TruncVT) && TLI.isTruncateFree(VT, TruncVT)) {
|
||||
SDLoc DL(N);
|
||||
SDValue Trunc = DAG.getZExtOrTrunc(Shl.getOperand(0), DL, TruncVT);
|
||||
SDValue ShiftC = DAG.getConstant(AddC->getAPIntValue().lshr(ShiftAmt).
|
||||
|
Loading…
x
Reference in New Issue
Block a user