mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-13 16:03:58 +00:00
remove nvload and two patterns that use it which are
better done by dag combine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97633 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f7866e796
commit
99fe641325
@ -417,23 +417,6 @@ def loadi32 : PatFrag<(ops node:$ptr), (i32 (unindexedload node:$ptr)), [{
|
||||
return false;
|
||||
}]>;
|
||||
|
||||
def nvloadi32 : 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)
|
||||
return false;
|
||||
if (LD->isVolatile())
|
||||
return false;
|
||||
ISD::LoadExtType ExtType = LD->getExtensionType();
|
||||
if (ExtType == ISD::NON_EXTLOAD)
|
||||
return true;
|
||||
if (ExtType == ISD::EXTLOAD)
|
||||
return LD->getAlignment() >= 4;
|
||||
return false;
|
||||
}]>;
|
||||
|
||||
|
||||
def loadi8 : PatFrag<(ops node:$ptr), (i8 (dsload node:$ptr))>;
|
||||
def loadi64 : PatFrag<(ops node:$ptr), (i64 (dsload node:$ptr))>;
|
||||
def loadf32 : PatFrag<(ops node:$ptr), (f32 (dsload node:$ptr))>;
|
||||
@ -4416,12 +4399,6 @@ def : Pat<(i16 (anyext GR8 :$src)), (MOVZX16rr8 GR8 :$src)>;
|
||||
def : Pat<(i32 (anyext GR8 :$src)), (MOVZX32rr8 GR8 :$src)>;
|
||||
def : Pat<(i32 (anyext GR16:$src)), (MOVZX32rr16 GR16:$src)>;
|
||||
|
||||
// (and (i32 load), 255) -> (zextload i8)
|
||||
def : Pat<(i32 (and (nvloadi32 addr:$src), (i32 255))),
|
||||
(MOVZX32rm8 addr:$src)>;
|
||||
def : Pat<(i32 (and (nvloadi32 addr:$src), (i32 65535))),
|
||||
(MOVZX32rm16 addr:$src)>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Some peepholes
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user