1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/lib/Transforms/IPO
Rong Xu 40080ca01c Conditionally eliminate library calls where the result value is not used
Summary:
This pass shrink-wraps a condition to some library calls where the call
result is not used. For example:
   sqrt(val);
 is transformed to
   if (val < 0)
     sqrt(val);
Even if the result of library call is not being used, the compiler cannot
safely delete the call because the function can set errno on error
conditions.
Note in many functions, the error condition solely depends on the incoming
parameter. In this optimization, we can generate the condition can lead to
the errno to shrink-wrap the call. Since the chances of hitting the error
condition is low, the runtime call is effectively eliminated.

These partially dead calls are usually results of C++ abstraction penalty
exposed by inlining. This optimization hits 108 times in 19 C/C++ programs
in SPEC2006.

Reviewers: hfinkel, mehdi_amini, davidxl

Subscribers: modocache, mgorny, mehdi_amini, xur, llvm-commits, beanz

Differential Revision: https://reviews.llvm.org/D24414

llvm-svn: 284542
2016-10-18 21:36:27 +00:00
..
AlwaysInliner.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ArgumentPromotion.cpp Modify df_iterator to support post-order actions 2016-10-05 21:36:16 +00:00
BarrierNoopPass.cpp
CMakeLists.txt [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ConstantMerge.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
CrossDSOCFI.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
DeadArgumentElimination.cpp DeadArgElim: Don't mark swifterror arguments as unused 2016-09-21 15:29:08 +00:00
ElimAvailExtern.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
ExtractGV.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
ForceFunctionAttrs.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
FunctionAttrs.cpp [FunctionAttrs] Don't try to infer returned if it is already on an argument 2016-09-12 16:04:59 +00:00
FunctionImport.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
GlobalDCE.cpp IR: Introduce Module::global_objects(). 2016-06-22 20:29:42 +00:00
GlobalOpt.cpp [GlobalOpt] Dead Eliminate declarations 2016-09-15 20:26:27 +00:00
InferFunctionAttrs.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
Inliner.cpp Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
InlineSimple.cpp Add a new method to create SimpleInliner instance and make pre-inliner use this. 2016-08-11 18:24:08 +00:00
Internalize.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
IPConstantPropagation.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IPO.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
LLVMBuild.txt
LoopExtractor.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
LowerTypeTests.cpp Revert r277556. Add -lowertypetests-bitsets-level to control bitsets generation 2016-09-27 00:29:53 +00:00
MergeFunctions.cpp Replace a few more "fall through" comments with LLVM_FALLTHROUGH 2016-08-17 20:30:52 +00:00
PartialInlining.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
PassManagerBuilder.cpp Conditionally eliminate library calls where the result value is not used 2016-10-18 21:36:27 +00:00
PruneEH.cpp [PruneEH] Be correct in the face IPO 2016-10-03 19:35:30 +00:00
SampleProfile.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
StripDeadPrototypes.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
StripSymbols.cpp Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC) 2016-09-17 06:00:02 +00:00
WholeProgramDevirt.cpp Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC 2016-09-27 22:19:23 +00:00