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:
Chris Lattner 2010-09-21 19:41:58 +00:00
parent 84bd98ac7b
commit 701cd62297
2 changed files with 13 additions and 28 deletions

View File

@ -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) {

View File

@ -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;