[llvm] [AMDGPU] Improve MIR pattern for FMinFMaxLegacy combine. NFC. (PR #90968)
    Thorsten Schütt via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri May  3 06:43:33 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()))
----------------
tschuett wrote:
No. Other uses could have sneaked in.
https://github.com/llvm/llvm-project/pull/90968
    
    
More information about the llvm-commits
mailing list