1. Nov 20, 2019
    • Vedant Kumar's avatar
      [profile] Address unused function warnings on Windows after D69586 · 0d4211f4
      Vedant Kumar authored
      This '#ifdef's out two functions which are unused on Windows, to prevent
      -Wunused-function warnings.
      0d4211f4
    • Vedant Kumar's avatar
      [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood (reland with fixes) · 568db780
      Vedant Kumar authored
      Currently, clang emits subprograms for declared functions when the
      target debugger or DWARF standard is known to support entry values
      (DW_OP_entry_value & the GNU equivalent).
      
      Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
      tail calls.
      
      Pre-patch debug session with a cross-TU tail call:
      
      ```
        * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
          frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]
      ```
      
      Post-patch (note that the tail-calling frame, "helper", is visible):
      
      ```
        * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
          frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
          frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]
      ```
      
      This was reverted in 5b9a072c because it attached declaration
      subprograms to inlinable builtin calls, which interacted badly with the
      MergeICmps pass. The fix is to not attach declarations to builtins.
      
      rdar://46577651
      
      Differential Revision: https://reviews.llvm.org/D69743
      568db780
    • Tim Northover's avatar
      [docs] Remove dangling parenthesis from documentation · 75b5db30
      Tim Northover authored
      Patch by leiteg.
      75b5db30
    • Reid Kleckner's avatar
      Add a key method to Sema to optimize debug info size · 586f65d3
      Reid Kleckner authored
      It turns out that the debug info describing the Sema class is an
      appreciable percentage of the total object file size of objects in Sema.
      By adding a key function, clang is able to optimize the debug info size
      by emitting a forward declaration in TUs that do not define the key
      function.
      
      On Windows, with clang-cl, these are the total sizes of object files in
      Sema before and after this change, compiling with optimizations and
      debug info:
        before: 335,012 KB
        after:  278,116 KB
        delta:  -56,896 KB
        percent: -17.0%
      
      The effect on link time was negligible, despite having ~56MB less input.
      
      On Linux, with clang, these are the same sizes using DWARF -g and
      optimizations:
        before: 603,756 KB
        after:  515,340 KB
        delta:  -88,416 KB
        percent: -14.6%
      
      I didn't use type units, DWARF-5, fission, or any other special flags.
      
      Reviewed By: thakis
      
      Differential Revision: https://reviews.llvm.org/D70340
      586f65d3
    • Vedant Kumar's avatar
      [profile] Unbreak Fuchsia/Windows after D68351 · 1aacf588
      Vedant Kumar authored
      Continuous mode is not yet supported on Fuchsia/Windows, however an
      error should not be reported unless the user attempted to actually
      enable continuous mode.
      1aacf588
    • diggerlin's avatar
      The patch is the compiler error specific on the compile error on CMVC · ea13683f
      diggerlin authored
      SUMMARY:
      
      CMVC has a compiler error on the
      const uint64_t OffsetToRaw = is64Bit()
                                         ? toSection64(Sec)->FileOffsetToRawData
                                         : toSection32(Sec)->FileOffsetToRawData;
      
      while  gcc  compiler do not have the problem.
      I have to change the code to
      
        uint64_t OffsetToRaw;
        if (is64Bit())
          OffsetToRaw = toSection64(Sec)->FileOffsetToRawData;
        else
          OffsetToRaw = toSection32(Sec)->FileOffsetToRawData;
      
      Reviewers: Sean Fertile
      Subscribers: rupprecht, seiyai,hiraditya
      
      Differential Revision: https://reviews.llvm.org/D70255
      ea13683f
    • Tyker's avatar
      fixe leak found by asan build bot · c444a01d
      Tyker authored
      c444a01d
    • Vedant Kumar's avatar
      [DebugInfo] Describe size of spilled values in call site params · ba71ca37
      Vedant Kumar authored
      A call site parameter description of a memory operand needs to
      unambiguously convey the size of the operand to prevent incorrect entry
      value evaluation.
      
      Thanks for David Stenberg for pointing this issue out!
      ba71ca37
    • Duncan P. N. Exon Smith's avatar
      llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls · 32797249
      Duncan P. N. Exon Smith authored
      Pair up inlined AutoreleaseRV calls with their matching RetainRV or
      ClaimRV.
      
      - RetainRV cancels out AutoreleaseRV.  Delete both instructions.
      - ClaimRV is a peephole for RetainRV+Release.  Delete AutoreleaseRV and
        replace ClaimRV with Release.
      
      This avoids problems where more aggressive inlining triggers memory
      regressions.
      
      This patch is happy to skip over non-callable instructions and non-ARC
      intrinsics looking for the pair.  It is likely sound to also skip over
      opaque function calls, but that's harder to reason about, and it's not
      relevant to the goal here: if there's an opaque function call splitting
      up a pair, it's very unlikely that a handshake would have happened
      dynamically without inlining.
      
      Note that this patch also subsumes the previous logic that looked
      backwards from ReleaseRV.
      
      https://reviews.llvm.org/D70370
      rdar://problem/46509586
      32797249
    • Sanjay Patel's avatar
      [SLP] fix miscompile on min/max reductions with extra uses (PR43948) (2nd try) · 0a8e7ca4
      Sanjay Patel authored
      The 1st attempt was reverted because it revealed an existing
      bug where we could produce invalid IR (use of value before
      definition). That should be fixed with:
      rG39de82ec
      
      The bug manifests as replacing a reduction operand with an undef
      value.
      
      The problem appears to be limited to cases where a min/max reduction
      has extra uses of the compare operand to the select.
      
      In the general case, we are tracking "ExternallyUsedValues" and
      an "IgnoreList" of the reduction operations, but those may not apply
      to the final compare+select in a min/max reduction.
      
      For that, we use replaceAllUsesWith (RAUW) to ensure that the new
      vectorized reduction values are transferred to all subsequent users.
      
      Differential Revision: https://reviews.llvm.org/D70148
      0a8e7ca4
    • JonChesterfield's avatar
    • Evgenii Stepanov's avatar
      MTE: add more unchecked instructions. · 2535fe5a
      Evgenii Stepanov authored
      Summary:
      In particular, 1- and 2-byte loads and stores ignore the pointer tag
      when using SP as the base register.
      
      Reviewers: pcc, ostannard
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70341
      2535fe5a
    • Tom Stellard's avatar
      test-release.sh: Update to fetch source from GitHub · c97f3038
      Tom Stellard authored
      Summary:
      This also changes the test-release.sh script to build using the monorepo
      layout instead of copying sub-projects into llvm/tools or llvm/projects.
      
      Reviewers: jdoerfert, hans
      
      Reviewed By: hans
      
      Subscribers: hans, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70353
      c97f3038
    • Alex Lorenz's avatar
      [ADT][Expensive checks] Create a std::random_device seed only once when shuffling before sorting · bfebc63a
      Alex Lorenz authored
      This speeds up the build of compiler-rt with an expensive checks enabled clang by an order of
      1 or 2 magnitudes on my machine. I was hoping this would also fix the 'large.test' libFuzzer
      timeout on the expensive checks bot on green dragon http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/,
      but the fuzzer test still takes too long to compile because of other IR/MIR verification inefficiencies.
      
      Differential Revision: https://reviews.llvm.org/D70288
      bfebc63a
    • Adrian Prantl's avatar
      Add a "Using LLDB" section to the welcome page of the website · 77f8a332
      Adrian Prantl authored
      This is an attempt to feature the user-facing resources more
      prominently on the LLDB website by calling out the tutorial and the
      GDB command map wight on the start page.
      
      I also moved the "Why a new debugger" section to the "Goals"
      subpage. Given that LLDB's first release is almost a decade in the
      past now, the title is a bit of an anachronism.
      
      Lastly, I moved the Architecture sub-page from "use" to "resources",
      since end-users do not care about the source code layout.
      
      Differential Revision: https://reviews.llvm.org/D70449
      77f8a332
    • David Green's avatar
      [ARM] MVE interleaving load and stores. · 882f23ca
      David Green authored
      Now that we have the intrinsics, we can add VLD2/4 and VST2/4 lowering
      for MVE. This works the same way as Neon, recognising the load/shuffles
      combination and converting them into intrinsics in a pre-isel pass,
      which just calls getMaxSupportedInterleaveFactor, lowerInterleavedLoad
      and lowerInterleavedStore.
      
      The main difference to Neon is that we do not have a VLD3 instruction.
      Otherwise most of the code works very similarly, with just some minor
      differences in the form of the intrinsics to work around. VLD3 is
      disabled by making isLegalInterleavedAccessType return false for those
      cases.
      
      We may need some other future adjustments, such as VLD4 take up half the
      available registers so should maybe cost more. This patch should get the
      basics in though.
      
      Differential Revision: https://reviews.llvm.org/D69392
      882f23ca
    • David Green's avatar
      411bfe47
    • diggerlin's avatar
      implement printing out raw section data of xcoff objectfile for llvm-objdump · b91f798f
      diggerlin authored
      SUMMARY:
      implement printing out raw section data of xcoff objectfile for llvm-objdump
      and option -D --disassemble-all option for llvm-objdump
      
      Reviewers: Sean Fertile
      Subscribers: rupprecht, seiyai,hiraditya
      
      Differential Revision: https://reviews.llvm.org/D70255
      b91f798f
    • Alexandre Ganea's avatar
      [C-index] Fix test when using Debug target & MSVC STL · f55cd39f
      Alexandre Ganea authored
      Avoids a deadlock in "clang/test/Index/crash-recovery-modules.m" when building with the MSVC STL & _ITERATOR_DEBUG_LEVEL == 2 (meaning a DEBUG build)
      
      Differential Revision: https://reviews.llvm.org/D69959
      f55cd39f
    • Jonas Devlieghere's avatar
      b117ec8b
    • Dan Liew's avatar
      [Symbolizers] On Darwin compute function offset when possible. · b9a92206
      Dan Liew authored
      Summary:
      The sanitizer symbolizers support printing the function offset
      (difference between pc and function start) of a stackframe using the
      `%q` format specifier.
      
      Unfortunately this didn't actually work because neither the atos
      or dladdr symbolizer set the `AddressInfo::function_offset` field.
      
      This patch teaches both symbolizers to try to compute the function
      offset. In the case of the atos symbolizer, atos might not report the
      function offset (e.g. it reports a source location instead) so in this
      case it fallsback to using `dladdr()` to compute the function offset.
      
      Two test cases are included.
      
      rdar://problem/56695185
      
      Reviewers: kubamracek, yln
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69549
      b9a92206
    • Matt Arsenault's avatar
      clang: Add -fconvergent-functions flag · e531750c
      Matt Arsenault authored
      The CUDA builtin library is apparently compiled in C++ mode, so the
      assumption of convergent needs to be made in a typically non-SPMD
      language. The functions in the library should still be assumed
      convergent. Currently they are not, which is potentially incorrect and
      this happens to work after the library is linked.
      e531750c
    • Fangrui Song's avatar
      [ELF] Disallow out-of-range section group indices after D70146 · ce5de93e
      Fangrui Song authored
      Exposed by invalid/sht-group-wrong-section.test
      http://45.33.8.238/win/2613/step_9.txt
      ce5de93e
    • Alexey Bataev's avatar
      [OPENMP]Rename function, NFC. · 1d943ae4
      Alexey Bataev authored
      Change the name of the CGOpenMPRuntime::emitOMPIfClause to CGOpenMPRuntime::emitIfClause.
      1d943ae4
    • JonChesterfield's avatar
    • Tyker's avatar
      [NFC] Refactor representation of materialized temporaries · b0561b33
      Tyker authored
      Summary:
      this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718
      
      Reviewers: rsmith, martong, shafik
      
      Reviewed By: rsmith
      
      Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69360
      b0561b33
    • Yitzhak Mandelbaum's avatar
      [libTooling] Extend `buildASTFromCodeWithArgs` to take files argument. · dd471dbe
      Yitzhak Mandelbaum authored
      Summary:
      Adds an optional parameter to `buildASTFromCodeWithArgs` that allows the user to
      pass additional files that the main code needs to compile. This change makes
      `buildASTFromCodeWithArgs` consistent with `runToolOnCodeWithArgs`.
      
      Patch by Alexey Eremin.
      
      Reviewers: gribozavr
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70175
      dd471dbe
    • Joel E. Denny's avatar
      [FileCheck] Use lit's internal shell for the test suite · 6e418dec
      Joel E. Denny authored
      An advantage is that there are less portability concerns when writing
      tests.  For example, `-u` is not supported by all implementations of
      `env`, but lit's internal shell provides its own `env` that supports
      `-u`.
      
      A disadvantage is that some shell constructs, such as parentheses, are
      not supported, but FileCheck's test suite currently doesn't require
      such constructs.
      
      For comparison, lit configures its test suite in the same manner.  See
      `llvm/utils/lit/tests/lit.cfg`.
      
      Reviewed By: rnk
      
      Differential Revision: https://reviews.llvm.org/D70278
      6e418dec
    • Fangrui Song's avatar
      [ELF] Improve --gc-sections compatibility with GNU ld regarding section groups · 6b0eb5a6
      Fangrui Song authored
      Based on D70020 by serge-sans-paille.
      
      The ELF spec says:
      
      > Furthermore, there may be internal references among these sections that would not make sense if one of the sections were removed or replaced by a duplicate from another object. Therefore, such groups must be included or omitted from the linked object as a unit. A section cannot be a member of more than one group.
      
      GNU ld has 2 behaviors that we don't have:
      
      - Group members (nextInSectionGroup != nullptr) are subject to garbage collection.
        This includes non-SHF_ALLOC SHT_NOTE sections.
        In particular, discarding non-SHF_ALLOC SHT_NOTE sections is an expected behavior by the Annobin
        project. See
        https://developers.redhat.com/blog/2018/02/20/annobin-storing-information-binaries/
        for more information.
      - Groups members are retained or discarded as a unit.
        Members may have internal references that are not expressed as
        SHF_LINK_ORDER, relocations, etc. It seems that we should be more conservative here:
        if a section is marked live, mark all the other member within the
        group.
      
      Both behaviors are reasonable. This patch implements them.
      
      A new field InputSectionBase::nextInSectionGroup tracks the next member
      within a group. on ELF64, this increases sizeof(InputSectionBase) froms
      144 to 152.
      
      InputSectionBase::dependentSections tracks section dependencies, which
      is used by both --gc-sections and /DISCARD/. We can't overload it for
      the "next member" semantic, because we should allow /DISCARD/ to discard
      sections independent of --gc-sections (GNU ld behavior). This behavior
      may be reasonably used by `/DISCARD/ : { *(.ARM.exidx*) }` or `/DISCARD/
      : { *(.note*) }` (new test `linkerscript/discard-group.s`).
      
      Reviewed By: ruiu
      
      Differential Revision: https://reviews.llvm.org/D70146
      6b0eb5a6
    • AndreyChurbanov's avatar
      Fix openmp on PowerPC64-BE-ELFv2 ABI on FreeBSD. · 3a76b8a5
      AndreyChurbanov authored
      Patch by adalava (Alfredo Dal'Ava J.nior)
      
      Differential Revision: https://reviews.llvm.org/D67190
      3a76b8a5
    • Mitchell Balan's avatar
    • LLVM GN Syncbot's avatar
      gn build: Merge 7fe9435d · 50b17de0
      LLVM GN Syncbot authored
      50b17de0
    • Matt Arsenault's avatar
      Work on cleaning up denormal mode handling · 7fe9435d
      Matt Arsenault authored
      Cleanup handling of the denormal-fp-math attribute. Consolidate places
      checking the allowed names in one place.
      
      This is in preparation for introducing FP type specific variants of
      the denormal-fp-mode attribute. AMDGPU will switch to using this in
      place of the current hacky use of subtarget features for the denormal
      mode.
      
      Introduce a new header for dealing with FP modes. The constrained
      intrinsic classes define related enums that should also be moved into
      this header for uses in other contexts.
      
      The verifier could use a check to make sure the denorm-fp-mode
      attribute is sane, but there currently isn't one.
      
      Currently, DAGCombiner incorrectly asssumes non-IEEE behavior by
      default in the one current user. Clang must be taught to start
      emitting this attribute by default to avoid regressions when this is
      switched to assume ieee behavior if the attribute isn't present.
      7fe9435d
    • Pavel Labath's avatar
      [cmake] Disable GCC 9's -Winit-list-lifetime warning in ArrayRef · 6c2151bf
      Pavel Labath authored
      Summary:
      This is a new warning which fires when one stores a reference to the
      initializer_list contents in a way which may outlive the
      initializer_list which it came from. In llvm this warning is triggered
      whenever someone uses the initializer_list ArrayRef constructor.
      
      This is indeed a dangerous thing to do (I myself was bitten by that at
      least once), but it is not more dangerous than calling other ArrayRef
      constructors with temporary objects -- something which we are used to
      and have accepted as a tradeoff for ArrayRef's efficiency.
      
      Currently, this warnings generates so much output that it completely
      obscures any actionable warnings, so this patch disables it.
      
      Reviewers: rnk, aaron.ballman
      
      Subscribers: mgorny, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70122
      6c2151bf
    • Thomas Preud'homme's avatar
      [clang][NFC] Make various uses of Regex const · b81cc603
      Thomas Preud'homme authored
      The const-correctness of match() was fixed in rL372764, which allows
      uses of Regex objects to be const in cases they couldn't be before. This
      patch tightens up the const-ness of Regex in various such cases.
      
      Reviewers: thopre
      
      Reviewed By: thopre
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D68155
      b81cc603
    • Mitchell Balan's avatar
    • jasonliu's avatar
      [AIX][XCOFF] Write Function descriptors and TOC base to data section · c9edaa82
      jasonliu authored
      This patch implements writing function descriptors and TOC base into
      data section, and also add function descriptors(both csect and label)
      and TOC base symbols to the symbol table.
      c9edaa82
  2. Nov 19, 2019
    • Mitchell Balan's avatar
      [clang-tidy] Give readability-redundant-member-init an option... · 98065362
      Mitchell Balan authored
      [clang-tidy] Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra
      
      Summary:
      readability-redundant-member-init removes redundant / unnecessary member and base class initialization. Unfortunately for the specific case of a copy constructor's initialization of a base class, gcc at strict warning levels warns if "base class is not initialized in the copy constructor of a derived class".
      
      This patch adds an option `IgnoreBaseInCopyConstructors` defaulting to 0 (thus maintaining current behavior by default) to skip the specific case of removal of redundant base class initialization in the copy constructor. Enabling this option enables the resulting code to continue to compile successfully under `gcc -Werror=extra`. New test cases `WithCopyConstructor1` and `WithCopyConstructor2` in clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp show that it removes redundant members even from copy constructors.
      
      Reviewers: malcolm.parsons, alexfh, hokein, aaron.ballman, lebedev.ri
      
      Patch by: poelmanc
      
      Subscribers: mgehre, lebedev.ri, cfe-commits
      
      Tags: #clang, #clang-tools-extra
      
      Differential revision: https://reviews.llvm.org/D69145
      98065362
    • Sanjay Patel's avatar
      [SLP] fix insertion point for min/max reduction · 39de82ec
      Sanjay Patel authored
      As discussed in D70148 (and caused a revert of the original commit):
      if we insert at the select, then we can produce invalid IR because
      the replacement for the compare may have uses before the select.
      39de82ec
    • LLVM GN Syncbot's avatar
      gn build: Merge 765b1250 · 41bac76d
      LLVM GN Syncbot authored
      41bac76d