summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-07-06 20:33:21 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-07-06 20:33:21 +0000
commit3bb921e8df7e473f1653f0046e066df103d6e75a (patch)
treec0933cc14d44ee196509ab2ee23e808eac820ad5 /llvm/lib/CodeGen
parentd09c4c34c0d0eac5cf49b25918f8d94b13a1d1b2 (diff)
downloadbcm5719-llvm-3bb921e8df7e473f1653f0046e066df103d6e75a.tar.gz
bcm5719-llvm-3bb921e8df7e473f1653f0046e066df103d6e75a.zip
Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
llvm-svn: 7112
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
index 8f35be8a07d..ff214500dbc 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
@@ -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.
OpenPOWER on IntegriCloud