mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
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
This commit is contained in:
parent
f616f22e81
commit
46bf5afa01
@ -74,6 +74,12 @@ SparcV9InstrInfo::ConvertConstantToIntType(const TargetMachine &target,
|
|||||||
return (uint64_t) CB->getValue();
|
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.
|
// For other types of constants, some conversion may be needed.
|
||||||
// First, extract the constant operand according to its own type
|
// First, extract the constant operand according to its own type
|
||||||
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
|
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user