mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +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:
parent
84bd98ac7b
commit
701cd62297
@ -404,10 +404,8 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// FIXME: Calls can't fold loads through segment registers yet.
|
// FIXME: Calls can't fold loads through segment registers yet.
|
||||||
if (const Value *Src = LD->getSrcValue())
|
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
return false;
|
||||||
if (PT->getAddressSpace() >= 256)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Now let's find the callseq_start.
|
// Now let's find the callseq_start.
|
||||||
while (HasCallSeq && Chain.getOpcode() != ISD::CALLSEQ_START) {
|
while (HasCallSeq && Chain.getOpcode() != ISD::CALLSEQ_START) {
|
||||||
|
@ -421,25 +421,17 @@ def i32immSExt8 : PatLeaf<(i32 immSext8)>;
|
|||||||
|
|
||||||
/// Load patterns: these constraint the match to the right address space.
|
/// Load patterns: these constraint the match to the right address space.
|
||||||
def dsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
def dsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
if (cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() > 255)
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
return false;
|
||||||
if (PT->getAddressSpace() > 255)
|
|
||||||
return false;
|
|
||||||
return true;
|
return true;
|
||||||
}]>;
|
}]>;
|
||||||
|
|
||||||
def gsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
def gsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
return cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() == 256;
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
|
||||||
return PT->getAddressSpace() == 256;
|
|
||||||
return false;
|
|
||||||
}]>;
|
}]>;
|
||||||
|
|
||||||
def fsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
def fsload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
|
||||||
if (const Value *Src = cast<LoadSDNode>(N)->getSrcValue())
|
return cast<LoadSDNode>(N)->getPointerInfo().getAddrSpace() == 257;
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
|
||||||
return PT->getAddressSpace() == 257;
|
|
||||||
return false;
|
|
||||||
}]>;
|
}]>;
|
||||||
|
|
||||||
|
|
||||||
@ -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.
|
// known to be 32-bit aligned or better. Ditto for i8 to i16.
|
||||||
def loadi16 : PatFrag<(ops node:$ptr), (i16 (unindexedload node:$ptr)), [{
|
def loadi16 : PatFrag<(ops node:$ptr), (i16 (unindexedload node:$ptr)), [{
|
||||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||||
if (const Value *Src = LD->getSrcValue())
|
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
return false;
|
||||||
if (PT->getAddressSpace() > 255)
|
|
||||||
return false;
|
|
||||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||||
if (ExtType == ISD::NON_EXTLOAD)
|
if (ExtType == ISD::NON_EXTLOAD)
|
||||||
return true;
|
return true;
|
||||||
@ -462,10 +453,8 @@ def loadi16 : PatFrag<(ops node:$ptr), (i16 (unindexedload node:$ptr)), [{
|
|||||||
|
|
||||||
def loadi16_anyext : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)),[{
|
def loadi16_anyext : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)),[{
|
||||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||||
if (const Value *Src = LD->getSrcValue())
|
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
return false;
|
||||||
if (PT->getAddressSpace() > 255)
|
|
||||||
return false;
|
|
||||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||||
if (ExtType == ISD::EXTLOAD)
|
if (ExtType == ISD::EXTLOAD)
|
||||||
return LD->getAlignment() >= 2 && !LD->isVolatile();
|
return LD->getAlignment() >= 2 && !LD->isVolatile();
|
||||||
@ -474,10 +463,8 @@ def loadi16_anyext : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)),[{
|
|||||||
|
|
||||||
def loadi32 : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)), [{
|
def loadi32 : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)), [{
|
||||||
LoadSDNode *LD = cast<LoadSDNode>(N);
|
LoadSDNode *LD = cast<LoadSDNode>(N);
|
||||||
if (const Value *Src = LD->getSrcValue())
|
if (LD->getPointerInfo().getAddrSpace() > 255)
|
||||||
if (const PointerType *PT = dyn_cast<PointerType>(Src->getType()))
|
return false;
|
||||||
if (PT->getAddressSpace() > 255)
|
|
||||||
return false;
|
|
||||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||||
if (ExtType == ISD::NON_EXTLOAD)
|
if (ExtType == ISD::NON_EXTLOAD)
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user