aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-19 22:31:21 +0000
committerChris Lattner <sabre@nondot.org>2005-01-19 22:31:21 +0000
commit2c49f2795514a7c56b680ba0310d7eb0a8a43289 (patch)
tree1d78d6c70c5b6516a1aa21324baaea273067a03d
parent6fb5a4a5f83355f431a652522a38ca4777f69bf9 (diff)
Support targets that do not use i8 shift amounts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19707 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index a17caa1469..3439249446 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -450,6 +450,10 @@ void SelectionDAGLowering::visitBr(BranchInst &I) {
void SelectionDAGLowering::visitBinary(User &I, unsigned Opcode) {
SDOperand Op1 = getValue(I.getOperand(0));
SDOperand Op2 = getValue(I.getOperand(1));
+
+ if (isa<ShiftInst>(I))
+ Op2 = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), Op2);
+
setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2));
}