Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions llvm/include/llvm/Target/GlobalISel/Combine.td
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def constantfp_matchinfo : GIDefMatchData<"ConstantFP*">;
def build_fn_matchinfo :
GIDefMatchData<"std::function<void(MachineIRBuilder &)>">;
def unsigned_matchinfo: GIDefMatchData<"unsigned">;
def register_vector_matchinfo : GIDefMatchData<"SmallVector<Register>">;

def copy_prop : GICombineRule<
(defs root:$d),
Expand Down Expand Up @@ -811,9 +812,8 @@ def zext_trunc_fold: GICombineRule <
(apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }])
>;

def not_cmp_fold_matchinfo : GIDefMatchData<"SmallVector<Register, 4>">;
def not_cmp_fold : GICombineRule<
(defs root:$d, not_cmp_fold_matchinfo:$info),
(defs root:$d, register_vector_matchinfo:$info),
(match (wip_match_opcode G_XOR): $d,
[{ return Helper.matchNotCmp(*${d}, ${info}); }]),
(apply [{ Helper.applyNotCmp(*${d}, ${info}); }])
Expand All @@ -828,9 +828,8 @@ def fneg_fneg_fold: GICombineRule <
>;

// 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),
(defs root:$d, register_vector_matchinfo:$info),
(match (wip_match_opcode G_UNMERGE_VALUES): $d,
[{ return Helper.matchCombineUnmergeMergeToPlainValues(*${d}, ${info}); }]),
(apply [{ Helper.applyCombineUnmergeMergeToPlainValues(*${d}, ${info}); }])
Expand Down Expand Up @@ -955,9 +954,8 @@ def ptr_add_with_zero: GICombineRule<
[{ return Helper.matchPtrAddZero(*${root}); }]),
(apply [{ 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),
(defs root:$root, register_vector_matchinfo:$info),
(match (wip_match_opcode G_INSERT_VECTOR_ELT):$root,
[{ return Helper.matchCombineInsertVecElts(*${root}, ${info}); }]),
(apply [{ Helper.applyCombineInsertVecElts(*${root}, ${info}); }])>;
Expand Down Expand Up @@ -1553,9 +1551,8 @@ def nneg_zext : GICombineRule<
(apply [{ Helper.applyBuildFnMO(${root}, ${matchinfo}); }])>;

// Combines concat operations
def concat_matchinfo : GIDefMatchData<"SmallVector<Register>">;
def combine_concat_vector : GICombineRule<
(defs root:$root, concat_matchinfo:$matchinfo),
(defs root:$root, register_vector_matchinfo:$matchinfo),
(match (wip_match_opcode G_CONCAT_VECTORS):$root,
[{ return Helper.matchCombineConcatVectors(*${root}, ${matchinfo}); }]),
(apply [{ Helper.applyCombineConcatVectors(*${root}, ${matchinfo}); }])>;
Expand All @@ -1567,7 +1564,7 @@ def combine_concat_vector : GICombineRule<
// ===>
// c = G_CONCAT_VECTORS x, y, z, undef
def combine_shuffle_concat : GICombineRule<
(defs root:$root, concat_matchinfo:$matchinfo),
(defs root:$root, register_vector_matchinfo:$matchinfo),
(match (wip_match_opcode G_SHUFFLE_VECTOR):$root,
[{ return Helper.matchCombineShuffleConcat(*${root}, ${matchinfo}); }]),
(apply [{ Helper.applyCombineShuffleConcat(*${root}, ${matchinfo}); }])>;
Expand Down
Loading