[llvm] [X86][Codegen] - Introduce a new tuning for X86 backend to control FMA generation (PR #210343)
Rohit Aggarwal via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 05:08:24 PDT 2026
================
@@ -3438,6 +3438,13 @@ class LLVM_ABI TargetLoweringBase {
return false;
}
+ /// When true, FMA fusion during DAG combine requires the FMUL to carry a
+ /// local contract flag, ignoring global -ffp-contract=fast.
----------------
rohitaggarwal007 wrote:
```llvm
bool AllowFusionGlobally =
Options.AllowFPOpFusion == FPOpFusion::Fast || HasFMAD;
auto isContractableFMUL = [AllowFusionGlobally](SDValue N) {
if (N.getOpcode() != ISD::FMUL)
return false;
return AllowFusionGlobally || N->getFlags().hasAllowContract();
};
```
I didn't think so. As the code snippet. Here AllowFusionGlobally is given first preference and then to the local contract. I am trying to give preference to local contract.
https://github.com/llvm/llvm-project/pull/210343
More information about the llvm-commits
mailing list