[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

Chris Lattner sabre at nondot.org
Sat Mar 24 18:57:52 PDT 2007



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.375 -> 1.376
---
Log message:

enforce the proper range for the i386 N constraint.


---
Diffs of the changes:  (+9 -8)

 X86ISelLowering.cpp |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.375 llvm/lib/Target/X86/X86ISelLowering.cpp:1.376
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.375	Thu Mar 22 13:42:45 2007
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Sat Mar 24 20:57:35 2007
@@ -4544,16 +4544,17 @@
   switch (Constraint) {
   default: break;
   case 'I':
-    if (isa<ConstantSDNode>(Op)) {
-      unsigned Value = cast<ConstantSDNode>(Op)->getValue();
-      if (Value <= 31)
+    if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
+      if (C->getValue() <= 31)
         return Op;
-      else 
-        return SDOperand(0,0);
-    } else {
-        return SDOperand(0,0);
     }
-    break;
+    return SDOperand(0,0);
+  case 'N':
+    if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
+      if (C->getValue() <= 255)
+        return Op;
+    }
+    return SDOperand(0,0);
   case 'i':
     // Literal immediates are always ok.
     if (isa<ConstantSDNode>(Op)) return Op;






More information about the llvm-commits mailing list