From 712d5c393b7d5d336e60b528788e3f2e46bb8777 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Wed, 4 Feb 2015 23:27:48 +0000 Subject: [PATCH] [Hexagon] Cleaning up i1 load and extension patterns. llvm-svn: 228232 --- llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td b/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td index e60304b6cd42..38a1feaacbd8 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/llvm/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.