-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[GlobalISel] Create a common register_vector_matchinfo #144306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GlobalISel] Create a common register_vector_matchinfo #144306
Conversation
Several combiner use MatchInfo that are just SmallVector<Register>. This creates a common register_vector_matchinfo that they can all use.
|
@llvm/pr-subscribers-llvm-globalisel Author: David Green (davemgreen) ChangesSeveral combiner use MatchInfo that are just SmallVector<Register>. This creates a common register_vector_matchinfo that they can all use. Full diff: https://github.com/llvm/llvm-project/pull/144306.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Target/GlobalISel/Combine.td b/llvm/include/llvm/Target/GlobalISel/Combine.td
index efd88524a159e..4a92dc16c1bf4 100644
--- a/llvm/include/llvm/Target/GlobalISel/Combine.td
+++ b/llvm/include/llvm/Target/GlobalISel/Combine.td
@@ -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),
@@ -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}); }])
@@ -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}); }])
@@ -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}); }])>;
@@ -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}); }])>;
@@ -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}); }])>;
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/13089 Here is the relevant piece of the build log for the reference |
Several combiner use MatchInfo that are just SmallVector. This creates a common register_vector_matchinfo that they can all use.