1. Nov 22, 2019
    • David Tellenbach's avatar
      [AArch64] [FrameLowering] Allow conditional insertion of CFI instruction · 75434366
      David Tellenbach authored
      Summary:
      The insertion of most CFI instructions during AArch64 frame lowering can
      be disabled (e.g. using the function attribute `nounwind`).
      
      This patch enables conditional insertion for one more CFI instruction.
      
      Reviewers: t.p.northover, ostannard
      
      Reviewed By: ostannard
      
      Subscribers: kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70129
      75434366
    • Marco Vanotti's avatar
      [libFuzzer] Fix fd check in DupAndCloseStderr. · 16d9f44f
      Marco Vanotti authored
      Summary:
      This commit fixes the check in the return value from the `DuplicateFile`
      function, which returns a new file descriptor. `DuplicateFile` can
      return 0 if that file descriptor is available (for example, if stdin has
      already been closed).
      
      In particular, this could cause a bug with the `-close_fd_mask` flag in
      some platforms: just call the fuzzer with stdin closed and the
      `-close_fd_mask=2` flag, and stderr will not be muted.
      
      Example fuzzer:
      
      ```
      
      extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
        fprintf(stderr, "STDERR\n");
        fprintf(stdout, "STDOUT\n");
        return 0;
      }
      ```
      
      Invocation (muting both stderr and stdout):
      ```
      ./test -close_fd_mask=3 -runs=1 0<&-
      INFO: Seed: 1155116940
      INFO: Loaded 1 modules   (1 inline 8-bit counters): 1 [0x48b020, 0x48b021),
      INFO: Loaded 1 PC tables (1 PCs): 1 [0x478dc8,0x478dd8),
      INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
      STDERR
      INFO: A corpus is not provided, starting from an empty corpus
      STDERR
      Done 2 runs in 0 second(s)
      ```
      
      Reviewers: mcgrathr, jakehehrlich, phosek, kcc, aarongreen
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D68775
      16d9f44f
    • Julian Lettner's avatar
    • Philip Reames's avatar
      Further cleanup manipulation of widenable branches [NFC] · 8293f743
      Philip Reames authored
      This is a follow on to aaea2480.  In post commit discussion, Artur and I realized we could cleanup the code using Uses; this patch does so.
      8293f743
    • Joel E. Denny's avatar
      [FileCheck] Make FILECHECK_OPTS useful for its test suite · f471eb8e
      Joel E. Denny authored
      Without this patch, `FILECHECK_OPTS` isn't propagated to FileCheck's
      test suite so that `FILECHECK_OPTS` doesn't inadvertently affect test
      results by affecting the output of FileCheck calls under test.  As a
      result, `FILECHECK_OPTS` is useless for debugging FileCheck's test
      suite.
      
      In `llvm/test/FileCheck/lit.local.cfg`, this patch provides a new
      subsitution, `%ProtectFileCheckOutput`, to address this problem for
      both `FILECHECK_OPTS` and the deprecated
      `FILECHECK_DUMP_INPUT_ON_FAILURE`.  The rest of the patch uses
      `%ProtectFileCheckOutput` throughout the test suite
      
      Fixes PR40284.
      
      Reviewed By: probinson, thopre
      
      Differential Revision: https://reviews.llvm.org/D65121
      f471eb8e
    • Luís Marques's avatar
      [Object][RISCV] Fix R_RISCV_SET6 and R_RISCV_SUB6 relocations resolution · b8b57087
      Luís Marques authored
      Summary: These relocations had a suspicious resolution logic, given their name.
      This patch makes the resolution match the LLD one, which makes more sense.
      
      Reviewers: asb, lenary, HsiangKai, jrtc27
      Reviewed By: HsiangKai
      Tags: #llvm
      Differential Revision: https://reviews.llvm.org/D70396
      b8b57087
    • Hiroshi Yamauchi's avatar
      [PGO][PGSO] DAG.shouldOptForSize part. · 52e37749
      Hiroshi Yamauchi authored
      Summary:
      (Split of off D67120)
      
      SelectionDAG::shouldOptForSize changes for profile guided size optimization.
      
      Reviewers: davidxl
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70095
      52e37749
    • Vedant Kumar's avatar
      Clang-trunk Generates Wrong Debug values with -O1 · 844d97f6
      Vedant Kumar authored
      Bit-Tracking Dead Code Elimination (bdce) do not mark dbg.value as undef after
      deleting instruction.  which shows invalid state of variable in debugger.  This
      patches fixes this by marking the dbg.value as undef which depends on dead
      instruction.
      
      This fixes https://bugs.llvm.org/show_bug.cgi?id=41925
      
      Patch by kamlesh kumar!
      
      Differential Revision: https://reviews.llvm.org/D70040
      844d97f6
    • Alexey Bataev's avatar
      f8ff3d7e
    • Jonas Devlieghere's avatar
      [Driver] Fix newline at the end of help output · 6c2e4e88
      Jonas Devlieghere authored
      Print a regular newline at the end of the help output. The current
      string literal seems to throw off shells.
      6c2e4e88
    • Jonas Devlieghere's avatar
      [Reproducer] Make 'reproducer xcrash' behave the same during capture & replay · bb090bb1
      Jonas Devlieghere authored
      There's no point in preventing this command from running during replay.
      We should simulate the same crash as during capture.
      bb090bb1
    • Jonas Devlieghere's avatar
      [Reproducer] Instruct users to replay reproducer · b26d9e41
      Jonas Devlieghere authored
      Improve the message printed when LLDB crashes by asking the user to
      replay the reproducer before attaching it to a bugreport..
      
      ********************
      Crash reproducer for lldb version 10.0.0 (git@github.com:llvm/llvm-project.git revision ...)
        clang revision ...
        llvm revision ...
      
      Reproducer written to '/path/to/reproducer'
      
      Before attaching the reproducer to a bug report:
       - Look at the directory to ensure you're willing to share its content.
       - Make sure the reproducer works by replaying the reproducer.
      
      Replay the reproducer with the following command:
      ./bin/lldb -replay /path/to/reproducer
      ********************
      b26d9e41
    • Jonas Devlieghere's avatar
      44fe1f02
    • Kazu Hirata's avatar
      [JumpThreading] Refactor ThreadEdge · 4f5d931c
      Kazu Hirata authored
      Summary:
      This patch moves various checks from ThreadEdge to new function
      TryThreadEdge The rational behind this is that I'd like to use
      ThreadEdge without its checks in my upcoming patch.
      
      This patch preserves lightweight checks as assertions in ThreadEdge.
      ThreadEdge does not repeat the cost check, however.
      
      Reviewers: wmi
      
      Subscribers: hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70338
      4f5d931c
    • Craig Topper's avatar
      [X86] Change legalization action for f128 fadd/fsub/fmul/fdiv from Custom to LibCall. · 1439059c
      Craig Topper authored
      The custom code just emits a libcall, but we can do the same
      with generic code. The only difference is that the generic code
      can form tail calls where the custom code couldn't. This is
      responsible for the test changes.
      
      This avoids needing to modify the Custom handling for strict fp.
      1439059c
    • Craig Topper's avatar
      [X86] Add test case for f128 fma. NFC · fea8288c
      Craig Topper authored
      This should be turned into a libcall to fmal. We already do it
      correctly, but we had no test to confirm.
      fea8288c
    • Stefan Pintilie's avatar
      [PowerPC] Add new Future CPU for PowerPC · 5fcf89f7
      Stefan Pintilie authored
      This patch will add -mcpu=future into clang for PowerPC.
      
      A CPU type is required for work that may possibly be enabled for some future
      Power CPU. The CPU type future will serve that purpose. This patch introduces
      no new functionality. It is an incremental patch on top of which Power PC work
      for some future CPU can be done.
      
      Differential Revision: https://reviews.llvm.org/D70262
      5fcf89f7
    • Jonas Devlieghere's avatar
      [Test] Split up TestIntegerTypes.py · f5759d5d
      Jonas Devlieghere authored
      The unsplit test is timing out on GreenDragon's sanitized bot. By
      splitting the test we avoid this issue and increase parallelism.
      f5759d5d
    • Adrian Prantl's avatar
      Debug info: Emit objc_direct methods as members of their containing class · e0cabe28
      Adrian Prantl authored
      even in DWARF 4 and earlier. This allows the debugger to recognize
      them as direct functions as opposed to Objective-C methods.
      
      <rdar://problem/57327663>
      
      Differential Revision: https://reviews.llvm.org/D70544
      e0cabe28
    • Tom Stellard's avatar
      [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" · ab411801
      Tom Stellard authored
      Summary:
      Most libraries are defined in the lib/ directory but there are also a
      few libraries defined in tools/ e.g. libLLVM, libLTO.  I'm defining
      "Component Libraries" as libraries defined in lib/ that may be included in
      libLLVM.so.  Explicitly marking the libraries in lib/ as component
      libraries allows us to remove some fragile checks that attempt to
      differentiate between lib/ libraries and tools/ libraires:
      
      1. In tools/llvm-shlib, because
      llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of
      all libraries defined in the whole project, there was custom code
      needed to filter out libraries defined in tools/, none of which should
      be included in libLLVM.so.  This code assumed that any library
      defined as static was from lib/ and everything else should be
      excluded.
      
      With this change, llvm_map_components_to_libnames(LIB_NAMES, "all")
      only returns libraries that have been added to the LLVM_COMPONENT_LIBS
      global cmake property, so this custom filtering logic can be removed.
      Doing this also fixes the build with BUILD_SHARED_LIBS=ON
      and LLVM_BUILD_LLVM_DYLIB=ON.
      
      2. There was some code in llvm_add_library that assumed that
      libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or
      ARG_LINK_COMPONENTS set.  This is only true because libraries
      defined lib lib/ use LLVMBuild.txt and don't set these values.
      This code has been fixed now to check if the library has been
      explicitly marked as a component library, which should now make it
      easier to remove LLVMBuild at some point in the future.
      
      I have tested this patch on Windows, MacOS and Linux with release builds
      and the following combinations of CMake options:
      
      - "" (No options)
      - -DLLVM_BUILD_LLVM_DYLIB=ON
      - -DLLVM_LINK_LLVM_DYLIB=ON
      - -DBUILD_SHARED_LIBS=ON
      - -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON
      - -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON
      
      Reviewers: beanz, smeenai, compnerd, phosek
      
      Reviewed By: beanz
      
      Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70179
      ab411801
    • Philip Reames's avatar
      Broaden the definition of a "widenable branch" · aaea2480
      Philip Reames authored
      As a reminder, a "widenable branch" is the pattern "br i1 (and i1 X, WC()), label %taken, label %untaken" where "WC" is the widenable condition intrinsics. The semantics of such a branch (derived from the semantics of WC) is that a new condition can be added into the condition arbitrarily without violating legality.
      
      Broaden the definition in two ways:
          Allow swapped operands to the br (and X, WC()) form
          Allow widenable branch w/trivial condition (i.e. true) which takes form of br i1 WC()
      
      The former is just general robustness (e.g. for X = non-instruction this is what instcombine produces). The later is specifically important as partial unswitching of a widenable range check produces exactly this form above the loop.
      
      Differential Revision: https://reviews.llvm.org/D70502
      aaea2480
    • Philip Reames's avatar
      [Tests] Autogenerate a bunch of SCEV trip count tests for readability. Will... · d9426c33
      Philip Reames authored
      [Tests] Autogenerate a bunch of SCEV trip count tests for readability.  Will likely merge some of these files soon.
      d9426c33
    • Alexey Bataev's avatar
      [OPENMP50]Add device/kind context selector support. · 4e8231b5
      Alexey Bataev authored
      Summary: Added basic parsing/sema support for device/kind context selector.
      
      Reviewers: jdoerfert
      
      Subscribers: rampitec, aheejin, fedor.sergeev, simoncook, guansong, s.egerton, hfinkel, kkwli0, caomhin, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70245
      4e8231b5
    • Philip Reames's avatar
      [SCEV] Add a mode to skip classification when printing analysis · 70d173fb
      Philip Reames authored
      For the various trip-count tests, the classification isn't useful and makes the auto-generated tests super verbose.  By skipping it, we make the auto-gen tests closer to the manually written ones.  Up next: auto-genning a bunch of the existings tests.
      70d173fb
    • Kostya Kortchinsky's avatar
      [scudo][standalone] Minor optimization & improvements · 46240c38
      Kostya Kortchinsky authored
      Summary:
      A few small improvements and optimizations:
      - when refilling the free list, push back the last batch and return
        the front one: this allows to keep the allocations towards the front
        of the region;
      - instead of using 48 entries in the shuffle array, use a multiple of
        `MaxNumCached`;
      - make the maximum number of batches to create on refil a constant;
        ultimately it should be configurable, but that's for later;
      - `initCache` doesn't need to zero out the cache, it's already done.
      - it turns out that when using `||` or `&&`, the compiler is adamant
        on adding a short circuit for every part of the expression. Which
        ends up making somewhat annoying asm with lots of test and
        conditional jump. I am changing that to bitwise `|` or `&` in two
        place so that the generated code looks better. Added comments since
        it might feel weird to people.
      
      This yields to some small performance gains overall, nothing drastic
      though.
      
      Reviewers: hctim, morehouse, cferris, eugenis
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D70452
      46240c38
    • Jonas Devlieghere's avatar
      [Docs] Generate the LLDB man page with Sphinx · bb775bee
      Jonas Devlieghere authored
      This patch replaces the existing out-of-date man page for lldb and
      replaces it with an RST file from which sphinx generates the actual
      troff file. This is similar to how man pages are generated for the rest
      of the LLVM utilities.
      
      The man page is generated by building the `docs-lldb-man` target.
      
      Differential revision: https://reviews.llvm.org/D70514
      bb775bee
    • Philip Reames's avatar
      [SCEV] Be robust against IR generated by simple-loop-unswitch · f1a9a832
      Philip Reames authored
      Simple loop unswitch likes to leave around unsimplified and/or/xors. SCEV today bails out on these idioms which is unfortunate in general, and specifically for the unswitch interaction.
      
      Differential Revision: https://reviews.llvm.org/D70459
      f1a9a832
    • Fangrui Song's avatar
      [ELF] Error if -Ttext-segment is specified · 4dc2fb12
      Fangrui Song authored
      In GNU ld, -Ttext sets the address of the .text section and -Ttext-segment sets the address of the text segment (RX).
      
      gold only supports the -Ttext-segment semantic and treats -Ttext as an alias for -Ttext-segment.
      
      lld only supports the -Ttext semantic and treats -Ttext-segment as an
      alias for -Ttext.  The text segment will be assigned to an address less
      than the specified -Ttext-segment value.
      
      This patch drops the -Ttext-segment alias.
      
      The text segment is traditionally the first segment. Users who specify
      -Ttext-segment may actually want to specify --image-base, the lld way to
      express this. Unfortunately currently this is supported by GNU ld's
      COFF port but not by its ELF port. gold does not support this option.
      With -z separate-code, the behavior of GNU ld -Ttext-segment is weird (see https://sourceware.org/bugzilla/show_bug.cgi?id=25207)
      
      rL289827 introduced the alias for linking qemu's non-pie user mode
      binaries. As explained previously, this actually assigns the text
      segment to an address less than 0x60000000. I feel that a better fix is
      on the qemu side:
      https://lists.nongnu.org/archive/html/qemu-devel/2019-11/msg02480.html
      
      Reviewed By: grimar, ruiu
      
      Differential Revision: https://reviews.llvm.org/D70468
      4dc2fb12
    • Fangrui Song's avatar
      [llvm-objcopy][MachO] Implement --strip-debug · 30ccee71
      Fangrui Song authored
      Reviewed By: alexshap
      
      Differential Revision: https://reviews.llvm.org/D70476
      30ccee71
    • Fangrui Song's avatar
      [llvm-objcopy][MachO] Fix symbol order in the symbol table · 24200277
      Fangrui Song authored
      Only consider isUndefinedSymbol() when the symbol is not local. This
      fixes an assert failure when copying the symbol table, if a n_type=0x20
      symbol is followed by a n_type=0x64 symbol.
      
      Reviewed By: alexshap, seiya
      
      Differential Revision: https://reviews.llvm.org/D70475
      24200277
    • Bjorn Pettersson's avatar
      [BranchFolding] Fix PR43964 about branch folder not being debug invariant · 898de302
      Bjorn Pettersson authored
      Summary:
      The fix in BranchFolder related to non debug invariant problems
      done in commit ec32dff0 actually introduced some new
      problems with debug invariance.
      
      Before that patch ComputeCommonTailLength would move iterators
      back, past debug instructions, in order to make ProfitableToMerge
      make consistent answers "when one block differs from the other
      only by whether debugging pseudos are present at the beginning".
      But the changes in ec32dff0 undid that by moving the iterators
      forward again.
      
      This patch refactors ComputeCommonTailLength. The function was
      really complex, considering that the SkipTopCFIAndReturn part
      always moved the iterators forward to the first "real" instruction
      in the found tail after ec32dff0.
      
      The patch also restores the logic to "back past possible debugging
      pseudos at beginning of block" to make sure ProfitableToMerge
      gives consistent answers independent of DBG_VALUE instructions
      before the tail. That is now done by ProfitableToMerge instead of
      being hidden as a side-effect in ComputeCommonTailLength.
      
      Reviewers: probinson, yechunliang, jmorse
      
      Reviewed By: jmorse
      
      Subscribers: Orlando, mehdi_amini, dexonsmith, aprantl, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70091
      898de302
    • Michael Liao's avatar
      Fix compilation warning. NFC. · c4afc656
      Michael Liao authored
      c4afc656
    • Adrian McCarthy's avatar
      [NFC] Refactor and improve comments in CommandObjectTarget · 3b69f0c5
      Adrian McCarthy authored
      Made small improvements while debugging through
      CommandObjectTarget::AddModuleSymbols.
      
      1.  Refactored error case for an early out, reducing the indentation of
      the rest of this long function.
      2.  Clarified some comments by correcting spelling and punctuation.
      3.  Reduced duplicate code at the end of the function.
      
      Tested with `ninja check-lldb`
      
      Differential Review: https://reviews.llvm.org/D70458
      3b69f0c5
    • Adrian Prantl's avatar
      1b9ef3bb
    • Alexey Bataev's avatar
      [OPENMP]Fix datasharing checks for if clause in parallel taskloop · 77d049d0
      Alexey Bataev authored
      directives.
      
      If the default datasharing is set to none, the datasharing attributes
      for variables in the condition of the if clause for the inner taskloop
        directive must be verified.
      77d049d0
    • Sanjay Patel's avatar
    • Simon Pilgrim's avatar
      Fix unused variable warning. NFCI. · d4e006e8
      Simon Pilgrim authored
      d4e006e8
  2. Nov 21, 2019