From 1cde1240ed6e45012d7510f4aa39badbdb4a4721 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Fri, 3 May 2024 15:32:09 +0100 Subject: [PATCH] [AMDGPU] Use replaceOpcodeWith instead of applyCombine_s_mul_u64. NFC. --- llvm/lib/Target/AMDGPU/AMDGPUCombine.td | 2 +- llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCombine.td b/llvm/lib/Target/AMDGPU/AMDGPUCombine.td index 9218760538dc5d..5b52a1a872b9ee 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUCombine.td +++ b/llvm/lib/Target/AMDGPU/AMDGPUCombine.td @@ -115,7 +115,7 @@ def smulu64 : GICombineRule< (defs root:$smul, unsigned_matchinfo:$matchinfo), (match (wip_match_opcode G_MUL):$smul, [{ return matchCombine_s_mul_u64(*${smul}, ${matchinfo}); }]), - (apply [{ applyCombine_s_mul_u64(*${smul}, ${matchinfo}); }])>; + (apply [{ Helper.replaceOpcodeWith(*${smul}, ${matchinfo}); }])>; def sign_exension_in_reg_matchdata : GIDefMatchData<"std::pair">; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp index c403c3c70479e9..ff7cf9c8d6dcc2 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp @@ -107,11 +107,10 @@ class AMDGPUPostLegalizerCombinerImpl : public Combiner { // Find the s_mul_u64 instructions where the higher bits are either // zero-extended or sign-extended. - bool matchCombine_s_mul_u64(MachineInstr &MI, unsigned &NewOpcode) const; // Replace the s_mul_u64 instructions with S_MUL_I64_I32_PSEUDO if the higher // 33 bits are sign extended and with S_MUL_U64_U32_PSEUDO if the higher 32 // bits are zero extended. - void applyCombine_s_mul_u64(MachineInstr &MI, unsigned &NewOpcode) const; + bool matchCombine_s_mul_u64(MachineInstr &MI, unsigned &NewOpcode) const; private: #define GET_GICOMBINER_CLASS_MEMBERS @@ -438,11 +437,6 @@ bool AMDGPUPostLegalizerCombinerImpl::matchCombine_s_mul_u64( return false; } -void AMDGPUPostLegalizerCombinerImpl::applyCombine_s_mul_u64( - MachineInstr &MI, unsigned &NewOpcode) const { - Helper.replaceOpcodeWith(MI, NewOpcode); -} - // Pass boilerplate // ================