[PATCH] D31788: [ConstantFolding] Add folding for various math '__<func>_finite' routines generated from -ffast-math

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 12:26:22 PDT 2017


andrew.w.kaylor added inline comments.


================
Comment at: lib/Analysis/ConstantFolding.cpp:1446
+    // __FINITE_MATH_ONLY__ enabled.
+    if (Name[0] == '_' && Name.size() > 2 && Name[1] == '_') {
+      switch (Name[2]) {
----------------
The Name[0] check here is redundant, but I suppose it's mostly harmless.


================
Comment at: test/Transforms/ConstProp/calls-math-finite.ll:35
+
+; CHECK-NOT: call
+; CHECK: ret
----------------
Won't this test fail on targets where these functions were marked as unavailable?


https://reviews.llvm.org/D31788





More information about the llvm-commits mailing list