Skip to content
  1. Jan 13, 2014
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
  2. Jan 12, 2014
    • Hans Wennborg's avatar
      Switch-to-lookup tables: Don't require a result for the default · ac114a3c
      Hans Wennborg authored
      case when the lookup table doesn't have any holes.
      
      This means we can build a lookup table for switches like this:
      
        switch (x) {
          case 0: return 1;
          case 1: return 2;
          case 2: return 3;
          case 3: return 4;
          default: exit(1);
        }
      
      The default case doesn't yield a constant result here, but that doesn't matter,
      since a default result is only necessary for filling holes in the lookup table,
      and this table doesn't have any holes.
      
      This makes us transform 505 more switches in a clang bootstrap, and shaves 164 KB
      off the resulting clang binary.
      
      llvm-svn: 199025
      ac114a3c
  3. Jan 07, 2014
  4. Jan 06, 2014
  5. Jan 04, 2014
    • Alp Toker's avatar
      Revert "Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists things." · 5e9f3265
      Alp Toker authored
      This commit was the source of crasher PR18384:
      
      While deleting: label %for.cond127
      An asserting value handle still pointed to this value!
      UNREACHABLE executed at llvm/lib/IR/Value.cpp:671!
      
      Reverting to get the builders green, feel free to re-land after fixing up.
      (Renato has a handy isolated repro if you need it.)
      
      This reverts commit r198478.
      
      llvm-svn: 198503
      5e9f3265
    • Andrew Trick's avatar
      Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists things. · aceac974
      Andrew Trick authored
      getSCEV for an ashr instruction creates an intermediate zext
      expression when it truncates its operand.
      
      The operand is initially inside the loop, so the narrow zext
      expression has a non-loop-invariant loop disposition.
      
      LoopSimplify then runs on an outer loop, hoists the ashr operand, and
      properly invalidate the SCEVs that are mapped to value.
      
      The SCEV expression for the ashr is now an AddRec with the hoisted
      value as the now loop-invariant start value.
      
      The LoopDisposition of this wide value was properly invalidated during
      LoopSimplify.
      
      However, if we later get the ashr SCEV again, we again try to create
      the intermediate zext expression. We get the same SCEV that we did
      earlier, and it is still cached because it was never mapped to a
      Value. When we try to create a new AddRec we abort because we're using
      the old non-loop-invariant LoopDisposition.
      
      I don't have a solution for this other than to clear LoopDisposition
      when LoopSimplify hoists things.
      
      I think the long-term strategy should be to perform LoopSimplify on
      all loops before computing SCEV and before running any loop opts on
      individual loops. It's possible we may want to rerun LoopSimplify on
      individual loops, but it should rarely do anything, so rarely require
      invalidating SCEV.
      
      llvm-svn: 198478
      aceac974
  6. Dec 24, 2013
    • Andrew Trick's avatar
      Add support to indvars for optimizing sadd.with.overflow. · 0ba77a07
      Andrew Trick authored
      Split sadd.with.overflow into add + sadd.with.overflow to allow
      analysis and optimization. This should ideally be done after
      InstCombine, which can perform code motion (eventually indvars should
      run after all canonical instcombines). We want ISEL to recombine the
      add and the check, at least on x86.
      
      This is currently under an option for reducing live induction
      variables: -liv-reduce. The next step is reducing liveness of IVs that
      are live out of the overflow check paths. Once the related
      optimizations are fully developed, reviewed and tested, I do expect
      this to become default.
      
      llvm-svn: 197926
      0ba77a07
  7. Dec 23, 2013
  8. Dec 20, 2013
  9. Dec 19, 2013
  10. Dec 16, 2013
  11. Dec 12, 2013
  12. Dec 10, 2013
  13. Dec 08, 2013
    • Manman Ren's avatar
      Revert 196544 due to internal bot failures. · 2e06c8c7
      Manman Ren authored
      llvm-svn: 196732
      2e06c8c7
    • Mark Seaborn's avatar
      Fix inlining to not lose the "cleanup" clause from landingpads · 1b3dd352
      Mark Seaborn authored
      This fixes PR17872.  This bug can lead to C++ destructors not being
      called when they should be, when an exception is thrown.
      
      llvm-svn: 196711
      1b3dd352
    • Mark Seaborn's avatar
      Fix inlining to not produce duplicate landingpad clauses · ef3dbb93
      Mark Seaborn authored
      Before this change, inlining one "invoke" into an outer "invoke" call
      site can lead to the outer landingpad's catch/filter clauses being
      copied multiple times into the resulting landingpad.  This happens:
      
       * when the inlined function contains multiple "resume" instructions,
         because forwardResume() copies the clauses but is called multiple
         times;
      
       * when the inlined function contains a "resume" and a "call", because
         HandleCallsInBlockInlinedThroughInvoke() copies the clauses but is
         redundant with forwardResume().
      
      Fix this by deduplicating the code.
      
      This problem doesn't lead to any incorrect execution; it's only
      untidy.
      
      This change will make fixing PR17872 a little easier.
      
      llvm-svn: 196710
      ef3dbb93
  14. Dec 07, 2013
  15. Dec 06, 2013
    • Kostya Serebryany's avatar
      [asan] fix ndebug build with strict warnings (-Wunused-variable) · 152d48d3
      Kostya Serebryany authored
      llvm-svn: 196574
      152d48d3
    • Kostya Serebryany's avatar
      [asan] rewrite asan's stack frame layout · 4fb7801b
      Kostya Serebryany authored
      Summary:
      Rewrite asan's stack frame layout.
      First, most of the stack layout logic is moved into a separte file
      to make it more testable and (potentially) useful for other projects.
      Second, make the frames more compact by using adaptive redzones
      (smaller for small objects, larger for large objects).
      Third, try to minimized gaps due to large alignments (this is hypothetical since
      today we don't see many stack vars aligned by more than 32).
      
      The frames indeed become more compact, but I'll still need to run more benchmarks
      before committing, but I am sking for review now to get early feedback.
      
      This change will be accompanied by a trivial change in compiler-rt tests
      to match the new frame sizes.
      
      Reviewers: samsonov, dvyukov
      
      Reviewed By: samsonov
      
      CC: llvm-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2324
      
      llvm-svn: 196568
      4fb7801b
  16. Dec 05, 2013
  17. Dec 02, 2013
  18. Nov 19, 2013
  19. Nov 17, 2013
  20. Nov 13, 2013
  21. Nov 12, 2013
    • Nadav Rotem's avatar
      FoldBranchToCommonDest merges branches into a single branch with or/and of the... · 53d32211
      Nadav Rotem authored
      FoldBranchToCommonDest merges branches into a single branch with or/and of the condition. It has a heuristics for estimating when some of the dependencies are processed by out-of-order processors. This patch adds another rule to the heuristics that says that if the "BonusInstruction" that we speculatively execute is used by the condition of the second branch then it is okay to hoist it. This change exposes more opportunities for other passes to transform the code. It does not matter that much that we if-convert the code because the selectiondag builder splits or/and branches into multiple branches when profitable.
      
      llvm-svn: 194524
      53d32211
    • Benjamin Kramer's avatar
      SimplifyCFG: Use existing constant folding logic when forming switch tables. · 7c30260a
      Benjamin Kramer authored
      Both simpler and more powerful than the hand-rolled folding logic.
      
      llvm-svn: 194475
      7c30260a
  22. Nov 10, 2013
    • Matt Arsenault's avatar
      Use type form of getIntPtrType. · c900303e
      Matt Arsenault authored
      This should be inconsequential and is work
      towards removing the default address space
      arguments.
      
      llvm-svn: 194347
      c900303e
    • Nadav Rotem's avatar
      SimplifyCFG has a heuristics for out-of-order processors that decides when it... · 5ba1c6ce
      Nadav Rotem authored
      SimplifyCFG has a heuristics for out-of-order processors that decides when it is worthwhile to merge branches. It tries to estimate if the operands of the instruction that we want to hoist are ready. This commit marks function arguments as 'ready' because they require no calculation. This boosts libquantum and a few other workloads from the testsuite.
        
      
      llvm-svn: 194346
      5ba1c6ce
  23. Nov 03, 2013
  24. Oct 31, 2013
    • Manman Ren's avatar
      Do not convert "call asm" to "invoke asm" in Inliner. · 87a2adc7
      Manman Ren authored
      Given that backend does not handle "invoke asm" correctly ("invoke asm" will be
      handled by SelectionDAGBuilder::visitInlineAsm, which does not have the right
      setup for LPadToCallSiteMap) and we already made the assumption that inline asm
      does not throw in InstCombiner::visitCallSite, we are going to make the same
      assumption in Inliner to make sure we don't convert "call asm" to "invoke asm".
      
      If it becomes necessary to add support for "invoke asm" later on, we will need
      to modify the backend as well as remove the assumptions that inline asm does
      not throw.
      
      Fix rdar://15317907
      
      llvm-svn: 193808
      87a2adc7
  25. Oct 26, 2013
    • Wan Xiaofei's avatar
      Quick look-up for block in loop. · be640b28
      Wan Xiaofei authored
      This patch implements quick look-up for block in loop by maintaining a hash set for blocks.
      It improves the efficiency of loop analysis a lot, the biggest improvement could be 5-6%(458.sjeng).
      Below are the compilation time for our benchmark in llc before & after the patch.
      
      Benchmark	llc - trunk		llc - patched	
      401.bzip2	0.339081	100.00%	0.329657	102.86%
      403.gcc		19.853966	100.00%	19.605466	101.27%
      429.mcf		0.049823	100.00%	0.048451	102.83%
      433.milc	0.514898	100.00%	0.510217	100.92%
      444.namd	1.109328	100.00%	1.103481	100.53%
      445.gobmk	4.988028	100.00%	4.929114	101.20%
      456.hmmer	0.843871	100.00%	0.825865	102.18%
      458.sjeng	0.754238	100.00%	0.714095	105.62%
      464.h264ref	2.9668		100.00%	2.90612		102.09%
      471.omnetpp	4.556533	100.00%	4.511886	100.99%
      bitmnp01	0.038168	100.00%	0.0357		106.91%
      idctrn01	0.037745	100.00%	0.037332	101.11%
      libquake2	3.78689		100.00%	3.76209		100.66%
      libquake_	2.251525	100.00%	2.234104	100.78%
      linpack		0.033159	100.00%	0.032788	101.13%
      matrix01	0.045319	100.00%	0.043497	104.19%
      nbench		0.333161	100.00%	0.329799	101.02%
      tblook01	0.017863	100.00%	0.017666	101.12%
      ttsprk01	0.054337	100.00%	0.053057	102.41%
      
      Reviewer	: Andrew Trick <atrick@apple.com>, Hal Finkel <hfinkel@anl.gov>
      Approver	: Andrew Trick <atrick@apple.com>
      Test		: Pass make check-all & llvm test-suite
      
      llvm-svn: 193460
      be640b28
  26. Oct 25, 2013
    • Rafael Espindola's avatar
      Handle calls and invokes in GlobalStatus. · 7749d7cc
      Rafael Espindola authored
      This patch teaches GlobalStatus to analyze a call that uses the global value as
      a callee, not as an argument.
      
      With this change internalize call handle the common use of linkonce_odr
      functions. This reduces the number of linkonce_odr functions in a LTO build of
      clang (checked with the emit-llvm gold plugin option) from 1730 to 60.
      
      llvm-svn: 193436
      7749d7cc
  27. Oct 24, 2013
  28. Oct 21, 2013
Loading