diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/include/llvm/Target/GlobalISel | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/Target/GlobalISel')
-rw-r--r-- | contrib/libs/llvm12/include/llvm/Target/GlobalISel/Combine.td | 678 | ||||
-rw-r--r-- | contrib/libs/llvm12/include/llvm/Target/GlobalISel/SelectionDAGCompat.td | 54 |
2 files changed, 366 insertions, 366 deletions
diff --git a/contrib/libs/llvm12/include/llvm/Target/GlobalISel/Combine.td b/contrib/libs/llvm12/include/llvm/Target/GlobalISel/Combine.td index e2c7a90a1b..2dde4acdc9 100644 --- a/contrib/libs/llvm12/include/llvm/Target/GlobalISel/Combine.td +++ b/contrib/libs/llvm12/include/llvm/Target/GlobalISel/Combine.td @@ -85,7 +85,7 @@ class GIDefMatchData<string type> : GIDefKind { def extending_load_matchdata : GIDefMatchData<"PreferredTuple">; def indexed_load_store_matchdata : GIDefMatchData<"IndexedLoadStoreMatchInfo">; -def instruction_steps_matchdata: GIDefMatchData<"InstructionStepsMatchInfo">; +def instruction_steps_matchdata: GIDefMatchData<"InstructionStepsMatchInfo">; /// The operator at the root of a GICombineRule.Match dag. def match; @@ -126,30 +126,30 @@ def extending_loads : GICombineRule< (apply [{ Helper.applyCombineExtendingLoads(*${root}, ${matchinfo}); }])>; def combines_for_extload: GICombineGroup<[extending_loads]>; -def sext_trunc_sextload : GICombineRule< +def sext_trunc_sextload : GICombineRule< (defs root:$d), (match (wip_match_opcode G_SEXT_INREG):$d, - [{ return Helper.matchSextTruncSextLoad(*${d}); }]), - (apply [{ Helper.applySextTruncSextLoad(*${d}); }])>; - -def sext_inreg_of_load_matchdata : GIDefMatchData<"std::tuple<Register, unsigned>">; -def sext_inreg_of_load : GICombineRule< - (defs root:$root, sext_inreg_of_load_matchdata:$matchinfo), - (match (wip_match_opcode G_SEXT_INREG):$root, - [{ return Helper.matchSextInRegOfLoad(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applySextInRegOfLoad(*${root}, ${matchinfo}); }])>; - + [{ return Helper.matchSextTruncSextLoad(*${d}); }]), + (apply [{ Helper.applySextTruncSextLoad(*${d}); }])>; + +def sext_inreg_of_load_matchdata : GIDefMatchData<"std::tuple<Register, unsigned>">; +def sext_inreg_of_load : GICombineRule< + (defs root:$root, sext_inreg_of_load_matchdata:$matchinfo), + (match (wip_match_opcode G_SEXT_INREG):$root, + [{ return Helper.matchSextInRegOfLoad(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applySextInRegOfLoad(*${root}, ${matchinfo}); }])>; + def combine_indexed_load_store : GICombineRule< (defs root:$root, indexed_load_store_matchdata:$matchinfo), (match (wip_match_opcode G_LOAD, G_SEXTLOAD, G_ZEXTLOAD, G_STORE):$root, [{ return Helper.matchCombineIndexedLoadStore(*${root}, ${matchinfo}); }]), (apply [{ Helper.applyCombineIndexedLoadStore(*${root}, ${matchinfo}); }])>; -def opt_brcond_by_inverting_cond : GICombineRule< +def opt_brcond_by_inverting_cond : GICombineRule< (defs root:$root), (match (wip_match_opcode G_BR):$root, - [{ return Helper.matchOptBrCondByInvertingCond(*${root}); }]), - (apply [{ Helper.applyOptBrCondByInvertingCond(*${root}); }])>; + [{ return Helper.matchOptBrCondByInvertingCond(*${root}); }]), + (apply [{ Helper.applyOptBrCondByInvertingCond(*${root}); }])>; def ptr_add_immed_matchdata : GIDefMatchData<"PtrAddChain">; def ptr_add_immed_chain : GICombineRule< @@ -158,23 +158,23 @@ def ptr_add_immed_chain : GICombineRule< [{ return Helper.matchPtrAddImmedChain(*${d}, ${matchinfo}); }]), (apply [{ Helper.applyPtrAddImmedChain(*${d}, ${matchinfo}); }])>; -// Fold shift (shift base x), y -> shift base, (x+y), if shifts are same -def shift_immed_matchdata : GIDefMatchData<"RegisterImmPair">; -def shift_immed_chain : GICombineRule< - (defs root:$d, shift_immed_matchdata:$matchinfo), - (match (wip_match_opcode G_SHL, G_ASHR, G_LSHR, G_SSHLSAT, G_USHLSAT):$d, - [{ return Helper.matchShiftImmedChain(*${d}, ${matchinfo}); }]), - (apply [{ Helper.applyShiftImmedChain(*${d}, ${matchinfo}); }])>; - -// Transform shift (logic (shift X, C0), Y), C1 -// -> logic (shift X, (C0+C1)), (shift Y, C1), if shifts are same -def shift_of_shifted_logic_matchdata : GIDefMatchData<"ShiftOfShiftedLogic">; -def shift_of_shifted_logic_chain : GICombineRule< - (defs root:$d, shift_of_shifted_logic_matchdata:$matchinfo), - (match (wip_match_opcode G_SHL, G_ASHR, G_LSHR, G_USHLSAT, G_SSHLSAT):$d, - [{ return Helper.matchShiftOfShiftedLogic(*${d}, ${matchinfo}); }]), - (apply [{ Helper.applyShiftOfShiftedLogic(*${d}, ${matchinfo}); }])>; - +// Fold shift (shift base x), y -> shift base, (x+y), if shifts are same +def shift_immed_matchdata : GIDefMatchData<"RegisterImmPair">; +def shift_immed_chain : GICombineRule< + (defs root:$d, shift_immed_matchdata:$matchinfo), + (match (wip_match_opcode G_SHL, G_ASHR, G_LSHR, G_SSHLSAT, G_USHLSAT):$d, + [{ return Helper.matchShiftImmedChain(*${d}, ${matchinfo}); }]), + (apply [{ Helper.applyShiftImmedChain(*${d}, ${matchinfo}); }])>; + +// Transform shift (logic (shift X, C0), Y), C1 +// -> logic (shift X, (C0+C1)), (shift Y, C1), if shifts are same +def shift_of_shifted_logic_matchdata : GIDefMatchData<"ShiftOfShiftedLogic">; +def shift_of_shifted_logic_chain : GICombineRule< + (defs root:$d, shift_of_shifted_logic_matchdata:$matchinfo), + (match (wip_match_opcode G_SHL, G_ASHR, G_LSHR, G_USHLSAT, G_SSHLSAT):$d, + [{ return Helper.matchShiftOfShiftedLogic(*${d}, ${matchinfo}); }]), + (apply [{ Helper.applyShiftOfShiftedLogic(*${d}, ${matchinfo}); }])>; + def mul_to_shl_matchdata : GIDefMatchData<"unsigned">; def mul_to_shl : GICombineRule< (defs root:$d, mul_to_shl_matchdata:$matchinfo), @@ -182,14 +182,14 @@ def mul_to_shl : GICombineRule< [{ return Helper.matchCombineMulToShl(*${mi}, ${matchinfo}); }]), (apply [{ Helper.applyCombineMulToShl(*${mi}, ${matchinfo}); }])>; -// shl ([asz]ext x), y => zext (shl x, y), if shift does not overflow int -def reduce_shl_of_extend_matchdata : GIDefMatchData<"RegisterImmPair">; -def reduce_shl_of_extend : GICombineRule< - (defs root:$dst, reduce_shl_of_extend_matchdata:$matchinfo), - (match (G_SHL $dst, $src0, $src1):$mi, - [{ return Helper.matchCombineShlOfExtend(*${mi}, ${matchinfo}); }]), - (apply [{ Helper.applyCombineShlOfExtend(*${mi}, ${matchinfo}); }])>; - +// shl ([asz]ext x), y => zext (shl x, y), if shift does not overflow int +def reduce_shl_of_extend_matchdata : GIDefMatchData<"RegisterImmPair">; +def reduce_shl_of_extend : GICombineRule< + (defs root:$dst, reduce_shl_of_extend_matchdata:$matchinfo), + (match (G_SHL $dst, $src0, $src1):$mi, + [{ return Helper.matchCombineShlOfExtend(*${mi}, ${matchinfo}); }]), + (apply [{ Helper.applyCombineShlOfExtend(*${mi}, ${matchinfo}); }])>; + // [us]itofp(undef) = 0, because the result value is bounded. def undef_to_fp_zero : GICombineRule< (defs root:$root), @@ -209,17 +209,17 @@ def undef_to_negative_one: GICombineRule< [{ return Helper.matchAnyExplicitUseIsUndef(*${root}); }]), (apply [{ Helper.replaceInstWithConstant(*${root}, -1); }])>; -def binop_left_undef_to_zero: GICombineRule< - (defs root:$root), - (match (wip_match_opcode G_SHL):$root, - [{ return Helper.matchOperandIsUndef(*${root}, 1); }]), - (apply [{ Helper.replaceInstWithConstant(*${root}, 0); }])>; - +def binop_left_undef_to_zero: GICombineRule< + (defs root:$root), + (match (wip_match_opcode G_SHL):$root, + [{ return Helper.matchOperandIsUndef(*${root}, 1); }]), + (apply [{ Helper.replaceInstWithConstant(*${root}, 0); }])>; + // Instructions where if any source operand is undef, the instruction can be // replaced with undef. def propagate_undef_any_op: GICombineRule< (defs root:$root), - (match (wip_match_opcode G_ADD, G_FPTOSI, G_FPTOUI, G_SUB, G_XOR, G_TRUNC):$root, + (match (wip_match_opcode G_ADD, G_FPTOSI, G_FPTOUI, G_SUB, G_XOR, G_TRUNC):$root, [{ return Helper.matchAnyExplicitUseIsUndef(*${root}); }]), (apply [{ Helper.replaceInstWithUndef(*${root}); }])>; @@ -246,24 +246,24 @@ def select_same_val: GICombineRule< (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) >; -// Fold (undef ? x : y) -> y -def select_undef_cmp: GICombineRule< - (defs root:$root), - (match (wip_match_opcode G_SELECT):$root, - [{ return Helper.matchUndefSelectCmp(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) ->; - -// Fold (true ? x : y) -> x -// Fold (false ? x : y) -> y -def select_constant_cmp_matchdata : GIDefMatchData<"unsigned">; -def select_constant_cmp: GICombineRule< - (defs root:$root, select_constant_cmp_matchdata:$matchinfo), - (match (wip_match_opcode G_SELECT):$root, - [{ return Helper.matchConstantSelectCmp(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, ${matchinfo}); }]) ->; - +// Fold (undef ? x : y) -> y +def select_undef_cmp: GICombineRule< + (defs root:$root), + (match (wip_match_opcode G_SELECT):$root, + [{ return Helper.matchUndefSelectCmp(*${root}); }]), + (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 2); }]) +>; + +// Fold (true ? x : y) -> x +// Fold (false ? x : y) -> y +def select_constant_cmp_matchdata : GIDefMatchData<"unsigned">; +def select_constant_cmp: GICombineRule< + (defs root:$root, select_constant_cmp_matchdata:$matchinfo), + (match (wip_match_opcode G_SELECT):$root, + [{ return Helper.matchConstantSelectCmp(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, ${matchinfo}); }]) +>; + // Fold x op 0 -> x def right_identity_zero: GICombineRule< (defs root:$root), @@ -272,14 +272,14 @@ def right_identity_zero: GICombineRule< (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; -// Fold x op 1 -> x -def right_identity_one: GICombineRule< - (defs root:$root), - (match (wip_match_opcode G_MUL):$root, - [{ return Helper.matchConstantOp(${root}->getOperand(2), 1); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) ->; - +// Fold x op 1 -> x +def right_identity_one: GICombineRule< + (defs root:$root), + (match (wip_match_opcode G_MUL):$root, + [{ return Helper.matchConstantOp(${root}->getOperand(2), 1); }]), + (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) +>; + // Fold (x op x) - > x def binop_same_val: GICombineRule< (defs root:$root), @@ -296,13 +296,13 @@ def binop_left_to_zero: GICombineRule< (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) >; -def urem_pow2_to_mask : GICombineRule< - (defs root:$root), - (match (wip_match_opcode G_UREM):$root, - [{ return Helper.matchOperandIsKnownToBeAPowerOfTwo(*${root}, 2); }]), - (apply [{ return Helper.applySimplifyURemByPow2(*${root}); }]) ->; - +def urem_pow2_to_mask : GICombineRule< + (defs root:$root), + (match (wip_match_opcode G_UREM):$root, + [{ return Helper.matchOperandIsKnownToBeAPowerOfTwo(*${root}, 2); }]), + (apply [{ return Helper.applySimplifyURemByPow2(*${root}); }]) +>; + // Fold (x op 0) - > 0 def binop_right_to_zero: GICombineRule< (defs root:$root), @@ -327,240 +327,240 @@ def simplify_add_to_sub: GICombineRule < (apply [{ return Helper.applySimplifyAddToSub(*${root}, ${info});}]) >; -// Fold fp_op(cst) to the constant result of the floating point operation. -def constant_fp_op_matchinfo: GIDefMatchData<"Optional<APFloat>">; -def constant_fp_op: GICombineRule < - (defs root:$root, constant_fp_op_matchinfo:$info), - (match (wip_match_opcode G_FNEG, G_FABS, G_FPTRUNC, G_FSQRT, G_FLOG2):$root, - [{ return Helper.matchCombineConstantFoldFpUnary(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineConstantFoldFpUnary(*${root}, ${info}); }]) ->; - -// Fold int2ptr(ptr2int(x)) -> x -def p2i_to_i2p_matchinfo: GIDefMatchData<"Register">; -def p2i_to_i2p: GICombineRule< - (defs root:$root, p2i_to_i2p_matchinfo:$info), - (match (wip_match_opcode G_INTTOPTR):$root, - [{ return Helper.matchCombineI2PToP2I(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineI2PToP2I(*${root}, ${info}); }]) ->; - -// Fold ptr2int(int2ptr(x)) -> x -def i2p_to_p2i_matchinfo: GIDefMatchData<"Register">; -def i2p_to_p2i: GICombineRule< - (defs root:$root, i2p_to_p2i_matchinfo:$info), - (match (wip_match_opcode G_PTRTOINT):$root, - [{ return Helper.matchCombineP2IToI2P(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineP2IToI2P(*${root}, ${info}); }]) ->; - -// Fold add ptrtoint(x), y -> ptrtoint (ptr_add x), y -def add_p2i_to_ptradd_matchinfo : GIDefMatchData<"std::pair<Register, bool>">; -def add_p2i_to_ptradd : GICombineRule< - (defs root:$root, add_p2i_to_ptradd_matchinfo:$info), - (match (wip_match_opcode G_ADD):$root, - [{ return Helper.matchCombineAddP2IToPtrAdd(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineAddP2IToPtrAdd(*${root}, ${info}); }]) ->; - -// Fold (ptr_add (int2ptr C1), C2) -> C1 + C2 -def const_ptradd_to_i2p_matchinfo : GIDefMatchData<"int64_t">; -def const_ptradd_to_i2p: GICombineRule< - (defs root:$root, const_ptradd_to_i2p_matchinfo:$info), - (match (wip_match_opcode G_PTR_ADD):$root, - [{ return Helper.matchCombineConstPtrAddToI2P(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineConstPtrAddToI2P(*${root}, ${info}); }]) ->; - -// Simplify: (logic_op (op x...), (op y...)) -> (op (logic_op x, y)) -def hoist_logic_op_with_same_opcode_hands: GICombineRule < - (defs root:$root, instruction_steps_matchdata:$info), - (match (wip_match_opcode G_AND, G_OR, G_XOR):$root, - [{ return Helper.matchHoistLogicOpWithSameOpcodeHands(*${root}, ${info}); }]), - (apply [{ return Helper.applyBuildInstructionSteps(*${root}, ${info});}]) ->; - -// Fold ashr (shl x, C), C -> sext_inreg (C) -def shl_ashr_to_sext_inreg_matchinfo : GIDefMatchData<"std::tuple<Register, int64_t>">; -def shl_ashr_to_sext_inreg : GICombineRule< - (defs root:$root, shl_ashr_to_sext_inreg_matchinfo:$info), - (match (wip_match_opcode G_ASHR): $root, - [{ return Helper.matchAshrShlToSextInreg(*${root}, ${info}); }]), - (apply [{ return Helper.applyAshShlToSextInreg(*${root}, ${info});}]) ->; -// Fold (x & y) -> x or (x & y) -> y when (x & y) is known to equal x or equal y. -def redundant_and_matchinfo : GIDefMatchData<"Register">; -def redundant_and: GICombineRule < - (defs root:$root, redundant_and_matchinfo:$matchinfo), - (match (wip_match_opcode G_AND):$root, - [{ return Helper.matchRedundantAnd(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) ->; - -// Fold (x | y) -> x or (x | y) -> y when (x | y) is known to equal x or equal y. -def redundant_or_matchinfo : GIDefMatchData<"Register">; -def redundant_or: GICombineRule < - (defs root:$root, redundant_or_matchinfo:$matchinfo), - (match (wip_match_opcode G_OR):$root, - [{ return Helper.matchRedundantOr(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) ->; - -// If the input is already sign extended, just drop the extension. -// sext_inreg x, K -> -// if computeNumSignBits(x) >= (x.getScalarSizeInBits() - K + 1) -def redundant_sext_inreg: GICombineRule < - (defs root:$root), - (match (wip_match_opcode G_SEXT_INREG):$root, - [{ return Helper.matchRedundantSExtInReg(*${root}); }]), - (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) ->; - -// Fold (anyext (trunc x)) -> x if the source type is same as -// the destination type. -def anyext_trunc_fold_matchinfo : GIDefMatchData<"Register">; -def anyext_trunc_fold: GICombineRule < - (defs root:$root, anyext_trunc_fold_matchinfo:$matchinfo), - (match (wip_match_opcode G_ANYEXT):$root, - [{ return Helper.matchCombineAnyExtTrunc(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyCombineAnyExtTrunc(*${root}, ${matchinfo}); }]) ->; - -// Fold ([asz]ext ([asz]ext x)) -> ([asz]ext x). -def ext_ext_fold_matchinfo : GIDefMatchData<"std::tuple<Register, unsigned>">; -def ext_ext_fold: GICombineRule < - (defs root:$root, ext_ext_fold_matchinfo:$matchinfo), - (match (wip_match_opcode G_ANYEXT, G_SEXT, G_ZEXT):$root, - [{ return Helper.matchCombineExtOfExt(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyCombineExtOfExt(*${root}, ${matchinfo}); }]) ->; - -def not_cmp_fold_matchinfo : GIDefMatchData<"SmallVector<Register, 4>">; -def not_cmp_fold : GICombineRule< - (defs root:$d, not_cmp_fold_matchinfo:$info), - (match (wip_match_opcode G_XOR): $d, - [{ return Helper.matchNotCmp(*${d}, ${info}); }]), - (apply [{ return Helper.applyNotCmp(*${d}, ${info}); }]) ->; - -// Fold (fneg (fneg x)) -> x. -def fneg_fneg_fold_matchinfo : GIDefMatchData<"Register">; -def fneg_fneg_fold: GICombineRule < - (defs root:$root, fneg_fneg_fold_matchinfo:$matchinfo), - (match (wip_match_opcode G_FNEG):$root, - [{ return Helper.matchCombineFNegOfFNeg(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) ->; - -// Fold (unmerge(merge x, y, z)) -> z, y, z. -def unmerge_merge_matchinfo : GIDefMatchData<"SmallVector<Register, 8>">; -def unmerge_merge : GICombineRule< - (defs root:$d, unmerge_merge_matchinfo:$info), - (match (wip_match_opcode G_UNMERGE_VALUES): $d, - [{ return Helper.matchCombineUnmergeMergeToPlainValues(*${d}, ${info}); }]), - (apply [{ return Helper.applyCombineUnmergeMergeToPlainValues(*${d}, ${info}); }]) ->; - -// Fold (fabs (fabs x)) -> (fabs x). -def fabs_fabs_fold_matchinfo : GIDefMatchData<"Register">; -def fabs_fabs_fold: GICombineRule< - (defs root:$root, fabs_fabs_fold_matchinfo:$matchinfo), - (match (wip_match_opcode G_FABS):$root, - [{ return Helper.matchCombineFAbsOfFAbs(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyCombineFAbsOfFAbs(*${root}, ${matchinfo}); }]) ->; - -// Fold (unmerge cst) -> cst1, cst2, ... -def unmerge_cst_matchinfo : GIDefMatchData<"SmallVector<APInt, 8>">; -def unmerge_cst : GICombineRule< - (defs root:$d, unmerge_cst_matchinfo:$info), - (match (wip_match_opcode G_UNMERGE_VALUES): $d, - [{ return Helper.matchCombineUnmergeConstant(*${d}, ${info}); }]), - (apply [{ return Helper.applyCombineUnmergeConstant(*${d}, ${info}); }]) ->; - -// Transform x,y<dead> = unmerge z -> x = trunc z. -def unmerge_dead_to_trunc : GICombineRule< - (defs root:$d), - (match (wip_match_opcode G_UNMERGE_VALUES): $d, - [{ return Helper.matchCombineUnmergeWithDeadLanesToTrunc(*${d}); }]), - (apply [{ return Helper.applyCombineUnmergeWithDeadLanesToTrunc(*${d}); }]) ->; - -// Transform x,y = unmerge(zext(z)) -> x = zext z; y = 0. -def unmerge_zext_to_zext : GICombineRule< - (defs root:$d), - (match (wip_match_opcode G_UNMERGE_VALUES): $d, - [{ return Helper.matchCombineUnmergeZExtToZExt(*${d}); }]), - (apply [{ return Helper.applyCombineUnmergeZExtToZExt(*${d}); }]) ->; - -// Fold trunc ([asz]ext x) -> x or ([asz]ext x) or (trunc x). -def trunc_ext_fold_matchinfo : GIDefMatchData<"std::pair<Register, unsigned>">; -def trunc_ext_fold: GICombineRule < - (defs root:$root, trunc_ext_fold_matchinfo:$matchinfo), - (match (wip_match_opcode G_TRUNC):$root, - [{ return Helper.matchCombineTruncOfExt(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyCombineTruncOfExt(*${root}, ${matchinfo}); }]) ->; - -// Fold trunc (shl x, K) -> shl (trunc x), K => K < VT.getScalarSizeInBits(). -def trunc_shl_matchinfo : GIDefMatchData<"std::pair<Register, Register>">; -def trunc_shl: GICombineRule < - (defs root:$root, trunc_shl_matchinfo:$matchinfo), - (match (wip_match_opcode G_TRUNC):$root, - [{ return Helper.matchCombineTruncOfShl(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyCombineTruncOfShl(*${root}, ${matchinfo}); }]) ->; - -// Transform (mul x, -1) -> (sub 0, x) -def mul_by_neg_one: GICombineRule < - (defs root:$root), - (match (wip_match_opcode G_MUL):$root, - [{ return Helper.matchConstantOp(${root}->getOperand(2), -1); }]), - (apply [{ return Helper.applyCombineMulByNegativeOne(*${root}); }]) ->; - -// Fold (xor (and x, y), y) -> (and (not x), y) -def xor_of_and_with_same_reg_matchinfo : - GIDefMatchData<"std::pair<Register, Register>">; -def xor_of_and_with_same_reg: GICombineRule < - (defs root:$root, xor_of_and_with_same_reg_matchinfo:$matchinfo), - (match (wip_match_opcode G_XOR):$root, - [{ return Helper.matchXorOfAndWithSameReg(*${root}, ${matchinfo}); }]), - (apply [{ return Helper.applyXorOfAndWithSameReg(*${root}, ${matchinfo}); }]) ->; - -// Transform (ptr_add 0, x) -> (int_to_ptr x) -def ptr_add_with_zero: GICombineRule< - (defs root:$root), - (match (wip_match_opcode G_PTR_ADD):$root, - [{ return Helper.matchPtrAddZero(*${root}); }]), - (apply [{ return Helper.applyPtrAddZero(*${root}); }])>; - -def regs_small_vec : GIDefMatchData<"SmallVector<Register, 4>">; -def combine_insert_vec_elts_build_vector : GICombineRule< - (defs root:$root, regs_small_vec:$info), - (match (wip_match_opcode G_INSERT_VECTOR_ELT):$root, - [{ return Helper.matchCombineInsertVecElts(*${root}, ${info}); }]), - (apply [{ return Helper.applyCombineInsertVecElts(*${root}, ${info}); }])>; - -def load_or_combine_matchdata : -GIDefMatchData<"std::function<void(MachineIRBuilder &)>">; -def load_or_combine : GICombineRule< - (defs root:$root, load_or_combine_matchdata:$info), - (match (wip_match_opcode G_OR):$root, - [{ return Helper.matchLoadOrCombine(*${root}, ${info}); }]), - (apply [{ return Helper.applyLoadOrCombine(*${root}, ${info}); }])>; - -// Currently only the one combine above. -def insert_vec_elt_combines : GICombineGroup< - [combine_insert_vec_elts_build_vector]>; - +// Fold fp_op(cst) to the constant result of the floating point operation. +def constant_fp_op_matchinfo: GIDefMatchData<"Optional<APFloat>">; +def constant_fp_op: GICombineRule < + (defs root:$root, constant_fp_op_matchinfo:$info), + (match (wip_match_opcode G_FNEG, G_FABS, G_FPTRUNC, G_FSQRT, G_FLOG2):$root, + [{ return Helper.matchCombineConstantFoldFpUnary(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineConstantFoldFpUnary(*${root}, ${info}); }]) +>; + +// Fold int2ptr(ptr2int(x)) -> x +def p2i_to_i2p_matchinfo: GIDefMatchData<"Register">; +def p2i_to_i2p: GICombineRule< + (defs root:$root, p2i_to_i2p_matchinfo:$info), + (match (wip_match_opcode G_INTTOPTR):$root, + [{ return Helper.matchCombineI2PToP2I(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineI2PToP2I(*${root}, ${info}); }]) +>; + +// Fold ptr2int(int2ptr(x)) -> x +def i2p_to_p2i_matchinfo: GIDefMatchData<"Register">; +def i2p_to_p2i: GICombineRule< + (defs root:$root, i2p_to_p2i_matchinfo:$info), + (match (wip_match_opcode G_PTRTOINT):$root, + [{ return Helper.matchCombineP2IToI2P(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineP2IToI2P(*${root}, ${info}); }]) +>; + +// Fold add ptrtoint(x), y -> ptrtoint (ptr_add x), y +def add_p2i_to_ptradd_matchinfo : GIDefMatchData<"std::pair<Register, bool>">; +def add_p2i_to_ptradd : GICombineRule< + (defs root:$root, add_p2i_to_ptradd_matchinfo:$info), + (match (wip_match_opcode G_ADD):$root, + [{ return Helper.matchCombineAddP2IToPtrAdd(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineAddP2IToPtrAdd(*${root}, ${info}); }]) +>; + +// Fold (ptr_add (int2ptr C1), C2) -> C1 + C2 +def const_ptradd_to_i2p_matchinfo : GIDefMatchData<"int64_t">; +def const_ptradd_to_i2p: GICombineRule< + (defs root:$root, const_ptradd_to_i2p_matchinfo:$info), + (match (wip_match_opcode G_PTR_ADD):$root, + [{ return Helper.matchCombineConstPtrAddToI2P(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineConstPtrAddToI2P(*${root}, ${info}); }]) +>; + +// Simplify: (logic_op (op x...), (op y...)) -> (op (logic_op x, y)) +def hoist_logic_op_with_same_opcode_hands: GICombineRule < + (defs root:$root, instruction_steps_matchdata:$info), + (match (wip_match_opcode G_AND, G_OR, G_XOR):$root, + [{ return Helper.matchHoistLogicOpWithSameOpcodeHands(*${root}, ${info}); }]), + (apply [{ return Helper.applyBuildInstructionSteps(*${root}, ${info});}]) +>; + +// Fold ashr (shl x, C), C -> sext_inreg (C) +def shl_ashr_to_sext_inreg_matchinfo : GIDefMatchData<"std::tuple<Register, int64_t>">; +def shl_ashr_to_sext_inreg : GICombineRule< + (defs root:$root, shl_ashr_to_sext_inreg_matchinfo:$info), + (match (wip_match_opcode G_ASHR): $root, + [{ return Helper.matchAshrShlToSextInreg(*${root}, ${info}); }]), + (apply [{ return Helper.applyAshShlToSextInreg(*${root}, ${info});}]) +>; +// Fold (x & y) -> x or (x & y) -> y when (x & y) is known to equal x or equal y. +def redundant_and_matchinfo : GIDefMatchData<"Register">; +def redundant_and: GICombineRule < + (defs root:$root, redundant_and_matchinfo:$matchinfo), + (match (wip_match_opcode G_AND):$root, + [{ return Helper.matchRedundantAnd(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) +>; + +// Fold (x | y) -> x or (x | y) -> y when (x | y) is known to equal x or equal y. +def redundant_or_matchinfo : GIDefMatchData<"Register">; +def redundant_or: GICombineRule < + (defs root:$root, redundant_or_matchinfo:$matchinfo), + (match (wip_match_opcode G_OR):$root, + [{ return Helper.matchRedundantOr(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) +>; + +// If the input is already sign extended, just drop the extension. +// sext_inreg x, K -> +// if computeNumSignBits(x) >= (x.getScalarSizeInBits() - K + 1) +def redundant_sext_inreg: GICombineRule < + (defs root:$root), + (match (wip_match_opcode G_SEXT_INREG):$root, + [{ return Helper.matchRedundantSExtInReg(*${root}); }]), + (apply [{ return Helper.replaceSingleDefInstWithOperand(*${root}, 1); }]) +>; + +// Fold (anyext (trunc x)) -> x if the source type is same as +// the destination type. +def anyext_trunc_fold_matchinfo : GIDefMatchData<"Register">; +def anyext_trunc_fold: GICombineRule < + (defs root:$root, anyext_trunc_fold_matchinfo:$matchinfo), + (match (wip_match_opcode G_ANYEXT):$root, + [{ return Helper.matchCombineAnyExtTrunc(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyCombineAnyExtTrunc(*${root}, ${matchinfo}); }]) +>; + +// Fold ([asz]ext ([asz]ext x)) -> ([asz]ext x). +def ext_ext_fold_matchinfo : GIDefMatchData<"std::tuple<Register, unsigned>">; +def ext_ext_fold: GICombineRule < + (defs root:$root, ext_ext_fold_matchinfo:$matchinfo), + (match (wip_match_opcode G_ANYEXT, G_SEXT, G_ZEXT):$root, + [{ return Helper.matchCombineExtOfExt(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyCombineExtOfExt(*${root}, ${matchinfo}); }]) +>; + +def not_cmp_fold_matchinfo : GIDefMatchData<"SmallVector<Register, 4>">; +def not_cmp_fold : GICombineRule< + (defs root:$d, not_cmp_fold_matchinfo:$info), + (match (wip_match_opcode G_XOR): $d, + [{ return Helper.matchNotCmp(*${d}, ${info}); }]), + (apply [{ return Helper.applyNotCmp(*${d}, ${info}); }]) +>; + +// Fold (fneg (fneg x)) -> x. +def fneg_fneg_fold_matchinfo : GIDefMatchData<"Register">; +def fneg_fneg_fold: GICombineRule < + (defs root:$root, fneg_fneg_fold_matchinfo:$matchinfo), + (match (wip_match_opcode G_FNEG):$root, + [{ return Helper.matchCombineFNegOfFNeg(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }]) +>; + +// Fold (unmerge(merge x, y, z)) -> z, y, z. +def unmerge_merge_matchinfo : GIDefMatchData<"SmallVector<Register, 8>">; +def unmerge_merge : GICombineRule< + (defs root:$d, unmerge_merge_matchinfo:$info), + (match (wip_match_opcode G_UNMERGE_VALUES): $d, + [{ return Helper.matchCombineUnmergeMergeToPlainValues(*${d}, ${info}); }]), + (apply [{ return Helper.applyCombineUnmergeMergeToPlainValues(*${d}, ${info}); }]) +>; + +// Fold (fabs (fabs x)) -> (fabs x). +def fabs_fabs_fold_matchinfo : GIDefMatchData<"Register">; +def fabs_fabs_fold: GICombineRule< + (defs root:$root, fabs_fabs_fold_matchinfo:$matchinfo), + (match (wip_match_opcode G_FABS):$root, + [{ return Helper.matchCombineFAbsOfFAbs(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyCombineFAbsOfFAbs(*${root}, ${matchinfo}); }]) +>; + +// Fold (unmerge cst) -> cst1, cst2, ... +def unmerge_cst_matchinfo : GIDefMatchData<"SmallVector<APInt, 8>">; +def unmerge_cst : GICombineRule< + (defs root:$d, unmerge_cst_matchinfo:$info), + (match (wip_match_opcode G_UNMERGE_VALUES): $d, + [{ return Helper.matchCombineUnmergeConstant(*${d}, ${info}); }]), + (apply [{ return Helper.applyCombineUnmergeConstant(*${d}, ${info}); }]) +>; + +// Transform x,y<dead> = unmerge z -> x = trunc z. +def unmerge_dead_to_trunc : GICombineRule< + (defs root:$d), + (match (wip_match_opcode G_UNMERGE_VALUES): $d, + [{ return Helper.matchCombineUnmergeWithDeadLanesToTrunc(*${d}); }]), + (apply [{ return Helper.applyCombineUnmergeWithDeadLanesToTrunc(*${d}); }]) +>; + +// Transform x,y = unmerge(zext(z)) -> x = zext z; y = 0. +def unmerge_zext_to_zext : GICombineRule< + (defs root:$d), + (match (wip_match_opcode G_UNMERGE_VALUES): $d, + [{ return Helper.matchCombineUnmergeZExtToZExt(*${d}); }]), + (apply [{ return Helper.applyCombineUnmergeZExtToZExt(*${d}); }]) +>; + +// Fold trunc ([asz]ext x) -> x or ([asz]ext x) or (trunc x). +def trunc_ext_fold_matchinfo : GIDefMatchData<"std::pair<Register, unsigned>">; +def trunc_ext_fold: GICombineRule < + (defs root:$root, trunc_ext_fold_matchinfo:$matchinfo), + (match (wip_match_opcode G_TRUNC):$root, + [{ return Helper.matchCombineTruncOfExt(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyCombineTruncOfExt(*${root}, ${matchinfo}); }]) +>; + +// Fold trunc (shl x, K) -> shl (trunc x), K => K < VT.getScalarSizeInBits(). +def trunc_shl_matchinfo : GIDefMatchData<"std::pair<Register, Register>">; +def trunc_shl: GICombineRule < + (defs root:$root, trunc_shl_matchinfo:$matchinfo), + (match (wip_match_opcode G_TRUNC):$root, + [{ return Helper.matchCombineTruncOfShl(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyCombineTruncOfShl(*${root}, ${matchinfo}); }]) +>; + +// Transform (mul x, -1) -> (sub 0, x) +def mul_by_neg_one: GICombineRule < + (defs root:$root), + (match (wip_match_opcode G_MUL):$root, + [{ return Helper.matchConstantOp(${root}->getOperand(2), -1); }]), + (apply [{ return Helper.applyCombineMulByNegativeOne(*${root}); }]) +>; + +// Fold (xor (and x, y), y) -> (and (not x), y) +def xor_of_and_with_same_reg_matchinfo : + GIDefMatchData<"std::pair<Register, Register>">; +def xor_of_and_with_same_reg: GICombineRule < + (defs root:$root, xor_of_and_with_same_reg_matchinfo:$matchinfo), + (match (wip_match_opcode G_XOR):$root, + [{ return Helper.matchXorOfAndWithSameReg(*${root}, ${matchinfo}); }]), + (apply [{ return Helper.applyXorOfAndWithSameReg(*${root}, ${matchinfo}); }]) +>; + +// Transform (ptr_add 0, x) -> (int_to_ptr x) +def ptr_add_with_zero: GICombineRule< + (defs root:$root), + (match (wip_match_opcode G_PTR_ADD):$root, + [{ return Helper.matchPtrAddZero(*${root}); }]), + (apply [{ return Helper.applyPtrAddZero(*${root}); }])>; + +def regs_small_vec : GIDefMatchData<"SmallVector<Register, 4>">; +def combine_insert_vec_elts_build_vector : GICombineRule< + (defs root:$root, regs_small_vec:$info), + (match (wip_match_opcode G_INSERT_VECTOR_ELT):$root, + [{ return Helper.matchCombineInsertVecElts(*${root}, ${info}); }]), + (apply [{ return Helper.applyCombineInsertVecElts(*${root}, ${info}); }])>; + +def load_or_combine_matchdata : +GIDefMatchData<"std::function<void(MachineIRBuilder &)>">; +def load_or_combine : GICombineRule< + (defs root:$root, load_or_combine_matchdata:$info), + (match (wip_match_opcode G_OR):$root, + [{ return Helper.matchLoadOrCombine(*${root}, ${info}); }]), + (apply [{ return Helper.applyLoadOrCombine(*${root}, ${info}); }])>; + +// Currently only the one combine above. +def insert_vec_elt_combines : GICombineGroup< + [combine_insert_vec_elts_build_vector]>; + // FIXME: These should use the custom predicate feature once it lands. def undef_combines : GICombineGroup<[undef_to_fp_zero, undef_to_int_zero, undef_to_negative_one, - binop_left_undef_to_zero, + binop_left_undef_to_zero, propagate_undef_any_op, propagate_undef_all_ops, propagate_undef_shuffle_mask, @@ -568,31 +568,31 @@ def undef_combines : GICombineGroup<[undef_to_fp_zero, undef_to_int_zero, def identity_combines : GICombineGroup<[select_same_val, right_identity_zero, binop_same_val, binop_left_to_zero, - binop_right_to_zero, p2i_to_i2p, - i2p_to_p2i, anyext_trunc_fold, - fneg_fneg_fold, right_identity_one]>; - -def const_combines : GICombineGroup<[constant_fp_op, const_ptradd_to_i2p]>; - -def known_bits_simplifications : GICombineGroup<[ - redundant_and, redundant_sext_inreg, redundant_or, urem_pow2_to_mask]>; - -def width_reduction_combines : GICombineGroup<[reduce_shl_of_extend]>; - -def select_combines : GICombineGroup<[select_undef_cmp, select_constant_cmp]>; - -def trivial_combines : GICombineGroup<[copy_prop, mul_to_shl, add_p2i_to_ptradd, - mul_by_neg_one]>; - -def all_combines : GICombineGroup<[trivial_combines, insert_vec_elt_combines, - ptr_add_immed_chain, combines_for_extload, combine_indexed_load_store, - undef_combines, identity_combines, simplify_add_to_sub, - hoist_logic_op_with_same_opcode_hands, - shl_ashr_to_sext_inreg, sext_inreg_of_load, - width_reduction_combines, select_combines, - known_bits_simplifications, ext_ext_fold, - not_cmp_fold, opt_brcond_by_inverting_cond, - unmerge_merge, fabs_fabs_fold, unmerge_cst, unmerge_dead_to_trunc, - unmerge_zext_to_zext, trunc_ext_fold, trunc_shl, - const_combines, xor_of_and_with_same_reg, ptr_add_with_zero, - shift_immed_chain, shift_of_shifted_logic_chain, load_or_combine]>; + binop_right_to_zero, p2i_to_i2p, + i2p_to_p2i, anyext_trunc_fold, + fneg_fneg_fold, right_identity_one]>; + +def const_combines : GICombineGroup<[constant_fp_op, const_ptradd_to_i2p]>; + +def known_bits_simplifications : GICombineGroup<[ + redundant_and, redundant_sext_inreg, redundant_or, urem_pow2_to_mask]>; + +def width_reduction_combines : GICombineGroup<[reduce_shl_of_extend]>; + +def select_combines : GICombineGroup<[select_undef_cmp, select_constant_cmp]>; + +def trivial_combines : GICombineGroup<[copy_prop, mul_to_shl, add_p2i_to_ptradd, + mul_by_neg_one]>; + +def all_combines : GICombineGroup<[trivial_combines, insert_vec_elt_combines, + ptr_add_immed_chain, combines_for_extload, combine_indexed_load_store, + undef_combines, identity_combines, simplify_add_to_sub, + hoist_logic_op_with_same_opcode_hands, + shl_ashr_to_sext_inreg, sext_inreg_of_load, + width_reduction_combines, select_combines, + known_bits_simplifications, ext_ext_fold, + not_cmp_fold, opt_brcond_by_inverting_cond, + unmerge_merge, fabs_fabs_fold, unmerge_cst, unmerge_dead_to_trunc, + unmerge_zext_to_zext, trunc_ext_fold, trunc_shl, + const_combines, xor_of_and_with_same_reg, ptr_add_with_zero, + shift_immed_chain, shift_of_shifted_logic_chain, load_or_combine]>; diff --git a/contrib/libs/llvm12/include/llvm/Target/GlobalISel/SelectionDAGCompat.td b/contrib/libs/llvm12/include/llvm/Target/GlobalISel/SelectionDAGCompat.td index 6fb8a6b15d..4520354169 100644 --- a/contrib/libs/llvm12/include/llvm/Target/GlobalISel/SelectionDAGCompat.td +++ b/contrib/libs/llvm12/include/llvm/Target/GlobalISel/SelectionDAGCompat.td @@ -26,8 +26,8 @@ class GINodeEquiv<Instruction i, SDNode node> { // SelectionDAG has separate nodes for atomic and non-atomic memory operations // (ISD::LOAD, ISD::ATOMIC_LOAD, ISD::STORE, ISD::ATOMIC_STORE) but GlobalISel // stores this information in the MachineMemoryOperand. - bit CheckMMOIsNonAtomic = false; - bit CheckMMOIsAtomic = false; + bit CheckMMOIsNonAtomic = false; + bit CheckMMOIsAtomic = false; // SelectionDAG has one node for all loads and uses predicates to // differentiate them. GlobalISel on the other hand uses separate opcodes. @@ -52,8 +52,8 @@ def : GINodeEquiv<G_BITCAST, bitconvert>; def : GINodeEquiv<G_CONSTANT, imm>; def : GINodeEquiv<G_FCONSTANT, fpimm>; def : GINodeEquiv<G_IMPLICIT_DEF, undef>; -def : GINodeEquiv<G_FRAME_INDEX, frameindex>; -def : GINodeEquiv<G_BLOCK_ADDR, blockaddress>; +def : GINodeEquiv<G_FRAME_INDEX, frameindex>; +def : GINodeEquiv<G_BLOCK_ADDR, blockaddress>; def : GINodeEquiv<G_ADD, add>; def : GINodeEquiv<G_SUB, sub>; def : GINodeEquiv<G_MUL, mul>; @@ -73,16 +73,16 @@ def : GINodeEquiv<G_SADDSAT, saddsat>; def : GINodeEquiv<G_UADDSAT, uaddsat>; def : GINodeEquiv<G_SSUBSAT, ssubsat>; def : GINodeEquiv<G_USUBSAT, usubsat>; -def : GINodeEquiv<G_SSHLSAT, sshlsat>; -def : GINodeEquiv<G_USHLSAT, ushlsat>; -def : GINodeEquiv<G_SMULFIX, smulfix>; -def : GINodeEquiv<G_UMULFIX, umulfix>; -def : GINodeEquiv<G_SMULFIXSAT, smulfixsat>; -def : GINodeEquiv<G_UMULFIXSAT, umulfixsat>; -def : GINodeEquiv<G_SDIVFIX, sdivfix>; -def : GINodeEquiv<G_UDIVFIX, udivfix>; -def : GINodeEquiv<G_SDIVFIXSAT, sdivfixsat>; -def : GINodeEquiv<G_UDIVFIXSAT, udivfixsat>; +def : GINodeEquiv<G_SSHLSAT, sshlsat>; +def : GINodeEquiv<G_USHLSAT, ushlsat>; +def : GINodeEquiv<G_SMULFIX, smulfix>; +def : GINodeEquiv<G_UMULFIX, umulfix>; +def : GINodeEquiv<G_SMULFIXSAT, smulfixsat>; +def : GINodeEquiv<G_UMULFIXSAT, umulfixsat>; +def : GINodeEquiv<G_SDIVFIX, sdivfix>; +def : GINodeEquiv<G_UDIVFIX, udivfix>; +def : GINodeEquiv<G_SDIVFIXSAT, sdivfixsat>; +def : GINodeEquiv<G_UDIVFIXSAT, udivfixsat>; def : GINodeEquiv<G_SELECT, select>; def : GINodeEquiv<G_FNEG, fneg>; def : GINodeEquiv<G_FPEXT, fpextend>; @@ -116,7 +116,7 @@ def : GINodeEquiv<G_CTTZ, cttz>; def : GINodeEquiv<G_CTLZ_ZERO_UNDEF, ctlz_zero_undef>; def : GINodeEquiv<G_CTTZ_ZERO_UNDEF, cttz_zero_undef>; def : GINodeEquiv<G_CTPOP, ctpop>; -def : GINodeEquiv<G_EXTRACT_VECTOR_ELT, extractelt>; +def : GINodeEquiv<G_EXTRACT_VECTOR_ELT, extractelt>; def : GINodeEquiv<G_CONCAT_VECTORS, concat_vectors>; def : GINodeEquiv<G_BUILD_VECTOR, build_vector>; def : GINodeEquiv<G_FCEIL, fceil>; @@ -129,13 +129,13 @@ def : GINodeEquiv<G_FRINT, frint>; def : GINodeEquiv<G_FNEARBYINT, fnearbyint>; def : GINodeEquiv<G_INTRINSIC_TRUNC, ftrunc>; def : GINodeEquiv<G_INTRINSIC_ROUND, fround>; -def : GINodeEquiv<G_INTRINSIC_LRINT, lrint>; +def : GINodeEquiv<G_INTRINSIC_LRINT, lrint>; def : GINodeEquiv<G_FCOPYSIGN, fcopysign>; def : GINodeEquiv<G_SMIN, smin>; def : GINodeEquiv<G_SMAX, smax>; def : GINodeEquiv<G_UMIN, umin>; def : GINodeEquiv<G_UMAX, umax>; -def : GINodeEquiv<G_ABS, abs>; +def : GINodeEquiv<G_ABS, abs>; def : GINodeEquiv<G_FMINNUM, fminnum>; def : GINodeEquiv<G_FMAXNUM, fmaxnum>; def : GINodeEquiv<G_FMINNUM_IEEE, fminnum_ieee>; @@ -158,7 +158,7 @@ def : GINodeEquiv<G_STRICT_FSQRT, strict_fsqrt>; // separate nodes for them. This GINodeEquiv maps the non-atomic loads to // G_LOAD with a non-atomic MachineMemOperand. def : GINodeEquiv<G_LOAD, ld> { - let CheckMMOIsNonAtomic = true; + let CheckMMOIsNonAtomic = true; let IfSignExtend = G_SEXTLOAD; let IfZeroExtend = G_ZEXTLOAD; } @@ -174,19 +174,19 @@ def : GINodeEquiv<G_ICMP, setcc> { // G_STORE handles both atomic and non-atomic stores where as SelectionDAG had // separate nodes for them. This GINodeEquiv maps the non-atomic stores to // G_STORE with a non-atomic MachineMemOperand. -def : GINodeEquiv<G_STORE, st> { let CheckMMOIsNonAtomic = true; } +def : GINodeEquiv<G_STORE, st> { let CheckMMOIsNonAtomic = true; } def : GINodeEquiv<G_LOAD, atomic_load> { - let CheckMMOIsNonAtomic = false; - let CheckMMOIsAtomic = true; -} - -// Operands are swapped for atomic_store vs. regular store -def : GINodeEquiv<G_STORE, atomic_store> { - let CheckMMOIsNonAtomic = false; - let CheckMMOIsAtomic = true; + let CheckMMOIsNonAtomic = false; + let CheckMMOIsAtomic = true; } +// Operands are swapped for atomic_store vs. regular store +def : GINodeEquiv<G_STORE, atomic_store> { + let CheckMMOIsNonAtomic = false; + let CheckMMOIsAtomic = true; +} + def : GINodeEquiv<G_ATOMIC_CMPXCHG, atomic_cmp_swap>; def : GINodeEquiv<G_ATOMICRMW_XCHG, atomic_swap>; def : GINodeEquiv<G_ATOMICRMW_ADD, atomic_load_add>; |