2008-09-22 09:08:49 +08:00
|
|
|
add_llvm_library(LLVMTransformUtils
|
2013-12-06 17:00:17 +08:00
|
|
|
ASanStackFrameLayout.cpp
|
2014-11-08 08:00:47 +08:00
|
|
|
AddDiscriminators.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
BasicBlockUtils.cpp
|
|
|
|
BreakCriticalEdges.cpp
|
2010-03-06 06:34:16 +08:00
|
|
|
BuildLibCalls.cpp
|
2012-09-05 02:22:17 +08:00
|
|
|
BypassSlowDivision.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
CloneFunction.cpp
|
|
|
|
CloneModule.cpp
|
|
|
|
CodeExtractor.cpp
|
2014-11-08 08:00:47 +08:00
|
|
|
CtorUtils.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
DemoteRegToStack.cpp
|
2017-11-15 05:09:45 +08:00
|
|
|
EntryExitInstrumenter.cpp
|
2016-11-15 05:41:13 +08:00
|
|
|
EscapeEnumerator.cpp
|
2016-02-03 10:51:00 +08:00
|
|
|
Evaluator.cpp
|
2014-11-08 08:00:47 +08:00
|
|
|
FlattenCFG.cpp
|
2016-11-12 05:15:13 +08:00
|
|
|
FunctionComparator.cpp
|
2016-02-11 02:11:31 +08:00
|
|
|
FunctionImportUtils.cpp
|
2013-10-22 01:14:55 +08:00
|
|
|
GlobalStatus.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
InlineFunction.cpp
|
Added ThinLTO inlining statistics
Summary:
copypasta doc of ImportedFunctionsInliningStatistics class
\brief Calculate and dump ThinLTO specific inliner stats.
The main statistics are:
(1) Number of inlined imported functions,
(2) Number of imported functions inlined into importing module (indirect),
(3) Number of non imported functions inlined into importing module
(indirect).
The difference between first and the second is that first stat counts
all performed inlines on imported functions, but the second one only the
functions that have been eventually inlined to a function in the importing
module (by a chain of inlines). Because llvm uses bottom-up inliner, it is
possible to e.g. import function `A`, `B` and then inline `B` to `A`,
and after this `A` might be too big to be inlined into some other function
that calls it. It calculates this statistic by building graph, where
the nodes are functions, and edges are performed inlines and then by marking
the edges starting from not imported function.
If `Verbose` is set to true, then it also dumps statistics
per each inlined function, sorted by the greatest inlines count like
- number of performed inlines
- number of performed inlines to importing module
Reviewers: eraman, tejohnson, mehdi_amini
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D22491
llvm-svn: 277089
2016-07-29 08:27:16 +08:00
|
|
|
ImportedFunctionsInliningStatistics.cpp
|
2009-07-22 01:43:20 +08:00
|
|
|
InstructionNamer.cpp
|
2012-09-19 06:02:40 +08:00
|
|
|
IntegerDivision.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
LCSSA.cpp
|
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-19 05:36:27 +08:00
|
|
|
LibCallsShrinkWrap.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
Local.cpp
|
|
|
|
LoopSimplify.cpp
|
2009-11-03 12:01:53 +08:00
|
|
|
LoopUnroll.cpp
|
2016-12-01 05:13:57 +08:00
|
|
|
LoopUnrollPeel.cpp
|
2011-12-09 14:19:40 +08:00
|
|
|
LoopUnrollRuntime.cpp
|
2015-04-20 12:38:33 +08:00
|
|
|
LoopUtils.cpp
|
2015-07-11 02:55:13 +08:00
|
|
|
LoopVersioning.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
LowerInvoke.cpp
|
2017-02-09 01:49:52 +08:00
|
|
|
LowerMemIntrinsics.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
LowerSwitch.cpp
|
|
|
|
Mem2Reg.cpp
|
2012-09-11 10:55:37 +08:00
|
|
|
MetaRenamer.cpp
|
2011-11-01 07:58:51 +08:00
|
|
|
ModuleUtils.cpp
|
2016-09-17 00:56:30 +08:00
|
|
|
NameAnonGlobals.cpp
|
2017-06-06 10:34:41 +08:00
|
|
|
OrderedInstructions.cpp
|
Add PredicateInfo utility and printing pass
Summary:
This patch adds a utility to build extended SSA (see "ABCD: eliminating
array bounds checks on demand"), and an intrinsic to support it. This
is then used to get functionality equivalent to propagateEquality in
GVN, in NewGVN (without having to replace instructions as we go). It
would work similarly in SCCP or other passes. This has been talked
about a few times, so i built a real implementation and tried to
productionize it.
Copies are inserted for operands used in assumes and conditional
branches that are based on comparisons (see below for more)
Every use affected by the predicate is renamed to the appropriate
intrinsic result.
E.g.
%cmp = icmp eq i32 %x, 50
br i1 %cmp, label %true, label %false
true:
ret i32 %x
false:
ret i32 1
will become
%cmp = icmp eq i32, %x, 50
br i1 %cmp, label %true, label %false
true:
; Has predicate info
; branch predicate info { TrueEdge: 1 Comparison: %cmp = icmp eq i32 %x, 50 }
%x.0 = call @llvm.ssa_copy.i32(i32 %x)
ret i32 %x.0
false:
ret i23 1
(you can use -print-predicateinfo to get an annotated-with-predicateinfo dump)
This enables us to easily determine what operations are affected by a
given predicate, and how operations affected by a chain of
predicates.
Reviewers: davide, sanjoy
Subscribers: mgorny, llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D29519
Update for review comments
Fix a bug Nuno noticed where we are giving information about and/or on edges where the info is not useful and easy to use wrong
Update for review comments
llvm-svn: 294351
2017-02-08 05:10:46 +08:00
|
|
|
PredicateInfo.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
PromoteMemoryToRegister.cpp
|
2016-10-22 02:43:16 +08:00
|
|
|
StripGCRelocates.cpp
|
2009-10-10 17:04:27 +08:00
|
|
|
SSAUpdater.cpp
|
2016-01-16 08:31:11 +08:00
|
|
|
SanitizerStats.cpp
|
2009-07-22 01:43:20 +08:00
|
|
|
SimplifyCFG.cpp
|
2011-08-10 11:51:58 +08:00
|
|
|
SimplifyIndVar.cpp
|
2010-12-21 04:54:37 +08:00
|
|
|
SimplifyInstructions.cpp
|
2012-10-14 00:45:24 +08:00
|
|
|
SimplifyLibCalls.cpp
|
2015-08-21 10:48:20 +08:00
|
|
|
SplitModule.cpp
|
2016-10-26 02:44:13 +08:00
|
|
|
StripNonLineTableDebugInfo.cpp
|
2014-11-08 08:00:47 +08:00
|
|
|
SymbolRewriter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
UnifyFunctionExitNodes.cpp
|
2010-10-08 01:55:47 +08:00
|
|
|
Utils.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
ValueMapper.cpp
|
2017-03-10 12:54:10 +08:00
|
|
|
VNCoercion.cpp
|
2015-02-11 11:28:02 +08:00
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Transforms
|
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Transforms/Utils
|
2012-06-24 21:32:01 +08:00
|
|
|
|
2016-11-17 12:36:50 +08:00
|
|
|
DEPENDS
|
|
|
|
intrinsics_gen
|
|
|
|
)
|