mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
even though I'm about to rip it out, simplify the address mode stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -404,9 +404,7 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) {
|
||||
return false;
|
||||
|
||||
// FIXME: Calls can't fold loads through segment registers yet.
|
||||
if (const Value *Src = LD->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
if (PT->getAddressSpace() >= 256)
|
||||
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||
return false;
|
||||
|
||||
// Now let's find the callseq_start.
|
||||
|
@@ -421,25 +421,17 @@ def i32immSExt8 : PatLeaf<(i32 immSext8)>;
|
||||
|
||||
/// Load patterns: these constraint the match to the right address space.
|
||||
def dsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
if (PT->getAddressSpace() > 255)
|
||||
if (cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() > 255)
|
||||
return false;
|
||||
return true;
|
||||
}]>;
|
||||
|
||||
def gsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
return PT->getAddressSpace() == 256;
|
||||
return false;
|
||||
return cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() == 256;
|
||||
}]>;
|
||||
|
||||
def fsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
return PT->getAddressSpace() == 257;
|
||||
return false;
|
||||
return cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() == 257;
|
||||
}]>;
|
||||
|
||||
|
||||
@@ -448,10 +440,9 @@ def fsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||
// known to be 32-bit aligned or better. Ditto for i8 to i16.
|
||||
def loadi16 : PatFrag<(ops node:$ptr), (i16 (unindexedload node:$ptr)), [{
|
||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||
if (const Value *Src = LD->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
if (PT->getAddressSpace() > 255)
|
||||
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||
return false;
|
||||
|
||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||
if (ExtType == ISD::NON_EXTLOAD)
|
||||
return true;
|
||||
@@ -462,9 +453,7 @@ def loadi16 : PatFrag<(ops node:$ptr), (i16 (unindexedload node:$ptr)), [{
|
||||
|
||||
def loadi16_anyext : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)),[{
|
||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||
if (const Value *Src = LD->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
if (PT->getAddressSpace() > 255)
|
||||
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||
return false;
|
||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||
if (ExtType == ISD::EXTLOAD)
|
||||
@@ -474,9 +463,7 @@ def loadi16_anyext : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)),[{
|
||||
|
||||
def loadi32 : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)), [{
|
||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||
if (const Value *Src = LD->getSrcValue())
|
||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
||||
if (PT->getAddressSpace() > 255)
|
||||
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||
return false;
|
||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||
if (ExtType == ISD::NON_EXTLOAD)
|
||||
|
Reference in New Issue
Block a user