From: Colin LeMahieu Date: Wed, 4 Feb 2015 23:27:48 +0000 (+0000) Subject: [Hexagon] Cleaning up i1 load and extension patterns. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2747f4aaf50715e719fe9bd6a9bd2e5d6a0d7e61;p=oota-llvm.git [Hexagon] Cleaning up i1 load and extension patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228232 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonInstrInfoV4.td b/lib/Target/Hexagon/HexagonInstrInfoV4.td index e60304b6cd4..38a1feaacbd 100644 --- a/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/lib/Target/Hexagon/HexagonInstrInfoV4.td @@ -3842,6 +3842,17 @@ let AddedComplexity = 100 in { def: LoadGP_pats ; } +// When the Interprocedural Global Variable optimizer realizes that a certain +// global variable takes only two constant values, it shrinks the global to +// a boolean. Catch those loads here in the following 3 patterns. +let AddedComplexity = 100 in { + def: LoadGP_pats ; + def: LoadGP_pats ; +} + +def: Pat<(i64 (ctlz I64:$src1)), (Zext64 (S2_cl0p I64:$src1))>; +def: Pat<(i64 (cttz I64:$src1)), (Zext64 (S2_ct0p I64:$src1))>; + let AddedComplexity = 30 in { def: Storea_pat; def: Storea_pat; @@ -3890,22 +3901,6 @@ let AddedComplexity = 100 in def : Pat <(i1 (load (HexagonCONST32_GP tglobaladdr:$global))), (i1 (C2_tfrrp (i32 (L2_loadrbgp tglobaladdr:$global))))>; -// When the Interprocedural Global Variable optimizer realizes that a certain -// global variable takes only two constant values, it shrinks the global to -// a boolean. Catch those loads here in the following 3 patterns. -let AddedComplexity = 100 in -def : Pat <(i32 (extloadi1 (HexagonCONST32_GP tglobaladdr:$global))), - (i32 (L2_loadrbgp tglobaladdr:$global))>; - -let AddedComplexity = 100 in -def : Pat <(i32 (sextloadi1 (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))>; - - // Transfer global address into a register let isExtended = 1, opExtendable = 1, AddedComplexity=50, isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1, validSubTargets = HasV4SubT in @@ -3966,14 +3961,6 @@ def STriw_offset_ext_V4 : STInst<(outs), (add IntRegs:$src1, u6_2ImmPred:$src2))]>, Requires<[HasV4T]>; -def : Pat<(i64 (ctlz (i64 DoubleRegs:$src1))), - (i64 (A4_combineir (i32 0), (i32 (S2_cl0p DoubleRegs:$src1))))>, - Requires<[HasV4T]>; - -def : Pat<(i64 (cttz (i64 DoubleRegs:$src1))), - (i64 (A4_combineir (i32 0), (i32 (S2_ct0p DoubleRegs:$src1))))>, - Requires<[HasV4T]>; - // i8/i16/i32 -> i64 loads // We need a complexity of 120 here to override preceding handling of // zextload.