2006-08-21 07:37:03 +02:00
|
|
|
//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===//
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2005-01-07 08:46:40 +01:00
|
|
|
// The LLVM Compiler Infrastructure
|
2005-01-06 07:02:53 +01:00
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:59:05 +02:00
|
|
|
//
|
2005-01-06 07:02:53 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-01-29 02:09:53 +01:00
|
|
|
// This header file pulls in all transformation and analysis passes for tools
|
2006-08-21 07:37:03 +02:00
|
|
|
// like opt and bugpoint that need this functionality.
|
2005-01-06 07:02:53 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-08-21 07:34:03 +02:00
|
|
|
#ifndef LLVM_LINKALLPASSES_H
|
|
|
|
#define LLVM_LINKALLPASSES_H
|
2005-01-06 07:02:53 +01:00
|
|
|
|
2015-04-14 05:49:53 +02:00
|
|
|
#include "llvm/ADT/Statistic.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/AliasSetTracker.h"
|
2013-01-11 18:28:14 +01:00
|
|
|
#include "llvm/Analysis/CallPrinter.h"
|
2009-10-18 06:10:40 +02:00
|
|
|
#include "llvm/Analysis/DomPrinter.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/IntervalPartition.h"
|
2012-12-03 18:02:12 +01:00
|
|
|
#include "llvm/Analysis/Lint.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/Passes.h"
|
|
|
|
#include "llvm/Analysis/PostDominators.h"
|
2010-10-25 17:36:50 +02:00
|
|
|
#include "llvm/Analysis/RegionPass.h"
|
2010-07-22 09:46:31 +02:00
|
|
|
#include "llvm/Analysis/RegionPrinter.h"
|
2006-08-21 07:34:03 +02:00
|
|
|
#include "llvm/Analysis/ScalarEvolution.h"
|
2005-01-08 19:15:23 +01:00
|
|
|
#include "llvm/CodeGen/Passes.h"
|
2013-01-02 12:36:10 +01:00
|
|
|
#include "llvm/IR/Function.h"
|
2014-01-12 12:10:32 +01:00
|
|
|
#include "llvm/IR/IRPrintingPasses.h"
|
2005-01-06 07:02:53 +01:00
|
|
|
#include "llvm/Transforms/IPO.h"
|
2012-12-03 18:02:12 +01:00
|
|
|
#include "llvm/Transforms/Instrumentation.h"
|
2013-01-28 02:35:51 +01:00
|
|
|
#include "llvm/Transforms/ObjCARC.h"
|
2005-01-06 07:02:53 +01:00
|
|
|
#include "llvm/Transforms/Scalar.h"
|
2014-11-07 22:32:08 +01:00
|
|
|
#include "llvm/Transforms/Utils/SymbolRewriter.h"
|
2015-01-14 12:23:27 +01:00
|
|
|
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
|
2012-12-03 18:02:12 +01:00
|
|
|
#include "llvm/Transforms/Vectorize.h"
|
2015-04-14 05:49:53 +02:00
|
|
|
#include "llvm/Support/Valgrind.h"
|
2005-10-24 02:08:51 +02:00
|
|
|
#include <cstdlib>
|
2005-01-06 07:02:53 +01:00
|
|
|
|
|
|
|
namespace {
|
2005-01-08 23:01:16 +01:00
|
|
|
struct ForcePassLinking {
|
|
|
|
ForcePassLinking() {
|
2005-10-24 02:08:51 +02:00
|
|
|
// We must reference the passes in such a way that compilers will not
|
2005-01-07 08:44:02 +01:00
|
|
|
// delete it all as dead code, even with whole program optimization,
|
|
|
|
// yet is effectively a NO-OP. As the compiler isn't smart enough
|
2005-10-24 02:08:51 +02:00
|
|
|
// to know that getenv() never returns -1, this will do the job.
|
|
|
|
if (std::getenv("bar") != (char*) -1)
|
2005-01-07 08:44:02 +01:00
|
|
|
return;
|
2005-01-06 07:02:53 +01:00
|
|
|
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createAAEvalPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createAggressiveDCEPass();
|
[BDCE] Add a bit-tracking DCE pass
BDCE is a bit-tracking dead code elimination pass. It is based on ADCE (the
"aggressive DCE" pass), with the added capability to track dead bits of integer
valued instructions and remove those instructions when all of the bits are
dead.
Currently, it does not actually do this all-bits-dead removal, but rather
replaces the instruction's uses with a constant zero, and lets instcombine (and
the later run of ADCE) do the rest. Because we essentially get a run of ADCE
"for free" while tracking the dead bits, we also do what ADCE does and removes
actually-dead instructions as well (this includes instructions newly trivially
dead because all bits were dead, but not all such instructions can be removed).
The motivation for this is a case like:
int __attribute__((const)) foo(int i);
int bar(int x) {
x |= (4 & foo(5));
x |= (8 & foo(3));
x |= (16 & foo(2));
x |= (32 & foo(1));
x |= (64 & foo(0));
x |= (128& foo(4));
return x >> 4;
}
As it turns out, if you order the bit-field insertions so that all of the dead
ones come last, then instcombine will remove them. However, if you pick some
other order (such as the one above), the fact that some of the calls to foo()
are useless is not locally obvious, and we don't remove them (without this
pass).
I did a quick compile-time overhead check using sqlite from the test suite
(Release+Asserts). BDCE took ~0.4% of the compilation time (making it about
twice as expensive as ADCE).
I've not looked at why yet, but we eliminate instructions due to having
all-dead bits in:
External/SPEC/CFP2006/447.dealII/447.dealII
External/SPEC/CINT2006/400.perlbench/400.perlbench
External/SPEC/CINT2006/403.gcc/403.gcc
MultiSource/Applications/ClamAV/clamscan
MultiSource/Benchmarks/7zip/7zip-benchmark
llvm-svn: 229462
2015-02-17 02:36:59 +01:00
|
|
|
(void) llvm::createBitTrackingDCEPass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createAliasAnalysisCounterPass();
|
2006-11-14 06:21:04 +01:00
|
|
|
(void) llvm::createAliasDebugger();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createArgumentPromotionPass();
|
2014-09-07 22:05:11 +02:00
|
|
|
(void) llvm::createAlignmentFromAssumptionsPass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createBasicAliasAnalysisPass();
|
2014-04-24 08:44:33 +02:00
|
|
|
(void) llvm::createLibCallAliasAnalysisPass(nullptr);
|
2009-08-26 16:53:06 +02:00
|
|
|
(void) llvm::createScalarEvolutionAliasAnalysisPass();
|
2010-08-03 01:11:01 +02:00
|
|
|
(void) llvm::createTypeBasedAliasAnalysisPass();
|
Add scoped-noalias metadata
This commit adds scoped noalias metadata. The primary motivations for this
feature are:
1. To preserve noalias function attribute information when inlining
2. To provide the ability to model block-scope C99 restrict pointers
Neither of these two abilities are added here, only the necessary
infrastructure. In fact, there should be no change to existing functionality,
only the addition of new features. The logic that converts noalias function
parameters into this metadata during inlining will come in a follow-up commit.
What is added here is the ability to generally specify noalias memory-access
sets. Regarding the metadata, alias-analysis scopes are defined similar to TBAA
nodes:
!scope0 = metadata !{ metadata !"scope of foo()" }
!scope1 = metadata !{ metadata !"scope 1", metadata !scope0 }
!scope2 = metadata !{ metadata !"scope 2", metadata !scope0 }
!scope3 = metadata !{ metadata !"scope 2.1", metadata !scope2 }
!scope4 = metadata !{ metadata !"scope 2.2", metadata !scope2 }
Loads and stores can be tagged with an alias-analysis scope, and also, with a
noalias tag for a specific scope:
... = load %ptr1, !alias.scope !{ !scope1 }
... = load %ptr2, !alias.scope !{ !scope1, !scope2 }, !noalias !{ !scope1 }
When evaluating an aliasing query, if one of the instructions is associated
with an alias.scope id that is identical to the noalias scope associated with
the other instruction, or is a descendant (in the scope hierarchy) of the
noalias scope associated with the other instruction, then the two memory
accesses are assumed not to alias.
Note that is the first element of the scope metadata is a string, then it can
be combined accross functions and translation units. The string can be replaced
by a self-reference to create globally unqiue scope identifiers.
[Note: This overview is slightly stylized, since the metadata nodes really need
to just be numbers (!0 instead of !scope0), and the scope lists are also global
unnamed metadata.]
Existing noalias metadata in a callee is "cloned" for use by the inlined code.
This is necessary because the aliasing scopes are unique to each call site
(because of possible control dependencies on the aliasing properties). For
example, consider a function: foo(noalias a, noalias b) { *a = *b; } that gets
inlined into bar() { ... if (...) foo(a1, b1); ... if (...) foo(a2, b2); } --
now just because we know that a1 does not alias with b1 at the first call site,
and a2 does not alias with b2 at the second call site, we cannot let inlining
these functons have the metadata imply that a1 does not alias with b2.
llvm-svn: 213864
2014-07-24 16:25:39 +02:00
|
|
|
(void) llvm::createScopedNoAliasAAPass();
|
2012-05-22 19:19:09 +02:00
|
|
|
(void) llvm::createBoundsCheckingPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createBreakCriticalEdgesPass();
|
2013-01-11 18:28:14 +01:00
|
|
|
(void) llvm::createCallGraphPrinterPass();
|
|
|
|
(void) llvm::createCallGraphViewerPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createCFGSimplificationPass();
|
2014-09-02 23:43:13 +02:00
|
|
|
(void) llvm::createCFLAliasAnalysisPass();
|
2013-06-19 22:18:24 +02:00
|
|
|
(void) llvm::createStructurizeCFGPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createConstantMergePass();
|
|
|
|
(void) llvm::createConstantPropagationPass();
|
2012-11-02 22:48:17 +01:00
|
|
|
(void) llvm::createCostModelAnalysisPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createDeadArgEliminationPass();
|
|
|
|
(void) llvm::createDeadCodeEliminationPass();
|
|
|
|
(void) llvm::createDeadInstEliminationPass();
|
|
|
|
(void) llvm::createDeadStoreEliminationPass();
|
dependence analysis
Patch from Preston Briggs <preston.briggs@gmail.com>.
This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.
It's a fairly complete implementation of the paper
Practical Dependence Testing
Gina Goff, Ken Kennedy, and Chau-Wen Tseng
PLDI 1991
It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).
It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.
Included in the patch file are many test cases, commented with C code showing
the loops and array references.
llvm-svn: 165708
2012-10-11 09:32:34 +02:00
|
|
|
(void) llvm::createDependenceAnalysisPass();
|
Divergence analysis for GPU programs
Summary:
Some optimizations such as jump threading and loop unswitching can negatively
affect performance when applied to divergent branches. The divergence analysis
added in this patch conservatively estimates which branches in a GPU program
can diverge. This information can then help LLVM to run certain optimizations
selectively.
Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll
Reviewers: resistor, hfinkel, eliben, meheff, jholewinski
Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D8576
llvm-svn: 234567
2015-04-10 07:03:50 +02:00
|
|
|
(void) llvm::createDivergenceAnalysisPass();
|
2009-10-18 06:10:40 +02:00
|
|
|
(void) llvm::createDomOnlyPrinterPass();
|
|
|
|
(void) llvm::createDomPrinterPass();
|
|
|
|
(void) llvm::createDomOnlyViewerPass();
|
|
|
|
(void) llvm::createDomViewerPass();
|
2011-12-06 01:11:58 +01:00
|
|
|
(void) llvm::createGCOVProfilerPass();
|
2014-12-08 19:02:35 +01:00
|
|
|
(void) llvm::createInstrProfilingPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createFunctionInliningPass();
|
2008-09-03 22:24:05 +02:00
|
|
|
(void) llvm::createAlwaysInlinerPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createGlobalDCEPass();
|
|
|
|
(void) llvm::createGlobalOptimizerPass();
|
2005-01-08 19:15:23 +01:00
|
|
|
(void) llvm::createGlobalsModRefPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createIPConstantPropagationPass();
|
|
|
|
(void) llvm::createIPSCCPPass();
|
2015-01-16 02:03:22 +01:00
|
|
|
(void) llvm::createInductiveRangeCheckEliminationPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createIndVarSimplifyPass();
|
|
|
|
(void) llvm::createInstructionCombiningPass();
|
2012-10-26 20:47:48 +02:00
|
|
|
(void) llvm::createInternalizePass();
|
2006-05-26 15:58:26 +02:00
|
|
|
(void) llvm::createLCSSAPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLICMPass();
|
2009-11-11 01:22:30 +01:00
|
|
|
(void) llvm::createLazyValueInfoPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createLoopExtractorPass();
|
2015-06-11 00:54:02 +02:00
|
|
|
(void) llvm::createLoopInterchangePass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLoopSimplifyPass();
|
|
|
|
(void) llvm::createLoopStrengthReducePass();
|
2013-11-17 00:59:05 +01:00
|
|
|
(void) llvm::createLoopRerollPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLoopUnrollPass();
|
|
|
|
(void) llvm::createLoopUnswitchPass();
|
2010-12-26 20:32:44 +01:00
|
|
|
(void) llvm::createLoopIdiomPass();
|
2007-04-07 06:43:02 +02:00
|
|
|
(void) llvm::createLoopRotatePass();
|
2011-07-06 20:22:43 +02:00
|
|
|
(void) llvm::createLowerExpectIntrinsicPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createLowerInvokePass();
|
|
|
|
(void) llvm::createLowerSwitchPass();
|
2015-04-14 06:59:22 +02:00
|
|
|
(void) llvm::createNaryReassociatePass();
|
2005-01-08 23:01:16 +01:00
|
|
|
(void) llvm::createNoAAPass();
|
2011-06-16 01:37:01 +02:00
|
|
|
(void) llvm::createObjCARCAliasAnalysisPass();
|
2012-01-17 21:52:24 +01:00
|
|
|
(void) llvm::createObjCARCAPElimPass();
|
2011-06-16 01:37:01 +02:00
|
|
|
(void) llvm::createObjCARCExpandPass();
|
|
|
|
(void) llvm::createObjCARCContractPass();
|
|
|
|
(void) llvm::createObjCARCOptPass();
|
2014-11-17 03:28:27 +01:00
|
|
|
(void) llvm::createPAEvalPass();
|
2005-03-28 04:52:28 +02:00
|
|
|
(void) llvm::createPromoteMemoryToRegisterPass();
|
2005-11-10 03:07:45 +01:00
|
|
|
(void) llvm::createDemoteRegisterToMemoryPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createPruneEHPass();
|
2009-10-18 06:10:40 +02:00
|
|
|
(void) llvm::createPostDomOnlyPrinterPass();
|
|
|
|
(void) llvm::createPostDomPrinterPass();
|
|
|
|
(void) llvm::createPostDomOnlyViewerPass();
|
|
|
|
(void) llvm::createPostDomViewerPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createReassociatePass();
|
2010-07-22 09:46:31 +02:00
|
|
|
(void) llvm::createRegionInfoPass();
|
|
|
|
(void) llvm::createRegionOnlyPrinterPass();
|
|
|
|
(void) llvm::createRegionOnlyViewerPass();
|
|
|
|
(void) llvm::createRegionPrinterPass();
|
|
|
|
(void) llvm::createRegionViewerPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createSCCPPass();
|
Protection against stack-based memory corruption errors using SafeStack
This patch adds the safe stack instrumentation pass to LLVM, which separates
the program stack into a safe stack, which stores return addresses, register
spills, and local variables that are statically verified to be accessed
in a safe way, and the unsafe stack, which stores everything else. Such
separation makes it much harder for an attacker to corrupt objects on the
safe stack, including function pointers stored in spilled registers and
return addresses. You can find more information about the safe stack, as
well as other parts of or control-flow hijack protection technique in our
OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
and our project website (http://levee.epfl.ch).
The overhead of our implementation of the safe stack is very close to zero
(0.01% on the Phoronix benchmarks). This is lower than the overhead of
stack cookies, which are supported by LLVM and are commonly used today,
yet the security guarantees of the safe stack are strictly stronger than
stack cookies. In some cases, the safe stack improves performance due to
better cache locality.
Our current implementation of the safe stack is stable and robust, we
used it to recompile multiple projects on Linux including Chromium, and
we also recompiled the entire FreeBSD user-space system and more than 100
packages. We ran unit tests on the FreeBSD system and many of the packages
and observed no errors caused by the safe stack. The safe stack is also fully
binary compatible with non-instrumented code and can be applied to parts of
a program selectively.
This patch is our implementation of the safe stack on top of LLVM. The
patches make the following changes:
- Add the safestack function attribute, similar to the ssp, sspstrong and
sspreq attributes.
- Add the SafeStack instrumentation pass that applies the safe stack to all
functions that have the safestack attribute. This pass moves all unsafe local
variables to the unsafe stack with a separate stack pointer, whereas all
safe variables remain on the regular stack that is managed by LLVM as usual.
- Invoke the pass as the last stage before code generation (at the same time
the existing cookie-based stack protector pass is invoked).
- Add unit tests for the safe stack.
Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.
Differential Revision: http://reviews.llvm.org/D6094
llvm-svn: 239761
2015-06-15 23:07:11 +02:00
|
|
|
(void) llvm::createSafeStackPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createScalarReplAggregatesPass();
|
|
|
|
(void) llvm::createSingleLoopExtractorPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createStripSymbolsPass();
|
2008-11-18 22:34:39 +01:00
|
|
|
(void) llvm::createStripNonDebugSymbolsPass();
|
2010-07-01 21:49:20 +02:00
|
|
|
(void) llvm::createStripDeadDebugInfoPass();
|
2008-02-22 19:39:29 +01:00
|
|
|
(void) llvm::createStripDeadPrototypesPass();
|
2005-01-07 08:44:02 +01:00
|
|
|
(void) llvm::createTailCallEliminationPass();
|
2008-04-20 22:35:01 +02:00
|
|
|
(void) llvm::createJumpThreadingPass();
|
2005-01-08 18:21:40 +01:00
|
|
|
(void) llvm::createUnifyFunctionExitNodesPass();
|
2006-08-21 07:34:03 +02:00
|
|
|
(void) llvm::createInstCountPass();
|
2014-01-25 03:02:55 +01:00
|
|
|
(void) llvm::createConstantHoistingPass();
|
2007-03-31 06:06:36 +02:00
|
|
|
(void) llvm::createCodeGenPreparePass();
|
2011-01-02 22:47:05 +01:00
|
|
|
(void) llvm::createEarlyCSEPass();
|
2014-09-10 19:52:27 +02:00
|
|
|
(void) llvm::createMergedLoadStoreMotionPass();
|
2007-07-24 19:55:58 +02:00
|
|
|
(void) llvm::createGVNPass();
|
2008-04-09 10:23:16 +02:00
|
|
|
(void) llvm::createMemCpyOptPass();
|
2008-04-29 22:06:54 +02:00
|
|
|
(void) llvm::createLoopDeletionPass();
|
2008-05-29 19:00:13 +02:00
|
|
|
(void) llvm::createPostDomTree();
|
2008-08-23 08:07:02 +02:00
|
|
|
(void) llvm::createInstructionNamerPass();
|
2012-09-11 04:46:18 +02:00
|
|
|
(void) llvm::createMetaRenamerPass();
|
2008-12-31 17:14:43 +01:00
|
|
|
(void) llvm::createFunctionAttrsPass();
|
2008-11-02 06:52:50 +01:00
|
|
|
(void) llvm::createMergeFunctionsPass();
|
2014-04-24 08:44:33 +02:00
|
|
|
(void) llvm::createPrintModulePass(*(llvm::raw_ostream*)nullptr);
|
|
|
|
(void) llvm::createPrintFunctionPass(*(llvm::raw_ostream*)nullptr);
|
|
|
|
(void) llvm::createPrintBasicBlockPass(*(llvm::raw_ostream*)nullptr);
|
2010-05-07 18:22:32 +02:00
|
|
|
(void) llvm::createModuleDebugInfoPrinterPass();
|
2009-06-14 10:26:32 +02:00
|
|
|
(void) llvm::createPartialInliningPass();
|
2010-04-08 20:47:09 +02:00
|
|
|
(void) llvm::createLintPass();
|
2010-05-07 17:40:13 +02:00
|
|
|
(void) llvm::createSinkingPass();
|
2010-08-03 18:19:16 +02:00
|
|
|
(void) llvm::createLowerAtomicPass();
|
2010-08-31 09:48:34 +02:00
|
|
|
(void) llvm::createCorrelatedValuePropagationPass();
|
2010-09-17 00:08:32 +02:00
|
|
|
(void) llvm::createMemDepPrinter();
|
2010-12-20 21:54:37 +01:00
|
|
|
(void) llvm::createInstructionSimplifierPass();
|
2012-12-12 20:29:45 +01:00
|
|
|
(void) llvm::createLoopVectorizePass();
|
2013-04-09 21:44:35 +02:00
|
|
|
(void) llvm::createSLPVectorizerPass();
|
2012-02-01 04:51:43 +01:00
|
|
|
(void) llvm::createBBVectorizePass();
|
2013-08-23 12:27:02 +02:00
|
|
|
(void) llvm::createPartiallyInlineLibCallsPass();
|
2013-11-22 17:58:05 +01:00
|
|
|
(void) llvm::createScalarizerPass();
|
2014-05-01 20:38:36 +02:00
|
|
|
(void) llvm::createSeparateConstOffsetFromGEPPass();
|
2015-05-15 19:54:48 +02:00
|
|
|
(void) llvm::createSpeculativeExecutionPass();
|
2014-11-07 22:32:08 +01:00
|
|
|
(void) llvm::createRewriteSymbolsPass();
|
Add straight-line strength reduction to LLVM
Summary:
Straight-line strength reduction (SLSR) is implemented in GCC but not yet in
LLVM. It has proven to effectively simplify statements derived from an unrolled
loop, and can potentially benefit many other cases too. For example,
LLVM unrolls
#pragma unroll
foo (int i = 0; i < 3; ++i) {
sum += foo((b + i) * s);
}
into
sum += foo(b * s);
sum += foo((b + 1) * s);
sum += foo((b + 2) * s);
However, no optimizations yet reduce the internal redundancy of the three
expressions:
b * s
(b + 1) * s
(b + 2) * s
With SLSR, LLVM can optimize these three expressions into:
t1 = b * s
t2 = t1 + s
t3 = t2 + s
This commit is only an initial step towards implementing a series of such
optimizations. I will implement more (see TODO in the file commentary) in the
near future. This optimization is enabled for the NVPTX backend for now.
However, I am more than happy to push it to the standard optimization pipeline
after more thorough performance tests.
Test Plan: test/StraightLineStrengthReduce/slsr.ll
Reviewers: eliben, HaoLiu, meheff, hfinkel, jholewinski, atrick
Reviewed By: jholewinski, atrick
Subscribers: karthikthecool, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D7310
llvm-svn: 228016
2015-02-03 20:37:06 +01:00
|
|
|
(void) llvm::createStraightLineStrengthReducePass();
|
2015-02-06 02:46:42 +01:00
|
|
|
(void) llvm::createMemDerefPrinter();
|
2015-03-27 11:36:57 +01:00
|
|
|
(void) llvm::createFloat2IntPass();
|
2006-08-21 07:34:03 +02:00
|
|
|
|
|
|
|
(void)new llvm::IntervalPartition();
|
|
|
|
(void)new llvm::ScalarEvolution();
|
2014-04-24 08:44:33 +02:00
|
|
|
((llvm::Function*)nullptr)->viewCFGOnly();
|
2011-08-29 19:07:00 +02:00
|
|
|
llvm::RGPassManager RGM;
|
2014-04-24 08:44:33 +02:00
|
|
|
((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
|
|
|
|
llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
|
2014-10-05 00:44:29 +02:00
|
|
|
X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
|
2015-04-14 05:49:53 +02:00
|
|
|
(void) llvm::AreStatisticsEnabled();
|
|
|
|
(void) llvm::sys::RunningOnValgrind();
|
2005-01-07 08:44:02 +01:00
|
|
|
}
|
2006-08-01 16:21:23 +02:00
|
|
|
} ForcePassLinking; // Force link by creating a global definition.
|
2015-06-23 12:48:35 +02:00
|
|
|
}
|
2005-01-06 07:02:53 +01:00
|
|
|
|
|
|
|
#endif
|