Skip to content
  1. Oct 30, 2019
  2. Oct 29, 2019
    • Nick Terrell's avatar
      [LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap · 68142324
      Nick Terrell authored
      Summary:
      Add a flag `F_no_mmap` to `FileOutputBuffer` to support
      `--[no-]mmap-output-file` in ELF LLD. LLD currently explicitly ignores
      this flag for compatibility with GNU ld and gold.
      
      We need this flag to speed up link time for large binaries in certain
      scenarios. When we link some of our larger binaries we find that LLD
      takes 50+ GB of memory, which causes memory pressure. The memory
      pressure causes the VM to flush dirty pages of the output file to disk.
      This is normally okay, since we should be flushing cold pages. However,
      when using BtrFS with compression we need to write 128KB at a time when
      we flush a page. If any page in that 128KB block is written again, then
      it must be flushed a second time, and so on. Since LLD doesn't write
      sequentially this causes write amplification. The same 128KB block will
      end up being flushed multiple times, causing the linker to many times
      more IO than necessary. We've observed 3-5x faster builds with
      -no-mmap-output-file when we hit this scenario.
      
      The bad scenario only applies to compressed filesystems, which group
      together multiple pages into a single compressed block. I've tested
      BtrFS, but the problem will be present for any compressed filesystem
      on Linux, since it is caused by the VM.
      
      Silently ignoring --no-mmap-output-file caused a silent regression when
      we switched from gold to lld. We pass --no-mmap-output-file to fix this
      edge case, but since lld silently ignored the flag we didn't realize it
      wasn't being respected.
      
      Benchmark building a 9 GB binary that exposes this edge case. I linked 3
      times with --mmap-output-file and 3 times with --no-mmap-output-file and
      took the average. The machine has 24 cores @ 2.4 GHz, 112 GB of RAM,
      BtrFS mounted with -compress-force=zstd, and an 80% full disk.
      
      | Mode    | Time  |
      |---------|-------|
      | mmap    | 894 s |
      | no mmap | 126 s |
      
      When compression is disabled, BtrFS performs just as well with and
      without mmap on this benchmark.
      
      I was unable to reproduce the regression with any binaries in
      lld-speed-test.
      
      Reviewed By: ruiu, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D69294
      68142324
    • Richard Smith's avatar
      Replace std::function in PrintingPolicy with a callbacks object. · dbcb690f
      Richard Smith authored
      This makes PrintingPolicy significantly more lightweight and provides
      groundwork for more printing customization hooks.
      dbcb690f
    • Lawrence D'Anna's avatar
      [LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args · a69bbe02
      Lawrence D'Anna authored
      Summary:
      Move breakpoints from the old, bad ArgInfo::count to the new, better
      ArgInfo::max_positional_args.   Soon ArgInfo::count will be no more.
      
      It looks like this functionality is already well tested by
      `TestBreakpointCommandsFromPython.py`, so there's no need to write
      additional tests for it.
      
      Reviewers: labath, jingham, JDevlieghere
      
      Reviewed By: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D69468
      a69bbe02
    • Eli Friedman's avatar
      [Headers] Fix compatibility between arm_acle.h and intrin.h · 98286b56
      Eli Friedman authored
      Make sure they don't both define __nop.
      
      Differential Revision: https://reviews.llvm.org/D69012
      98286b56
    • Richard Smith's avatar
    • Adrian Prantl's avatar
      [DWARF5] Added support for deleted C++ special member functions. · f919be33
      Adrian Prantl authored
      This patch adds support for deleted C++ special member functions in
      clang and llvm. Also added Defaulted member encodings for future
      support for defaulted member functions.
      
      Patch by Sourabh Singh Tomar!
      
      Differential Revision: https://reviews.llvm.org/D69215
      f919be33
    • Daniel Sanders's avatar
      [globalisel][docs] Fix warning treated as error · 3260fa2c
      Daniel Sanders authored
      I had hoped that I could have some
      ```
      .. code-block:: MIR
      ```
      sections for MIR examples which causes a warning about pygments not
      supporting it but we have warnings treated as errors
      3260fa2c
    • Daniel Sanders's avatar
      [globalisel][docs] Rewrite the IRTranslator documentation · 6f665fc7
      Daniel Sanders authored
      Summary:
      I haven't refreshed the Function Calls section as I don't feel I have
      sufficient knowledge of that area. It would be appreciated if someone could
      review that section.
      
      Note: I'm aware that pygments doesn't support 'mir' as used in one of the
      code-block directives. This currently emits a warning and I decided to
      keep it to enable finding them later. Maybe we can teach pygments to
      support it.
      
      Depends on D69456
      
      Reviewers: volkan, aditya_nandakumar
      
      Subscribers: rovka, Petar.Avramovic, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69457
      6f665fc7
    • Richard Smith's avatar
      Fix argument numbering confusion when diagnosing a non-viable operator(). · 52590319
      Richard Smith authored
      This could lead to crashes if operator() is a variadic template, as we
      could end up asking for an out-of-bounds argument.
      52590319
    • Davide Italiano's avatar
    • Philip Reames's avatar
      [SelectionDAG] Enable lowering unordered atomics loads w/LoadSDNode (and... · 2460989e
      Philip Reames authored
      [SelectionDAG] Enable lowering unordered atomics loads w/LoadSDNode (and stores w/StoreSDNode) by default
      
      Enable the new SelectionDAG representation for unordered loads and stores introduced in r371441 by default.  As a reminder, the new lowering changes the representation of an unordered atomic load from an AtomicSDNode - which is essentially a black box which gets passed through without combines messing with it - to a LoadSDNode w/a atomic marker on the MMO. The later parallels the way we handle volatiles, and I've audited the code to ensure that every location which checks one checks the other.
      
      This has been fairly heavily fuzzed, and I examined diffs in a reasonable large corpus of assembly by hand, so I'm reasonable sure this is correct for the common case.  Late in the review for this, it was discovered that I hadn't correctly handled cases which could be legalized into CAS operations.  This points out that there's a strong bias in the IR of the frontend I'm working with towards only legal atomics.  If there are problems with this patch, the most likely area will be legalization.
      
      Differential Revision: https://reviews.llvm.org/D69219
      2460989e
    • Philip Reames's avatar
    • Joel E. Denny's avatar
      [lit] Extend internal diff to support `-` argument · 7c1d536c
      Joel E. Denny authored
      When using lit's internal shell, RUN lines like the following
      accidentally execute an external `diff` instead of lit's internal
      `diff`:
      
      ```
       # RUN: program | diff file -
      ```
      
      Such cases exist now, in `clang/test/Analysis` for example.  We are
      preparing patches to ensure lit's internal `diff` is called in such
      cases, which will then fail because lit's internal `diff` doesn't
      recognize `-` as a command-line option.  This patch adds support for
      `-` to mean stdin.
      
      Reviewed By: probinson, rnk
      
      Differential Revision: https://reviews.llvm.org/D67643
      7c1d536c
    • Joel E. Denny's avatar
      [lit] Make internal diff work in pipelines · b163806c
      Joel E. Denny authored
      When using lit's internal shell, RUN lines like the following
      accidentally execute an external `diff` instead of lit's internal
      `diff`:
      
      ```
       # RUN: program | diff file -
       # RUN: not diff file1 file2 | FileCheck %s
      ```
      
      Such cases exist now, in `clang/test/Analysis` for example.  We are
      preparing patches to ensure lit's internal `diff` is called in such
      cases, which will then fail because lit's internal `diff` cannot
      currently be used in pipelines and doesn't recognize `-` as a
      command-line option.
      
      To enable pipelines, this patch moves lit's `diff` implementation into
      an out-of-process script, similar to lit's `cat` implementation.  A
      follow-up patch will implement `-` to mean stdin.
      
      Also, when lit's `diff` prints differences to stdout in Windows, this
      patch ensures it always terminate lines with `\n` not `\r\n`.  That
      way, strict FileCheck directives checking the `diff` output succeed in
      both Linux and Windows.  This wasn't an issue when `diff` was internal
      to lit because `diff` didn't then write to the true stdout, which is
      where the `\n` -> `\r\n` conversion happened in Python.
      
      Reviewed By: probinson, stella.stamenova
      
      Differential Revision: https://reviews.llvm.org/D66574
      b163806c
Loading