[llvm] [AMDGPU] Improve MIR pattern for FMinFMaxLegacy combine. NFC. (PR #90968)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Fri May 3 06:46:31 PDT 2024
================
@@ -159,17 +160,14 @@ bool AMDGPUPostLegalizerCombinerImpl::tryCombineAll(MachineInstr &MI) const {
}
bool AMDGPUPostLegalizerCombinerImpl::matchFMinFMaxLegacy(
- MachineInstr &MI, FMinFMaxLegacyInfo &Info) const {
- // FIXME: Type predicate on pattern
- if (MRI.getType(MI.getOperand(0).getReg()) != LLT::scalar(32))
- return false;
-
- Register Cond = MI.getOperand(1).getReg();
- if (!MRI.hasOneNonDBGUse(Cond) ||
- !mi_match(Cond, MRI,
- m_GFCmp(m_Pred(Info.Pred), m_Reg(Info.LHS), m_Reg(Info.RHS))))
+ MachineInstr &MI, MachineInstr &FCmp, FMinFMaxLegacyInfo &Info) const {
+ if (!MRI.hasOneNonDBGUse(FCmp.getOperand(0).getReg()))
----------------
jayfoad wrote:
Sneaked in after the autogenerated matcher runs but before this match function is called? That doesn't sound right.
https://github.com/llvm/llvm-project/pull/90968
More information about the llvm-commits
mailing list