1. Nov 20, 2019
    • 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
    • David Bozier's avatar
      Fixup AVR tests to reflect changes in addend format in llvm-objdump · e6c55fbe
      David Bozier authored
      Summary: Changes to llvm-objdump made in D69997
      
      Reviewers: thakis, jhenderson, grimar
      
      Reviewed By: thakis
      
      Subscribers: dylanmckay, Jim, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70438
      e6c55fbe
    • Sanjay Patel's avatar
      [SLP] add test for reduction miscompile; NFC · 6265be27
      Sanjay Patel authored
      See D70148 for discussion.
      6265be27
    • Raphael Isemann's avatar
    • Simon Tatham's avatar
      [ARM,MVE] Add intrinsics for scalar shifts. · 254b4f25
      Simon Tatham authored
      This fills in the small family of MVE intrinsics that have nothing to
      do with vectors: they implement bit-shift operations on 32- or 64-bit
      values held in one or two general-purpose registers. Most of these
      shift operations saturate if shifting left, and round to nearest if
      shifting right, although LSLL and ASRL behave like ordinary shifts.
      
      When these instructions take a variable shift count in a register,
      they pay attention to its sign, so that (for example) LSLL or UQRSHLL
      will shift left if given a positive number but right if given a
      negative one. That makes even LSLL and ASRL different enough from
      standard LLVM IR shift semantics that I couldn't see any better
      alternative than to simply model the whole family as a set of
      MVE-specific IR intrinsics.
      
      (The //immediate// forms of LSLL and ASRL, on the other hand, do
      behave exactly like a standard IR shift of a 64-bit value. In fact,
      those forms don't have ACLE intrinsics defined at all, because you can
      just write an ordinary C shift operation if you want one of those.)
      
      The 64-bit shifts have to be instruction-selected in C++, because they
      deliver two output values. But the 32-bit ones are simple enough that
      I could write a DAG isel pattern directly into each Instruction
      record.
      
      Reviewers: ostannard, MarkMurrayARM, dmgreen
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D70319
      254b4f25
    • Sam McCall's avatar
      [clangd] Show values of more expressions on hover · 33d93c3d
      Sam McCall authored
      Reviewers: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70359
      33d93c3d
    • Matt Arsenault's avatar
      AMDGPU: Refactor treatment of denormal mode · db0ed3e4
      Matt Arsenault authored
      Start moving towards treating this as a property of the calling
      convention, and not the subtarget. The default denormal mode should
      not be part of the subtarget, and be moved into a separate function
      attribute.
      
      This patch is still NFC. The denormal mode remains as a subtarget
      feature for now, but make the necessary changes to switch to using an
      attribute.
      db0ed3e4
    • Matt Arsenault's avatar
      AMDGPU: Be explicit about denormal mode in MIR tests · ea23b642
      Matt Arsenault authored
      Start checking the machine function in GlobalISel instead of the
      target directly.
      
      This temporarily breaks fcanonicalize selection in GlobalISel.
      ea23b642
    • Balázs Kéri's avatar
      c9b87981
    • Sam McCall's avatar
      [clangd] Untangle Hover from XRefs, move into own file. · 765b1250
      Sam McCall authored
      Summary:
      This is mostly mechanical, with a few exceptions:
       - getDeducedType moved into AST.h where it belongs. It now takes
         ASTContext instead of ParsedAST, and avoids using the preprocessor.
       - hover now uses SelectionTree directly rather than via
         getDeclAtPosition helper
       - hover on 'auto' used to find the decl that contained the 'auto' and
         use that to set Kind and documentation for the hover result.
         Now we use targetDecl() to find the decl matching the deduced type instead.
         This changes tests, e.g. 'variable' -> class for auto on lambdas.
         I think this is better, but the motivation was to avoid depending on
         the internals of DeducedTypeVisitor. This functionality is removed
         from the visitor.
      
      Reviewers: kadircet
      
      Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70357
      765b1250
    • Raphael Isemann's avatar
    • Matt Arsenault's avatar
      DAG: Add function context to isFMAFasterThanFMulAndFAdd · b696b9db
      Matt Arsenault authored
      AMDGPU needs to know the FP mode for the function to answer this
      correctly when this is removed from the subtarget.
      
      AArch64 had to make this more complicated by using this from an IR
      hook, so add an IR typed overload.
      b696b9db
    • Raphael Isemann's avatar
      714445e4
    • dfukalov's avatar
      [AMDGPU] Tune inlining parameters for AMDGPU target (part 2) · 6fd11b14
      dfukalov authored
      Summary:
      Most of IR instructions got better code size estimations after commit 47a5c36b.
      So default parameters values should be updated to improve inlining and
      unrolling for the target.
      
      Reviewers: rampitec, arsenm
      
      Reviewed By: rampitec
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, zzheng, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70391
      6fd11b14
    • Roman Lebedev's avatar
      [NFC][X86] Fixup comment in CodeGen/X86/cmov.ll · 6de85095
      Roman Lebedev authored
      As noted in post-commit review for
      https://reviews.llvm.org/D59035#inline-631659
      6de85095
    • Simon Pilgrim's avatar
      [ARM] Regenerate vector lane store tests · fed8c068
      Simon Pilgrim authored
      fed8c068
    • Simon Pilgrim's avatar
      c7f85f3a
    • Nico Weber's avatar
      Revert "[RISCV] Support mutilib in baremetal environment" · 3de7cc9f
      Nico Weber authored
      This reverts commit b6d7bbfa.
      Driver/riscv64-toolchain.c fails on Windows.
      3de7cc9f
    • evgeny's avatar
      [ThinLTO] Simplify code. NFC · ef5e3b85
      evgeny authored
      ef5e3b85
    • Raphael Isemann's avatar
      [lldb] Also test Get[De]mangledName of SBType in TestSBTypeClassMembers.py · f6ffe6fc
      Raphael Isemann authored
      I just used the mangled names as this test is anyway a Darwin-only ObjC++ test.
      We probably should also test this on other platforms but that will be
      another commit as we need to untangle the ObjC and C++ parts first.
      f6ffe6fc
    • Mitchell Balan's avatar
      [clang-tidy] modernize-use-override new option AllowOverrideAndFinal · df111170
      Mitchell Balan authored
      Summary:
      In addition to adding `override` wherever possible, clang-tidy's `modernize-use-override` nicely removes `virtual` when `override` or `final` is specified, and further removes override when final is specified. While this is great default behavior, when code needs to be compiled with gcc at high warning levels that include `gcc -Wsuggest-override` or `gcc -Werror=suggest-override`, clang-tidy's removal of the redundant `override` keyword causes gcc to emit a warning or error. This discrepancy / conflict has been noted by others including a comment on Stack Overflow and by Mozilla's Firefox developers.
      
      This patch adds an AllowOverrideAndFinal option defaulting to 0 - thus preserving current behavior - that when enabled allows both `override` and `final` to co-exist, while still fixing all other issues.
      
      The patch includes a test file verifying all combinations of virtual/override/final, and mentions the new option in the release notes.
      
      Reviewers: alexfh, djasper, JonasToth
      
      Patch by: poelmanc
      
      Subscribers: JonasToth, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70165
      df111170
    • Mitchell Balan's avatar
      [clang-tidy] Fix readability-redundant-string-init for c++17/c++2a · 1315f4e0
      Mitchell Balan authored
      Summary:
      `readability-redundant-string-init` was one of several clang-tidy checks documented as failing for C++17. (The failure mode in C++17 is that it changes `std::string Name = ""`; to `std::string Name = Name;`, which actually compiles but crashes at run-time.)
      
      Analyzing the AST with `clang -Xclang -ast-dump` showed that the outer `CXXConstructExprs` that previously held the correct SourceRange were being elided in C++17/2a, but the containing `VarDecl` expressions still had all the relevant information. So this patch changes the fix to get its source ranges from `VarDecl`.
      
      It adds one test `std::string g = "u", h = "", i = "uuu", j = "", k;` to confirm proper warnings and fixit replacements in a single `DeclStmt` where some strings require replacement and others don't. The readability-redundant-string-init.cpp and readability-redundant-string-init-msvc.cpp tests now pass for C++11/14/17/2a.
      
      Reviewers: gribozavr, etienneb, alexfh, hokein, aaron.ballman, gribozavr2
      
      Patch by: poelmanc
      
      Subscribers: NoQ, MyDeveloperDay, Eugene.Zelenko, dylanmckay, cfe-commits
      
      Tags: #clang, #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D69238
      1315f4e0
    • Mitchell Balan's avatar
      f8901aff
    • Mitchell Balan's avatar
      41ee54e5
    • David Bozier's avatar
      [llvm-objdump] Print relocation addends in hexadecimal · 6baec971
      David Bozier authored
      Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format.
      
      Reviewers: MaskRay, grimar, jhenderson, bd1976llvm
      
      Reviewed By: jhenderson
      
      Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69997
      6baec971
    • Simon Pilgrim's avatar
      [X86][SSE] Remove XFormVExtractWithShuffleIntoLoad to prevent legalization infinite loops (PR43971) · bbf4af31
      Simon Pilgrim authored
      As detailed in PR43971/D70267, the use of XFormVExtractWithShuffleIntoLoad causes issues where we end up in infinite loops of extract(targetshuffle(vecload)) -> extract(shuffle(vecload)) -> extract(vecload) -> extract(targetshuffle(vecload)), there are just too many legalization checks at every stage that we can't guarantee that extract(shuffle(vecload)) -> scalarload can occur.
      
      At the moment we see a number of minor regressions as we don't fold extract(shuffle(vecload)) -> scalarload before legal ops, these can be addressed in future patches and extension of X86ISelLowering's combineExtractWithShuffle.
      bbf4af31
    • Raphael Isemann's avatar
      [lldb] Remove ClangExpressionDeclMap::ResolveUnknownTypes · 96d814a5
      Raphael Isemann authored
      Summary:
      This is some really shady code. It's supposed to kick in after an expression already failed and then try to look
      up "unknown types" that for some undocumented reason can't be resolved during/before parsing. Beside the
      fact that we never mark any type as `EVUnknownType` in either swift-lldb or lldb (which means this code is unreachable),
      this code doesn't even make the expression evaluation succeed if if would ever be executed but instead seems
      to try to load more debug info that maybe any following expression evaluations might succeed.
      
      This patch removes ClangExpressionDeclMap::ResolveUnknownTypes and the related data structures/checks/calls.
      
      Reviewers: davide
      
      Reviewed By: davide
      
      Subscribers: aprantl, abidh, JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D70388
      96d814a5
    • Thomas Preud'homme's avatar
      Fix PR44001: assert failure in getFunctionLocalOffsetAfterInsn · a89ca4ae
      Thomas Preud'homme authored
      Summary:
      Assert in getFunctionLocalOffsetAfterInsn() fails when processing a call
      MachineInstr inside a bundle and compiling with debug info. This is
      because labels are added by DwarfDebug::beginInstruction() which is
      called for each top-level MI by EmitFunctionBody()'s for-loop iteration
      but constructCallSiteEntryDIEs() which calls
      getFunctionLocalOffsetAfterInsn() iterates over all MIs.
      
      This commit modifies constructCallSiteEntryDIEs() to get the associated
      bundle MI for call MIs inside a bundle and use that to when calling
      getFunctionLocalOffsetAfterInsn() and getLabelAfterInsn(). It also skips
      loop iterations for bundle MIs since the loop statements are concerned
      with debug info for each physical instructions and bundles represent a
      group of instructions. It also fix the comment about PCAddr since the
      code is getting the return address and not the call address.
      
      Reviewers: dstenb, vsk, aprantl, djtodoro, dblaikie, NikolaPrica
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70293
      a89ca4ae