[PATCH] D14069: [FPEnv Core 04/14] Skip constant folding to preserve FPEnv

Sergey Dmitrouk via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 14:23:15 PST 2015


sdmitrouk marked 5 inline comments as done.
sdmitrouk added a comment.

@joker.eph, thanks. Changed according to your comments, but tests on this revision don't pass... Can't reorder commits nicely due to changes of flags (now that default value `FastMathFlags()` is "bad" for incremental changes). Instead I'm leaving patches separated for review, but when committing will squash them to make tests pass on each revision.


================
Comment at: include/llvm/Analysis/ValueTracking.h:265
@@ -261,1 +264,3 @@
+  /// floating-point operations will result in observably different
+  /// floating-point exceptions being raised.
   ///
----------------
It's left from one of previous versions, the one with function attributes. Removed.

================
Comment at: include/llvm/IR/Constants.h:1106
@@ +1105,3 @@
+                       unsigned Flags = 0, Type *OnlyIfReducedTy = nullptr,
+                       FastMathFlags FMF = FastMathFlags());
+
----------------
Should be done, at least for this patch.

================
Comment at: include/llvm/IR/Constants.h:1243
@@ -1224,3 +1242,3 @@
   void setValueSubclassData(unsigned short D) {
     Value::setValueSubclassData(D);
   }
----------------
Moved it to place where it's used (used to be two such places), changed type of argument and added an assert.

================
Comment at: lib/Analysis/ValueTracking.cpp:3400
@@ +3399,3 @@
+      if (S != APFloat::opOK || (S & APFloat::opInexact))
+        return false;
+    }
----------------
Accidentally applied stash to the next patch instead of this one.

================
Comment at: lib/IR/ConstantFold.cpp:1182
@@ -1180,1 +1181,3 @@
+        break;
       case Instruction::FSub:
+        S = C3V.subtract(C2V, APFloat::rmNearestTiesToEven);
----------------
Changed it using `Optional`.


Repository:
  rL LLVM

http://reviews.llvm.org/D14069





More information about the llvm-commits mailing list