[llvm] [DAGCombiner] Add generic DAG combine for ISD::PARTIAL_REDUCE_MLA (PR #127083)

James Chesterman via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 04:09:17 PST 2025


================
@@ -836,9 +836,8 @@ void TargetLoweringBase::initActions() {
     setOperationAction(ISD::SET_FPENV, VT, Expand);
     setOperationAction(ISD::RESET_FPENV, VT, Expand);
 
-    // PartialReduceMLA operations default to expand.
-    setOperationAction({ISD::PARTIAL_REDUCE_UMLA, ISD::PARTIAL_REDUCE_SMLA}, VT,
-                       Expand);
+    for (MVT InputVT : MVT::all_valuetypes())
+      setPartialReduceMLAAction(VT, InputVT, Expand);
----------------
JamesChesterman wrote:

If we changed the operation actions to Legal or Custom then the combined node would attempt to be lowered, which is not implemented yet. I can tell it works because I have a patch that will be applied after this in which it is successfully lowered to a dot product instruction (because of the successful DAG combine). Unless there would maybe be some other way to test it?

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


More information about the llvm-commits mailing list