[llvm] [RISCV] Restrict combineOp_VLToVWOp_VL w/ bf16 to vfwmadd_vl with zvfbfwma (PR #108798)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 10:04:47 PDT 2024


topperc wrote:

Do we need to do this check when we check the other users too?

```
    auto AppendUsersIfNeeded = [&Worklist, &Subtarget,                           
                                &Inserted](const NodeExtensionHelper &Op) {      
      if (Op.needToPromoteOtherUsers()) {                                        
        for (SDNode::use_iterator UI = Op.OrigOperand->use_begin(),              
                                  UE = Op.OrigOperand->use_end();                
             UI != UE; ++UI) {                                                   
          SDNode *TheUse = *UI;                                                  
          if (!NodeExtensionHelper::isSupportedRoot(TheUse, Subtarget))          
            return false;                                                        
          // We only support the first 2 operands of FMA.                        
          if (UI.getOperandNo() >= 2)                                            
            return false;                                                        
          if (Inserted.insert(TheUse).second)                                    
            Worklist.push_back(TheUse);                                          
        }                                                                        
      }                                                                          
      return true;                                                               
    }; 
```

https://github.com/llvm/llvm-project/pull/108798


More information about the llvm-commits mailing list