1. Dec 23, 2023
  2. Dec 21, 2023
    • Mark de Wever's avatar
      [libc++][modules] Removes module testing. · 5c5c9685
      Mark de Wever authored
      This removes the entire modules testing infrastructure.
      
      The current infrastructure uses CMake to generate the std and std.compat
      module. This requires quite a bit of plumbing and uses CMake. Since
      CMake introduced module support in CMake 3.26, modules have a higher
      CMake requirement than the rest of the LLVM project. (The LLVM project
      requires 3.20.) The main motivation for this approach was how libc++
      generated its modules. Every header had its own module partition. This
      was changed to improve performance and now only two modules remain.
      The code to build these can be manually crafted.
      
      A followup patch will reenable testing modules, using a different
      approach.
      5c5c9685
    • Florian Hahn's avatar
      [ConstraintElim] Extend AND implication logic to support OR as well. (#76044) · 18170d0f
      Florian Hahn authored
      Extend the logic check if an operand of an AND is implied by the other
      to also support OR. This is done by checking if !op1 implies op2 or vice
      versa.
      18170d0f
    • LLVM GN Syncbot's avatar
      [gn build] Port 5ea15fab · 2c257cf8
      LLVM GN Syncbot authored
      2c257cf8
    • Cyndy Ishida's avatar
      [TextAPI] Add support to convert RecordSlices -> InterfaceFile (#75007) · 5ea15fab
      Cyndy Ishida authored
      Introduce RecordVisitor. This is used for different clients that want to
      extract information out of RecordSlice types.
      The first and immediate use case is for serializing symbol information
      into TBD files.
      5ea15fab
    • Schrodinger ZHU Yifan's avatar
      [libc] [startup] add cmake function to merge separated crt1 objects (#75413) · 8bbeed05
      Schrodinger ZHU Yifan authored
      As part of startup refactoring, this patch adds a function to merge
      multiple objects into a single relocatable object:
                           cc -r obj1.o obj2.o -o obj.o
      
      A relocatable object is an object file that is not fully linked into an
      executable or a shared library. It is an intermediate file format that
      can be passed into the linker.
      
      A crt object can have arch-specific code and arch-agnostic code. To
      reduce code cohesion, the implementation is splitted into multiple
      units. As a result, we need to merge them into a single relocatable
      object.
      8bbeed05
    • Joseph Huber's avatar
      [Libomptarget][NFC] Fix linting warnings in the plugins · e4f4022b
      Joseph Huber authored
      Summary:
      Fix some linting warnings present in the plugins.
      e4f4022b
  3. Dec 20, 2023
    • Florian Hahn's avatar
      [ARM] Check all terms in emitPopInst when clearing Restored for LR. (#75527) · b1a5ee1f
      Florian Hahn authored
      emitPopInst checks a single function exit MBB. If other paths also exit
      the function and any of there terminators uses LR implicitly, it is not
      save to clear the Restored bit.
      
      Check all terminators for the function before clearing Restored.
      
      This fixes a mis-compile in outlined-fn-may-clobber-lr-in-caller.ll
      where the machine-outliner previously introduced BLs that clobbered LR
      which in turn is used by the tail call return.
      
      Alternative to #73553
      b1a5ee1f
    • Lucas Duarte Prates's avatar
      Reland: [AArch64] Assembly support for the Checked Pointer Arithmetic Extension (#73777) · d43fc5a6
      Lucas Duarte Prates authored
      This introduces assembly support for the Checked Pointer Arithmetic
      Extension (FEAT_CPA), annouced as part of the Armv9.5-A architecture
      version.
      
      The changes include:
      * New subtarget feature for FEAT_CPA
      * New scalar instruction for pointer arithmetic
        * ADDPT, SUBPT, MADDPT, and MSUBPT
      * New SVE instructions for pointer arithmetic
        * ADDPT (vectors, predicated), ADDPT (vectors, unpredicated)
        * SUBPT (vectors, predicated), SUBPT (vectors, unpredicated)
        * MADPT and MLAPT
      * New ID_AA64ISAR3_EL1 system register
      
      Mode details about the extension can be found at:
      * https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023
      * https://developer.arm.com/documentation/ddi0602/2023-09/
      
      
      
      Co-authored-by: default avatarRodolfo Wottrich <rodolfo.wottrich@arm.com>
      d43fc5a6
    • Zequan Wu's avatar
      [Profile] Dump binary id to raw profiles on Windows. (#75618) · 688fa35d
      Zequan Wu authored
      #74652 adds `__buildid` symbol which allows us to dump it at runtime.
      688fa35d
    • Paul C Fuqua's avatar
    • LLVM GN Syncbot's avatar
      [gn build] Port fdd089b5 · 300adbee
      LLVM GN Syncbot authored
      300adbee
    • LLVM GN Syncbot's avatar
      [gn build] Port 39034388 · d2330058
      LLVM GN Syncbot authored
      d2330058
    • Simon Pilgrim's avatar
      [X86] SimplifyDemandedVectorEltsForTargetShuffle - don't simplify constant... · 6ec350b4
      Simon Pilgrim authored
      [X86] SimplifyDemandedVectorEltsForTargetShuffle - don't simplify constant mask if it has multiple uses
      
      Avoid generating extra constant vectors
      6ec350b4
    • Razvan Lupusoru's avatar
      [acc] Initial implementation of MemoryEffects on `acc` operations (#75970) · a711b042
      Razvan Lupusoru authored
      The `acc` dialect operations now implement MemoryEffects interfaces in
      the following ways:
      - Data entry operations which may read host memory via `varPtr` are now
      marked as so. The majority of them do NOT actually read the host memory.
      For example, `acc.present` works on the basis of presence of pointer and
      not necessarily what the data points to - so they are not marked as
      reading the host memory. They still use `varPtr` though but this
      dependency is reflected through ssa.
      - Data clause operations which may mutate the data pointed to by
      `accPtr` are marked as doing so.
      - Data clause operations which update required structured or dynamic
      runtime counters are marked as reading and writing the newly defined
      `RuntimeCounters` resource. Some operations, like `acc.getdeviceptr` do
      not actually use the runtime counters - but are marked as reading them
      since the address obtained depends on the mapping operations which do
      update the runtime counters. Namely, `acc.getdeviceptr` cannot be moved
      across other mapping operations.
      - Constructs are marked as writing to the `ConstructResource`. This may
      be too strict but is needed for the following reasons: 1) Structured
      constructs may not use `accPtr` and instead use `varPtr` - when this is
      the case, data actions may be removed even when used. 2) Unstructured
      constructs are currently used to aggregate multiple data actions. We do
      not want such constructs removed or moved for now.
      - Terminators are marked as `Pure` as in other dialects.
      
      The current approach has the following limitations which may require
      further improvements:
      - Subsequent `acc.copyin` operations on same data do not actually read
      host memory pointed to by `varPtr` but are still marked as so.
      - Two `acc.delete` operations on same data may not mutate `accPtr` until
      the runtime counters are zero (but are still marked as mutating).
      - The `varPtrPtr` argument, when present, points to the address of
      location of `varPtr`. When mapping to target device, an `accPtrPtr`
      needs computed and this memory is mutated. This effect is not captured
      since the current operations do not produce `accPtrPtr`.
      - Runtime counter effects are imprecise since two operations with
      differing `varPtr` increment/decrement different counters. Additionally,
      operations with `varPtrPtr` mutate attachment counters.
      - The `ConstructResource` is too strict and likely can be relaxed with
      better modeling.
      a711b042
    • Christian Sigg's avatar
      476812a7
    • Nikita Popov's avatar
      [MergeFunc] Fix comparison of constant expressions · 8b8f2ef0
      Nikita Popov authored
      Functions using different constant expressions were incorrectly
      merged, because a lot of state was missing from the comparison,
      including the opcode, the comparison predicate, the GEP element
      type, as well as the inbounds, inrange and nowrap poison flags.
      8b8f2ef0
    • Nico Weber's avatar
      [gn] port e86a02ce (dladdr -> llvm-config.h) · 6cd296ed
      Nico Weber authored
      Also set HAVE_DLADDR to 1 on non-Win instead of just on macOS.
      That looked like an oversight.
      6cd296ed
    • Alexey Bataev's avatar
      [SLP]Fix PR75995: drop wrapping flags for resized wrapped binops. · a13148a8
      Alexey Bataev authored
      If decided to resize the instruction, need to drop wrapping flags from
      the resulting vector instructions to avoid incorrect
      optimizations/assumptions later.
      Fixes PR75995.
      a13148a8
    • David Spickett's avatar
      [lldb][DWARF] Search for symbols in all external modules (#75927) · 7767c585
      David Spickett authored
      The way this code was updated in
      dd958779 meant that if the first module
      did not have the symbol, the iteration stopped as returning true means
      stop. So only if every module had the symbol would we find it, in the
      last module.
      
      Invert the condition to break when we find the first instance, which is
      what the previous code did.
      7767c585
    • Nico Weber's avatar
      [gn] port 2fd4084f · f1156eb5
      Nico Weber authored
      f1156eb5
    • Hassnaa Hamdi's avatar
      [LLVM][AArch64][tblgen]: Match clamp pattern (#75529) · f3dcc0cb
      Hassnaa Hamdi authored
      Add isel pattern to replase min(max(v1,v2),v3) by clamp
      Add tests for uclamp, sclamp, bfclamp, fclamp.
      f3dcc0cb
    • Alexey Bataev's avatar
      [SLP][NFC]Add a test with incorrect wrapping flags in the binops with · 8abf8c94
      Alexey Bataev authored
      minbitwidth types.
      8abf8c94
    • Christian Sigg's avatar
      [mlir][bazel] Fix build after d9803841 · 7153fa3d
      Christian Sigg authored
      7153fa3d
    • bipmis's avatar
      [ValueTracking] isNonZero sub of ptr2int's with recursive GEP (#68680) · 64987c64
      bipmis authored
      When the sub arguments are ptr2int it is not possible to determine
      computeKnownBits() of its arguments.
      For scalar case generally sub of 2 ptr2int are converted to sub of
      indexes.
      However a loop with recursive GEP/PHI where the arguments to sub is of
      type ptr2int, if it is possible to determine that a sub of this GEP and
      another pointer with the same base is KnownNonZero we can return this.
      This helps subsequent passes to optimize the loop further.
      64987c64
    • Nikita Popov's avatar
      [MergeFunc] Adjust GEP indices in test (NFC) · 836e71a4
      Nikita Popov authored
      Otherwise inbounds will be inferred, and we don't actually end
      up testing the case of one gep without inbounds and one with.
      836e71a4
    • David Spickett's avatar
      [lldb][test] Skip global module cache on Arm/AArch64 Linux (again) · a8af51df
      David Spickett authored
      This reverts commit 01c4ecb7,
      d14d5215 and
      a756dc47.
      
      This removes the logging and workaround I added earlier,
      and puts back the skip for Arm/AArch64 Linux.
      
      I've not seen it fail on AArch64 since, but let's not create
      more noise if it does.
      
      I've written up the issue as https://github.com/llvm/llvm-project/issues/76057.
      It's something to do with trying to destroy a process while
      a thread is doing a single sep. So my workaround wouldn't have
      worked in any case. It needs a more involved fix.
      a8af51df
    • Nikita Popov's avatar
      [MergeFunc] Add another test for incorrect constexpr merging (NFC) · 3dd2db08
      Nikita Popov authored
      Looks like we don't even check the opcode :(
      3dd2db08
    • Abhina Sree's avatar
      Use llvm-config.h in CIndexer.cpp instead of private header (#75928) · e86a02ce
      Abhina Sree authored
      Use llvm-config.h in CIndexer.cpp instead of private header
      e86a02ce
    • Nikita Popov's avatar
    • Gil Rapaport's avatar
      [mlir][emitc] Add op modelling C expressions (#71631) · d9803841
      Gil Rapaport authored
      Add an emitc.expression operation that models C expressions, and provide
      transforms to form and fold expressions. The translator emits the body
      of
      emitc.expression ops as a single C expression.
      This expression is emitted by default as the RHS of an EmitC SSA value,
      but if
      possible, expressions with a single use that is not another expression
      are
      instead inlined. Specific expression's inlining can be fine tuned by
      lowering
      passes and transforms.
      d9803841
    • Matt Arsenault's avatar
      AMDGPU: Strengthen some bfloat tests · b01adc6b
      Matt Arsenault authored
      Fix bitcast test, which was splitting apart phis intended to force
      bitcasts that survive all the way to selection.
      
      Disable the amdgpu-codegenprepare phi splitting, which defeats the technique
      of using a phi to ensure a bitcast reaches all the way to selection. Also
      add a variety of bfloat tests. These probably need revisiting to avoid the
      cast folding into argument loads. Also round out set of bfloat bitcast and
      ABI tests.
      
      Add codegen tests for more bf16 operations The promotion of these works
      contrary to the comment.
      b01adc6b
    • Matt Arsenault's avatar
      DAG: Fix expansion of bf16 sourced extloads · 9e574a39
      Matt Arsenault authored
      Also fix assorted vector extload failures for AMDGPU.
      9e574a39
    • David Green's avatar
      [Flang] Allow Intrinsic simpification with min/maxloc dim and scalar result. (#75820) · 701f6479
      David Green authored
      This makes an adjustment to the existing fir minloc/maxloc generation
      code to handle functions with a dim=1 that produce a scalar result. This
      should allow us to get the same benefits as the existing generated
      minmax reductions.
      701f6479
    • Andrzej Warzyński's avatar
      [mlir][vector] Extend `CreateMaskFolder` (#75842) · 354adb44
      Andrzej Warzyński authored
      Extends `CreateMaskFolder` pattern so that the following:
      ```mlir
        %c8 = arith.constant 8 : index
        %c16 = arith.constant 16 : index
        %0 = vector.vscale
        %1 = arith.muli %0, %c16 : index
        %10 = vector.create_mask %c8, %1 : vector<8x[16]xi1>
      ```
      
      is folded as:
      
      ```mlir
        %0 = vector.constant_mask [8, 16] : vector<8x[16]xi1>
      ```
      354adb44
    • David Spickett's avatar
      [lldb][test] Skip runlocker test on AArch64 Linux · 83f8caea
      David Spickett authored
      This has been flaky for a while, for example
      https://lab.llvm.org/buildbot/#/builders/96/builds/50350
      
      ```
      Command Output (stdout):
      --
      lldb version 18.0.0git (https://github.com/llvm/llvm-project.git revision 3974d89b)
        clang revision 3974d89b
        llvm revision 3974d89b
      "can't evaluate expressions when the process is running."
      ```
      
      ```
        PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
         #0 0x0000ffffa46191a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x529a1a0)
         #1 0x0000ffffa4617144 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x5298144)
         #2 0x0000ffffa46198d0 SignalHandler(int) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x529a8d0)
         #3 0x0000ffffab25b7dc (linux-vdso.so.1+0x7dc)
         #4 0x0000ffffab13d050 /build/glibc-Q8DG8B/glibc-2.31/string/../sysdeps/aarch64/multiarch/memcpy_advsimd.S:92:0
         #5 0x0000ffffa446f420 lldb_private::process_gdb_remote::GDBRemoteRegisterContext::PrivateSetRegisterValue(unsigned int, llvm::ArrayRef<unsigned char>) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x50f0420)
         #6 0x0000ffffa446f7b8 lldb_private::process_gdb_remote::GDBRemoteRegisterContext::GetPrimordialRegister(lldb_private::RegisterInfo const*, lldb_private::process_gdb_remote::GDBRemoteCommunicationClient&) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x50f07b8)
         #7 0x0000ffffa446f308 lldb_private::process_gdb_remote::GDBRemoteRegisterContext::ReadRegisterBytes(lldb_private::RegisterInfo const*) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x50f0308)
         #8 0x0000ffffa446ec1c lldb_private::process_gdb_remote::GDBRemoteRegisterContext::ReadRegister(lldb_private::RegisterInfo const*, lldb_private::RegisterValue&) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x50efc1c)
         #9 0x0000ffffa412eaa4 lldb_private::RegisterContext::ReadRegisterAsUnsigned(lldb_private::RegisterInfo const*, unsigned long) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4dafaa4)
        #10 0x0000ffffa420861c ReadLinuxProcessAddressMask(std::shared_ptr<lldb_private::Process>, llvm::StringRef) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4e8961c)
        #11 0x0000ffffa4208430 ABISysV_arm64::FixCodeAddress(unsigned long) (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lib/python3.8/site-packages/lldb/_lldb.cpython-38-aarch64-linux-gnu.so+0x4e89430)
      ```
      
      Judging by the backtrace something is trying to read the pointer authentication address/code mask
      registers. This explains why I've not seen this issue locally, as the buildbot runs on Graviton
      3 with has the pointer authentication extension.
      
      I will try to reproduce, fix and re-enable the test.
      83f8caea
    • Florian Hahn's avatar
      [ConstraintElim] Check if second op implies first for And. (#75750) · 7cf499c6
      Florian Hahn authored
      Generalize checkAndSecondOpImpliedByFirst to also check if the second
      operand implies the first.
      7cf499c6