- Jan 19, 2015
-
-
Chandler Carruth authored
APIs and replace it and numerous booleans with an option struct. The critical edge splitting API has a really large surface of flags and so it seems worth burning a small option struct / builder. This struct can be constructed with the various preserved analyses and then flags can be flipped in a builder style. The various users are now responsible for directly passing along their analysis information. This should be enough for the critical edge splitting to work cleanly with the new pass manager as well. This API is still pretty crufty and could be cleaned up a lot, but I've focused on this change just threading an option struct rather than a pass through the API. llvm-svn: 226456
-
Chandler Carruth authored
we can while splitting critical edges. The only code which called this and didn't require simplified loops to be preserved is polly, and the code behaves correctly there anyways. Without this change, it becomes really hard to share this code with the new pass manager where things like preserving loop simplify form don't make any sense. If anyone discovers this code behaving incorrectly, what it *should* be testing for is whether the loops it needs to be in simplified form are in fact in that form. It should always be trying to preserve that form when it exists. llvm-svn: 226443
-
Erik Eckstein authored
In case of blocks with many memory-accessing instructions, alias checking can take lot of time (because calculating the memory dependencies has quadratic complexity). I chose a limit which resulted in no changes when running the benchmarks. llvm-svn: 226439
-
Chandler Carruth authored
SplitLandingPadPredecessors and remove the Pass argument from its interface. Another step to the utilities being usable with both old and new pass managers. llvm-svn: 226426
-
- Jan 18, 2015
-
-
Chandler Carruth authored
rather than relying on the pass object. This one is a bit annoying, but will pay off. First, supporting this one will make the next one much easier, and for utilities like LoopSimplify, this is moving them (slowly) closer to not having to pass the pass object around throughout their APIs. llvm-svn: 226396
-
Chandler Carruth authored
interface, removing Pass from its interface. This also makes those analyses optional so that passes which don't even preserve these (or use them) can skip the logic entirely. llvm-svn: 226394
-
Chandler Carruth authored
optionally updated by MergeBlockIntoPredecessors. No functionality changed, just refactoring to clear the way for the new pass manager. llvm-svn: 226392
-
Chandler Carruth authored
Instead of querying the pass every where we need to, do that once and cache a pointer in the pass object. This is both simpler and I'm about to add yet another place where we need to dig out that pointer. llvm-svn: 226391
-
Chandler Carruth authored
accepting a Pass and querying it for analyses. This is necessary to allow the utilities to work both with the old and new pass managers, and I also think this makes the interface much more clear and helps the reader know what analyses the utility can actually handle. I plan to repeat this process iteratively to clean up all the pass utilities. llvm-svn: 226386
-
Chandler Carruth authored
cleaner to derive from the generic base. Thise removes a ton of boiler plate code and somewhat strange and pointless indirections. It also remove a bunch of the previously needed friend declarations. To fully remove these, I also lifted the verify logic into the generic LoopInfoBase, which seems good anyways -- it is generic and useful logic even for the machine side. llvm-svn: 226385
-
- Jan 17, 2015
-
-
Chandler Carruth authored
This was dead even before I refactored how we initialized it, but my refactoring made it trivially dead and it is now caught by a Clang warning. This fixes the warning and should clean up the -Werror bot failures (sorry!). llvm-svn: 226376
-
Chandler Carruth authored
a LoopInfoWrapperPass to wire the object up to the legacy pass manager. This switches all the clients of LoopInfo over and paves the way to port LoopInfo to the new pass manager. No functionality change is intended with this iteration. llvm-svn: 226373
-
- Jan 16, 2015
-
-
Mehdi Amini authored
http://reviews.llvm.org/D6993 llvm-svn: 226245
-
Sanjoy Das authored
IRCE eliminates range checks of the form 0 <= A * I + B < Length by splitting a loop's iteration space into three segments in a way that the check is completely redundant in the middle segment. As an example, IRCE will convert len = < known positive > for (i = 0; i < n; i++) { if (0 <= i && i < len) { do_something(); } else { throw_out_of_bounds(); } } to len = < known positive > limit = smin(n, len) // no first segment for (i = 0; i < limit; i++) { if (0 <= i && i < len) { // this check is fully redundant do_something(); } else { throw_out_of_bounds(); } } for (i = limit; i < n; i++) { if (0 <= i && i < len) { do_something(); } else { throw_out_of_bounds(); } } IRCE can deal with multiple range checks in the same loop (it takes the intersection of the ranges that will make each of them redundant individually). Currently IRCE does not do any profitability analysis. That is a TODO. Please note that the status of this pass is *experimental*, and it is not part of any default pass pipeline. Having said that, I will love to get feedback and general input from people interested in trying this out. This pass was originally r226201. It was reverted because it used C++ features not supported by MSVC 2012. Differential Revision: http://reviews.llvm.org/D6693 llvm-svn: 226238
-
- Jan 15, 2015
-
-
Sanjoy Das authored
The change used C++11 features not supported by MSVC 2012. I will fix the change to use things supported MSVC 2012 and recommit shortly. llvm-svn: 226216
-
David Majnemer authored
This silences a GCC warning. llvm-svn: 226215
-
Sanjoy Das authored
IRCE eliminates range checks of the form 0 <= A * I + B < Length by splitting a loop's iteration space into three segments in a way that the check is completely redundant in the middle segment. As an example, IRCE will convert len = < known positive > for (i = 0; i < n; i++) { if (0 <= i && i < len) { do_something(); } else { throw_out_of_bounds(); } } to len = < known positive > limit = smin(n, len) // no first segment for (i = 0; i < limit; i++) { if (0 <= i && i < len) { // this check is fully redundant do_something(); } else { throw_out_of_bounds(); } } for (i = limit; i < n; i++) { if (0 <= i && i < len) { do_something(); } else { throw_out_of_bounds(); } } IRCE can deal with multiple range checks in the same loop (it takes the intersection of the ranges that will make each of them redundant individually). Currently IRCE does not do any profitability analysis. That is a TODO. Please note that the status of this pass is *experimental*, and it is not part of any default pass pipeline. Having said that, I will love to get feedback and general input from people interested in trying this out. Differential Revision: http://reviews.llvm.org/D6693 llvm-svn: 226201
-
Alexander Kornienko authored
This patch was generated by a clang tidy checker that is being open sourced. The documentation of that checker is the following: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. Patch by Gábor Horváth! llvm-svn: 226161
-
Chandler Carruth authored
The pass is really just a means of accessing a cached instance of the TargetLibraryInfo object, and this way we can re-use that object for the new pass manager as its result. Lots of delta, but nothing interesting happening here. This is the common pattern that is developing to allow analyses to live in both the old and new pass manager -- a wrapper pass in the old pass manager emulates the separation intrinsic to the new pass manager between the result and pass for analyses. llvm-svn: 226157
-
David Majnemer authored
OtherOperandIdx is not used anymore, remove it to silence warnings. llvm-svn: 226138
-
NAKAMURA Takumi authored
llvm-svn: 226126
-
Chandler Carruth authored
While the term "Target" is in the name, it doesn't really have to do with the LLVM Target library -- this isn't an abstraction which LLVM targets generally need to implement or extend. It has much more to do with modeling the various runtime libraries on different OSes and with different runtime environments. The "target" in this sense is the more general sense of a target of cross compilation. This is in preparation for porting this analysis to the new pass manager. No functionality changed, and updates inbound for Clang and Polly. llvm-svn: 226078
-
Sanjoy Das authored
The bug was introduced in r225282. r225282 assumed that sub X, Y is the same as add X, -Y. This is not correct if we are going to upgrade the sub to sub nuw. This change fixes the issue by making the optimization ignore sub instructions. Differential Revision: http://reviews.llvm.org/D6979 llvm-svn: 226075
-
- Jan 14, 2015
-
-
David Majnemer authored
This fixes PR22226. llvm-svn: 226023
-
Erik Eckstein authored
This speeds up the dependency calculations for blocks with many load/store/call instructions. Beside the improved runtime, there is no functional change. Compared to the original commit, this re-applied commit contains a bug fix which ensures that there are no incorrect collisions in the alias cache. llvm-svn: 225977
-
Hao Liu authored
I.E. more than two -> exactly two Fix a typo function name in LoopVectorize. I.E. collectStrideAcccess() -> collectStrideAccess() llvm-svn: 225935
-
Duncan P. N. Exon Smith authored
llvm-svn: 225929
-
Duncan P. N. Exon Smith authored
llvm-svn: 225924
-
Duncan P. N. Exon Smith authored
Part of PR21433. llvm-svn: 225921
-
Duncan P. N. Exon Smith authored
The new logic isn't actually reachable yet, so no functionality change. llvm-svn: 225918
-
Duncan P. N. Exon Smith authored
llvm-svn: 225917
-
Duncan P. N. Exon Smith authored
llvm-svn: 225915
-
Duncan P. N. Exon Smith authored
Still doesn't handle distinct ones. Part of PR21433. llvm-svn: 225914
-
Duncan P. N. Exon Smith authored
llvm-svn: 225912
-
Duncan P. N. Exon Smith authored
llvm-svn: 225911
-
Duncan P. N. Exon Smith authored
llvm-svn: 225906
-
Duncan P. N. Exon Smith authored
llvm-svn: 225905
-
Duncan P. N. Exon Smith authored
Although this makes the `cast<>` assert more often, the `assert(Node->isResolved())` on the following line would assert in all those cases. So, no functionality change here. llvm-svn: 225903
-
Duncan P. N. Exon Smith authored
llvm-svn: 225902
-
Duncan P. N. Exon Smith authored
llvm-svn: 225901
-