Skip to content

Commit

Permalink
[AMDGPU] Use replaceOpcodeWith instead of applyCombine_s_mul_u64. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed May 3, 2024
1 parent 5fc5769 commit 1cde124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUCombine.td
Original file line number Diff line number Diff line change
Expand Up @@ -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<MachineInstr *, unsigned>">;

Expand Down
8 changes: 1 addition & 7 deletions llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
// ================

Expand Down

0 comments on commit 1cde124

Please sign in to comment.