Skip to content
  1. May 01, 2010
    • Owen Anderson's avatar
      Disable the call-deletion transformation introduced in r86975. Without · 550986ea
      Owen Anderson authored
      halting analysis, it is illegal to delete a call to a read-only function.
      The correct solution is almost certainly to add a "must halt" attribute and
      only allow deletions in its presence.
      
      XFAIL the relevant testcase for now.
      
      llvm-svn: 102831
      550986ea
    • Chris Lattner's avatar
      rename InlineInfo.DevirtualizedCalls -> InlinedCalls to · c2432b9d
      Chris Lattner authored
      reflect that it includes all inlined calls now, not just
      devirtualized ones.
      
      llvm-svn: 102824
      c2432b9d
    • Chris Lattner's avatar
      The inliner has traditionally not considered call sites · e8262675
      Chris Lattner authored
      that appear due to inlining a callee as candidates for
      futher inlining, but a recent patch made it do this if
      those call sites were indirect and became direct.
      
      Unfortunately, in bizarre cases (see testcase) doing this
      can cause us to infinitely inline mutually recursive
      functions into callers not in the cycle.  Fix this by
      keeping track of the inline history from which callsite
      inline candidates got inlined from.
      
      This shouldn't affect any "real world" code, but is required
      for a follow on patch that is coming up next.
      
      llvm-svn: 102822
      e8262675
  2. Apr 25, 2010
  3. Apr 23, 2010
  4. Apr 20, 2010
  5. Apr 17, 2010
  6. Mar 10, 2010
    • Jakob Stoklund Olesen's avatar
      Try to keep the cached inliner costs around for a bit longer for big functions. · b495cad7
      Jakob Stoklund Olesen authored
      The Caller cost info would be reset everytime a callee was inlined. If the
      caller has lots of calls and there is some mutual recursion going on, the
      caller cost info could be calculated many times.
      
      This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
      small function calls.
      
      This is a more conservative version of r98089 that doesn't break the clang
      test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining
      for constant folding.
      
      llvm-svn: 98099
      b495cad7
  7. Mar 09, 2010
  8. Feb 13, 2010
    • Jakob Stoklund Olesen's avatar
      Enable the inlinehint attribute in the Inliner. · 492b8b42
      Jakob Stoklund Olesen authored
      Functions explicitly marked inline will get an inlining threshold slightly
      more aggressive than the default for -O3. This means than -O3 builds are
      mostly unaffected while -Os builds will be a bit bigger and faster.
      
      The difference depends entirely on how many 'inline's are sprinkled on the
      source.
      
      In the CINT2006 suite, only these tests are significantly affected under -Os:
      
                     Size   Time
      471.omnetpp   +1.63% -1.85%
      473.astar     +4.01% -6.02%
      483.xalancbmk +4.60%  0.00%
      
      Note that 483.xalancbmk runs too quickly to give useful timing results.
      
      llvm-svn: 96066
      492b8b42
  9. Feb 06, 2010
    • Jakob Stoklund Olesen's avatar
      Reintroduce the InlineHint function attribute. · 74bb06c0
      Jakob Stoklund Olesen authored
      This time it's for real! I am going to hook this up in the frontends as well.
      
      The inliner has some experimental heuristics for dealing with the inline hint.
      When given a -respect-inlinehint option, functions marked with the inline
      keyword are given a threshold just above the default for -O3.
      
      We need some experiments to determine if that is the right thing to do.
      
      llvm-svn: 95466
      74bb06c0
  10. Feb 04, 2010
    • Jakob Stoklund Olesen's avatar
      Increase inliner thresholds by 25. · 113fb54b
      Jakob Stoklund Olesen authored
      This makes the inliner about as agressive as it was before my changes to the
      inliner cost calculations. These levels give the same performance and slightly
      smaller code than before.
      
      llvm-svn: 95320
      113fb54b
  11. Jan 20, 2010
  12. Jan 05, 2010
  13. Nov 12, 2009
    • Chris Lattner's avatar
      use isInstructionTriviallyDead, as pointed out by Duncan · 5c89f4b4
      Chris Lattner authored
      llvm-svn: 87035
      5c89f4b4
    • Chris Lattner's avatar
      implement a nice little efficiency hack in the inliner. Since we're now · eb9acbfb
      Chris Lattner authored
      running IPSCCP early, and we run functionattrs interlaced with the inliner,
      we often (particularly for small or noop functions) completely propagate
      all of the information about a call to its call site in IPSSCP (making a call
      dead) and functionattrs is smart enough to realize that the function is
      readonly (because it is interlaced with inliner).
      
      To improve compile time and make the inliner threshold more accurate, realize
      that we don't have to inline dead readonly function calls.  Instead, just 
      delete the call.  This happens all the time for C++ codes, here are some
      counters from opt/llvm-ld counting the number of times calls were deleted vs
      inlined on various apps:
      
      Tramp3d opt:
        5033 inline                - Number of call sites deleted, not inlined
       24596 inline                - Number of functions inlined
      llvm-ld:
        667 inline           - Number of functions deleted because all callers found
        699 inline           - Number of functions inlined
      
      483.xalancbmk opt:
        8096 inline                - Number of call sites deleted, not inlined
       62528 inline                - Number of functions inlined
      llvm-ld:
         217 inline           - Number of allocas merged together
        2158 inline           - Number of functions inlined
      
      471.omnetpp:
        331 inline                - Number of call sites deleted, not inlined
       8981 inline                - Number of functions inlined
      llvm-ld:
        171 inline           - Number of functions deleted because all callers found
        629 inline           - Number of functions inlined
      
      
      Deleting a call is much faster than inlining it, and is insensitive to the
      size of the callee. :)
      
      llvm-svn: 86975
      eb9acbfb
  14. Oct 13, 2009
  15. Oct 09, 2009
  16. Oct 04, 2009
  17. Aug 31, 2009
    • Chris Lattner's avatar
      comment and simplify some code. · 9e507479
      Chris Lattner authored
      llvm-svn: 80540
      9e507479
    • Chris Lattner's avatar
      Fix PR4834, a tricky case where the inliner would resolve an · 081375bb
      Chris Lattner authored
      indirect function pointer, inline it, then go to delete the body.
      The problem is that the callgraph had other references to the function,
      though the inliner had no way to know it, so we got a dangling pointer
      and an invalid iterator out of the deal.
      
      The fix to this is pretty simple: stop the inliner from deleting the
      function by knowing that there are references to it.  Do this by making
      CallGraphNodes contain a refcount.  This requires moving deletion of 
      available_externally functions to the module-level cleanup sweep where
      it belongs.
      
      llvm-svn: 80533
      081375bb
    • Chris Lattner's avatar
      Fix some nasty callgraph dangling pointer problems in · 305b115a
      Chris Lattner authored
      argpromotion and structretpromote.  Basically, when replacing
      a function, they used the 'changeFunction' api which changes
      the entry in the function map (and steals/reuses the callgraph
      node).
      
      This has some interesting effects: first, the problem is that it doesn't
      update the "callee" edges in any callees of the function in the call graph.
      Second, this covers for a major problem in all the CGSCC pass stuff, which 
      is that it is completely broken when functions are deleted if they *don't*
      reuse a CGN.  (there is a cute little fixme about this though :).
      
      This patch changes the protocol that CGSCC passes must obey: now the CGSCC 
      pass manager copies the SCC and preincrements its iterator to avoid passes
      invalidating it.  This allows CGSCC passes to mutate the current SCC.  However
      multiple passes may be run on that SCC, so if passes do this, they are now
      required to *update* the SCC to be current when they return.
      
      Other less interesting parts of this patch are that it makes passes update
      the CG more directly, eliminates changeFunction, and requires clients of
      replaceCallSite to specify the new callee CGN if they are changing it.
      
      llvm-svn: 80527
      305b115a
  18. Aug 28, 2009
  19. Aug 27, 2009
    • Chris Lattner's avatar
      Implement a new optimization in the inliner: if inlining multiple · d3374e8d
      Chris Lattner authored
      calls into a function and if the calls bring in arrays, try to merge
      them together to reduce stack size.  For example, in the testcase
      we'd previously end up with 4 allocas, now we end up with 2 allocas.
      
      As described in the comments, this is not really the ideal solution
      to this problem, but it is surprisingly effective.  For example, on
      176.gcc, we end up eliminating 67 arrays at "gccas" time and another
      24 at "llvm-ld" time.
      
      One piece of concern that I didn't look into: at -O0 -g with
      forced inlining this will almost certainly result in worse debug
      info.  I think this is acceptable though given that this is a case
      of "debugging optimized code", and we don't want debug info to
      prevent the optimizer from doing things anyway.
      
      llvm-svn: 80215
      d3374e8d
    • Chris Lattner's avatar
      reduce header #include'age · b9d0a961
      Chris Lattner authored
      llvm-svn: 80204
      b9d0a961
    • Chris Lattner's avatar
      reduce inlining factor some stuff out to a static helper function, · 5eef6ad6
      Chris Lattner authored
      and other code cleanups.  No functionality change.
      
      llvm-svn: 80199
      5eef6ad6
  20. Aug 25, 2009
  21. Jul 31, 2009
  22. Jul 25, 2009
    • Daniel Dunbar's avatar
      More migration to raw_ostream, the water has dried up around the iostream hole. · 0dd5e1ed
      Daniel Dunbar authored
       - Some clients which used DOUT have moved to DEBUG. We are deprecating the
         "magic" DOUT behavior which avoided calling printing functions when the
         statement was disabled. In addition to being unnecessary magic, it had the
         downside of leaving code in -Asserts builds, and of hiding potentially
         unnecessary computations.
      
      llvm-svn: 77019
      0dd5e1ed
  23. Jul 24, 2009
  24. Jul 18, 2009
  25. May 23, 2009
  26. Mar 24, 2009
Loading