From: Colin LeMahieu Date: Wed, 4 Feb 2015 23:10:21 +0000 (+0000) Subject: [Hexagon] Simplifying some load and store patterns. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=18c8166405da6cd56789a8983e9f2a66184b447f;p=oota-llvm.git [Hexagon] Simplifying some load and store patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228227 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonInstrInfoV4.td b/lib/Target/Hexagon/HexagonInstrInfoV4.td index 75e08cbc552..d11a1c2d757 100644 --- a/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/lib/Target/Hexagon/HexagonInstrInfoV4.td @@ -3864,6 +3864,41 @@ def L2_loadrigp : T_LoadGP<"memw", "LDriw", IntRegs, u16_2Imm, 0b100>; let accessSize = DoubleWordAccess in def L2_loadrdgp : T_LoadGP<"memd", "LDrid", DoubleRegs, u16_3Imm, 0b110>; +def: Loada_pat; +def: Loada_pat; +def: Loada_pat; +def: Loada_pat; + +// Map from load(globaladdress) -> mem[u][bhwd](#foo) +class LoadGP_pats + : Pat <(VT (ldOp (HexagonCONST32_GP tglobaladdr:$global))), + (VT (MI tglobaladdr:$global))>; + +let AddedComplexity = 100 in { + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; + def: LoadGP_pats ; +} + +let AddedComplexity = 30 in { + def: Storea_pat; + def: Storea_pat; + def: Storea_pat; +} + +let AddedComplexity = 30 in { + def: Loada_pat; + def: Loada_pat; + def: Loada_pat; + def: Loada_pat; + def: Loada_pat; +} + let Predicates = [HasV4T], AddedComplexity = 30 in { def : Pat<(i32 (load (HexagonCONST32 tglobaladdr:$absaddr))), (L4_loadri_abs tglobaladdr: $absaddr)>; @@ -3881,23 +3916,6 @@ def : Pat<(i32 (zextloadi16 (HexagonCONST32 tglobaladdr:$absaddr))), (L4_loadruh_abs tglobaladdr:$absaddr)>; } -def : Pat <(atomic_load_64 (HexagonCONST32_GP tglobaladdr:$global)), - (i64 (L2_loadrdgp tglobaladdr:$global))>; - -def : Pat <(atomic_load_32 (HexagonCONST32_GP tglobaladdr:$global)), - (i32 (L2_loadrigp tglobaladdr:$global))>; - -def : Pat <(atomic_load_16 (HexagonCONST32_GP tglobaladdr:$global)), - (i32 (L2_loadruhgp tglobaladdr:$global))>; - -def : Pat <(atomic_load_8 (HexagonCONST32_GP tglobaladdr:$global)), - (i32 (L2_loadrubgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memw(#foo + 0) -let AddedComplexity = 100 in -def : Pat <(i64 (load (HexagonCONST32_GP tglobaladdr:$global))), - (i64 (L2_loadrdgp tglobaladdr:$global))>; - // Map from Pd = load(globaladdress) -> Rd = memb(globaladdress), Pd = Rd let AddedComplexity = 100 in def : Pat <(i1 (load (HexagonCONST32_GP tglobaladdr:$global))), @@ -3914,45 +3932,10 @@ let AddedComplexity = 100 in def : Pat <(i32 (sextloadi1 (HexagonCONST32_GP tglobaladdr:$global))), (i32 (L2_loadrbgp tglobaladdr:$global))>; -// Map from load(globaladdress) -> memb(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (extloadi8 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrbgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memb(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (sextloadi8 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrbgp tglobaladdr:$global))>; - let AddedComplexity = 100 in def : Pat <(i32 (zextloadi1 (HexagonCONST32_GP tglobaladdr:$global))), (i32 (L2_loadrubgp tglobaladdr:$global))>; -// Map from load(globaladdress) -> memub(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (zextloadi8 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrubgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memh(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (extloadi16 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrhgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memh(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (sextloadi16 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrhgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memuh(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (zextloadi16 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadruhgp tglobaladdr:$global))>; - -// Map from load(globaladdress) -> memw(#foo) -let AddedComplexity = 100 in -def : Pat <(i32 (load (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrigp tglobaladdr:$global))>; - // Transfer global address into a register let isExtended = 1, opExtendable = 1, AddedComplexity=50, isMoveImm = 1, @@ -4004,22 +3987,6 @@ def : Pat<(HexagonCONST32_GP tglobaladdr:$src1), (TFRI_V4 tglobaladdr:$src1)>, Requires<[HasV4T]>; -let Predicates = [HasV4T], AddedComplexity = 30 in { -def : Pat<(truncstorei8 (i32 IntRegs:$src1), u0AlwaysExtPred:$src2), - (S2_storerbabs u0AlwaysExtPred:$src2, IntRegs: $src1)>; - -def : Pat<(truncstorei16 (i32 IntRegs:$src1), u0AlwaysExtPred:$src2), - (S2_storerhabs u0AlwaysExtPred:$src2, IntRegs: $src1)>; - -def : Pat<(store (i32 IntRegs:$src1), u0AlwaysExtPred:$src2), - (S2_storeriabs u0AlwaysExtPred:$src2, IntRegs: $src1)>; -} - -let Predicates = [HasV4T], AddedComplexity = 30 in { -def : Pat<(i32 (load u0AlwaysExtPred:$src)), - (L4_loadri_abs u0AlwaysExtPred:$src)>; -} - // Indexed store word - global address. // memw(Rs+#u6:2)=#S8 let AddedComplexity = 10 in