Skip to content
  1. Nov 27, 2012
  2. Nov 26, 2012
    • Shuxin Yang's avatar
      rdar://12329730 (defect 2) · 6ea79e86
      Shuxin Yang authored
      Enhancement to InstCombine. Try to catch this opportunity:
        
       ---------------------------------------------------------------
       ((X^C1) >> C2) ^ C3  => (X>>C2) ^ ((C1>>C2)^C3)
        where the subexpression "X ^ C1" has more than one uses, and
        "(X^C1) >> C2" has single use. 
       ---------------------------------------------------------------- 
      
       Reviewed by Nadav (with minor change per his request).
      
      llvm-svn: 168615
      6ea79e86
    • Meador Inge's avatar
      instcombine: Migrate printf optimizations · 08ca115a
      Meador Inge authored
      This patch migrates the printf optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168604
      08ca115a
    • Meador Inge's avatar
      instcombine: Migrate toascii optimizations · 604937d1
      Meador Inge authored
      This patch migrates the toascii optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168580
      604937d1
    • Meador Inge's avatar
      instcombine: Migrate isascii optimizations · a62a39e0
      Meador Inge authored
      This patch migrates the isascii optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168579
      a62a39e0
    • Meador Inge's avatar
      instcombine: Migrate isdigit optimizations · 9a59ab61
      Meador Inge authored
      This patch migrates the isdigit optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168578
      9a59ab61
    • Meador Inge's avatar
      Fix bogus comment; no functional change. · 24d134c3
      Meador Inge authored
      llvm-svn: 168575
      24d134c3
    • Meador Inge's avatar
      instcombine: Migrate *abs optimizations · a0b6d878
      Meador Inge authored
      This patch migrates the *abs optimizations from the simplify-libcalls
      pass into the instcombine library call simplifier.
      
      llvm-svn: 168574
      a0b6d878
  3. Nov 25, 2012
  4. Nov 23, 2012
  5. Nov 22, 2012
  6. Nov 21, 2012
  7. Nov 20, 2012
    • 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
      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
  8. Nov 18, 2012
  9. Nov 17, 2012
  10. Nov 16, 2012
  11. Nov 15, 2012
    • Hans Wennborg's avatar
      Make GlobalOpt be conservative with TLS variables (PR14309) · 709e015c
      Hans Wennborg authored
      For global variables that get the same value stored into them
      everywhere, GlobalOpt will replace them with a constant. The problem is
      that a thread-local GlobalVariable looks like one value (the address of
      the TLS var), but is different between threads.
      
      This patch introduces Constant::isThreadDependent() which returns true
      for thread-local variables and constants which depend on them (e.g. a GEP
      into a thread-local array), and teaches GlobalOpt not to track such
      values.
      
      llvm-svn: 168037
      709e015c
    • 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
  12. Nov 14, 2012
  13. Nov 13, 2012
    • Duncan Sands's avatar
      Fix the instcombine GEP index widening transform to work correctly for vector · db698d8a
      Duncan Sands authored
      getelementptrs.
      
      llvm-svn: 167829
      db698d8a
    • Duncan Sands's avatar
      Relax the restrictions on vector of pointer types, and vector getelementptr. · e6beec67
      Duncan Sands authored
      Previously in a vector of pointers, the pointer couldn't be any pointer type,
      it had to be a pointer to an integer or floating point type.  This is a hassle
      for dragonegg because the GCC vectorizer happily produces vectors of pointers
      where the pointer is a pointer to a struct or whatever.  Vector getelementptr
      was restricted to just one index, but now that vectors of pointers can have
      any pointer type it is more natural to allow arbitrary vector getelementptrs.
      There is however the issue of struct GEPs, where if each lane chose different
      struct fields then from that point on each lane will be working down into
      unrelated types.  This seems like too much pain for too little gain, so when
      you have a vector struct index all the elements are required to be the same.
      
      llvm-svn: 167828
      e6beec67
    • Alexey Samsonov's avatar
      Figure out <size> argument of llvm.lifetime intrinsics at the moment they are... · cfd662f2
      Alexey Samsonov authored
      Figure out <size> argument of llvm.lifetime intrinsics at the moment they are created (during function inlining)
      
      llvm-svn: 167821
      cfd662f2
    • 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
    • Hal Finkel's avatar
      BBVectorize: Don't vectorize vector-manipulation chains · 2a1df367
      Hal Finkel authored
      Don't choose a vectorization plan containing only shuffles and
      vector inserts/extracts. Due to inperfections in the cost model,
      these can lead to infinite recusion.
      
      llvm-svn: 167811
      2a1df367
    • Shuxin Yang's avatar
      revert r167740 · c94c3bb5
      Shuxin Yang authored
      llvm-svn: 167787
      c94c3bb5
    • Hal Finkel's avatar
      BBVectorize: Only some insert element operand pairs are free. · 3b79f55c
      Hal Finkel authored
      This fixes another infinite recursion case when using target costs.
      We can only replace insert element input chains that are pure (end
      with inserting into an undef).
      
      llvm-svn: 167784
      3b79f55c
Loading