summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SparcV9
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-07-27 21:11:20 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-07-27 21:11:20 +0000
commit28f75c21406ef4086ceea0fdcca875b38230d90d (patch)
tree48b51d67aa853c02bef71ede04ec5dbc9c936318 /llvm/lib/Target/SparcV9
parent1256571c0df8d13e4804597b6917f12894a3c62f (diff)
downloadbcm5719-llvm-28f75c21406ef4086ceea0fdcca875b38230d90d.tar.gz
bcm5719-llvm-28f75c21406ef4086ceea0fdcca875b38230d90d.zip
This was the only user of TargetInstrInfo::ConstantTypeMustBeLoaded().
llvm-svn: 15293
Diffstat (limited to 'llvm/lib/Target/SparcV9')
-rw-r--r--llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp b/llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp
index f6ab34aa1e4..97fa212e954 100644
--- a/llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp
+++ b/llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp
@@ -154,6 +154,10 @@ static Instruction* DecomposeConstantExpr(ConstantExpr* CE,
}
}
+static inline bool ConstantTypeMustBeLoaded(const Type* CVT) {
+ assert(CVT->isPrimitiveType() || isa<PointerType>(CVT));
+ return !(CVT->isIntegral() || isa<PointerType>(CVT));
+}
//------------------------------------------------------------------------------
// Instruction visitor methods to perform instruction-specific operations
@@ -177,7 +181,7 @@ PreSelection::visitOneOperand(Instruction &I, Value* Op, unsigned opNum,
// load-time constant: factor it out so we optimize as best we can
Instruction* computeConst = DecomposeConstantExpr(CE, insertBefore);
I.setOperand(opNum, computeConst); // replace expr operand with result
- } else if (instrInfo.ConstantTypeMustBeLoaded(CV)) {
+ } else if (ConstantTypeMustBeLoaded(CV->getType())) {
// load address of constant into a register, then load the constant
// this is now done during instruction selection
// the constant will live in the MachineConstantPool later on
OpenPOWER on IntegriCloud