1. Mar 04, 2021
  2. Mar 03, 2021
    • Nathan James's avatar
      [clang-query] Fix help text after D91918 · e7080aa2
      Nathan James authored
      After rG5e180181 The help command still lists IgnoreImplicitCastsAndParentheses as a valid option.
      
      Reviewed By: aaron.ballman, rsmith
      
      Differential Revision: https://reviews.llvm.org/D97806
      e7080aa2
    • Simon Pilgrim's avatar
      [X86] Fold scalar_to_vector(x) -> extract_subvector(broadcast(x),0) iff broadcast(x) exists · aa4afebb
      Simon Pilgrim authored
      Add handling for reusing an existing broadcast(x) to a wider vector.
      aa4afebb
    • David Tenty's avatar
      [AIX][clang][driver] Restrict /usr/lib to internal library search paths · 66799bf0
      David Tenty authored
      Adding it to the general filepaths results in it being added to the
      linker arguments. The AIX linker always looks in this path anyway
      and adds it as a default library path component. Adding this duplicate
      explicitly results in duplicate entries in path in the loader section
      of executables and messes up tools like CMake that parse the default
      library flags.
      
      Reviewed By: ZarkoCA
      
      Differential Revision: https://reviews.llvm.org/D97574
      66799bf0
    • Daniel McIntosh's avatar
      [test] Fix apparent typo in clang/test/Driver/std.c · 9403b59a
      Daniel McIntosh authored
      Currently the test on line 3 is identical to the test on line 1.
      Looking at the rest of the file (particularily the use of FOVERRIDE
      as the check-prefix), I think it's pretty clear that this line
      was supposed to use `-ftrigraphs` instead of `-trigraphs`.
      
      Reviewed By: thakis
      
      Differential Revision: https://reviews.llvm.org/D97796
      9403b59a
    • Benjamin Kramer's avatar
      [mlir][Shape] Make shape_eq nary · 24acadef
      Benjamin Kramer authored
      This gets rid of a dubious shape_eq %a, %a fold, that folds shape_eq
      even if %a is not an Attribute.
      
      Differential Revision: https://reviews.llvm.org/D97728
      24acadef
    • Nico Weber's avatar
      Revert "[InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF" · 64f5d7e9
      Nico Weber authored
      This reverts commit 04c3040f.
      Breaks instrprof-value-merge.c in bootstrap builds.
      64f5d7e9
    • Benjamin Kramer's avatar
      [mlir][Shape] Make cstr_eq more like cstr_broadcastable · c714b441
      Benjamin Kramer authored
      This includes allowing extents and not just shapes.
      
      Differential Revision: https://reviews.llvm.org/D97716
      c714b441
    • Melanie Blower's avatar
      cc3d25be
    • Aaron Ballman's avatar
      Implement P2173 for attributes on lambdas · b2bc0a32
      Aaron Ballman authored
      https://wg21.link/P2173 is making its way through WG21 currently and
      has not been formally adopted yet. This feature provides very useful
      functionality in that you can specify attributes on the various
      function *declarations* generated by a lambda expression, where the
      current C++ grammar only allows attributes which apply to the various
      function *types* so generated.
      
      This patch implements P2173 on the assumption that it will be adopted
      by WG21 with this syntax for C++23.
      b2bc0a32
    • Anastasia Stulova's avatar
      [OpenCL] Prevent adding extension pragma by default. · 25ad188b
      Anastasia Stulova authored
      This commit refactors extension support to allow
      specifying whether pragma is needed or not explicitly.
      
      For backward compatibility pragmas are set to required
      for all extensions that were added prior to this but
      not for OpenCL 3.0 features.
      
      Differential Revision: https://reviews.llvm.org/D97052
      25ad188b
    • Hans Wennborg's avatar
      Revert "[ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of... · 0a5dd067
      Hans Wennborg authored
      Revert "[ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR"
      
      This caused miscompiles of Chromium tests for iOS due clobbering of live
      registers. See discussion on the code review for details.
      
      > Background:
      >
      > This fixes a longstanding problem where llvm breaks ARC's autorelease
      > optimization (see the link below) by separating calls from the marker
      > instructions or retainRV/claimRV calls. The backend changes are in
      > https://reviews.llvm.org/D92569.
      >
      > https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-autoreleasereturnvalue
      >
      > What this patch does to fix the problem:
      >
      > - The front-end adds operand bundle "clang.arc.attachedcall" to calls,
      >   which indicates the call is implicitly followed by a marker
      >   instruction and an implicit retainRV/claimRV call that consumes the
      >   call result. In addition, it emits a call to
      >   @llvm.objc.clang.arc.noop.use, which consumes the call result, to
      >   prevent the middle-end passes from changing the return type of the
      >   called function. This is currently done only when the target is arm64
      >   and the optimization level is higher than -O0.
      >
      > - ARC optimizer temporarily emits retainRV/claimRV calls after the calls
      >   with the operand bundle in the IR and removes the inserted calls after
      >   processing the function.
      >
      > - ARC contract pass emits retainRV/claimRV calls after the call with the
      >   operand bundle. It doesn't remove the operand bundle on the call since
      >   the backend needs it to emit the marker instruction. The retainRV and
      >   claimRV calls are emitted late in the pipeline to prevent optimization
      >   passes from transforming the IR in a way that makes it harder for the
      >   ARC middle-end passes to figure out the def-use relationship between
      >   the call and the retainRV/claimRV calls (which is the cause of
      >   PR31925).
      >
      > - The function inliner removes an autoreleaseRV call in the callee if
      >   nothing in the callee prevents it from being paired up with the
      >   retainRV/claimRV call in the caller. It then inserts a release call if
      >   claimRV is attached to the call since autoreleaseRV+claimRV is
      >   equivalent to a release. If it cannot find an autoreleaseRV call, it
      >   tries to transfer the operand bundle to a function call in the callee.
      >   This is important since the ARC optimizer can remove the autoreleaseRV
      >   returning the callee result, which makes it impossible to pair it up
      >   with the retainRV/claimRV call in the caller. If that fails, it simply
      >   emits a retain call in the IR if retainRV is attached to the call and
      >   does nothing if claimRV is attached to it.
      >
      > - SCCP refrains from replacing the return value of a call with a
      >   constant value if the call has the operand bundle. This ensures the
      >   call always has at least one user (the call to
      >   @llvm.objc.clang.arc.noop.use).
      >
      > - This patch also fixes a bug in replaceUsesOfNonProtoConstant where
      >   multiple operand bundles of the same kind were being added to a call.
      >
      > Future work:
      >
      > - Use the operand bundle on x86-64.
      >
      > - Fix the auto upgrader to convert call+retainRV/claimRV pairs into
      >   calls with the operand bundles.
      >
      > rdar://71443534
      >
      > Differential Revision: https://reviews.llvm.org/D92808
      
      This reverts commit ed4718ec.
      0a5dd067
    • Hans Wennborg's avatar
    • Kadir Cetinkaya's avatar
      [clangd] Make WorkspaceSymbols request work with empty queries · 188373fb
      Kadir Cetinkaya authored
      Clangd uses codecompletion limit as the limit for workspacesymbols, so
      in theory this should only be an order of magnitude slower than a
      codecompletion request with empty identifier (as code completion limits
      the available symbols).
      
      This is also what LSP suggests "Clients may send an empty string here to request all symbols.".
      Clangd doesn't really fulfill the "all" part of that statement, but we
      never do unless user set the index query limit to zero explicitly.
      
      Differential Revision: https://reviews.llvm.org/D97773
      188373fb
    • Ayke van Laethem's avatar
      [AVR] Fix def state of operands · 15f495c0
      Ayke van Laethem authored
      Some instructions (especially mov+pop instructions) were setting the
      wrong operands. For example, the pop instruction had the register set as
      a source operand while it is a destination operand (the value is loaded
      into the register).
      
      I have found these issues using the machine verifier and using manual
      code inspection.
      
      Differential Revision: https://reviews.llvm.org/D97159
      15f495c0
    • Ayke van Laethem's avatar
      [AVR] Fix expansion of NEGW · bbfef8ac
      Ayke van Laethem authored
      The previous expansion used SBCI, which is incorrect because the NEGW
      pseudo instruction accepts a DREGS operand (2xGPR8) and SBCI only allows
      LD8 registers. One solution could be to correct the NEGW pseudo
      instruction, but another solution is to use a different instruction
      (sbc) that does accept a GPR8 register and therefore allows more freedom
      to the register allocator.
      
      The output now matches avr-gcc for the following code:
      
          int foo(int n) {
              return -n;
          }
      
      I've found this issue using the machine instruction verifier: it was
      complaining about the wrong register class in NEGWRd.mir.
      
      Differential Revision: https://reviews.llvm.org/D97131
      bbfef8ac
    • Ayke van Laethem's avatar
      [AVR] Add register aliases XL, YH, etc · 4f6d7985
      Ayke van Laethem authored
      These aliases are sometimes used in assembly code and make the code more
      readable. They are supported by avr-gcc too.
      
      Differential Revision: https://reviews.llvm.org/D96492
      4f6d7985
    • Matt Arsenault's avatar
      GlobalISel: Add default implementation of assignValueToReg · 78dcff48
      Matt Arsenault authored
      Refactor insertion of the asserting ops. This enables using them for
      AMDGPU.
      
      This code should essentially be the same for every target. Mips, X86
      and ARM all have different code there now, but this seems to be an
      accident. The assignment functions are called with different types
      than they would be in the DAG, so this is all likely an assortment of
      hacks to get around that.
      78dcff48
    • Aaron Ballman's avatar
      Improve static_assert/_Static_assert diagnostics · 8da09038
      Aaron Ballman authored
      Our diagnostics relating to static assertions were a bit confused. For
      instance, when in MS compatibility mode in C (where we accept
      static_assert even without including <assert.h>), we would fail
      to warn the user that they were using the wrong spelling (even in
      pedantic mode), we were missing a compatibility warning about using
      _Static_assert in earlier standards modes, diagnostics for the optional
      message were not reflected in C as they were in C++, etc.
      8da09038
    • Piotr Sobczak's avatar
      [AMDGPU] Introduce Strict WQM mode · 4672bac1
      Piotr Sobczak authored
      * Add amdgcn_strict_wqm intrinsic.
      * Add a corresponding STRICT_WQM machine instruction.
      * The semantic is similar to amdgcn_strict_wwm with a notable difference that not all threads will be forcibly enabled during the computations of the intrinsic's argument, but only all threads in quads that have at least one thread active.
      * The difference between amdgc_wqm and amdgcn_strict_wqm, is that in the strict mode an inactive lane will always be enabled irrespective of control flow decisions.
      
      Reviewed By: critson
      
      Differential Revision: https://reviews.llvm.org/D96258
      4672bac1
    • Vladislav Vinogradov's avatar
      [mlir][ODS] Use StringLiteral instead of StringRef when applicable · 5d613e42
      Vladislav Vinogradov authored
      Use `StringLiteral` for function return type if it is known to return
      constant string literals only.
      
      This will make it visible to API users, that such values can be safely
      stored, since they refers to constant data, which will never be deallocated.
      
      `StringRef` is general is not safe to store for a long term,
      since it might refer to temporal data allocated in heap.
      
      Add `inline` and `constexpr` methods support to `OpMethod`.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D97390
      5d613e42
    • Vladislav Vinogradov's avatar
      [mlir][NFC] Use `BaseMemRefType::isValidElementType` in Parser · e3b350ce
      Vladislav Vinogradov authored
      Instead of hard-coded check.
      
      Reviewed By: ftynse, rriddle
      
      Differential Revision: https://reviews.llvm.org/D97612
      e3b350ce
    • Christian Sigg's avatar
      [mlir] Silence -Wglobal-constructors error in CudaRuntimeWrapper.cpp · b6ac26fc
      Christian Sigg authored
      Until I have a better solution with dynamic initialization, to get
      the nvidia build bot green again.
      b6ac26fc
    • Raphael Isemann's avatar
      [lldb][NFC] Delete unused AddressResolverName · 820a8466
      Raphael Isemann authored
      That's all just dead code that hasn't been changed in years.
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D97760
      820a8466
    • Christian Sigg's avatar
      [mlir] Move cuda tests · 9d7be77b
      Christian Sigg authored
      Move test inputs to test/Integration directory.
      Move runtime wrappers to ExecutionEngine.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D97463
      9d7be77b
    • Stephen Kelly's avatar
      [ASTMatchers] Make Param functors variadic · 243cd0af
      Stephen Kelly authored
      Differential Revision: https://reviews.llvm.org/D97156
      243cd0af
    • Sam McCall's avatar
      [clangd] Fix uninit member · 1a4990a4
      Sam McCall authored
      1a4990a4
    • JinGu Kang's avatar
      [AArch64] Add missing intrinsics for vcls · 394a4d04
      JinGu Kang authored
      Differential Revision: https://reviews.llvm.org/D97775
      394a4d04
    • Mikael Holmen's avatar
      [lld][MachO] Silence "enumeral and non-enumeral type" warning from gcc · 85b67d5f
      Mikael Holmen authored
      gcc complained with
      
      [1110/1140] Building CXX object tools/lld/MachO/CMakeFiles/lldMachO2.dir/SyntheticSections.cpp.o
      ../../lld/MachO/SyntheticSections.cpp: In function 'int16_t ordinalForDylibSymbol(const lld::macho::DylibSymbol&)':
      ../../lld/MachO/SyntheticSections.cpp:287:14: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
        286 |   return config->namespaceKind == NamespaceKind::flat || dysym.isDynamicLookup()
            |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        287 |              ? MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        288 |              : dysym.getFile()->ordinal;
            |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
      85b67d5f
    • Andy Yankovsky's avatar
      [lldb] Fix handling of `DW_AT_decl_file` according to D91014 (attempt #2) · 3b47bd32
      Andy Yankovsky authored
      Apply changes from https://reviews.llvm.org/D91014 to other places where DWARF entries are being processed.
      
      Test case is provided by @jankratochvil.
      The test is marked to run only on x64 and exclude Windows and Darwin, because the assembly is not OS-independent.
      
      (First attempt https://reviews.llvm.org/D96778 broke the build bots)
      
      Reviewed By: jankratochvil
      
      Differential Revision: https://reviews.llvm.org/D97765
      3b47bd32
    • Piotr Sobczak's avatar
      [AMDGPU] Rename amdgcn_wwm to amdgcn_strict_wwm · c3ce7bae
      Piotr Sobczak authored
       * Introduce the new intrinsic amdgcn_strict_wwm
       * Deprecate the old intrinsic amdgcn_wwm
      
      The change is done for consistency as the "strict"
      prefix will become an important, distinguishing factor
      between amdgcn_wqm and amdgcn_strictwqm in the future.
      
      The "strict" prefix indicates that inactive lanes do not
      take part in control flow, specifically an inactive lane
      enabled by a strict mode will always be enabled irrespective
      of control flow decisions.
      
      The amdgcn_wwm will be removed, but doing so in two steps
      gives users time to switch to the new name at their own pace.
      
      Reviewed By: critson
      
      Differential Revision: https://reviews.llvm.org/D96257
      c3ce7bae
    • Carl Ritson's avatar
      [AMDGPU] Rename llvm.amdgcn.msaa.load to llvm.amdgcn.msaa.load.x · 2ddac69f
      Carl Ritson authored
      While the underlying instruction is called image_msaa_load,
      the resource must be x component only.
      Rename the intrinsic for clarity.
      
      Reviewed By: foad
      
      Differential Revision: https://reviews.llvm.org/D97829
      2ddac69f
    • Thomas Preud'homme's avatar
      [FileCheck] Do not skip end of line in diagnostics · 09c35739
      Thomas Preud'homme authored
      When commit da108b4e introduced
      the CHECK-NEXT directive, it added logic to skip to the next line when
      printing a diagnostic if the current matching position is at the end of
      a line. This was fine while FileCheck did not support regular expression
      but since it does now it can be confusing when the pattern to match
      starts with the expectation of a newline (e.g. CHECK-NEXT: {{\n}}foo).
      It is also inconsistent with the column information in the diagnostic
      which does point to the end of line.
      
      This commit removes this logic altogether, such that failure to match
      diagnostic for such cases would show the end of line and be consistent
      with the column information. The commit also adapts all existing
      testcases accordingly.
      
      Note to reviewers: An alternative approach would be to restrict the code
      to only skip to the next line if the first character of the pattern is
      known not to match a whitespace-like character. This would respect the
      original intent but keep the inconsistency in terms of column info and
      requires more code. I've only chosen this current approach by laziness
      and would be happy to restrict the logic instead.
      
      Reviewed By: jdenny, jhenderson
      
      Differential Revision: https://reviews.llvm.org/D93341
      09c35739
    • Petr Hosek's avatar
      [runtimes] Use standalone build only for compiler-rt · 6e3946c9
      Petr Hosek authored
      compiler-rt needs to use standalone build because of the assumptions
      made by its build, but other runtimes can use non-standalone build.
      
      Differential Revision: https://reviews.llvm.org/D97575
      6e3946c9
    • David Green's avatar
      [ARM] Ensure undef is propagated to CBZ/CBNZ flags · ab280cba
      David Green authored
      In some rare circumstances we can be using an undef register for a
      compare. When folded into a CBZ/CBNZ the undef flags are lost, leading
      to machine verifier problems. This propagates the existing flags to the
      new instruction.
      ab280cba
    • Andy Wingo's avatar
      [WebAssembly] Swap operand order of call_indirect in text format · 4307069d
      Andy Wingo authored
      The WebAssembly text and binary formats have different operand orders
      for the "type" and "table" fields of call_indirect (and
      return_call_indirect).  In LLVM we use the binary order for the MCInstr,
      but when we produce or consume the text format we should use the text
      order.  For compilation units targetting WebAssembly 1.0 (without the
      reference types feature), we omit the table operand entirely.
      
      Differential Revision: https://reviews.llvm.org/D97761
      4307069d