- Dec 03, 2012
-
-
Chandler Carruth authored
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
-
Chandler Carruth authored
The partitioning logic attempted to handle uses of an alloca with an offset starting before the alloca so long as the use had some overlap with the alloca itself. However, there was a bug where we tested '(uint64_t)Offset >= AllocSize' without first checking whether 'Offset' was positive. As a consequence, essentially every negative offset (that is, starting *before* the alloca does) would be thrown out, even if it was overlapping. The subsequent code to throw out negative offsets which were actually non-overlapping was essentially dead. The code to *handle* overlapping negative offsets was actually dead! I've just removed all of this, and taught SROA to discard any uses which start prior to the alloca from the beginning. It has the lovely property of simplifying the code. =] All the tests still pass, and in fact no new tests are needed as this is already covered by our testsuite. Fixing the code so that negative offsets work the way the comments indicate they were supposed to work causes regressions. That's how I found this. Anyways, this is all progress in the correct direction -- tightening up SROA to be maximally aggressive. Some day, I really hope to turn out-of-bounds accesses to an alloca into 'unreachable'. llvm-svn: 169120
-
Nuno Lopes authored
llvm-svn: 169119
-
- Dec 01, 2012
-
-
Benjamin Kramer authored
Fixes PR14465. Differential Revision: http://llvm-reviews.chandlerc.com/D148 llvm-svn: 169084
-
Zhou Sheng authored
llvm-svn: 169083
-
Zhou Sheng authored
Also check in a case to repeat the issue, on which 'opt -globalopt' consumes 1.6GB memory. The big memory footprint cause is that current GlobalOpt one by one hoists and stores the leaf element constant into the global array, in each iteration, it recreates the global array initializer constant and leave the old initializer alone. This may result in many obsolete constants left. For example: we have global array @rom = global [16 x i32] zeroinitializer After the first element value is hoisted and installed: @rom = global [16 x i32] [ 1, 0, 0, ... ] After the second element value is installed: @rom = global [16 x 32] [ 1, 2, 0, 0, ... ] // here the previous initializer is obsolete ... When the transform is done, we have 15 obsolete initializers left useless. llvm-svn: 169079
-
- Nov 30, 2012
-
-
Pedro Artigas authored
reversed the logic of the log2 detection routine to reduce the number of nested ifs llvm-svn: 169049
-
Nadav Rotem authored
llvm-svn: 169048
-
Bill Wendling authored
The original patch removed a bunch of code that the SjLjEHPrepare pass placed into the entry block if all of the landing pads were removed during the CodeGenPrepare class. The more natural way of doing things is to run the CGP *before* we run the SjLjEHPrepare pass. Make it so! llvm-svn: 169044
-
Pedro Artigas authored
llvm-svn: 169043
-
Pedro Artigas authored
reviewed by Michael Ilseman <milseman@apple.com> llvm-svn: 169025
-
Nadav Rotem authored
Remove the use of LPPassManager. We can remove LPM because we dont need to run any additional loop passes on the new vector loop. llvm-svn: 169016
-
Kostya Serebryany authored
llvm-svn: 168995
-
Chandler Carruth authored
We're iterating over a non-deterministically ordered container looking for two saturating flags. To do this correctly, we have to saturate both, and only stop looping if both saturate to their final value. Otherwise, which flag we see first changes the result. This is also a micro-optimization of the previous version as now we don't go into the (possibly expensive) test logic once the first violation of either constraint is detected. llvm-svn: 168989
-
Chandler Carruth authored
functionality changed. Evan's commit r168970 moved the code that the primary comment in this function referred to to the other end of the function without moving the comment, and there has been a steady creep of "boolean" logic in it that is simpler if handled via early exit. That way each special case can have its own comments. I've also made the variable name a bit more explanatory than "AllFit". This is in preparation to fix the non-deterministic output of this function. llvm-svn: 168988
-
Meador Inge authored
The simplify-libcalls pass maintained a statistic to count the number of library calls that have been simplified. Now that library call simplification is being carried out in instcombine the statistic should be moved to there. llvm-svn: 168975
-
Chandler Carruth authored
depends on the IR infrastructure, there is no sense in it being off in Support land. This is in preparation to start working to expand InstVisitor into more special-purpose visitors that are still generic and can be re-used across different passes. The expansion will go into the Analylis tree though as nothing in VMCore needs it. llvm-svn: 168972
-
Evan Cheng authored
the tables cannot fit in registers (i.e. bitmap), do not emit the table if it's using an illegal type. rdar://12779436 llvm-svn: 168970
-
- Nov 29, 2012
-
-
rdar://12100355Shuxin Yang authored
This revision attempts to recognize following population-count pattern: while(a) { c++; ... ; a &= a - 1; ... }, where <c> and <a>could be used multiple times in the loop body. TODO: On X8664 and ARM, __buildin_ctpop() are not expanded to a efficent instruction sequence, which need to be improved in the following commits. Reviewed by Nadav, really appreciate! llvm-svn: 168931
-
Bill Wendling authored
the last invoke instruction in the function. This also removes the last landing pad in an function. This is fine, but with SjLj EH code, we've already placed a bunch of code in the 'entry' block, which expects the landing pad to stick around. When we get to the situation where CGP has removed the last landing pad, go ahead and nuke the SjLj instructions from the 'entry' block. <rdar://problem/12721258> llvm-svn: 168930
-
Nadav Rotem authored
llvm-svn: 168928
-
Nadav Rotem authored
llvm-svn: 168927
-
Meador Inge authored
This patch migrates the puts optimizations from the simplify-libcalls pass into the instcombine library call simplifier. All the simplifiers from simplify-libcalls have now been migrated to instcombine. Yay! Just a few other bits to migrate (prototype attribute inference and a few statistics) and simplify-libcalls can finally be put to rest. llvm-svn: 168925
-
Alexey Samsonov authored
[ASan] Simplify check added in r168861. Bail out from module pass early if the module is blacklisted. llvm-svn: 168913
-
Matt Beaumont-Gay authored
llvm-svn: 168911
-
Alexey Samsonov authored
llvm-svn: 168910
-
Meador Inge authored
This patch migrates the fputs optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168893
-
Meador Inge authored
This patch migrates the fwrite optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168892
-
Meador Inge authored
This patch migrates the fprintf optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 168891
-
Evgeniy Stepanov authored
Handle insertelement, extractelement, shufflevector. llvm-svn: 168889
-
Evgeniy Stepanov authored
The old version failed on a 3-arg instruction with (-1, 0, 0) shadows (it would pick the 3rd operand origin irrespective of its shadow). The new version always picks the origin of the rightmost poisoned operand. llvm-svn: 168887
-
Evgeniy Stepanov authored
llvm-svn: 168884
-
Evgeniy Stepanov authored
This is a special case of signed relational comparison where result only depends on the sign of x. llvm-svn: 168881
-
Evgeniy Stepanov authored
This change ensures that shadow memory accesses have the same alignment as corresponding app memory accesses. llvm-svn: 168880
-
Evgeniy Stepanov authored
Rewrite getOriginPtr in a way that lets subsequent optimizations factor out the common part of Shadow and Origin address calculation. Improves perf by up to 5%. llvm-svn: 168879
-
Evgeniy Stepanov authored
llvm-svn: 168878
-
Evgeniy Stepanov authored
This was already done for memmove, where it is required for correctness. This change improves performance by avoiding copyingthe same memory twice. Also, the library functions are given __msan_ prefix to prevent instcombine pass from converting them back to intrinsics. llvm-svn: 168876
-
Evgeniy Stepanov authored
llvm-svn: 168873
-
Evgeniy Stepanov authored
Compiler pass only. llvm-svn: 168866
-
Kostya Serebryany authored
[asan/tsan] initialize the asan/tsan callbacks in runOnFunction as opposed to doInitialization. This is required to allow the upcoming changes in PassManager behavior llvm-svn: 168864
-