Skip to content
  1. Dec 31, 2012
  2. Dec 30, 2012
  3. Dec 28, 2012
    • Chandler Carruth's avatar
      Fix a stunning oversight in the inline cost analysis. It was never · 86ed5308
      Chandler Carruth authored
      propagating one of the values it simplified to a constant across
      a myriad of instructions. Notably, ptrtoint instructions when we had
      a constant pointer (say, 0) didn't propagate that, blocking a massive
      number of down-stream optimizations.
      
      This was uncovered when investigating why we fail to inline and delete
      the boilerplate in:
      
        void f() {
          std::vector<int> v;
          v.push_back(1);
        }
      
      It turns out most of the efforts I've made thus far to improve the
      analysis weren't making it far purely because of this. After this is
      fixed, the store-to-load forwarding patch enables LLVM to optimize the
      above to an empty function. We still can't nuke a second push_back, but
      for different reasons.
      
      There is a very real chance this will cause somewhat noticable changes
      in inlining behavior, so please let me know if you see regressions (or
      improvements!) because of this patch.
      
      llvm-svn: 171196
      86ed5308
    • Chandler Carruth's avatar
      Teach the inline cost analysis about calls that can be simplified and · 753e21d0
      Chandler Carruth authored
      how to propagate constants through insert and extract value
      instructions.
      
      With the recent improvements to instsimplify, this allows inline cost
      analysis to constant fold through intrinsic functions, including notably
      the with.overflow intrinsic math routines which often show up inside of
      STL abstractions. This is yet another piece in the puzzle of breaking
      down the code for:
      
        void f() {
          std::vector<int> v;
          v.push_back(1);
        }
      
      But it still isn't enough. There are a pile of bugs in inline cost still
      blocking this.
      
      llvm-svn: 171195
      753e21d0
    • Chandler Carruth's avatar
      Teach instsimplify to use the constant folder where appropriate for · f6182155
      Chandler Carruth authored
      constant folding calls. Add the initial tests for this which show that
      now instsimplify can simplify blindingly obvious code patterns expressed
      with both intrinsics and library calls.
      
      llvm-svn: 171194
      f6182155
  4. Dec 27, 2012
  5. Dec 26, 2012
  6. Dec 25, 2012
  7. Dec 24, 2012
  8. Dec 23, 2012
  9. Dec 21, 2012
  10. Dec 20, 2012
    • Nadav Rotem's avatar
      LoopVectorize: Fix a bug in the scalarization of instructions. · 2ababf68
      Nadav Rotem authored
      Before if-conversion we could check if a value is loop invariant
      if it was declared inside the basic block. Now that loops have
      multiple blocks this check is incorrect.
      
      This fixes External/SPEC/CINT95/099_go/099_go
      
      llvm-svn: 170756
      2ababf68
    • James Molloy's avatar
      Add a new attribute, 'noduplicate'. If a function contains a noduplicate call,... · 4f6fb953
      James Molloy authored
      Add a new attribute, 'noduplicate'. If a function contains a noduplicate call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call.
      
      Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage).
      
      llvm-svn: 170704
      4f6fb953
  11. Dec 19, 2012
  12. Dec 18, 2012
  13. Dec 17, 2012
    • Chandler Carruth's avatar
      Fix another SROA crasher, PR14601. · e3f4119b
      Chandler Carruth authored
      This was a silly oversight, we weren't pruning allocas which were used
      by variable-length memory intrinsics from the set that could be widened
      and promoted as integers. Fix that.
      
      llvm-svn: 170353
      e3f4119b
    • Chandler Carruth's avatar
      Teach the rewriting of memcpy calls to support subvector copies. · 21eb4e96
      Chandler Carruth authored
      This also cleans up a bit of the memcpy call rewriting by sinking some
      irrelevant code further down and making the call-emitting code a bit
      more concrete.
      
      Previously, memcpy of a subvector would actually miscompile (!!!) the
      copy into a single vector element copy. I have no idea how this ever
      worked. =/ This is the memcpy half of PR14478 which we probably weren't
      noticing previously because it didn't actually assert.
      
      The rewrite relies on the newly refactored insert- and extractVector
      functions to do the heavy lifting, and those are the same as used for
      loads and stores which makes the test coverage a bit more meaningful
      here.
      
      llvm-svn: 170338
      21eb4e96
    • Chandler Carruth's avatar
      Fix a secondary bug I introduced while fixing the first part of PR14478. · cacda256
      Chandler Carruth authored
      The first half of fixing this bug was actually in r170328, but was
      entirely coincidental. It did however get me to realize the nature of
      the bug, and adapt the test case to test more interesting behavior. In
      turn, that uncovered the rest of the bug which I've fixed here.
      
      This should fix two new asserts that showed up in the vectorize nightly
      tester.
      
      llvm-svn: 170333
      cacda256
    • Chandler Carruth's avatar
      Fix the first part of PR14478: memset now works. · ccca504f
      Chandler Carruth authored
      PR14478 highlights a serious problem in SROA that simply wasn't being
      exercised due to a lack of vector input code mixed with C-library
      function calls. Part of SROA was written carefully to handle subvector
      accesses via memset and memcpy, but the rewriter never grew support for
      this. Fixing it required refactoring the subvector access code in other
      parts of SROA so it could be shared, and then fixing the splat formation
      logic and using subvector insertion (this patch).
      
      The PR isn't quite fixed yet, as memcpy is still broken in the same way.
      I'm starting on that series of patches now.
      
      Hopefully this will be enough to bring the bullet benchmark back to life
      with the bb-vectorizer enabled, but that may require fixing memcpy as
      well.
      
      llvm-svn: 170301
      ccca504f
  14. Dec 15, 2012
  15. Dec 14, 2012
  16. Dec 13, 2012
    • NAKAMURA Takumi's avatar
      Revert r170020, "Simplify negated bit test", for now. · 38d2b244
      NAKAMURA Takumi authored
      This assumes (1 << n) is always not zero. Consider n is greater than word size.
      Although I know it is undefined, this transforms undefined behavior hidden.
      
      This led clang unexpected behavior with some failures. I will investigate to fix undefined shl in clang.
      
      llvm-svn: 170128
      38d2b244
    • Quentin Colombet's avatar
      Take into account minimize size attribute in the inliner. · c0dba203
      Quentin Colombet authored
      Better controls the inlining of functions when the caller function has MinSize attribute.
      Basically, when the caller function has this attribute, we do not "force" the inlining
      of callee functions carrying the InlineHint attribute (i.e., functions defined with
      inline keyword)
      
      llvm-svn: 170065
      c0dba203
Loading