[PATCH] D72930: [FEnv] Constfold some unary constrained operations

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 22:25:39 PST 2020


sepavloff marked 2 inline comments as done.
sepavloff added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1407
   switch (F->getIntrinsicID()) {
   case Intrinsic::fabs:
   case Intrinsic::minnum:
----------------
evandro wrote:
> Should these cases be true even when `isStrictFP()` is true?
`fabs` is allowed irrespective of `isStrictFP()` , so it should be processed here. As for functions like `ceil`, they cannot be found in strictfp function, corresponding operations are represented by constrained intrinsics.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2526
                                  const TargetLibraryInfo *TLI) {
-  if (Call->isNoBuiltin() || Call->isStrictFP())
+  if (Call->isNoBuiltin())
     return nullptr;
----------------
evandro wrote:
> Again, not sure about the impact of doing this...
The same thing. If an operation depends on or changes current floating point environment, it is represented by corresponding constrained intrinsics in strictfp function. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72930/new/

https://reviews.llvm.org/D72930





More information about the llvm-commits mailing list