Skip to content
  1. Feb 12, 2019
  2. Feb 11, 2019
  3. Feb 10, 2019
  4. Feb 08, 2019
    • Craig Topper's avatar
      Implementation of asm-goto support in LLVM · 784929d0
      Craig Topper authored
      This patch accompanies the RFC posted here:
      http://lists.llvm.org/pipermail/llvm-dev/2018-October/127239.html
      
      This patch adds a new CallBr IR instruction to support asm-goto
      inline assembly like gcc as used by the linux kernel. This
      instruction is both a call instruction and a terminator
      instruction with multiple successors. Only inline assembly
      usage is supported today.
      
      This also adds a new INLINEASM_BR opcode to SelectionDAG and
      MachineIR to represent an INLINEASM block that is also
      considered a terminator instruction.
      
      There will likely be more bug fixes and optimizations to follow
      this, but we felt it had reached a point where we would like to
      switch to an incremental development model.
      
      Patch by Craig Topper, Alexander Ivchenko, Mikhail Dvoretckii
      
      Differential Revision: https://reviews.llvm.org/D53765
      
      llvm-svn: 353563
      784929d0
    • Vedant Kumar's avatar
      [CodeExtractor] Restore outputs after creating exit stubs · 0e5dd512
      Vedant Kumar authored
      When CodeExtractor saves the result of InvokeInst at the first insertion
      point of the 'normal destination' basic block, this block can be omitted
      in the outlined region, so store is placed outside of the function. The
      suggested solution is to process saving outputs after creating exit
      stubs for new function, and stores will be placed in that blocks before
      return in this case.
      
      Patch by Sergei Kachkov!
      
      Fixes llvm.org/PR40455.
      
      Differential Revision: https://reviews.llvm.org/D57919
      
      llvm-svn: 353562
      0e5dd512
    • Carlos Alberto Enciso's avatar
      [DWARF] LLVM ERROR: Broken function found, while removing Debug Intrinsics. · 08dc50f2
      Carlos Alberto Enciso authored
      Check that when SimplifyCFG is flattening a 'br', all their debug intrinsic instructions are removed, including any dbg.label referencing a label associated with the basic blocks being removed.
      
      Differential Revision: https://reviews.llvm.org/D57444
      
      llvm-svn: 353511
      08dc50f2
    • Sergey Dmitriev's avatar
      [CodeExtractor] Update function's assumption cache after extracting blocks from it · 807960e6
      Sergey Dmitriev authored
      Summary: Assumption cache's self-updating mechanism does not correctly handle the case when blocks are extracted from the function by the CodeExtractor. As a result function's assumption cache may have stale references to the llvm.assume calls that were moved to the outlined function. This patch fixes this problem by removing extracted llvm.assume calls from the function’s assumption cache.
      
      Reviewers: hfinkel, vsk, fhahn, davidxl, sanjoy
      
      Reviewed By: hfinkel, vsk
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57215
      
      llvm-svn: 353500
      807960e6
  5. Feb 06, 2019
  6. Feb 05, 2019
    • Jeremy Morse's avatar
      [DebugInfo][NFCI] Split salvageDebugInfo into helper functions · 84ca706b
      Jeremy Morse authored
      Some use cases are appearing where salvaging is needed that does not
      correspond to an instruction being deleted -- for example an instruction
      being sunk, or a Value not being available in a block being isel'd.
      
      Enable more fine grained control over how salavging occurs by splitting
      the logic into helper functions, separating things that are specific to
      working on DbgVariableIntrinsics from those specific to interpreting IR
      and building DIExpressions.
      
      Differential Revision: https://reviews.llvm.org/D57696
      
      llvm-svn: 353156
      84ca706b
  7. Feb 04, 2019
  8. Feb 02, 2019
    • Florian Hahn's avatar
      [LCSSA] Handle case with single new PHI faster. · dd2ef0af
      Florian Hahn authored
      If there is only a single available value, all uses must be dominated by
      the single value and there is no need to search for a reaching
      definition.
      
      This drastically speeds up LCSSA in some cases. For the test case
      from PR37202, it speeds up LCSSA construction by 4 times.
      
      Time-passes without this patch for test case from PR37202:
      
          Total Execution Time: 29.9285 seconds (29.9276 wall clock)
      
          ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
          5.2786 ( 17.7%)   0.0021 (  1.2%)   5.2806 ( 17.6%)   5.2808 ( 17.6%)  Unswitch loops
          4.3739 ( 14.7%)   0.0303 ( 18.1%)   4.4042 ( 14.7%)   4.4042 ( 14.7%)  Loop-Closed SSA Form Pass
          4.2658 ( 14.3%)   0.0192 ( 11.5%)   4.2850 ( 14.3%)   4.2851 ( 14.3%)  Loop-Closed SSA Form Pass #2
          2.2307 (  7.5%)   0.0013 (  0.8%)   2.2320 (  7.5%)   2.2318 (  7.5%)  Loop Invariant Code Motion
          2.0888 (  7.0%)   0.0012 (  0.7%)   2.0900 (  7.0%)   2.0897 (  7.0%)  Unroll loops
          1.6761 (  5.6%)   0.0013 (  0.8%)   1.6774 (  5.6%)   1.6774 (  5.6%)  Value Propagation
          1.3686 (  4.6%)   0.0029 (  1.8%)   1.3716 (  4.6%)   1.3714 (  4.6%)  Induction Variable Simplification
          1.1457 (  3.8%)   0.0010 (  0.6%)   1.1468 (  3.8%)   1.1468 (  3.8%)  Loop-Closed SSA Form Pass #4
          1.1384 (  3.8%)   0.0005 (  0.3%)   1.1389 (  3.8%)   1.1389 (  3.8%)  Loop-Closed SSA Form Pass #6
          1.1360 (  3.8%)   0.0027 (  1.6%)   1.1387 (  3.8%)   1.1387 (  3.8%)  Loop-Closed SSA Form Pass #5
          1.1331 (  3.8%)   0.0010 (  0.6%)   1.1341 (  3.8%)   1.1340 (  3.8%)  Loop-Closed SSA Form Pass #3
      
      Time passes with this patch
      
        Total Execution Time: 19.2802 seconds (19.2813 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         4.4234 ( 23.2%)   0.0038 (  2.0%)   4.4272 ( 23.0%)   4.4273 ( 23.0%)  Unswitch loops
         2.3828 ( 12.5%)   0.0020 (  1.1%)   2.3848 ( 12.4%)   2.3847 ( 12.4%)  Unroll loops
         1.8714 (  9.8%)   0.0020 (  1.1%)   1.8734 (  9.7%)   1.8735 (  9.7%)  Loop Invariant Code Motion
         1.7973 (  9.4%)   0.0022 (  1.2%)   1.7995 (  9.3%)   1.8003 (  9.3%)  Value Propagation
         1.4010 (  7.3%)   0.0033 (  1.8%)   1.4043 (  7.3%)   1.4044 (  7.3%)  Induction Variable Simplification
         0.9978 (  5.2%)   0.0244 ( 13.1%)   1.0222 (  5.3%)   1.0224 (  5.3%)  Loop-Closed SSA Form Pass #2
         0.9611 (  5.0%)   0.0257 ( 13.8%)   0.9868 (  5.1%)   0.9868 (  5.1%)  Loop-Closed SSA Form Pass
         0.5856 (  3.1%)   0.0015 (  0.8%)   0.5871 (  3.0%)   0.5869 (  3.0%)  Unroll loops #2
         0.4132 (  2.2%)   0.0012 (  0.7%)   0.4145 (  2.1%)   0.4143 (  2.1%)  Loop Invariant Code Motion #3
      
      Reviewers: efriedma, davide, mzolotukhin
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D57033
      
      llvm-svn: 352960
      dd2ef0af
    • Florian Hahn's avatar
      [LCSSA] Add expensive verification of LCSSA form for sub-loops. · 509b48a6
      Florian Hahn authored
      This assertion makes sure all sub-loops are in LCSSA form before
      bringing their parent in LCSSA form. This precondition was added to
      formLCSSA in D56848.
      
      Reviewers: davide, efriedma, mzolotukhin
      
      Reviewed By: davide
      
      Differential Revision: https://reviews.llvm.org/D56921
      
      llvm-svn: 352958
      509b48a6
  9. Feb 01, 2019
  10. Jan 31, 2019
  11. Jan 29, 2019
  12. Jan 28, 2019
  13. Jan 24, 2019
    • Julian Lettner's avatar
      b62e9dc4
    • Julian Lettner's avatar
      [Sanitizers] UBSan unreachable incompatible with ASan in the presence of `noreturn` calls · cea84ab9
      Julian Lettner authored
      Summary:
      UBSan wants to detect when unreachable code is actually reached, so it
      adds instrumentation before every `unreachable` instruction. However,
      the optimizer will remove code after calls to functions marked with
      `noreturn`. To avoid this UBSan removes `noreturn` from both the call
      instruction as well as from the function itself. Unfortunately, ASan
      relies on this annotation to unpoison the stack by inserting calls to
      `_asan_handle_no_return` before `noreturn` functions. This is important
      for functions that do not return but access the the stack memory, e.g.,
      unwinder functions *like* `longjmp` (`longjmp` itself is actually
      "double-proofed" via its interceptor). The result is that when ASan and
      UBSan are combined, the `noreturn` attributes are missing and ASan
      cannot unpoison the stack, so it has false positives when stack
      unwinding is used.
      
      Changes:
        # UBSan now adds the `expect_noreturn` attribute whenever it removes
          the `noreturn` attribute from a function
        # ASan additionally checks for the presence of this attribute
      
      Generated code:
      ```
      call void @__asan_handle_no_return    // Additionally inserted to avoid false positives
      call void @longjmp
      call void @__asan_handle_no_return
      call void @__ubsan_handle_builtin_unreachable
      unreachable
      ```
      
      The second call to `__asan_handle_no_return` is redundant. This will be
      cleaned up in a follow-up patch.
      
      rdar://problem/40723397
      
      Reviewers: delcypher, eugenis
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D56624
      
      llvm-svn: 352003
      cea84ab9
    • David Callahan's avatar
      Update entry count for cold calls · d2eeb251
      David Callahan authored
      Summary:
      Profile sample files include the number of times each entry or inlined
      call site is sampled. This is translated into the entry count metadta
      on functions.
      
      When sample data is being read, if a call site that was inlined
      in the sample program is considered cold and not inlined, then
      the entry count of the out-of-line functions does not reflect
      the current compilation.
      
      In this patch, we note call sites where the function was not inlined
      and as a last action of the sample profile loading, we update the
      called function's entry count to reflect the calls from these
      call sites which are not included in the profile file.
      
      Reviewers: danielcdh, wmi, Kader, modocache
      
      Reviewed By: wmi
      
      Subscribers: davidxl, eraman, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52845
      
      llvm-svn: 352001
      d2eeb251
    • Mircea Trofin's avatar
      [llvm] Clarify responsiblity of some of DILocation discriminator APIs · ec026302
      Mircea Trofin authored
      Summary:
      Renamed setBaseDiscriminator to cloneWithBaseDiscriminator, to match
      similar APIs. Also changed its behavior to copy over the other
      discriminator components, instead of eliding them.
      
      Renamed cloneWithDuplicationFactor to
      cloneByMultiplyingDuplicationFactor, which more closely matches what
      this API does.
      
      Reviewers: dblaikie, wmi
      
      Reviewed By: dblaikie
      
      Subscribers: zzheng, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D56220
      
      llvm-svn: 351996
      ec026302
  14. Jan 19, 2019
    • Chandler Carruth's avatar
      Update the file headers across all of the LLVM projects in the monorepo · 2946cd70
      Chandler Carruth authored
      to reflect the new license.
      
      We understand that people may be surprised that we're moving the header
      entirely to discuss the new license. We checked this carefully with the
      Foundation's lawyer and we believe this is the correct approach.
      
      Essentially, all code in the project is now made available by the LLVM
      project under our new license, so you will see that the license headers
      include that license only. Some of our contributors have contributed
      code under our old license, and accordingly, we have retained a copy of
      our old license notice in the top-level files in each project and
      repository.
      
      llvm-svn: 351636
      2946cd70
    • Vedant Kumar's avatar
      [CodeExtractor] Emit lifetime markers around reloads of outputs · 17d9f14b
      Vedant Kumar authored
      CodeExtractor permits extracting a region of blocks from a function even
      when values defined within the region are used outside of it.
      
      This is typically done by creating an alloca in the original function
      and reloading the alloca after a call to the extracted function.
      
      Wrap the reload in lifetime start/end markers to promote stack coloring.
      
      Suggested by Sergei Kachkov!
      
      Differential Revision: https://reviews.llvm.org/D56045
      
      llvm-svn: 351621
      17d9f14b
  15. Jan 18, 2019
    • Florian Hahn's avatar
      [LCSSA] Skip blocks in sub-loops when scanning for uses. · be7cbe3f
      Florian Hahn authored
      Summary:
      Scanning blocks in sub-loops for uses is unnecessary, as they were
      already handled while dealing with the containing sub-loop.
      
      This speeds up LCSSA for highly nested loops. For the test case in PR37202, it
      halves the time spent in LCSSA. In cases were we won't be able to skip
      any blocks, the additional lookup should be negligible.
      
      Time-passes without this patch for test case from PR37202:
      
        Total Execution Time: 48.5505 seconds (48.5511 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
        10.0822 ( 21.0%)   0.1406 ( 27.0%)  10.2228 ( 21.1%)  10.2228 ( 21.1%)  Loop-Closed SSA Form Pass
        10.0417 ( 20.9%)   0.1467 ( 28.2%)  10.1884 ( 21.0%)  10.1890 ( 21.0%)  Loop-Closed SSA Form Pass #2
         4.2703 (  8.9%)   0.0040 (  0.8%)   4.2742 (  8.8%)   4.2742 (  8.8%)  Unswitch loops
         2.7376 (  5.7%)   0.0229 (  4.4%)   2.7605 (  5.7%)   2.7611 (  5.7%)  Loop-Closed SSA Form Pass #5
         2.7332 (  5.7%)   0.0214 (  4.1%)   2.7546 (  5.7%)   2.7546 (  5.7%)  Loop-Closed SSA Form Pass #3
         2.7088 (  5.6%)   0.0230 (  4.4%)   2.7319 (  5.6%)   2.7324 (  5.6%)  Loop-Closed SSA Form Pass #4
         2.6855 (  5.6%)   0.0236 (  4.5%)   2.7091 (  5.6%)   2.7090 (  5.6%)  Loop-Closed SSA Form Pass #6
         2.1648 (  4.5%)   0.0018 (  0.4%)   2.1666 (  4.5%)   2.1664 (  4.5%)  Unroll loops
         1.8371 (  3.8%)   0.0009 (  0.2%)   1.8379 (  3.8%)   1.8380 (  3.8%)  Value Propagation
         1.8149 (  3.8%)   0.0021 (  0.4%)   1.8170 (  3.7%)   1.8169 (  3.7%)  Loop Invariant Code Motion
         1.6755 (  3.5%)   0.0226 (  4.3%)   1.6981 (  3.5%)   1.6980 (  3.5%)  Loop-Closed SSA Form Pass #7
      
      Time-passes with this patch
      
        Total Execution Time: 29.9285 seconds (29.9276 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         5.2786 ( 17.7%)   0.0021 (  1.2%)   5.2806 ( 17.6%)   5.2808 ( 17.6%)  Unswitch loops
         4.3739 ( 14.7%)   0.0303 ( 18.1%)   4.4042 ( 14.7%)   4.4042 ( 14.7%)  Loop-Closed SSA Form Pass
         4.2658 ( 14.3%)   0.0192 ( 11.5%)   4.2850 ( 14.3%)   4.2851 ( 14.3%)  Loop-Closed SSA Form Pass #2
         2.2307 (  7.5%)   0.0013 (  0.8%)   2.2320 (  7.5%)   2.2318 (  7.5%)  Loop Invariant Code Motion
         2.0888 (  7.0%)   0.0012 (  0.7%)   2.0900 (  7.0%)   2.0897 (  7.0%)  Unroll loops
         1.6761 (  5.6%)   0.0013 (  0.8%)   1.6774 (  5.6%)   1.6774 (  5.6%)  Value Propagation
         1.3686 (  4.6%)   0.0029 (  1.8%)   1.3716 (  4.6%)   1.3714 (  4.6%)  Induction Variable Simplification
         1.1457 (  3.8%)   0.0010 (  0.6%)   1.1468 (  3.8%)   1.1468 (  3.8%)  Loop-Closed SSA Form Pass #4
         1.1384 (  3.8%)   0.0005 (  0.3%)   1.1389 (  3.8%)   1.1389 (  3.8%)  Loop-Closed SSA Form Pass #6
         1.1360 (  3.8%)   0.0027 (  1.6%)   1.1387 (  3.8%)   1.1387 (  3.8%)  Loop-Closed SSA Form Pass #5
         1.1331 (  3.8%)   0.0010 (  0.6%)   1.1341 (  3.8%)   1.1340 (  3.8%)  Loop-Closed SSA Form Pass #3
      
      Reviewers: davide, efriedma, mzolotukhin
      
      Reviewed By: davide, efriedma
      
      Subscribers: hiraditya, dmgreen, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D56848
      
      llvm-svn: 351567
      be7cbe3f
  16. Jan 17, 2019
  17. Jan 16, 2019
    • Philip Pfaffe's avatar
      [NewPM][TSan] Reiterate the TSan port · 685c76d7
      Philip Pfaffe authored
      Summary:
      Second iteration of D56433 which got reverted in rL350719. The problem
      in the previous version was that we dropped the thunk calling the tsan init
      function. The new version keeps the thunk which should appease dyld, but is not
      actually OK wrt. the current semantics of function passes. Hence, add a
      helper to insert the functions only on the first time. The helper
      allows hooking into the insertion to be able to append them to the
      global ctors list.
      
      Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D56538
      
      llvm-svn: 351314
      685c76d7
Loading