[clang] [llvm] [IR] Allow non-constrained math intrinsics in strictfp functions (PR #188297)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 24 10:54:32 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- clang/test/CodeGen/strictfp-elementwise-builtins.cpp llvm/include/llvm/IR/Function.h llvm/include/llvm/IR/IRBuilder.h llvm/include/llvm/IR/InstrTypes.h llvm/include/llvm/IR/Intrinsics.h llvm/include/llvm/Support/ModRef.h llvm/lib/Analysis/BasicAliasAnalysis.cpp llvm/lib/Analysis/GlobalsModRef.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h llvm/lib/IR/Function.cpp llvm/lib/IR/IRBuilder.cpp llvm/lib/IR/Instructions.cpp llvm/lib/IR/Intrinsics.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 05c869462..18d03faed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9584,11 +9584,10 @@ bool SelectionDAGBuilder::visitFPOperation(const CallInst &I, unsigned Opcode) {
     Flags.copyFMF(*FPOp);
   fp::ExceptionBehavior EB;
   if (DAG.getMachineFunction().getFunction().getAttributes().hasFnAttr(
-    llvm::Attribute::StrictFP)) {
+          llvm::Attribute::StrictFP)) {
     EB = fp::ebStrict;
     Flags.setNoFPExcept(true);
-  }
-  else {
+  } else {
     EB = fp::ebIgnore;
   }
 

``````````

</details>


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


More information about the cfe-commits mailing list