- 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
-
Duncan P. N. Exon Smith authored
llvm-svn: 225897
-
Duncan P. N. Exon Smith authored
Working towards supporting `MDLocation` in `MapMetadata()`. llvm-svn: 225896
-
Ahmed Bougacha authored
It turns out, all callsites of the simplifier are guarded by a check for CallInst::getCalledFunction (i.e., to make sure the callee is direct). This check wasn't done when trying to further optimize a simplified fortified libcall, introduced by a refactoring in r225640. Fix that, add a testcase, and document the requirement. llvm-svn: 225895
-
- Jan 13, 2015
-
-
Julien Lerouge authored
The issue was introduced in r214638: + for (auto &BSIter : BlocksSchedules) { + scheduleBlock(BSIter.second.get()); + } Because BlocksSchedules is a DenseMap with BasicBlock* keys, blocks are scheduled in non-deterministic order, resulting in unpredictable IR. Patch by Daniel Reynaud! llvm-svn: 225821
-
Erik Eckstein authored
The alias cache has a problem of incorrect collisions in case a new instruction is allocated at the same address as a previously deleted instruction. llvm-svn: 225790
-
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. llvm-svn: 225786
-
Ramkumar Ramachandra authored
llvm-svn: 225762
-
Ramkumar Ramachandra authored
The functions {pred,succ,use,user}_{begin,end} exist, but many users have to check *_begin() with *_end() by hand to determine if the BasicBlock or User is empty. Fix this with a standard *_empty(), demonstrating a few usecases. llvm-svn: 225760
-
Sanjay Patel authored
llvm-svn: 225753
-
- Jan 12, 2015
-
-
Sanjay Patel authored
llvm-svn: 225700
-
Duncan P. N. Exon Smith authored
Split `GenericMDNode` into two classes (with more descriptive names). - `UniquableMDNode` will be a common subclass for `MDNode`s that are sometimes uniqued like constants, and sometimes 'distinct'. This class gets the (short-lived) RAUW support and related API. - `MDTuple` is the basic tuple that has always been returned by `MDNode::get()`. This is as opposed to more specific nodes to be added soon, which have additional fields, custom assembly syntax, and extra semantics. This class gets the hash-related logic, since other sublcasses of `UniquableMDNode` may need to hash based on other fields. To keep this diff from getting too big, I've added casts to `MDTuple` that won't really scale as new subclasses of `UniquableMDNode` are added, but I'll clean those up incrementally. (No functionality change intended.) llvm-svn: 225682
-
Sanjay Patel authored
Allow optimizations based on FP comparison values in the same way as integers. This resolves PR17713: http://llvm.org/bugs/show_bug.cgi?id=17713 Differential Revision: http://reviews.llvm.org/D6911 llvm-svn: 225660
-