Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 6 Jul 2003 20:33:21 +0000 (20:33 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 6 Jul 2003 20:33:21 +0000 (20:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp

index 8f35be8a07d3ce38802e9baeac385941128896d9..ff214500dbcd48bef81a1810fbc598a0b9d3cd00 100644 (file)
@@ -91,9 +91,10 @@ ChooseRegOrImmed(Value* val,
 
   // To use reg or immed, constant needs to be integer, bool, or a NULL pointer
   Constant *CPV = dyn_cast<Constant>(val);
-  if (CPV == NULL ||
-      (! CPV->getType()->isIntegral() &&
-       ! (isa<PointerType>(CPV->getType()) && CPV->isNullValue())))
+  if (CPV == NULL
+      || CPV->isConstantExpr()
+      || (! CPV->getType()->isIntegral() &&
+          ! (isa<PointerType>(CPV->getType()) && CPV->isNullValue())))
     return MachineOperand::MO_VirtualRegister;
 
   // Now get the constant value and check if it fits in the IMMED field.
index 8f35be8a07d3ce38802e9baeac385941128896d9..ff214500dbcd48bef81a1810fbc598a0b9d3cd00 100644 (file)
@@ -91,9 +91,10 @@ ChooseRegOrImmed(Value* val,
 
   // To use reg or immed, constant needs to be integer, bool, or a NULL pointer
   Constant *CPV = dyn_cast<Constant>(val);
-  if (CPV == NULL ||
-      (! CPV->getType()->isIntegral() &&
-       ! (isa<PointerType>(CPV->getType()) && CPV->isNullValue())))
+  if (CPV == NULL
+      || CPV->isConstantExpr()
+      || (! CPV->getType()->isIntegral() &&
+          ! (isa<PointerType>(CPV->getType()) && CPV->isNullValue())))
     return MachineOperand::MO_VirtualRegister;
 
   // Now get the constant value and check if it fits in the IMMED field.