[PATCH] D24414: Conditionally eliminate library calls where the result value is not used

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 11:51:17 PDT 2016


xur marked 4 inline comments as done.

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:149
@@ +148,3 @@
+  switch (Func) {
+  case LibFunc::asinh:
+  case LibFunc::asinhf:
----------------
davidxl wrote:
> why not having a separate patch to improve FE?
we could. I only tested c/c++ FE. I think the good thing doing here is this applies to all FE.

I'll leave it here for now. Will do post commit fix if needed.

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:161
@@ +160,3 @@
+  case LibFunc::tanhl:
+  // The following functions seem already being marked by FE.
+  case LibFunc::ceil:
----------------
davidxl wrote:
> Why not using attribute marked by FE?
I haven't tested that. But why bother? we can safely delete them here.

================
Comment at: lib/Transforms/Utils/CondDeadCallElimination.cpp:595
@@ +594,3 @@
+    return false;
+  if (F.hasFnAttribute(Attribute::OptimizeForSize))
+    OptForSize = true;
----------------
davidxl wrote:
> Should OptimizeForSize be passed in via pass builder (see LoopUnswitch) as well?
the parameter OptForSize is passed from pass builder.
Here we also check the function attribute that can overwrite the command line options. 


https://reviews.llvm.org/D24414





More information about the llvm-commits mailing list