diff options
author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-26 18:57:22 +0000 |
---|---|---|
committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-26 18:57:22 +0000 |
commit | 63602ed8769afc21e7085d95263475c6669deaaf (patch) | |
tree | deb542a450e0fb9e85b0612f573d96a1a675bea5 /lib/Target/PTX/PTXInstrLoadStore.td | |
parent | 439780eeaef1a2c6a1105fb705a27c5c819e8d0e (diff) | |
download | llvm-63602ed8769afc21e7085d95263475c6669deaaf.tar.gz llvm-63602ed8769afc21e7085d95263475c6669deaaf.tar.bz2 llvm-63602ed8769afc21e7085d95263475c6669deaaf.tar.xz |
PTX: Fix detection of stack load/store vs. global load/store, as well as fix the
printing of local offsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PTX/PTXInstrLoadStore.td')
-rw-r--r-- | lib/Target/PTX/PTXInstrLoadStore.td | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/Target/PTX/PTXInstrLoadStore.td b/lib/Target/PTX/PTXInstrLoadStore.td index 83aafd81ef..bb84bb5696 100644 --- a/lib/Target/PTX/PTXInstrLoadStore.td +++ b/lib/Target/PTX/PTXInstrLoadStore.td @@ -24,9 +24,7 @@ def Use64BitAddresses : Predicate<"getSubtarget().is64Bit()">; def load_global : PatFrag<(ops node:$ptr), (load node:$ptr), [{ const Value *Src; const PointerType *PT; - const SDValue &MemOp = N->getOperand(1); - if ((MemOp.getOpcode() != ISD::FrameIndex) && - (Src = cast<LoadSDNode>(N)->getSrcValue()) && + if ((Src = cast<LoadSDNode>(N)->getSrcValue()) && (PT = dyn_cast<PointerType>(Src->getType()))) return PT->getAddressSpace() == PTX::GLOBAL; return false; @@ -41,11 +39,6 @@ def load_constant : PatFrag<(ops node:$ptr), (load node:$ptr), [{ return false; }]>; -def load_local : PatFrag<(ops node:$ptr), (load node:$ptr), [{ - const SDValue &MemOp = N->getOperand(1); - return MemOp.getOpcode() == ISD::FrameIndex; -}]>; - def load_shared : PatFrag<(ops node:$ptr), (load node:$ptr), [{ const Value *Src; const PointerType *PT; @@ -59,20 +52,12 @@ def store_global : PatFrag<(ops node:$d, node:$ptr), (store node:$d, node:$ptr), [{ const Value *Src; const PointerType *PT; - const SDValue &MemOp = N->getOperand(2); - if ((MemOp.getOpcode() != ISD::FrameIndex) && - (Src = cast<StoreSDNode>(N)->getSrcValue()) && + if ((Src = cast<StoreSDNode>(N)->getSrcValue()) && (PT = dyn_cast<PointerType>(Src->getType()))) return PT->getAddressSpace() == PTX::GLOBAL; return false; }]>; -def store_local - : PatFrag<(ops node:$d, node:$ptr), (store node:$d, node:$ptr), [{ - const SDValue &MemOp = N->getOperand(2); - return MemOp.getOpcode() == ISD::FrameIndex; -}]>; - def store_shared : PatFrag<(ops node:$d, node:$ptr), (store node:$d, node:$ptr), [{ const Value *Src; @@ -221,16 +206,16 @@ multiclass PTX_ST<string opstr, string typestr, RegisterClass RC, multiclass PTX_LOCAL_LD_ST<string typestr, RegisterClass RC> { def LDri32 : InstPTX<(outs RC:$d), (ins LOCALri32:$a), !strconcat("ld.local", !strconcat(typestr, "\t$d, [$a]")), - [(set RC:$d, (load_local ADDRlocal32:$a))]>; + [(set RC:$d, (load_global ADDRlocal32:$a))]>; def LDri64 : InstPTX<(outs RC:$d), (ins LOCALri64:$a), !strconcat("ld.local", !strconcat(typestr, "\t$d, [$a]")), - [(set RC:$d, (load_local ADDRlocal64:$a))]>; + [(set RC:$d, (load_global ADDRlocal64:$a))]>; def STri32 : InstPTX<(outs), (ins RC:$d, LOCALri32:$a), !strconcat("st.local", !strconcat(typestr, "\t[$a], $d")), - [(store_local RC:$d, ADDRlocal32:$a)]>; + [(store_global RC:$d, ADDRlocal32:$a)]>; def STri64 : InstPTX<(outs), (ins RC:$d, LOCALri64:$a), !strconcat("st.local", !strconcat(typestr, "\t[$a], $d")), - [(store_local RC:$d, ADDRlocal64:$a)]>; + [(store_global RC:$d, ADDRlocal64:$a)]>; } multiclass PTX_PARAM_LD_ST<string typestr, RegisterClass RC> { |