mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -101,8 +101,7 @@ bool FastISel::hasTrivialKill(const Value *V) const {
|
||||
|
||||
// No-op casts are trivially coalesced by fast-isel.
|
||||
if (const CastInst *Cast = dyn_cast<CastInst>(I))
|
||||
if (Cast->isNoopCast(TD.getIntPtrType(Cast->getContext())) &&
|
||||
!hasTrivialKill(Cast->getOperand(0)))
|
||||
if (Cast->isNoopCast(TD) && !hasTrivialKill(Cast->getOperand(0)))
|
||||
return false;
|
||||
|
||||
// GEPs with all zero indices are trivially coalesced by fast-isel.
|
||||
@@ -175,7 +174,7 @@ unsigned FastISel::materializeRegForValue(const Value *V, MVT VT) {
|
||||
// Translate this as an integer zero so that it can be
|
||||
// local-CSE'd with actual integer zeros.
|
||||
Reg =
|
||||
getRegForValue(Constant::getNullValue(TD.getIntPtrType(V->getContext())));
|
||||
getRegForValue(Constant::getNullValue(TD.getIntPtrType(V->getType())));
|
||||
} else if (const ConstantFP *CF = dyn_cast<ConstantFP>(V)) {
|
||||
if (CF->isNullValue()) {
|
||||
Reg = TargetMaterializeFloatZero(CF);
|
||||
|
Reference in New Issue
Block a user