[PATCH] D25970: DCE math library calls with a constant operand

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 16:00:12 PDT 2016


efriedma added inline comments.


================
Comment at: lib/Analysis/ConstantFolding.cpp:1971
+
+bool llvm::isMathLibCallNoop(CallSite CS, const TargetLibraryInfo *TLI) {
+  Function *F = CS.getCalledFunction();
----------------
davidxl wrote:
> There are lots of duplicated logic here with LibcallShinkWrap pass. I think the right way to do is let the later passes to clean up the dead calls. This can be done by pushing libcall shrinkwrap later in the pipeline.
The case which I originally ran into involves pow(), and LibCallsShrinkWrap can't really deal with that effectively, as far as I can tell.

It's probably possible to refactor the logic for some of the other libcalls... but we want to perform the check in isInstructionTriviallyDead to get rid of dead calls as soon as possible, so they don't block other optimizations.


Repository:
  rL LLVM

https://reviews.llvm.org/D25970





More information about the llvm-commits mailing list