summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2024-05-03 15:54:17 +0100
committerJay Foad <jay.foad@amd.com>2024-05-03 15:54:39 +0100
commit692e887c7d77d71204df9090f12f1b8f47e4bfba (patch)
tree43d7da727f6fe2a98d0788872c43a675754b9e71
parent01e91a2dde497b71b0b85d5ec0f101a21e9c892c (diff)
[GlobalISel] Use some standard matchinfo defs. NFC.
-rw-r--r--llvm/include/llvm/Target/GlobalISel/Combine.td12
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUCombine.td4
2 files changed, 5 insertions, 11 deletions
diff --git a/llvm/include/llvm/Target/GlobalISel/Combine.td b/llvm/include/llvm/Target/GlobalISel/Combine.td
index dbbb3abaa830..f7895fbc6539 100644
--- a/llvm/include/llvm/Target/GlobalISel/Combine.td
+++ b/llvm/include/llvm/Target/GlobalISel/Combine.td
@@ -309,9 +309,8 @@ def shift_of_shifted_logic_chain : GICombineRule<
[{ 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),
+ (defs root:$d, unsigned_matchinfo:$matchinfo),
(match (G_MUL $d, $op1, $op2):$mi,
[{ return Helper.matchCombineMulToShl(*${mi}, ${matchinfo}); }]),
(apply [{ Helper.applyCombineMulToShl(*${mi}, ${matchinfo}); }])>;
@@ -430,9 +429,8 @@ def select_undef_cmp: GICombineRule<
// 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),
+ (defs root:$root, unsigned_matchinfo:$matchinfo),
(match (wip_match_opcode G_SELECT):$root,
[{ return Helper.matchConstantSelectCmp(*${root}, ${matchinfo}); }]),
(apply [{ Helper.replaceSingleDefInstWithOperand(*${root}, ${matchinfo}); }])
@@ -651,9 +649,8 @@ def add_p2i_to_ptradd : GICombineRule<
>;
// Fold (ptr_add (int2ptr C1), C2) -> C1 + C2
-def const_ptradd_to_i2p_matchinfo : GIDefMatchData<"APInt">;
def const_ptradd_to_i2p: GICombineRule<
- (defs root:$root, const_ptradd_to_i2p_matchinfo:$info),
+ (defs root:$root, apint_matchinfo:$info),
(match (wip_match_opcode G_PTR_ADD):$root,
[{ return Helper.matchCombineConstPtrAddToI2P(*${root}, ${info}); }]),
(apply [{ Helper.applyCombineConstPtrAddToI2P(*${root}, ${info}); }])
@@ -721,9 +718,8 @@ def anyext_trunc_fold: GICombineRule <
// Fold (zext (trunc x)) -> x if the source type is same as the destination type
// and truncated bits are known to be zero.
-def zext_trunc_fold_matchinfo : GIDefMatchData<"Register">;
def zext_trunc_fold: GICombineRule <
- (defs root:$root, zext_trunc_fold_matchinfo:$matchinfo),
+ (defs root:$root, register_matchinfo:$matchinfo),
(match (wip_match_opcode G_ZEXT):$root,
[{ return Helper.matchCombineZextTrunc(*${root}, ${matchinfo}); }]),
(apply [{ Helper.replaceSingleDefInstWithReg(*${root}, ${matchinfo}); }])
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCombine.td b/llvm/lib/Target/AMDGPU/AMDGPUCombine.td
index 5b52a1a872b9..3e043db115b7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCombine.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCombine.td
@@ -94,10 +94,8 @@ def fmed3_intrinsic_to_clamp : GICombineRule<
[{ return matchFPMed3ToClamp(*${fmed3}, ${matchinfo}); }]),
(apply [{ applyClamp(*${fmed3}, ${matchinfo}); }])>;
-def remove_fcanonicalize_matchinfo : GIDefMatchData<"Register">;
-
def remove_fcanonicalize : GICombineRule<
- (defs root:$fcanonicalize, remove_fcanonicalize_matchinfo:$matchinfo),
+ (defs root:$fcanonicalize, register_matchinfo:$matchinfo),
(match (wip_match_opcode G_FCANONICALIZE):$fcanonicalize,
[{ return matchRemoveFcanonicalize(*${fcanonicalize}, ${matchinfo}); }]),
(apply [{ Helper.replaceSingleDefInstWithReg(*${fcanonicalize}, ${matchinfo}); }])>;