Skip to content
  1. Mar 24, 2012
  2. Mar 23, 2012
  3. Mar 22, 2012
  4. Mar 21, 2012
  5. Mar 20, 2012
  6. Mar 19, 2012
  7. Mar 16, 2012
    • Bill Wendling's avatar
      Revert r152907. · 55b6b2b6
      Bill Wendling authored
      llvm-svn: 152935
      55b6b2b6
    • Bill Wendling's avatar
      The alignment of the pointer part of the store instruction may have an · a2a26b54
      Bill Wendling authored
      alignment. If that's the case, then we want to make sure that we don't increase
      the alignment of the store instruction. Because if we increase it to be "more
      aligned" than the pointer, code-gen may use instructions which require a greater
      alignment than the pointer guarantees.
      <rdar://problem/11043589>
      
      llvm-svn: 152907
      a2a26b54
    • Chandler Carruth's avatar
      Rip out support for 'llvm.noinline'. This thing has a strange history... · b37fc13a
      Chandler Carruth authored
      It was added in 2007 as the first cut at supporting no-inline
      attributes, but we didn't have function attributes of any form at the
      time. However, it was added without any mention in the LangRef or other
      documentation.
      
      Later on, in 2008, Devang added function notes for 'inline=never' and
      then turned them into proper function attributes. From that point
      onward, as far as I can tell, the world moved on, and no one has touched
      'llvm.noinline' in any meaningful way since.
      
      It's time has now come. We have had better mechanisms for doing this for
      a long time, all the frontends I'm aware of use them, and this is just
      holding back progress. Given that it was never a documented feature of
      the IR, I've provided no auto-upgrade support. If people know of real,
      in-the-wild bitcode that relies on this, yell at me and I'll add it, but
      I *seriously* doubt anyone cares.
      
      llvm-svn: 152904
      b37fc13a
    • Chandler Carruth's avatar
      Start removing the use of an ad-hoc 'never inline' set and instead · d7a5f2ad
      Chandler Carruth authored
      directly query the function information which this set was representing.
      This simplifies the interface of the inline cost analysis, and makes the
      always-inline pass significantly more efficient.
      
      Previously, always-inline would first make a single set of every
      function in the module *except* those marked with the always-inline
      attribute. It would then query this set at every call site to see if the
      function was a member of the set, and if so, refuse to inline it. This
      is quite wasteful. Instead, simply check the function attribute directly
      when looking at the callsite.
      
      The normal inliner also had similar redundancy. It added every function
      in the module with the noinline attribute to its set to ignore, even
      though inside the cost analysis function we *already tested* the
      noinline attribute and produced the same result.
      
      The only tricky part of removing this is that we have to be able to
      correctly remove only the functions inlined by the always-inline pass
      when finalizing, which requires a bit of a hack. Still, much less of
      a hack than the set of all non-always-inline functions was. While I was
      touching this function, I switched a heavy-weight set to a vector with
      sort+unique. The algorithm already had a two-phase insert and removal
      pattern, we were just needlessly paying the uniquing cost on every
      insert.
      
      This probably speeds up some compiles by a small amount (-O0 compiles
      with lots of always-inline, so potentially heavy libc++ users), but I've
      not tried to measure it.
      
      I believe there is no functional change here, but yell if you spot one.
      None are intended.
      
      Finally, the direction this is going in is to greatly simplify the
      inline cost query interface so that we can replace its implementation
      with a much more clever one. Along the way, all the APIs get simplified,
      so it seems incrementally good.
      
      llvm-svn: 152903
      d7a5f2ad
    • Andrew Trick's avatar
      LSR fix: Add isSimplifiedLoopNest to IVUsers analysis. · 070e540a
      Andrew Trick authored
      Only record IVUsers that are dominated by simplified loop
      headers. Otherwise SCEVExpander will crash while looking for a
      preheader.
      
      I previously tried to work around this in LSR itself, but that was
      insufficient. This way, LSR can continue to run if some uses are not
      in simple loops, as long as we don't attempt to analyze those users.
      
      Fixes <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce
      
      llvm-svn: 152892
      070e540a
    • Eli Friedman's avatar
      In InstCombiner::visitOr, make sure we reverse the operand swap used for... · e06535b2
      Eli Friedman authored
      In InstCombiner::visitOr, make sure we reverse the operand swap used for checking for or-of-xor operations after those checks; a later check expects that any constant will be in Op1.  PR12234.
      
      llvm-svn: 152884
      e06535b2
  8. Mar 15, 2012
  9. Mar 14, 2012
    • Chandler Carruth's avatar
      Change where we enable the heuristic that delays inlining into functions · 30b8416d
      Chandler Carruth authored
      which are small enough to themselves be inlined. Delaying in this manner
      can be harmful if the function is inelligible for inlining in some (or
      many) contexts as it pessimizes the code of the function itself in the
      event that inlining does not eventually happen.
      
      Previously the check was written to only do this delaying of inlining
      for static functions in the hope that they could be entirely deleted and
      in the knowledge that all callers of static functions will have the
      opportunity to inline if it is in fact profitable. However, with C++ we
      get two other important sources of functions where the definition is
      always available for inlining: inline functions and templated functions.
      This patch generalizes the inliner to allow linkonce-ODR (the linkage
      such C++ routines receive) to also qualify for this delay-based
      inlining.
      
      Benchmarking across a range of large real-world applications shows
      roughly 2% size increase across the board, but an average speedup of
      about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary
      itself (when bootstrapped with this feature) shows a 1% -O0 performance
      improvement when run over all Sema, Lex, and Parse source code smashed
      into a single file. A clean re-build of Clang+LLVM with a bootstrapped
      Clang shows approximately 2% improvement, but that measurement is often
      noisy.
      
      llvm-svn: 152737
      30b8416d
  10. Mar 13, 2012
  11. Mar 12, 2012
    • Chandler Carruth's avatar
      When inlining a function and adding its inner call sites to the · 595fda84
      Chandler Carruth authored
      candidate set for subsequent inlining, try to simplify the arguments to
      the inner call site now that inlining has been performed.
      
      The goal here is to propagate and fold constants through deeply nested
      call chains. Without doing this, we loose the inliner bonus that should
      be applied because the arguments don't match the exact pattern the cost
      estimator uses.
      
      Reviewed on IRC by Benjamin Kramer.
      
      llvm-svn: 152556
      595fda84
  12. Mar 11, 2012
    • Stepan Dyatkovskiy's avatar
      llvm::SwitchInst · 97b02fc1
      Stepan Dyatkovskiy authored
      Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
      Added some notes relative to case iterators.
      
      llvm-svn: 152532
      97b02fc1
  13. Mar 09, 2012
  14. Mar 08, 2012
    • Stepan Dyatkovskiy's avatar
      Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012: · 5b648afb
      Stepan Dyatkovskiy authored
      http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html
      
      Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".
      
      ConstCaseIt is just a read-only iterator.
      CaseIt is read-write iterator; it allows to change case successor and case value.
      
      Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.
      
      Main way of iterator usage looks like this:
      SwitchInst *SI = ... // intialize it somehow
      
      for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
        BasicBlock *BB = i.getCaseSuccessor();
        ConstantInt *V = i.getCaseValue();
        // Do something.
      }
      
      If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
      If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.
      
      There are also related changes in llvm-clients: klee and clang.
      
      llvm-svn: 152297
      5b648afb
Loading