summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-06-11 02:03:48 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-06-11 02:03:48 +0000
commit46bf5afa01b71f672bfc37166989884ea60647d1 (patch)
tree24645b7f1bb4fc0db09c280192c714e6490b8aae
parentf616f22e816ce7f7ba3414cf3d91c9410aa03223 (diff)
downloadllvm-46bf5afa01b71f672bfc37166989884ea60647d1.tar.gz
llvm-46bf5afa01b71f672bfc37166989884ea60647d1.tar.bz2
llvm-46bf5afa01b71f672bfc37166989884ea60647d1.tar.xz
Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14128 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/SparcV9/SparcV9InstrInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrInfo.cpp b/lib/Target/SparcV9/SparcV9InstrInfo.cpp
index cbbe154ccf..986d4a88b3 100644
--- a/lib/Target/SparcV9/SparcV9InstrInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrInfo.cpp
@@ -74,6 +74,12 @@ SparcV9InstrInfo::ConvertConstantToIntType(const TargetMachine &target,
return (uint64_t) CB->getValue();
}
+ // ConstantPointerNull: it's really just a big, shiny version of zero.
+ if (const ConstantPointerNull *CPN = dyn_cast<ConstantPointerNull>(V)) {
+ isValidConstant = true;
+ return 0;
+ }
+
// For other types of constants, some conversion may be needed.
// First, extract the constant operand according to its own type
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V))