| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
constant hoisting. It not only takes into account the number of uses and the
cost of expressions in which constants appear, but now also the resulting
integer range of the offsets. Thus, the algorithm maximizes the number of uses
within an integer range that will enable more efficient code generation. On
ARM, for example, this will enable code size optimisations because less
negative offsets will be created. Negative offsets/immediates are not supported
by Thumb1 thus preventing more compact instruction encoding.
Differential Revision: http://reviews.llvm.org/D21183
llvm-svn: 275382
|
| |
|
|
|
|
|
|
| |
We were able to fold masked loads with an all-ones mask to a normal
load. However, we couldn't turn a masked load with a mask with mixed
ones and undefs into a normal load.
llvm-svn: 275380
|
| |
|
|
|
|
| |
Thanks to Eli for the suggestion!
llvm-svn: 275366
|
| |
|
|
|
|
|
|
|
|
|
| |
values are constant.
This now should also work with the interprocedural variant of the pass.
Slightly easier now that the yak is shaved.
Differential Revision: http://reviews.llvm.org/D22329
llvm-svn: 275363
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In Scalarizer::gather we see if we already have a scattered form of Op,
and in that case use the new form.
In the particular case of PR28108, the found ValueVector SV has size 2,
where the first Value is nullptr, and the second is indeed a proper Value.
The nullptr then caused an assert to blow when we tried to do
cast<Instruction>(SV[I]).
With this patch we check SV[I] before doing the cast, and if it's nullptr
we just skip over it.
I don't know the Scalarizer well enough to know if this is the best fix
or if something should be done else where to prevent the nullptr from
being in the ValueVector at all, but at least this avoids the crash
and looking at the test case output it looks reasonable.
Reviewers: hfinkel, frasercrmck, wala, mehdi_amini
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D21518
llvm-svn: 275359
|
| |
|
|
| |
llvm-svn: 275357
|
| |
|
|
| |
llvm-svn: 275346
|
| |
|
|
|
|
|
| |
This transform doesn't require any new instructions, it can safely live
in InstSimplify.
llvm-svn: 275344
|
| |
|
|
|
|
|
|
|
| |
The code was pretty much copy-pasted between SCCP and IPSCCP. The situation
became clearly worse after I introduced the support for folding structs in
SCCP. This commit is NFC as we currently (still) skip the replacement
step in IPSCCP, but I'll change this soon.
llvm-svn: 275339
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
LSV used to abort vectorizing a chain for interleaved load/store accesses that alias.
Allow a valid prefix of the chain to be vectorized, mark just the prefix and retry vectorizing the remaining chain.
Reviewers: llvm-commits, jlebar, arsenm
Subscribers: mzolotukhin
Differential Revision: http://reviews.llvm.org/D22119
llvm-svn: 275317
|
| |
|
|
| |
llvm-svn: 275308
|
| |
|
|
| |
llvm-svn: 275307
|
| |
|
|
| |
llvm-svn: 275304
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In D21740, we discussed trying to make this a more general matcher. However, I didn't see a clean
way to handle the regular m_Not cases and these non-splat vector patterns, so I've opted for the
direct approach here. If there are other potential uses of areInverseVectorBitmasks(), we could
move that helper function to a higher level.
There is an open question as to which is of these forms should be considered the canonical IR:
%sel = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x i32> %a, <4 x i32> %b
%shuf = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
Differential Revision: http://reviews.llvm.org/D22114
llvm-svn: 275289
|
| |
|
|
|
|
|
|
| |
Patch by Sunita Marathe
Differential Revision: http://reviews.llvm.org/D21920
llvm-svn: 275284
|
| |
|
|
|
|
| |
No functional change is intended, just a minor cleanup.
llvm-svn: 275243
|
| |
|
|
|
|
| |
Should make sanitizers happier.
llvm-svn: 275230
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Port LICM to the new pass manager.
Reviewers: davidxl, silvas
Subscribers: krasin, vitalybuka, silvas, davide, sanjoy, llvm-commits, mehdi_amini
Differential Revision: http://reviews.llvm.org/D21772
llvm-svn: 275222
|
| |
|
|
|
|
|
| |
Remove unused variable added in r275216. Should fix bot failure:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/24665
llvm-svn: 275219
|
| |
|
|
|
|
|
|
|
| |
The LCSSA pass itself will not generate several redundant PHI nodes in a single
exit block. However, such redundant PHI nodes don't violate LCSSA form, and may
be introduced by passes that preserve LCSSA, and/or preserved by the LCSSA pass
itself. So, assuming a single PHI node per exit block is not safe.
llvm-svn: 275217
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Refactored the profitability analysis out of the IC promotion pass and
into lib/Analysis so that it can be accessed by the summary index
builder in a follow-on patch to enable IC promotion in ThinLTO (D21932).
Reviewers: davidxl, xur
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22182
llvm-svn: 275216
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D22269
llvm-svn: 275208
|
| |
|
|
|
|
|
|
|
| |
Use range-based for loops instead of doing everything manually.
Use auto when appropriate.
No functional change is intended.
llvm-svn: 275205
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Port LoopIdiomRecognize Pass to new PM
Reviewers: davidxl
Subscribers: davide, sanjoy, mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D22250
llvm-svn: 275202
|
| |
|
|
|
|
|
|
|
|
| |
Summary: This reverts commit r275118.
Subscribers: sanjoy, mehdi_amini
Differential Revision: http://reviews.llvm.org/D22259
llvm-svn: 275156
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
It's useful to have some visibility about which call sites are devirtualized,
especially for debug purposes. Another use case is a regression test on the
application side (like, Chromium).
Reviewers: pcc
Differential Revision: http://reviews.llvm.org/D22252
llvm-svn: 275145
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Port LICM to the new pass manager.
Reviewers: davidxl, silvas
Subscribers: silvas, davide, sanjoy, llvm-commits, mehdi_amini
Differential Revision: http://reviews.llvm.org/D21772
llvm-svn: 275118
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Aiming to correct the ordering of loads/stores. This patch changes the
insert point for loads to the position of the first load.
It updates the ordering method for loads to insert before, rather than after.
Before this patch the following sequence:
"load a[1], store a[1], store a[0], load a[2]"
Would incorrectly vectorize to "store a[0,1], load a[1,2]".
The correctness check was assuming the insertion point for loads is at
the position of the first load, when in practice it was at the last
load. An alternative fix would have been to invert the correctness check.
The current fix changes insert position but also requires reordering of
instructions before the vectorized load.
Updated testcases to reflect the changes.
Reviewers: tstellarAMD, llvm-commits, jlebar, arsenm
Subscribers: mzolotukhin
Differential Revision: http://reviews.llvm.org/D22071
llvm-svn: 275117
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Extend TTI to access TLI.allowsMisalignedMemoryAccesses(). Check condition when vectorizing load and store chains.
Add additional parameters: AddressSpace, Alignment, Fast.
Reviewers: llvm-commits, jlebar
Subscribers: arsenm, mzolotukhin
Differential Revision: http://reviews.llvm.org/D21935
llvm-svn: 275100
|
| |
|
|
|
|
| |
Thanks to Eli Friedman for pointing out in his post-commit review!
llvm-svn: 275084
|
| |
|
|
| |
llvm-svn: 275083
|
| |
|
|
|
|
|
|
| |
There's a little bit of churn in this patch because the initialization
mechanism is now shared between the old and the new PM. Other than
that, it's just a pretty mechanical translation.
llvm-svn: 275082
|
| |
|
|
|
|
|
|
|
| |
In preparation for porting this pass to the new PM (which has no
doInitialization()).
Differential Revision: http://reviews.llvm.org/D22223
llvm-svn: 275074
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
For sample-based PGO, using BFI to calculate callsite count is sometime not accurate. This is because with sampling based approach, if a callsite resides in a hot loop deeply nested in a bunch of cold branches, the callsite's BFI frequency would be inaccurately calculated due to lack of samples in the cold branch.
E.g.
if (A1 && A2 && A3 && ..... && A10) {
for (i=0; i < 100000000; i++) {
callsite();
}
}
Assume that A1 to A100 are all 100% taken, and callsite has 1000 samples and thus is considerred hot. Because the loop's trip count is huge, it's normal that all branches outside the loop has no sample at all. As a result, we can only use static branch probability to derive the the frequency of the loop header. Assuming that static heuristic thinks each branch is 50% taken, then the count calculated from BFI will be 1/(2^10) of the actual value.
In order to get more accurate callsite count, we directly annotate the weight on the call instruction, and directly use it when checking callsite hotness.
Note that this mechanism can also be shared by instrumentation based callsite hotness analysis. The side benefit is that it breaks the dependency from Inliner to BFI as call count is embedded in the IR.
Reviewers: davidxl, eraman, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22118
llvm-svn: 275073
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary: Handle the case when there is only one incoming/outgoing edge for a visited basic block: use the block weight to adjust edge weight even when the edge has been visited before. This can help reduce inaccuracies introduced by incorrect basic block profile, as shown in the updated unittest.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22180
llvm-svn: 275072
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Reviewers: hfinkel, majnemer, tstellarAMD, sunfish
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17279
llvm-svn: 275066
|
| |
|
|
|
|
| |
Reverting r275027 and r275033. These seem to cause miscompiles on the AArch64 buildbot.
llvm-svn: 275042
|
| |
|
|
|
|
|
| |
Suggested post-commit by David Majnemer on IRC (following-up on a pre-commit
review comment).
llvm-svn: 275033
|
| |
|
|
|
|
|
|
|
|
| |
A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.
Differential Revision: http://reviews.llvm.org/D22202
llvm-svn: 275027
|
| |
|
|
| |
llvm-svn: 275014
|
| |
|
|
|
|
|
|
|
|
| |
In the solver, isUndefined() does really mean "we don't know the
value yet" rather than "this is an UndefinedValue". Discussed with
Eli Friedman.
Differential Revision: http://reviews.llvm.org/D22192
llvm-svn: 275004
|
| |
|
|
| |
llvm-svn: 275000
|
| |
|
|
|
|
|
|
|
| |
This code was already commented out and it made some weird assumptions,
e.g. using isUndefined() as "this value is UndefValue" instead of
"we haven't computed this value is yet". Thanks to Eli Friedman for
pointing out where I was wrong (and where this code was wrong).
llvm-svn: 274995
|
| |
|
|
|
|
|
|
|
| |
ConstantInt::getSExtValue may fail on >64-bit integers. Add checks to call
getSExtValue only on narrow integers.
As a minor aside, simplify slsr-gep.ll to remove unnecessary load instructions.
llvm-svn: 274982
|
| |
|
|
|
|
| |
No functionality change intended.
llvm-svn: 274973
|
| |
|
|
|
|
|
| |
Chandler pointed out in his review but I forgot to remove before
committing, my bad.
llvm-svn: 274963
|
| |
|
|
| |
llvm-svn: 274962
|
| |
|
|
| |
llvm-svn: 274960
|
| |
|
|
|
|
|
|
|
| |
While here move simplifyLoop() function to the new header, as
suggested by Chandler in the review.
Differential Revision: http://reviews.llvm.org/D21404
llvm-svn: 274959
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This way the metadata will be only generated when asserts enabled,
or when -enable-import-metadata specified
FIXED missing colon on requires.
Reviewers: tejohnson, eraman, mehdi_amini
Subscribers: mehdi_amini, llvm-commits
Differential Revision: http://reviews.llvm.org/D22167
llvm-svn: 274947
|