1. Jul 07, 2022
    • David Spickett's avatar
      [lldb][Windows] Fixup overlapping memory regions tests · f3d43eca
      David Spickett authored
      As suggested in post-commit review on https://reviews.llvm.org/D129272.
      
      * Rename the test case.
      * Simplify the overlap check.
      * Correct assertion.
      f3d43eca
    • Mark de Wever's avatar
      [libc++][format] Implements 128-bit support. · 0857a02e
      Mark de Wever authored
      With to_chars supporting 128-bit it's possible to support the full
      128-bit range in format. This only removes the previous restrictions
      and updates the tests to validate proper support.
      
      Depends on D128929.
      
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D129007
      0857a02e
    • Pavel Labath's avatar
      [lldb/test] Use the shim executable for TestGdbRemoteAttach*Or*Wait as well · d955185b
      Pavel Labath authored
      Without it, the test may nondeterminstically fail due to YAMA
      restrictions.
      
      Also, merge the two tests into one to reduce duplication.
      d955185b
    • Mark de Wever's avatar
      [libc++] Implements 128-bit support in to_chars. · 3f786833
      Mark de Wever authored
      This is required by the Standard and makes it possible to add full
      128-bit support to format.
      
      The patch also fixes 128-bit from_chars "support". One unit test
      required a too large value, this failed on 128-bit; the fix was to add
      more characters to the input.
      
      Note only base 10 has been optimized. Other bases can be optimized.
      
      Note the 128-bit lookup table could be made smaller. This will be done later. I
      really want to get 128-bit working in to_chars and format in the upcomming
      LLVM 15 release, these optimizations aren't critical.
      
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D128929
      3f786833
    • Max Kazantsev's avatar
      [Test] Add some tests showing missing opportunities in IndVars · b4466bcd
      Max Kazantsev authored
      The general idea of these tests is elimination of signed and unsigned
      comparison of the same values through proving non-negativity of them.
      Here are some examples where SCEV is not smart enough to prove it.
      b4466bcd
    • Aleksandr Bezzubikov's avatar
      [SPIR-V] Introduce SPIR-V global entities tracking and deduplication infra. · fa2a7a25
      Aleksandr Bezzubikov authored
      SPIR-V module typically contains some global entities that were not
      global before made it to SPIR-V, e.g. types and constants are not usually
      declared globally in LLVM. By design SPIR-V requires such stuff to be declared
      once and in the module's global section. Since MIR is not able to represent
      such things properly they were generated per-function, and then at the very end
      of the backend's pipeline hoisted into some 'meta' function minding possible
      duplicates.
      
      New SPIRVDuplicatesTracker keeps mapping of the original LLVM entities such
      as types, constant, global variables, etc to their MIR counterparts -
      (MachineFunction, Register). Later SPIRVModuleAnalysis (apart from other
      thing it's responsible for) performs topological sorting of the
      tracker's entries to ensure proper ordering before the hoisting,
      and actually performs the hoisting in a duplicates-free manner
      by the tracker's nature.
      
      Differential Revision: https://reviews.llvm.org/D128471
      fa2a7a25
    • David Green's avatar
      [ARM] Switch the costs of mve1beat and mve4beat · 438ffdb8
      David Green authored
      These three subtarget features are meant to control where MVE
      instructions take 1 vs 2 vs 4 architectural beats. The mve1beat feature
      is described as "Model MVE instructions as a 1 beat per tick
      architecture", meaning MVE instruction will execute over 4 cycles.
      mve4beat is the opposite where the entire 4 beats of the MVE instruction
      execute in a single cycle. The costs for the two were backwards though,
      not matching the cycle counts like they should. This patch switches the
      costs on the two to bring them in-line with expectations.
      
      Differential Revision: https://reviews.llvm.org/D129141
      438ffdb8
    • Alex Brachet's avatar
      [libc] Make div test names unique · a442c628
      Alex Brachet authored
      In Fuchsia, all tests in a directory, ie stdlib, are linked
      into one executable, this causes problems for multiple
      definitions of the vtables of the div tests because their
      class has the same name. This patch just trivially changes
      their name to be unique between all div tests.
      
      Differential revision: https://reviews.llvm.org/D129248
      a442c628
    • Michał Górny's avatar
      Revert "[lldb] [test] Improve stability of llgs vCont-threads tests" · fad93cd6
      Michał Górny authored
      This reverts commit 86e47231.
      It breaks Debian buildbot, for some reason.
      fad93cd6
    • Krzysztof Drewniak's avatar
      [mlir][AMDGPU] Add --chipset option to AMDGPUToROCDL · cab44c51
      Krzysztof Drewniak authored
      Because the buffer descriptor structure (the V#) has no backwards-compatibility
      guarentees, and since said guarantees have been violated in practice
      (see https://github.com/llvm/llvm-project/issues/56323 ), and since
      the `targetIsRDNA` attribute isn't something that higher-level clients can set
      in general, make the lowering of the amdgpu dialect to rocdl take a --chipset
      option.
      
      Note that this option is a string because adding a parser for the Chipset
      struct to llvm::cl wasn't working out.
      
      Reviewed By: herhut
      
      Differential Revision: https://reviews.llvm.org/D129228
      cab44c51
    • KOLANICH's avatar
      [Driver] Improve linking options for target AVR · 2d01a857
      KOLANICH authored
      Move user specified inputs to the linking group in case
      they and the stardard libraries have mutual reference.
      
      Reviewed By: benshi001
      
      Differential Revision: https://reviews.llvm.org/D127501
      2d01a857
    • Michał Górny's avatar
      [lldb] [test] Improve stability of llgs vCont-threads tests · 86e47231
      Michał Górny authored
      Perform a major refactoring of vCont-threads tests in order to attempt
      to improve their stability and performance.
      
      Split test_vCont_run_subset_of_threads() into smaller test cases,
      and split the whole suite into two files: one for signal-related tests,
      the running-subset-of tests.
      
      Eliminate output_match checks entirely, as they are fragile to
      fragmentation of output.  Instead, for the initial thread list capture
      raise an explicit SIGSTOP from inside the test program, and for
      the remaining output let the test program run until exit, and check all
      the captured output afterwards.
      
      For resume tests, capture the LLDB's thread view before and after
      starting new threads in order to determine the IDs corresponding
      to subthreads rather than relying on program output for that.
      
      Add a mutex for output to guarantee serialization.  A barrier is used
      to guarantee that all threads start before SIGSTOP, and an atomic bool
      is used to delay prints from happening until after SIGSTOP.
      
      Call std::this_thread::yield() to reduce the risk of one of the threads
      not being run.
      
      This fixes the test hangs on FreeBSD.  Hopefully, it will also fix all
      the flakiness on buildbots.
      
      Sponsored by: The FreeBSD Foundation
      Differential Revision: https://reviews.llvm.org/D129012
      86e47231
    • Nicolas Vasilache's avatar
      [mlir][Transform] Make applyToOne return a DiagnosedSilenceableFailure · 52307109
      Nicolas Vasilache authored
      This revision revisits the implementation of applyToOne and its handling
      of recoverable errors as well as propagation of null handles.
      The implementation is simplified to always require passing a vector<Operation*>
      in which the results are returned, resulting in less template instantiation magic.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D129185
      52307109
    • Eric Astor's avatar
      [ms] [llvm-ml] Add support for anonymous labels (`@@`, `@B`, `@F`) · 7d1a2954
      Eric Astor authored
      ml.exe and ml64.exe support the use of anonymous labels, with @B and @F referring to the previous and next anonymous label respectively.
      
      We add similar support to llvm-ml, with the exception that we are unable to emit an error message for an @F expression not followed by a @@ label.
      
      Reviewed By: rnk
      
      Differential Revision: https://reviews.llvm.org/D128944
      7d1a2954
    • Pavel Labath's avatar
      [lldb/test] Add a couple of libc++ std::string layouts · 8262ff44
      Pavel Labath authored
      .. to the "string simulator" test. These layouts were used at some point in
      the past few months, and are already supported by the code.
      8262ff44
    • Denis Antrushin's avatar
      [IR][OpaquePointers] Properly print cmpxchg with pointer operands. · 26f36939
      Denis Antrushin authored
      With opaque pointers address of pointer variable and its value have
      same type (`ptr`). As a result, cmpxchg is printed without values
      types in LLVM assembly and cannot be read back. Add AtomicCmpXchg
      to the list of instructions which always have operand types printed.
      
      Reviewed By: nikic
      
      Differential Revision: https://reviews.llvm.org/D129276
      26f36939
    • Groverkss's avatar
      [MLIR][Presburger] Refactor division representation to DivisionRepr · 479c4f64
      Groverkss authored
      This patch refactors existing implementations of division representation storage
      into a new class, DivisionRepr. This refactoring is done so that the common
      division utilities can be shared in an upcoming patch.
      
      Reviewed By: arjunp
      
      Differential Revision: https://reviews.llvm.org/D129146
      479c4f64
    • David Spickett's avatar
      [lldb][Windows] Fix memory region base addresses when a range is split · 1ca8a978
      David Spickett authored
      Previously we recorded AllocationBase as the base address of the region
      we get from VirtualQueryEx. However, this is the base of the allocation,
      which can later be split into more regions.
      
      So you got stuff like:
      [0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
      [0x00007fff377c0000-0x00007fff37840000) r-x .text
      [0x00007fff377c0000-0x00007fff37870000) r-- .rdata
      
      Where all the base addresses were the same.
      
      Instead, use BaseAddress as the base of the region. So we get:
      [0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
      [0x00007fff377c1000-0x00007fff37840000) r-x .text
      [0x00007fff37840000-0x00007fff37870000) r-- .rdata
      
      https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_information
      
      The added test checks for any overlapping regions which means
      if we get the base or size wrong it'll fail. This logic
      applies to any OS so the test isn't restricted to Windows.
      
      Reviewed By: labath
      
      Differential Revision: https://reviews.llvm.org/D129272
      1ca8a978
    • Pavel Labath's avatar
      [lldb] Fixup TestLoadAfterAttach for 82ba3f44 · 11a09692
      Pavel Labath authored
      After 82ba3f44, we (again) need to call lldb_enable_attach to be able to
      attach to processes on linux. This was a new test, so it does not have
      the necessary boilerplate.
      11a09692
    • Xiaodong Liu's avatar
      [ORC][MIPS} Correct template parameter for stubAndPointerRangesOk function on Mips · 17c790ca
      Xiaodong Liu authored
      It might be an oversight that pass OrcAArch64 as template parameter to stubAndPointerRangesOk on MIps.
      
      Reviewed By: lhames
      
      Differential Revision: https://reviews.llvm.org/D129076
      17c790ca
    • Haojian Wu's avatar
      cd3aa338
    • Pavel Labath's avatar
      Recommit "[lldb/test] Don't use preexec_fn for launching inferiors" · 82ba3f44
      Pavel Labath authored
      This recommits b15b1421, which reverted in was reverted in f51c47d9 due to
      failures on apple systems. The problem was that the patch introduced a race
      where the debug server could start the attach process before the first process
      (which isn't supposed to be attached to) was set up. This caused us to attach
      to the wrong process.
      
      The new version introduces additional synchronization to ensure that does not
      happen.
      
      Original commit message was:
      As the documentation states, using this is not safe in multithreaded
      programs, and I have traced it to a rare deadlock in some of the tests.
      
      The reason this was introduced was to be able to attach to a program
      from the very first instruction, where our usual mechanism of
      synchronization -- waiting for a file to appear -- does not work.
      
      However, this is only needed for a single test
      (TestGdbRemoteAttachWait) so instead of doing this everywhere, I create
      a bespoke solution for that single test. The solution basically
      consists of outsourcing the preexec_fn code to a separate (and
      single-threaded) shim process, which enables attaching and then executes
      the real program.
      
      This pattern could be generalized in case we needed to use it for other
      tests, but I suspect that we will not be having many tests like this.
      
      This effectively reverts commit
      a997a1d7.
      82ba3f44
    • Nicolai Hähnle's avatar
      64a78c85
    • Nicolai Hähnle's avatar
      llvm-c: Add LLVMDeleteInstruction to fix a test issue · fdf7e437
      Nicolai Hähnle authored
      Not deleting the loose instruction with metadata associated to it causes
      an assertion when the LLVMContext is destroyed. This was previously
      hidden by the fact that llvm-c-test does not call LLVMShutdown. The
      planned removal of ManagedStatic exposed this issue.
      
      Differential Revision: https://reviews.llvm.org/D129114
      fdf7e437
    • Tim Northover's avatar
      lld test fix: don't check the precise hex emitted as a comment. · 0f4339a8
      Tim Northover authored
      It can vary depending on the platform, so as with the NO-FMA test just check
      for "0x".
      0f4339a8
    • Tim Northover's avatar
    • Matthias Springer's avatar
      [mlir][bufferization][NFC] Move more unknown type conversion logic into BufferizationOptions · 606f7c8f
      Matthias Springer authored
      The `unknownTypeConversion` bufferization option (enum) is now a type converter function option. Some logic of `getMemRefType` is now handled by that function.
      
      This change makes type conversion more controllable. Previously, there were only two options when generating memref types for non-bufferizable ops: Static identity layout or fully dynamic layout. With this change, users of One-Shot Bufferize can provide a function with custom logic.
      
      Differential Revision: https://reviews.llvm.org/D129273
      606f7c8f
    • Tim Northover's avatar
      X86: add newline to end of FMA instruction comments. · 8d9dc83f
      Tim Northover authored
      The newline is used by Disassembler.cpp (`emitComments`) to work out how to
      format them properly, and if there's no newline it goes into an infinite loop.
      
      Unfortunately I couldn't get llvm-objdump to be affected, only the MacOS otool
      utility which dlopens libLTO.
      8d9dc83f
    • Michał Chojnowski's avatar
      [BOLT] Fix concurrent hash table modification in the instrumentation runtime · bd301a41
      Michał Chojnowski authored
      `__bolt_instr_data_dump()` does not lock the hash tables when iterating
      over them, so the iteration can happen concurrently with a modification
      done in another thread, when the table is in an inconsistent state. This
      also has been observed in practice, when it caused a segmentation fault.
      
      We fix this by locking hash tables during iteration. This is done by taking
      the lock in `forEachElement()`.
      The only other site of iteration, `resetCounters()`, has been correctly
      locking the table even before this patch. This patch removes its `Lock`
      because the lock is now taken in the inner `forEachElement()`.
      
      Reviewed By: maksfb, yota9
      
      Differential Revision: https://reviews.llvm.org/D129089
      bd301a41
    • Alex Zinenko's avatar
      [mlir] Transform dialect: introduce merge_handles op · 8e03bfc3
      Alex Zinenko authored
      This Transform dialect op allows one to merge the lists of Payload IR
      operations pointed to by several handles into a single list associated with one
      handle. This is an important Transform dialect usability improvement for cases
      where transformations may temporarily diverge for different groups of Payload
      IR ops before converging back to the same script. Without this op, several
      copies of the trailing transformations would have to be present in the
      transformation script.
      
      Depends On D129090
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D129110
      8e03bfc3
    • Alex Zinenko's avatar
      [mlir] Structured transforms: introduce op splitting · ff6e5508
      Alex Zinenko authored
      Introduce a new transformation on structured ops that splits the iteration
      space into two parts along the specified dimension. The index at which the
      splitting happens may be static or dynamic. This transformation can be seen as
      a rudimentary form of index-set splitting that only supports the splitting
      along hyperplanes parallel to the iteration space hyperplanes, and is therefore
      decomposable into per-dimension application.
      
      It is a key low-level transformation that enables independent scheduling for
      different parts of the iteration space of the same op, which hasn't been
      possible previously. It may be used to implement, e.g., multi-sized tiling. In
      future, peeling can be implemented as a combination of split-off amount
      computation and splitting.
      
      The transformation is conceptually close to tiling in its separation of the
      iteration and data spaces, but cannot be currently implemented on top of
      TilingInterface as the latter does not properly support `linalg.index`
      offsetting.
      
      Note that the transformation intentionally bypasses folding of
      `tensor.extract_slice` operations when creating them as this folding was found
      to prevent repeated splitting of the same operation because due to internal
      assumptions about extract/insert_slice combination in dialect utilities.
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D129090
      ff6e5508
    • Sven van Haastregt's avatar
      Fix use of uninitialized member in constructor · 1d9086bf
      Sven van Haastregt authored
      
      
      The constructor does `Saver(Alloc)`, so `Alloc` should be
      initialized first.  Move `Alloc` up in the declaration order.
      
      Fixes a -Wuninitialized warning when building with GCC 12.1.
      
      Reported-by: default avatarMihail Atanassov <mihail.atanassov@arm.com>
      1d9086bf
    • Peter Waller's avatar
      [doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209 · 2db2a4e1
      Peter Waller authored
      D127209 fixed LLVM to bring it in line with the AAPCS. The fix affects
      functions where the first SVE parameter appears in the 9th or later
      arguments, and the function does not return an SVE type.
      
      Differential Revision: https://reviews.llvm.org/D129135
      2db2a4e1
    • Markus Böck's avatar
      [mlir][ods] Replace redundant `Type` instances for interfaces · 1a92dbcf
      Markus Böck authored
      This patch makes use of TypeInterface implementing Type to remove instances of Type that simply checked whether a type implemented a given interface.
      As part of this refactoring, some changes had to be done in the OpenMP Dialect files. In particular, they assumed that OpenMPOps.td to only ever include OpenMP TypeInterfaces, which did not hold anymore with a moved include in LLVMOpBase.td. For that reason, the type interface defintions were moved into a new file as is convention.
      
      Differential Revision: https://reviews.llvm.org/D129210
      1a92dbcf
    • Markus Böck's avatar
      [mlir][ods] Make Type- and AttrInterfaces also `Type`s and `Attr`s · 9f186bb1
      Markus Böck authored
      By making TypeInterfaces and AttrInterfaces, Types and Attrs respectively it'd then be possible to use them anywhere where a Type or Attr may go. That is within the arguments and results of an Op definition, in a RewritePattern etc.
      
      Prior to this change users had to separately define a Type or Attr, with a predicate to check whether a type or attribute implements a given interface. Such code will be redundant now.
      Removing such occurrences in upstream dialects will be part of a separate patch.
      
      As part of implementing this patch, slight refactoring had to be done. In particular, Interfaces cppClassName field was renamed to cppInterfaceName as it "clashed" with TypeConstraints cppClassName. In particular Interfaces cppClassName expected just the class name, without any namespaces, while TypeConstraints cppClassName expected a fully qualified class name.
      
      Differential Revision: https://reviews.llvm.org/D129209
      9f186bb1
    • Bradley Smith's avatar
      [LegalizeTypes] Replace vecreduce_xor/or/and with vecreduce_add/umax/umin if not legal · 60d6be5d
      Bradley Smith authored
      This is done during type legalization since the target representation of
      these nodes may not be valid until after type legalization, and after
      type legalization the fact that these are dealing with i1 types may be
      lost.
      
      Differential Revision: https://reviews.llvm.org/D128996
      60d6be5d
    • Sander de Smalen's avatar
    • Sander de Smalen's avatar
    • Nikita Popov's avatar
      [GlobalsModRef] Don't override getModRefBehavior() for CallBase · 4a579abd
      Nikita Popov authored
      BasicAA will already call getModRefBehavior() on the Function of
      the CallBase if there are no operand bundles. This happens through
      getBestAAResults(), i.e. it is a recursive call that will query
      other AA providers, not just the BasicAA implementation.
      
      As such, there is no need to reimplement the same functionality
      in GlobalsModRef, a combination of BasicAA and GlobalsModRef already
      handles it. This does mean that this no longer works under
      -disable-basic-aa, but that's a testing only option.
      4a579abd
    • Marek Kurdej's avatar
      [clang-format] Avoid crash in LevelIndentTracker. · 14c30c70
      Marek Kurdej authored
      Fixes https://github.com/llvm/llvm-project/issues/56352.
      
      Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
      
      Differential Revision: https://reviews.llvm.org/D129064
      14c30c70