Do not try to create a MVT type of width 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2009-05-28 23:52:18 +00:00
parent 2265ba0717
commit d3c76bb6fc
2 changed files with 40 additions and 0 deletions
+2
View File
@@ -4937,6 +4937,8 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) {
APInt Imm = cast<ConstantSDNode>(N1)->getAPIntValue();
if (Opc == ISD::AND)
Imm ^= APInt::getAllOnesValue(BitWidth);
if (Imm == 0 || Imm.isAllOnesValue())
return SDValue();
unsigned ShAmt = Imm.countTrailingZeros();
unsigned MSB = BitWidth - Imm.countLeadingZeros() - 1;
unsigned NewBW = NextPowerOf2(MSB - ShAmt);