Skip to content
  1. Dec 03, 2012
    • Chandler Carruth's avatar
      Use the new script to sort the includes of every file under lib. · ed0881b2
      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
      ed0881b2
    • Chandler Carruth's avatar
      Remove some buggy and apparantly unnecessary code from SROA. · f02b8bf1
      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
      f02b8bf1
  2. Dec 01, 2012
  3. Nov 30, 2012
    • Bill Wendling's avatar
      Replace r168930 with a more reasonable patch. · c786b312
      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
      c786b312
    • Meador Inge's avatar
      Move library call simplification statistic to instcombine · e3f2b26b
      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
      e3f2b26b
    • Chandler Carruth's avatar
      Move the InstVisitor utility into VMCore where it belongs. It heavily · dbd69581
      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
      dbd69581
  4. Nov 29, 2012
    • Shuxin Yang's avatar
      rdar://12100355 (part 1) · abcc3704
      Shuxin 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
      abcc3704
    • Bill Wendling's avatar
      Handle the situation where CodeGenPrepare removes a reference to a BB that has · a4a77edf
      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
      a4a77edf
    • Meador Inge's avatar
      instcombine: Migrate puts optimizations · 75798bb7
      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
      75798bb7
    • Meador Inge's avatar
      instcombine: Migrate fputs optimizations · f8e72508
      Meador Inge authored
      This patch migrates the fputs optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168893
      f8e72508
    • Meador Inge's avatar
      instcombine: Migrate fwrite optimizations · bc84d1a4
      Meador Inge authored
      This patch migrates the fwrite optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168892
      bc84d1a4
    • Meador Inge's avatar
      instcombine: Migrate fprintf optimizations · 1009cecc
      Meador Inge authored
      This patch migrates the fprintf optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168891
      1009cecc
    • Bill Wendling's avatar
      When we delete a dead basic block, see if any of its successors are dead and · f3614fd8
      Bill Wendling authored
      delete those as well.
      
      llvm-svn: 168829
      f3614fd8
  5. Nov 27, 2012
  6. Nov 26, 2012
  7. Nov 25, 2012
  8. Nov 23, 2012
  9. Nov 21, 2012
    • Chandler Carruth's avatar
      PR14055: Implement support for sub-vector operations in SROA. · 845b73c0
      Chandler Carruth authored
      Now if we can transform an alloca into a single vector value, but it has
      subvector, non-element accesses, we form the appropriate shufflevectors
      to allow SROA to proceed. This fixes PR14055 which pointed out a very
      common pattern that SROA couldn't handle -- mixed vec3 and vec4
      operations on a single alloca.
      
      llvm-svn: 168418
      845b73c0
  10. Nov 20, 2012
    • Chandler Carruth's avatar
      Use LLVM_ENABLE_DUMP for the variables used in printing as well as the · b7915f7f
      Chandler Carruth authored
      printing functions themselves.
      
      Part of PR14324 (which should have just been a patch to the list, but
      hey...)
      
      llvm-svn: 168362
      b7915f7f
    • Chandler Carruth's avatar
      Fix PR14132 and handle OOB loads speculated throuh PHI nodes. · 3e994a26
      Chandler Carruth authored
      The issue is that we may end up with newly OOB loads when speculating
      a load into the predecessors of a PHI node, and this confuses the new
      integer splitting logic in some cases, triggering an assertion failure.
      In fact, the branch in question must be dead code as it loads from
      a too-narrow alloca. Add code to handle this gracefully and leave the
      requisite FIXMEs for both optimizing more aggressively and doing more to
      aid sanitizing invalid code which triggers these patterns.
      
      llvm-svn: 168361
      3e994a26
    • Chandler Carruth's avatar
      Add a comment to associate a FIXME with a PR where it is matters. · 9324c960
      Chandler Carruth authored
      llvm-svn: 168347
      9324c960
    • Chandler Carruth's avatar
      Rework the rewriting of loads and stores for vector and integer allocas · 18db795b
      Chandler Carruth authored
      to properly handle the combinations of these with split integer loads
      and stores. This essentially replaces Evan's r168227 by refactoring the
      code in a different way, and trynig to mirror that refactoring in both
      the load and store sides of the rewriting.
      
      Generally speaking there was some really problematic duplicated code
      here that led to poorly founded assumptions and then subtle bugs. Now
      much of the code actually flows through and follows a more consistent
      style and logical path. There is still a tiny bit of duplication on the
      store side of things, but it is much less bad.
      
      This also changes the logic to never re-use a load or store instruction
      as that was simply too error prone in practice.
      
      I've added a few tests (one a reduction of the one in Evan's original
      patch, which happened to be the same as the report in PR14349). I'm
      going to look at adding a few more tests for things I found and fixed in
      passing (such as the volatile tests in the vectorizable predicate).
      
      This patch has survived bootstrap, and modulo one bugfix survived
      Duncan's test suite, but let me know if anything else explodes.
      
      llvm-svn: 168346
      18db795b
  11. Nov 18, 2012
  12. Nov 17, 2012
  13. Nov 15, 2012
    • Duncan Sands's avatar
      Fix a crash observed by Shuxin Yang. The issue here is that LinearizeExprTree, · ac852c74
      Duncan Sands authored
      the utility for extracting a chain of operations from the IR, thought that it
      might as well combine any constants it came across (rather than just returning
      them along with everything else).  On the other hand, the factorization code
      would like to see the individual constants (this is quite reasonable: it is
      much easier to pull a factor of 3 out of 2*3 than it is to pull it out of 6;
      you may think 6/3 isn't so hard, but due to overflow it's not as easy to undo
      multiplications of constants as it may at first appear).  This patch therefore
      makes LinearizeExprTree stupider: it now leaves optimizing to the optimization
      part of reassociate, and sticks to just analysing the IR.
      
      llvm-svn: 168035
      ac852c74
  14. Nov 13, 2012
    • Meador Inge's avatar
      instcombine: Migrate math library call simplifications · 193e035b
      Meador Inge authored
      This patch migrates the math library call simplifications from the
      simplify-libcalls pass into the instcombine library call simplifier.
      
      I have typically migrated just one simplifier at a time, but the math
      simplifiers are interdependent because:
      
         1. CosOpt, PowOpt, and Exp2Opt all depend on UnaryDoubleFPOpt.
         2. CosOpt, PowOpt, Exp2Opt, and UnaryDoubleFPOpt all depend on
            the option -enable-double-float-shrink.
      
      These two factors made migrating each of these simplifiers individually
      more of a pain than it would be worth.  So, I migrated them all together.
      
      llvm-svn: 167815
      193e035b
    • Shuxin Yang's avatar
      revert r167740 · c94c3bb5
      Shuxin Yang authored
      llvm-svn: 167787
      c94c3bb5
  15. Nov 12, 2012
  16. Nov 11, 2012
  17. Nov 10, 2012
Loading