diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-15 01:28:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-15 01:28:08 +0000 |
commit | 709fd414e2e5c3f3f282864a16688409ea152706 (patch) | |
tree | ffd4845e45646a6a60dd4f2a5f83c9f31b710c8f | |
parent | 19e3f31f6acd9f5ce3cdd8372d4cb598ed921f95 (diff) |
fix subtle bugs in inline asm operand selection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37065 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index da95925848..6de6b21c78 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -4725,18 +4725,19 @@ isOperandValidForConstraint(SDOperand Op, char Constraint, SelectionDAG &DAG) { case 'I': if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) { if (C->getValue() <= 31) - return Op; + return DAG.getTargetConstant(C->getValue(), Op.getValueType()); } return SDOperand(0,0); case 'N': if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) { if (C->getValue() <= 255) - return Op; + return DAG.getTargetConstant(C->getValue(), Op.getValueType()); } return SDOperand(0,0); case 'i': { // Literal immediates are always ok. - if (isa<ConstantSDNode>(Op)) return Op; + if (ConstantSDNode *CST = dyn_cast<ConstantSDNode>(Op)) + return DAG.getTargetConstant(CST->getValue(), Op.getValueType()); // If we are in non-pic codegen mode, we allow the address of a global (with // an optional displacement) to be used with 'i'. |