| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Instead of DFS numbering basic blocks we now DFS number instructions that avoids
the costly operation of which instruction comes first in a basic block.
Patch mostly written by Daniel Berlin.
Differential Revision: https://reviews.llvm.org/D22777
llvm-svn: 276714
|
| |
|
|
|
|
|
|
|
|
| |
This patch adds an option to specify the maximum depth in a BB at which to
consider hoisting instructions. Hoisting instructions from a deeper level is
not profitable as it increases register pressure and compilation time.
Differential Revision: https://reviews.llvm.org/D22772
llvm-svn: 276713
|
| |
|
|
| |
llvm-svn: 276681
|
| |
|
|
| |
llvm-svn: 276670
|
| |
|
|
| |
llvm-svn: 276662
|
| |
|
|
|
|
| |
This fixes GVNHoist's portion of PR28670.
llvm-svn: 276658
|
| |
|
|
| |
llvm-svn: 276657
|
| |
|
|
|
|
|
| |
We can combine metadata from multiple instructions intelligently for
certain metadata nodes.
llvm-svn: 276602
|
| |
|
|
|
|
|
|
|
| |
If we two loads of two different alignments, we must use the minimum of
the two alignments when hoisting. Same deal for stores.
For allocas, use the maximum of the two allocas.
llvm-svn: 276601
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allowed loop vectorization with secondary FP IVs. Like this:
float *A;
float x = init;
for (int i=0; i < N; ++i) {
A[i] = x;
x -= fp_inc;
}
The auto-vectorization is possible when the induction binary operator is "fast" or the function has "unsafe" attribute.
Differential Revision: https://reviews.llvm.org/D21330
llvm-svn: 276554
|
| |
|
|
| |
llvm-svn: 276491
|
| |
|
|
| |
llvm-svn: 276488
|
| |
|
|
| |
llvm-svn: 276487
|
| |
|
|
|
|
|
|
|
|
|
| |
Recommiting r275571 after fixing crash reported in PR28270.
Now we erase elements of IOL in deleteDeadInstruction().
Original Summary:
This change use the overlap interval map built from partial overwrite tracking to perform shortening MemIntrinsics.
Add test cases which was missing opportunities before.
llvm-svn: 276452
|
| |
|
|
|
|
|
|
|
| |
Just because we can constant fold the result of an instruction does not
imply that we can delete the instruction. It may have side effects.
This fixes PR28655.
llvm-svn: 276389
|
| |
|
|
|
|
|
|
| |
If `-irce-skip-profitability-checks` is passed in, IRCE will kick in in
all cases where it is legal for it to kick in. This flag is intended to
help diagnose and analyse performance issues.
llvm-svn: 276372
|
| |
|
|
| |
llvm-svn: 276368
|
| |
|
|
| |
llvm-svn: 276364
|
| |
|
|
|
|
|
|
|
| |
Do not clone stored values unless they are GEPs that are special cased to avoid
hoisting them without hoisting their associated ld/st.
Differential revision: https://reviews.llvm.org/D22652
llvm-svn: 276358
|
| |
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D22648
llvm-svn: 276349
|
| |
|
|
| |
llvm-svn: 276340
|
| |
|
|
| |
llvm-svn: 276319
|
| |
|
|
|
|
|
| |
If we have optimization hints with agree with each other along different
paths, preserve them.
llvm-svn: 276248
|
| |
|
|
|
|
|
| |
We hoisted loads/stores without taking into account which can cause
miscompiles.
llvm-svn: 276240
|
| |
|
|
| |
llvm-svn: 276239
|
| |
|
|
|
|
|
|
|
| |
We hoisted PHIs without respecting their special insertion point in the
block, leading to verfier errors.
This fixes PR28626.
llvm-svn: 276181
|
| |
|
|
|
|
|
|
|
| |
We can replace the return values with undef if we replaced all
the call uses with a constant/undef.
Differential Revision: https://reviews.llvm.org/D22336
llvm-svn: 276174
|
| |
|
|
|
|
|
|
|
| |
We just set PreserveLCSSA to always true since we don't have an
analogous method `mustPreserveAnalysisID(LCSSA)`.
Also port LoopInfo verifier pass to test LoopUnrollPass.
llvm-svn: 276063
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D22545
llvm-svn: 276048
|
| |
|
|
|
|
|
| |
I've been hitting those already while working on SCCP and I think
it's be useful to provide a more explanatory diagnostic.
llvm-svn: 276007
|
| |
|
|
| |
llvm-svn: 276005
|
| |
|
|
| |
llvm-svn: 275991
|
| |
|
|
|
|
|
|
|
|
| |
Reviewers: hfinkel, jfb, reames
Subscribers: mcrosier, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D22385
llvm-svn: 275932
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Convert Loop String Reduce pass to new PM
Reviewers: davidxl, silvas
Subscribers: junbuml, sanjoy, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D22468
llvm-svn: 275919
|
| |
|
|
|
|
|
|
|
| |
replaceUsesOfWith will, on average, consider fewer values when trying
to do the replacement.
No functional change is intended.
llvm-svn: 275884
|
| |
|
|
| |
llvm-svn: 275879
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The direct motivation for the port is to ensure that the OptRemarkEmitter
tests work with the new PM.
This remains a function pass because we not only create multiple loops
but could also version the original loop.
In the test I need to invoke opt
with -passes='require<aa>,loop-distribute'. LoopDistribute does not
directly depend on AA however LAA does. LAA uses getCachedResult so
I *think* we need manually pull in 'aa'.
Reviewers: davidxl, silvas
Subscribers: sanjoy, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D22437
llvm-svn: 275811
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The main goal is to able to start using the new OptRemarkEmitter
analysis from the LoopVectorizer. Since the vectorizer was recently
converted to the new PM, it makes sense to convert this analysis as
well.
This pass is currently tested through the LoopDistribution pass, so I am
also porting LoopDistribution to get coverage for this analysis with the
new PM.
Reviewers: davidxl, silvas
Subscribers: llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D22436
llvm-svn: 275810
|
| |
|
|
|
|
| |
Causes https://llvm.org/bugs/show_bug.cgi?id=28588
llvm-svn: 275801
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While debugging GVNHoist, I found it confusing that the entries in a
VNtoInsns were not always value numbers. They _usually_ were except for
StoreInst in which case they were a hash of two different value numbers.
This leads to two observations:
- It is more difficult to debug things when the semantic contents of
VNtoInsns changes over time.
- Using a single value number is not much cheaper, the value of
VNtoInsns is a SmallVector.
- It is not immediately clear what the algorithm would do if there were
hash collisions in the StoreInst case.
Using a DenseMap of std::pair sidesteps all of this.
N.B. The changes in the test were due their sensitivity to the
iteration order of VNtoInsns which has changed.
llvm-svn: 275761
|
| |
|
|
|
|
|
| |
HoistedCtr cannot be a mutated global variable, that will open us up to
races between threads compiling code in parallel.
llvm-svn: 275744
|
| |
|
|
|
|
|
| |
No functional change is intended, just trying to clean things up a
little.
llvm-svn: 275743
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Convert IVUsers analysis to new pass manager.
Reviewers: davidxl, silvas
Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D22434
llvm-svn: 275698
|
| |
|
|
| |
llvm-svn: 275626
|
| |
|
|
| |
llvm-svn: 275593
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is the first set of changes implementing the RFC from
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334
This is a cross-sectional patch; rather than implementing the hotness
attribute for all optimization remarks and all passes in a patch set, it
implements it for the 'missed-optimization' remark for Loop
Distribution. My goal is to shake out the design issues before scaling
it up to other types and passes.
Hotness is computed as an integer as the multiplication of the block
frequency with the function entry count. It's only printed in opt
currently since clang prints the diagnostic fields directly. E.g.:
remark: /tmp/t.c:3:3: loop not distributed: use -Rpass-analysis=loop-distribute for more info (hotness: 300)
A new API added is similar to emitOptimizationRemarkMissed. The
difference is that it additionally takes a code region that the
diagnostic corresponds to. From this, hotness is computed using BFI.
The new API is exposed via an analysis pass so that it can be made
dependent on LazyBFI. (Thanks to Hal for the analysis pass idea.)
This feature can all be enabled by setDiagnosticHotnessRequested in the
LLVM context. If this is off, LazyBFI is not calculated (D22141) so
there should be no overhead.
A new command-line option is added to turn this on in opt.
My plan is to switch all user of emitOptimizationRemark* to use this
module instead.
Reviewers: hfinkel
Subscribers: rcox2, mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D21771
llvm-svn: 275583
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Convert LoopInstSimplify to new PM. Unfortunately there is no exisiting unittest for this pass.
Reviewers: davidxl, silvas
Subscribers: silvas, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D22280
llvm-svn: 275576
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change use the overlap interval map built from partial overwrite tracking to perform shortening MemIntrinsics.
Add test cases which was missing opportunities before.
Reviewers: hfinkel, eeckstein, mcrosier
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D21909
llvm-svn: 275571
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This pass hoists duplicated computations in the program. The primary goal of
gvn-hoist is to reduce the size of functions before inline heuristics to reduce
the total cost of function inlining.
Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki.
Important algorithmic contributions by Daniel Berlin under the form of reviews.
Differential Revision: http://reviews.llvm.org/D19338
llvm-svn: 275561
|
| |
|
|
| |
llvm-svn: 275495
|