diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-27 21:11:20 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-07-27 21:11:20 +0000 |
commit | a770e0041b07bb66177eff6f473452e1b087eb2a (patch) | |
tree | 66dfb9cdd2e5c3eb87e93b7aa6f76eb30ef53f20 | |
parent | a2601e3e55b10a8e1d3978c0e1710e2c1997d1b0 (diff) |
This was the only user of TargetInstrInfo::ConstantTypeMustBeLoaded().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15293 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/SparcV9/SparcV9PreSelection.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/SparcV9/SparcV9PreSelection.cpp b/lib/Target/SparcV9/SparcV9PreSelection.cpp index f6ab34aa1e..97fa212e95 100644 --- a/lib/Target/SparcV9/SparcV9PreSelection.cpp +++ b/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 |