[llvm] [FPEnv][IRBuilder] Set strictfp mode automatically when possible. (PR #98677)

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 10:14:44 PDT 2024


================
@@ -2691,20 +2691,32 @@ class IRBuilder : public IRBuilderBase {
                       FPMathTag, OpBundles),
         Folder(Folder) {
     SetInsertPoint(TheBB);
+    Function *F = TheBB->getParent();
+    if (F && F->hasFnAttribute(Attribute::StrictFP)) {
----------------
spavloff wrote:

Braces here are not needed, see https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements.

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


More information about the llvm-commits mailing list