aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-13 19:09:16 +0000
committerChris Lattner <sabre@nondot.org>2011-02-13 19:09:16 +0000
commite075118489baf15a7cea2e7f155b4799b93d6d02 (patch)
tree9cf6795a2e0d8eddc3739d05383dcd29de983679 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parente5116f840eedbc3cffa31adc683b4e37d53f2c7a (diff)
downloadexternal_llvm-e075118489baf15a7cea2e7f155b4799b93d6d02.zip
external_llvm-e075118489baf15a7cea2e7f155b4799b93d6d02.tar.gz
external_llvm-e075118489baf15a7cea2e7f155b4799b93d6d02.tar.bz2
Revisit my fix for PR9028: the issue is that DAGCombine was
generating i8 shift amounts for things like i1024 types. Add an assert in getNode to prevent this from occuring in the future, fix the buggy transformation, revert my previous patch, and document this gotcha in ISDOpcodes.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 696cd24..09e33e2 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2434,7 +2434,6 @@ void SelectionDAGBuilder::visitShift(const User &I, unsigned Opcode) {
DebugLoc DL = getCurDebugLoc();
// If the operand is smaller than the shift count type, promote it.
- MVT PtrTy = TLI.getPointerTy();
if (ShiftSize > Op2Size)
Op2 = DAG.getNode(ISD::ZERO_EXTEND, DL, ShiftTy, Op2);
@@ -2445,9 +2444,9 @@ void SelectionDAGBuilder::visitShift(const User &I, unsigned Opcode) {
else if (ShiftSize >= Log2_32_Ceil(Op2.getValueType().getSizeInBits()))
Op2 = DAG.getNode(ISD::TRUNCATE, DL, ShiftTy, Op2);
// Otherwise we'll need to temporarily settle for some other convenient
- // type. Type legalization will make adjustments as needed.
+ // type. Type legalization will make adjustments once the shiftee is split.
else
- Op2 = DAG.getZExtOrTrunc(Op2, DL, PtrTy);
+ Op2 = DAG.getZExtOrTrunc(Op2, DL, MVT::i32);
}
setValue(&I, DAG.getNode(Opcode, getCurDebugLoc(),