1. Dec 03, 2021
    • Jean Perier's avatar
      [flang] Return arrays in Transfer runtime with SIZE argument · 1c16b0db
      Jean Perier authored
      In TRANSFER runtime the result was an array only if the MOLD was an array.
      This is not in line with TRANSFER definition in 16.9.193 that rules that it
      must also be an array if MOLD is scalar and SIZE if provided.
      
      Differential Revision: https://reviews.llvm.org/D114943
      1c16b0db
    • Jessica Clarke's avatar
      [TableGen][SelectionDAG] Use ComplexPattern type for non-leaf nodes · c1048e3e
      Jessica Clarke authored
      When used as a non-leaf node, TableGen does not currently use the type
      of a ComplexPattern for type inference, which also means it does not
      check it doesn't conflict with the use. This differs from when used as a
      leaf value, where the type is used for inference. This addresses that
      discrepancy. The test case is not representative of most real-world uses
      but is sufficient to demonstrate inference is working.
      
      Some of these uses also make use of ValueTypeByHwMode rather than
      SimpleValueType and so the existing type inference is extended to
      support that alongside the new type inference.
      
      There are also currently various cases of using ComplexPatterns with an
      untyped type, but only for non-leaf nodes. For compatibility this is
      permitted, and uses the old behaviour of not inferring for non-leaf
      nodes, but the existing logic is still used for leaf values. This
      remaining discrepancy should eventually be eliminated, either by
      removing all such uses of untyped so the special case goes away (I
      imagine Any, or a more specific type in certain cases, would be
      perfectly sufficient), or by copying it to the leaf value case so
      they're consistent with one another if this is something that does need
      to keep being supported.
      
      All non-experimental targets have been verified to produce bit-for-bit
      identical TableGen output with this change applied.
      
      Reviewed By: kparzysz
      
      Differential Revision: https://reviews.llvm.org/D109035
      c1048e3e
    • Jessica Clarke's avatar
      [AArch64][NFC] Alter ComplexPattern types to be consistent with their uses · a3530dc1
      Jessica Clarke authored
      When used as a non-leaf node, TableGen does not currently use the type
      of a ComplexPattern for type inference, which also means it does not
      check it doesn't conflict with the use. This differs from when used as a
      leaf value, where the type is used for inference. Fixing that
      discrepancy is something I intend to upstream as a subsequent review.
      
      AArch64 currently has several ComplexPatterns that are used in contexts
      where they're expected to be an iPTR. The cases that lead to type
      contradictions are separated out in D108759, but there are additional
      differences to the TableGen output when using my locally-patched
      TableGen. None of these appear to matter, at least for passing all the
      CodeGen tests, but it's safer to avoid such changes (and similar changes
      were causing issues on some AMDGPU tests, causing failures to select).
      Changing these additional ComplexPatterns to use iPTR rather than i64
      ensures that the TableGen output remains bit-for-bit identical (compared
      to without having this patch and my TableGen patch, as well as the
      intermediate state of having this patch but not my TableGen patch), and
      more accurately captures the higher-level meaning of these patterns.
      
      Reviewed By: david-arm
      
      Differential Revision: https://reviews.llvm.org/D109034
      a3530dc1
    • Jessica Clarke's avatar
      [AMDGPU][NFC] Alter ComplexPattern types to be consistent with their uses · 3ee56eed
      Jessica Clarke authored
      When used as a non-leaf node, TableGen does not currently use the type
      of a ComplexPattern for type inference, which also means it does not
      check it doesn't conflict with the use. This differs from when used as a
      leaf value, where the type is used for inference. Fixing that
      discrepancy is something I intend to upstream as a subsequent review.
      
      AMDGPU currently has several ComplexPatterns that are used in contexts
      where they're expected to be an iPTR, and where using an iPTR instead of
      a fixed-width integer type matters. With my locally-patched TableGen,
      none of these mismatches result in type contradictions, but do change
      the patterns and cause various failures to select. These changes to the
      ComplexPatterns' types reflect how they are actually used, result in
      bit-for-bit identical TableGen output (without my local TableGen patch),
      and ensure that with improved type inference AMDGPU's backend will
      continue to work.
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D109032
      3ee56eed
    • Jessica Clarke's avatar
      [AArch64][NFC] Fix ComplexPattern types conflicting with uses · 0cb44cfb
      Jessica Clarke authored
      When used as a non-leaf node, TableGen does not currently use the type
      of a ComplexPattern for type inference, which also means it does not
      check it doesn't conflict with the use. This differs from when used as a
      leaf value, where the type is used for inference. Fixing that
      discrepancy is something I intend to upstream as a subsequent review,
      but these are all the type conflicts found (all legitimate) by my
      locally-patched TableGen.
      
      Reviewed By: paulwalker-arm
      
      Differential Revision: https://reviews.llvm.org/D108759
      0cb44cfb
    • Esme-Yi's avatar
      [NFC] move GNUELFDumper::printEnum() into a common header for reuse. · 62c74d49
      Esme-Yi authored
      Summary:
      	This is a NFC patch moving the GNUELFDumper<ELFT>::printEnum()
       function from ELFDumper into ScopedPrinter.h for reuse.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D114840
      62c74d49
    • Chuanqi Xu's avatar
      [Coroutines] Handle InvokeInst in SalvageDebugInfo · 84980761
      Chuanqi Xu authored
      Since coroutine would be splitted into pieces, compiler would move the
      dbg.declare intrinsic after the Storage is created to make sure the
      corresponding dbg instruction is still available aftet splitted.
      However, it would be problematic if the storage instruction is an
      InvokeInst, which is a terminator. We couldn't move instruction after an
      InvokeInst. This patch tries to move the dbg.declare intrinsic in the
      normal destination of the InvokeInst. It should make sense due to the
      Storage should be invalid in exception path.
      84980761
    • lh123's avatar
      [clangd] Show parameters for construct. · 7bb785cc
      lh123 authored
      Show parameters for construct.
      
      Reviewed By: kadircet
      
      Differential Revision: https://reviews.llvm.org/D114621
      7bb785cc
    • Lawrence D'Anna's avatar
      [lldb] add fallback for LLDB_PYTHON_RELATIVE_PATH · 27ca9458
      Lawrence D'Anna authored
      Some pythons are configured to set platlib somewhere outside of their
      sys.prefix.   It's important that we at least use some reasonable
      default for LLDB_PYTHON_RELATIVE_PATH even in that case, because
      even if the user overrides it on the cmake invocation, cmake will
      still be called without the override in order to build tablegen.
      
      Reviewed By: JDevlieghere, clayborg
      
      Differential Revision: https://reviews.llvm.org/D114973
      27ca9458
    • Kirill Stoimenov's avatar
      [ASan] Changed intrisic implemenation to use PLT safe registers. · 021ecbbb
      Kirill Stoimenov authored
      Changed registers to R10 and R11 because PLT resolution clobbers them. Also changed the implementation to use R11 instead of RCX, which saves a push/pop.
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D115002
      021ecbbb
    • Liqiang Tao's avatar
      [llvm][Inline] Add FunctionSimplificationPipeline to module inliner pipeline · 7e8f9d6b
      Liqiang Tao authored
      The FunctionSimplificationPipeline could effectively reduce the size of .text section when module inliner is enabled.
      
      Reviewed By: kazu
      
      Differential Revision: https://reviews.llvm.org/D114704
      7e8f9d6b
    • LLVM GN Syncbot's avatar
      [gn build] Port aba8f320 · 4380f505
      LLVM GN Syncbot authored
      4380f505
    • LLVM GN Syncbot's avatar
      [gn build] Port 2d9efcfe · 1633398c
      LLVM GN Syncbot authored
      1633398c
    • Jason Molenda's avatar
      Simplify logic to identify dyld_sim in Simulator debugging on macos · fddafa11
      Jason Molenda authored
      When debugging a Simulator process on macOS (e.g. the iPhone simulator),
      the process will have both a dyld, and a dyld_sim present.  The dyld_sim
      is an iOS Simulator binary.  The dyld is a macOS binary.  Both are
      MH_DYLINKER filetypes.  lldb needs to identify & set a breakpoint in
      dyld, so it has to distinguish between these two.
      
      Previously lldb was checking if the inferior target was x86 (indicating
      macOS) and the OS of the MH_DYLINKER binary was iOS/watchOS/etc -- if
      so, then this is dyld_sim and we should ignore it.  Now with arm64
      macOS systems, this check was invalid, and we would set our breakpoint
      for new binaries being loaded in dyld_sim, causing binary loading to
      be missed by lldb.
      
      This patch uses the Target's ArchSpec triple environment, to see if
      this process is a simulator process.  If this is a Simulator process,
      then we only recognize a MH_DYLINKER binary with OS type macOS as
      being dyld.
      
      This patch also removes some code that handled pre-2016 era debugservers
      which didn't give us the OS type for each binary.  This was only being
      used on macOS, where we don't need to handle the presence of very old
      debugservers.
      
      Differential Revision: https://reviews.llvm.org/D115001
      rdar://85907839
      fddafa11
    • Nico Weber's avatar
      [gn build] (manually) port 9c4d194f better · b3aa120f
      Nico Weber authored
      b3aa120f
    • Vitaly Buka's avatar
      [lsan] Deflake fork_and_leak test · 550fd071
      Vitaly Buka authored
      550fd071
    • Nico Weber's avatar
      [gn build] (manually) port 9c4d194f · 7cc681e6
      Nico Weber authored
      7cc681e6
    • Konstantin Varlamov's avatar
      [libc++][ranges] Implement [special.mem.concepts]. · 2d9efcfe
      Konstantin Varlamov authored
      Implement the exposition-only concepts specified in
      `[special.mem.concepts]`. These are all thin wrappers over other
      concepts.
      
      Reviewed By: #libc, Quuxplusone, ldionne
      
      Differential Revision: https://reviews.llvm.org/D114761
      2d9efcfe
    • Hongtao Yu's avatar
      [CSSPGO] Turn on Profi by default · 4e24ca1c
      Hongtao Yu authored
      As titled.
      
      Reviewed By: wenlei, wlei
      
      Differential Revision: https://reviews.llvm.org/D115011
      4e24ca1c
    • Mehdi Amini's avatar
      Using make_unique instead of `new` (NFC) · d2386ab6
      Mehdi Amini authored
      Fix a clang-tidy warning.
      d2386ab6
    • Geoffrey Martin-Noble's avatar
      [Bazel] Set the right default for LLVM_WINDOWS_PREFER_FORWARD_SLASH on Windows · dc5e1d06
      Geoffrey Martin-Noble authored
      This cmake configure option was added in
      df0ba47c, and was ported to
      Bazel in 7d323dc7.
      
      However, the setting chosen in Bazel seems accidental, not necessarily
      intentional.
      
      LLVM_WINDOWS_PREFER_FORWARD_SLASH has no effect on Unix, and on
      Windows, setting it to 0 is the default, which gets the same behaviour
      as before. Setting it to 1 enables new experimental behaviours
      (which is enabled by default on MinGW targets only).
      
      As I don't see any explicit intent to opt in to the new experimental
      behaviour, I believe the current configuration in bazel was a
      mistake.
      
      Differential Revision: https://reviews.llvm.org/D114065
      dc5e1d06
    • Keith Smiley's avatar
      [clang][Darwin] Remove old lld implementation handling · ace03d0d
      Keith Smiley authored
      This now assumes that for the darwin driver any lld is the "new" macho
      lld implementation.
      
      Differential Revision: https://reviews.llvm.org/D114974
      ace03d0d
    • Reid Kleckner's avatar
    • Mingming Liu's avatar
      Run update_test_checks.py on test cases. · 603a39b6
      Mingming Liu authored
      In this way, each instruction has a line, and diffs will be more clear.
      
      Differential Revision: https://reviews.llvm.org/D115006
      603a39b6
    • Reid Kleckner's avatar
    • Daniil Fukalov's avatar
      [CostModel][AMDGPU] Fix instructions costs estimation for vector types. · ab05ab59
      Daniil Fukalov authored
      1. Fixed vector instructions costs estimations incosistency - removed different
         logic for "not simple types" since it biases costs for these types.
      2. Fixed legalization penalty for vectors too big for the target: changed from
         overwrite default legalization cost value estimation to added penalty.
      3. Fixed few typos in tests.
      
      Reviewed By: rampitec
      
      Differential Revision: https://reviews.llvm.org/D114893
      ab05ab59
    • Greg Clayton's avatar
      Include extra input contents on this test so we can see why lldb-arm-ubuntu buildbot is failing. · 266a66c9
      Greg Clayton authored
      Only lldb-arm-ubuntu is failing after https://reviews.llvm.org/D114288 and there isn't enough input context to see why this is failing. It works on x86_64 linux just fine.
      266a66c9
    • Mogball's avatar
      [mlir][ods] update attr/type def format docs · 29d990e4
      Mogball authored
      29d990e4
    • Vy Nguyen's avatar
      [clang-tidy][objc] Finds and fixes improper usages of XCTAssertEquals and XCTAssertNotEquals. · aba8f320
      Vy Nguyen authored
      Using XCTAssertEqual on NSString* objects is almost always  wrong.
      
      Unfortunately, we have seen a lot of tests doing this and reyling on pointer equality for strings with the same values (which happens to work sometimes - depending on the linker, but this assumption is not guaranteed by the language)
      
      These fixes would make tests less brittle.
      
      Differential Revision: https://reviews.llvm.org/D114975
      aba8f320
    • Steven Wan's avatar
      [analyzer]Skip unstable CSA tests failing on several platforms · 9c4d194f
      Steven Wan authored
      Clang static analyzer uses bitwidth to infer the integer value type, that is, any 32-bit integer is considered of type `int`, and any 64-bit integer is considered of type `long`. This isn't always true, for instance, in ILP32 (e.g., 32-bit AIX), 32-bit could be `long`, and in LP64 (e.g., 64-bit wasm64), 64-bit could be `long long`.
      
      Reviewed By: steakhal
      
      Differential Revision: https://reviews.llvm.org/D114454
      9c4d194f
    • George Koehler's avatar
      [ELF][PPC32] Make R_PPC32_PLTREL retain .got · 885fb9a2
      George Koehler authored
      PLT usage needs the first 12 bytes of the .got section. We need to keep .got and
      DT_GOT_PPC even if .got/_GLOBAL_OFFSET_TABLE_ are not referenced (large PIC code
      may only reference .got2), which is the case in OpenBSD's ld.so, leading
      to a misleading error, "unsupported insecure BSS PLT object".
      
      Fix this by adding R_PPC32_PLTREL to the list of hasGotOffRel.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D114982
      885fb9a2
    • Matt Arsenault's avatar
      AMDGPU: Sanitized functions require implicit arguments · 0eebe2e3
      Matt Arsenault authored
      Do not infer no-amdgpu-implicitarg-ptr for sanitized functions. If a
      function is explicitly marked amdgpu-no-implicitarg-ptr and
      sanitize_address, infer that it is required.
      0eebe2e3
    • Ulysse Beaugnon's avatar
      [MLIR] Use a shared uniquer for affine maps and integer sets. · e45705ad
      Ulysse Beaugnon authored
      Affine maps and integer sets previously relied on a single lock for creating unique instances. In a multi-threaded setting, this lock becomes a contention point. This commit updates AffineMap and IntegerSet to use StorageUniquer instead. StorageUniquer internally uses sharded locks and thread-local caches to reduce contention. It is already used for affine expressions, types and attributes. On my local machine, this gives me a 5X speedup for an application that manipulates a lot of affine maps and integer sets.
      
      This commit also removes the integer set uniquer threshold. The threshold was used to avoid adding integer sets with a lot of constraints to the hash_map containing unique instances, but the constraints and the integer set were still allocated in the same allocator and never freed, thus not saving any space expect for the hash-map entry.
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D114942
      e45705ad
    • Vitaly Buka's avatar
      [NFC][sanitizer] Remove SetSoftRssLimitExceededCallback · 36e6a259
      Vitaly Buka authored
      According comments on D44404, something like that was the goal.
      
      Reviewed By: morehouse, kstoimenov
      
      Differential Revision: https://reviews.llvm.org/D114991
      36e6a259
    • Vitaly Buka's avatar
      3195610b
    • David Blaikie's avatar
      libcxx pretty printers: remove non-lazy_string fallback · 1f2492b7
      David Blaikie authored
      This has been supported on gdb for something like ~10 years, so doesn't
      seem necessary to carry a fallback.
      
      Differential Revision: https://reviews.llvm.org/D114986
      1f2492b7
    • Paul Robinson's avatar
      [TLI checker] Follow good practice with -COUNT directives · 7bef4929
      Paul Robinson authored
      FileCheck's -COUNT suffix doesn't fail if there are more matches
      than you asked for, so it's good practice to put a -NOT after.
      7bef4929
    • Yitzhak Mandelbaum's avatar
      [clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks. · 081074e1
      Yitzhak Mandelbaum authored
      This patch parameterizes the clang-tidy diagnostic consumer with a boolean that
      controls whether to honor NOLINTBEGIN/NOLINTEND blocks. The current support for
      scanning these blocks is very costly -- O(n*m) in the size of files (n) and
      number of diagnostics found (m), with a large constant factor.  So, the patch
      allows clients to disable it.
      
      Future patches should make the feature more efficient, but this will mitigate in
      the interim.
      
      Differential Revision: https://reviews.llvm.org/D114981
      081074e1
    • Groverkss's avatar
      [MLIR][FlatAffineConstraints] Remove duplicate divisions while merging local ids · d257f7c1
      Groverkss authored
      This patch implements detecting duplicate local identifiers by extracting their
      division representation while merging local identifiers.
      
      For example, given the FACs A, B:
      
      ```
      A: (x, y)[s0] : (exists d0 = [x / 4], d1 = [y / 4]: d0 <= s0, d1 <= s0, x + y >= 2)
      B: (x, y)[s0] : (exists d0 = [x / 4], d1 = [y / 4]: d0 <= s0, d1 <= s0, x + y >= 5)
      ```
      
      The intersection of A and B without this patch would lead to the following FAC:
      
      ```
      (x, y)[s0] : (exists d0 = [x / 4], d1 = [y / 4], d2 = [x / 4], d3 = [x / 4]: d0 <= s0, d1 <= s0, d2 <= s0, d3 <= s0, x + y >= 2, x + y >= 5)
      ```
      
      after this patch, merging of local ids will detect that `d0 = d2` and `d1 = d3`,
      and the intersection of these two FACs will be (after removing duplicate constraints):
      
      ```
      (x, y)[s0] : (exists d0 = [x / 4], d1 = [y / 4] : d0 <= s0, d1 <= s0, x + y >= 2, x + y >= 5)
      ```
      
      This reduces the number of constraints by 2 (constraints) + 4 (2 constraints for each extra division) for this case.
      
      This is used to reduce the output size representation of operations like
      PresburgerSet::subtract, PresburgerSet::intersect which require merging local
      variables.
      
      Reviewed By: arjunp, bondhugula
      
      Differential Revision: https://reviews.llvm.org/D112867
      d257f7c1
    • Groverkss's avatar
      Revert changes that should have been sent as a patch · cff427ee
      Groverkss authored
      Revert changes that were meant to be sent as a single commit with
      summary for the differential review, but were accidently sent directly.
      
      This reverts commit 3bc5353f.
      cff427ee