From 0f9cf365b2b6a60e99d4e93d3228414ed67dcf8f Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Wed, 4 Feb 2015 22:40:36 +0000 Subject: [PATCH] [Hexagon] Converting atomic store/load to use AddrGP addressing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228223 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Hexagon/HexagonInstrInfoV4.td | 43 ++++++------------------ 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/lib/Target/Hexagon/HexagonInstrInfoV4.td b/lib/Target/Hexagon/HexagonInstrInfoV4.td index b3a9033b85c..dd28b3d183c 100644 --- a/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/lib/Target/Hexagon/HexagonInstrInfoV4.td @@ -4061,6 +4061,16 @@ let AddedComplexity = 100 in { def: Storea_pat; } +def: Loada_pat; +def: Loada_pat; +def: Loada_pat; +def: Loada_pat; + +def: Storea_pat, I32, addrgp, S2_storerbabs>; +def: Storea_pat, I32, addrgp, S2_storerhabs>; +def: Storea_pat, I32, addrgp, S2_storeriabs>; +def: Storea_pat, I64, addrgp, S2_storerdabs>; + // Indexed store double word - global address. // memw(Rs+#u6:2)=#S8 let AddedComplexity = 10 in @@ -4071,33 +4081,12 @@ def STrih_offset_ext_V4 : STInst<(outs), (add IntRegs:$src1, u6_1ImmPred:$src2))]>, Requires<[HasV4T]>; -def : Pat<(atomic_store_64 FoldGlobalAddrGP:$addr, - (i64 DoubleRegs:$src1)), - (S2_storerdabs FoldGlobalAddrGP:$addr, (i64 DoubleRegs:$src1))>, - Requires<[HasV4T]>; - -def : Pat<(atomic_store_8 FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1)), - (S2_storerbabs FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1))>, - Requires<[HasV4T]>; - -def : Pat<(atomic_store_16 FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1)), - (S2_storerhabs FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1))>, - Requires<[HasV4T]>; - -def : Pat<(atomic_store_32 FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1)), - (S2_storeriabs FoldGlobalAddrGP:$addr, (i32 IntRegs:$src1))>, - Requires<[HasV4T]>; - // Map from load(globaladdress + x) -> memd(#foo + x) let AddedComplexity = 100 in def : Pat<(i64 (load FoldGlobalAddrGP:$addr)), (i64 (L4_loadrd_abs FoldGlobalAddrGP:$addr))>, Requires<[HasV4T]>; -def : Pat<(atomic_load_64 FoldGlobalAddrGP:$addr), - (i64 (L4_loadrd_abs FoldGlobalAddrGP:$addr))>, - Requires<[HasV4T]>; - // Map from load(globaladdress + x) -> memb(#foo + x) let AddedComplexity = 100 in def : Pat<(i32 (extloadi8 FoldGlobalAddrGP:$addr)), @@ -4128,30 +4117,18 @@ def : Pat<(i32 (zextloadi16 FoldGlobalAddrGP:$addr)), (i32 (L4_loadruh_abs FoldGlobalAddrGP:$addr))>, Requires<[HasV4T]>; -def : Pat<(atomic_load_16 FoldGlobalAddrGP:$addr), - (i32 (L4_loadruh_abs FoldGlobalAddrGP:$addr))>, - Requires<[HasV4T]>; - // Map from load(globaladdress + x) -> memub(#foo + x) let AddedComplexity = 100 in def : Pat<(i32 (zextloadi8 FoldGlobalAddrGP:$addr)), (i32 (L4_loadrub_abs FoldGlobalAddrGP:$addr))>, Requires<[HasV4T]>; -def : Pat<(atomic_load_8 FoldGlobalAddrGP:$addr), - (i32 (L4_loadrub_abs FoldGlobalAddrGP:$addr))>, - Requires<[HasV4T]>; - // Map from load(globaladdress + x) -> memw(#foo + x) let AddedComplexity = 100 in def : Pat<(i32 (load FoldGlobalAddrGP:$addr)), (i32 (L4_loadri_abs FoldGlobalAddrGP:$addr))>, Requires<[HasV4T]>; -def : Pat<(atomic_load_32 FoldGlobalAddrGP:$addr), - (i32 (L4_loadri_abs FoldGlobalAddrGP:$addr))>, - Requires<[HasV4T]>; - //===----------------------------------------------------------------------===// // :raw for of boundscheck:hi:lo insns //===----------------------------------------------------------------------===//