[PATCH] D14073: [FPEnv Core 08/14] Do not simplify expressions with FPEnv access

Sergey Dmitrouk via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 23 06:26:49 PST 2016


sdmitrouk added inline comments.

================
Comment at: lib/Analysis/ConstantFolding.cpp:1008
@@ -1007,1 +1007,3 @@
+  if (!FMF.any())
+    FMF = CE->getFastMathFlags();
   return ConstantFoldConstantExpressionImpl(CE, DL, TLI, FoldedOps, FMF);
----------------
joker.eph wrote:
> Why not always use `CE->getFastMathFlags();`? Wasn't the `FMF` param added to this function because of the lack of `FMF` in `ConstantExpr` originally? 
> Wasn't the FMF param added to this function because of the lack of FMF in ConstantExpr originally?

No, it wasn't. `FMF` can be from instruction which contains `CE` as one of its operands, the argument was added for `llvm::ConstantFoldInstruction`.

================
Comment at: lib/IR/ConstantsContext.h:423
@@ -422,2 +422,3 @@
   uint16_t SubclassData;
+  FastMathFlags FMF;
   ArrayRef<Constant *> Ops;
----------------
joker.eph wrote:
> I think it is OK, unless you have any clue why it wouldn't?
No, I just didn't see such use and thought maybe there is a reason for that, which isn't documented. I'll change this then.


Repository:
  rL LLVM

http://reviews.llvm.org/D14073





More information about the llvm-commits mailing list