1. Feb 01, 2024
    • Jason Molenda's avatar
      Collecting more logging to debug CI bots · cf2533e7
      Jason Molenda authored
      Watchpoint test fails on arm-ubuntu and x86-64-debian
      cf2533e7
    • Richard Howell's avatar
      [lld] enable fixup chains by default (#79894) · 775c2856
      Richard Howell authored
      Enable chained fixups in lld when all platform and version criteria are
      met. This is an attempt at simplifying the logic used in ld 907:
      
      https://github.com/apple-oss-distributions/ld64/blob/93d74eafc37c0558b4ffb88a8bc15c17bed44a20/src/ld/Options.cpp#L5458-L5549
      
      Some changes were made to simplify the logic:
      - only enable chained fixups for macOS from 13.0 to avoid the arch check
      - only enable chained fixups for iphonesimulator from 16.0 to avoid the
      arch check
      - don't enable chained fixups for not specifically listed platforms
      - don't enable chained fixups for arm64_32
      775c2856
    • Justin Bogner's avatar
      [DirectX][docs] Architecture and design philosophy of DXIL support · 151559cf
      Justin Bogner authored
      This documents some of the architectural direction for DXIL and tries
      to provide a bit of a map for where to implement different aspects of
      DXIL support.
      
      Pull Request: https://github.com/llvm/llvm-project/pull/78221
      151559cf
    • Jason Molenda's avatar
      Add extra printing to TestWatchpointCount.py to debug CI fail · dad50fef
      Jason Molenda authored
      The way the locals are laid out on the stack on x86-64 Debian is
      resulting in a test failure with the new large watchpoint support.
      Collecting more logging before I revert/debug it.
      dad50fef
    • Louis Dionne's avatar
      [libc++abi] Add temporary workaround to unblock Chrome · 372f7dd4
      Louis Dionne authored
      Chrome rolls libc++ and libc++abi as separate projects. As a result, they
      may not always be updated in lockstep, and this can lead to build failures
      when mixing libc++ that doesn't have <__thread/support.h> with libc++abi
      that requires it.
      
      This patch adds a workaround to make libc++abi work with both versions.
      While Chrome's setup is not supported, this workaround will allow them
      to go back to green and do the required work needed to roll libc++ and
      libc++abi in lockstep. This workaround will be short-lived -- I have a
      reminder to go back and remove it by EOW.
      372f7dd4
    • Joseph Huber's avatar
      [Libomptarget] Remove handling of old ctor / dtor entries (#80153) · 25428765
      Joseph Huber authored
      Summary:
      A previous patch removed creating these entries in clang in favor of the
      backend emitting a callable kernel and having the runtime call that if
      present. The support for the old style was kept around in LLVM 18.0 but
      now that we have forked to 19.0 we should remove the support.
      
      The effect of this would be that an application linking against a newer
      libomptarget that still had the old constructors will no longer be
      called. In that case, they can either recompile or use the
      `libomptarget.so.18` that comes with the previous release.
      25428765
    • LLVM GN Syncbot's avatar
      [gn build] Port 57c66b35 · 35a00899
      LLVM GN Syncbot authored
      35a00899
    • Jason Molenda's avatar
      [lldb] Add support for large watchpoints in lldb (#79962) · 57c66b35
      Jason Molenda authored
      This patch is the next piece of work in my Large Watchpoint proposal,
      https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116
      
      This patch breaks a user's watchpoint into one or more
      WatchpointResources which reflect what the hardware registers can cover.
      This means we can watch objects larger than 8 bytes, and we can watched
      unaligned address ranges. On a typical 64-bit target with 4 watchpoint
      registers you can watch 32 bytes of memory if the start address is
      doubleword aligned.
      
      Additionally, if the remote stub implements AArch64 MASK style
      watchpoints (e.g. debugserver on Darwin), we can watch any power-of-2
      size region of memory up to 2GB, aligned to that same size.
      
      I updated the Watchpoint constructor and CommandObjectWatchpoint to
      create a CompilerType of Array<UInt8> when the size of the watched
      region is greater than pointer-size and we don't have a variable type to
      use. For pointer-size and smaller, we can display the watched granule as
      an integer value; for larger-than-pointer-size we will display as an
      array of bytes.
      
      I have `watchpoint list` now print the WatchpointResources used to
      implement the watchpoint.
      
      I added a WatchpointAlgorithm class which has a top-level static method
      that takes an enum flag mask WatchpointHardwareFeature and a user
      address and size, and returns a vector of WatchpointResources covering
      the request. It does not take into account the number of watchpoint
      registers the target has, or the number still available for use. Right
      now there is only one algorithm, which monitors power-of-2 regions of
      memory. For up to pointer-size, this is what Intel hardware supports.
      AArch64 Byte Address Select watchpoints can watch any number of
      contiguous bytes in a pointer-size memory granule, that is not currently
      supported so if you ask to watch bytes 3-5, the algorithm will watch the
      entire doubleword (8 bytes). The newly default "modify" style means we
      will silently ignore modifications to bytes outside the watched range.
      
      I've temporarily skipped TestLargeWatchpoint.py for all targets. It was
      only run on Darwin when using the in-tree debugserver, which was a proxy
      for "debugserver supports MASK watchpoints". I'll be adding the
      aforementioned feature flag from the stub and enabling full mask
      watchpoints when a debugserver with that feature is enabled, and
      re-enable this test.
      
      I added a new TestUnalignedLargeWatchpoint.py which only has one test
      but it's a great one, watching a 22-byte range that is unaligned and
      requires four 8-byte watchpoints to cover.
      
      I also added a unit test, WatchpointAlgorithmsTests, which has a number
      of simple tests against WatchpointAlgorithms::PowerOf2Watchpoints. I
      think there's interesting possible different approaches to how we cover
      these; I note in the unit test that a user requesting a watch on address
      0x12e0 of 120 bytes will be covered by two watchpoints today, a
      128-bytes at 0x1280 and at 0x1300. But it could be done with a 16-byte
      watchpoint at 0x12e0 and a 128-byte at 0x1300, which would have fewer
      false positives/private stops. As we try refining this one, it's helpful
      to have a collection of tests to make sure things don't regress.
      
      I tested this on arm64 macOS, (genuine) x86_64 macOS, and AArch64
      Ubuntu. I have not modifed the Windows process plugins yet, I might try
      that as a standalone patch, I'd be making the change blind, but the
      necessary changes (see ProcessGDBRemote::EnableWatchpoint) are pretty
      small so it might be obvious enough that I can change it and see what
      the Windows CI thinks.
      
      There isn't yet a packet (or a qSupported feature query) for the gdb
      remote serial protocol stub to communicate its watchpoint capabilities
      to lldb. I'll be doing that in a patch right after this is landed,
      having debugserver advertise its capability of AArch64 MASK watchpoints,
      and have ProcessGDBRemote add eWatchpointHardwareArmMASK to
      WatchpointAlgorithms so we can watch larger than 32-byte requests on
      Darwin.
      
      I haven't yet tackled WatchpointResource *sharing* by multiple
      Watchpoints. This is all part of the goal, especially when we may be
      watching a larger memory range than the user requested, if they then add
      another watchpoint next to their first request, it may be covered by the
      same WatchpointResource (hardware watchpoint register). Also one "read"
      watchpoint and one "write" watchpoint on the same memory granule need to
      be handled, making the WatchpointResource cover all requests.
      
      As WatchpointResources aren't shared among multiple Watchpoints yet,
      there's no handling of running the conditions/commands/etc on multiple
      Watchpoints when their shared WatchpointResource is hit. The goal beyond
      "large watchpoint" is to unify (much more) the Watchpoint and Breakpoint
      behavior and commands. I have a feeling I may be slowly chipping away at
      this for a while.
      
      rdar://108234227
      57c66b35
    • Michael Buch's avatar
      [lldb][DataFormatter][NFC] Use GetFirstValueOfLibCXXCompressedPair throughout formatters (#80133) · 08c0eb18
      Michael Buch authored
      This avoids duplicating the logic to get the first
      element of a libc++ `__compressed_pair`. This will
      be useful in supporting upcoming changes to the layout
      of `__compressed_pair`.
      
      Drive-by changes:
      * Renamed `m_item` to `size_node` for readability;
        `m_item` suggests it's a member variable, which it
        is not.
      08c0eb18
    • Min-Yih Hsu's avatar
      [Exegesis] Print epsilon value in the sched model inconsistency report (#80080) · 8241106b
      Min-Yih Hsu authored
      Since I've formatted the epsilon value, I don't think it's necessary to
      escape it.
      8241106b
    • Benjamin Kramer's avatar
      16c4843d
    • Jinsong Ji's avatar
      [Clang][test] Add fPIC when building shared library (#80065) · b929be2d
      Jinsong Ji authored
      Fix linking error: "ld: error: can't create dynamic relocation
      R_X86_64_64 against local symbol in readonly segment; recompile object
      files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in
      the output"
      b929be2d
    • David Green's avatar
      [AArch64] Use DAG->isAddLike in add_and_or_is_add (#79563) · d04ae1b1
      David Green authored
      This allows it to work with disjoint or's as well as computing the known
      bits.
      d04ae1b1
    • Benjamin Kramer's avatar
      [bazel] Port 31fc0a12 · 6720e3af
      Benjamin Kramer authored
      6720e3af
    • Rin Dobrescu's avatar
      Revert "[AArch64] Convert concat(uhadd(a,b), uhadd(c,d)) to uhadd(concat(a,c),... · 2907c633
      Rin Dobrescu authored
      Revert "[AArch64] Convert concat(uhadd(a,b), uhadd(c,d)) to uhadd(concat(a,c), concat(b,d))" (#80157)
      
      Reverts llvm/llvm-project#79464 while figuring out why the tests are
      failing.
      2907c633
    • Benjamin Kramer's avatar
      Revert "[mlir] Lower math dialect later in gpu-lower-to-nvvm-pipeline (#78556)" · 98dbc688
      Benjamin Kramer authored
      This reverts commit 74bf0b1c. The test
      always fails.
      
       | mlir/test/Dialect/GPU/test-nvvm-pipeline.mlir:23:16: error: CHECK-PTX: expected string not found in input
       |  // CHECK-PTX: __nv_expf
      
      https://lab.llvm.org/buildbot/#/builders/61/builds/53789
      98dbc688
    • Jay Foad's avatar
    • Jay Foad's avatar
    • Daniel Chen's avatar
      [Flang] Support NULL(procptr): null intrinsic that has procedure pointer argument. (#80072) · bd8bec27
      Daniel Chen authored
      This PR adds support for NULL intrinsic to have a procedure pointer
      argument.
      bd8bec27
    • Paul Semel's avatar
      [clang][dataflow] fix assert in `Environment::getResultObjectLocation` (#79608) · 5c2da289
      Paul Semel authored
      
      
      When calling `Environment::getResultObjectLocation` with a
      CXXOperatorCallExpr that is a prvalue, we just hit an assert because no
      record was ever created.
      
      ---------
      
      Co-authored-by: default avatarmartinboehme <mboehme@google.com>
      5c2da289
    • LLVM GN Syncbot's avatar
      [gn build] Port 8d1b1c9b · 0cd83486
      LLVM GN Syncbot authored
      0cd83486
    • Nikita Popov's avatar
      [AsmParser] Support non-consecutive global value numbers (#80013) · f2df4bfe
      Nikita Popov authored
      https://github.com/llvm/llvm-project/pull/78171 added support for
      non-consecutive local value numbers. This extends the support for global
      value numbers (for globals and functions).
      
      This means that it is now possible to delete an unnamed global
      definition/declaration without breaking the IR.
      
      This is a lot less common than unnamed local values, but it seems like
      something we should support for consistency. (Unnamed globals are used a
      lot in Rust though.)
      f2df4bfe
    • Timm Bäder's avatar
      [clang][Interp] Remove wrong * operator · dfd5a64d
      Timm Bäder authored
      classifyComplexElementType used to return a std::optional, seems like
      this was left in a PR and not re-tested.
      
      This broke build bots, e.g.
      https://lab.llvm.org/buildbot/#/builders/68/builds/67930
      dfd5a64d
  2. Jan 31, 2024
    • Timm Baeder's avatar
      [clang][Interp] Handle casts between complex types (#79269) · 32c00485
      Timm Baeder authored
      Just handle this like two primtive casts.
      32c00485
    • David Green's avatar
      [AArch64] Use add_and_or_is_add for CSINC (#79552) · 5d7d89de
      David Green authored
      Adds or add-like-or's of 1 can both be turned into csinc, which can help
      fold more instructions into a csinc.
      5d7d89de
    • Aaron Ballman's avatar
      Add a release note for TypeLoc::dump() support; NFC · e33dc6b0
      Aaron Ballman authored
      This amends 8d1b1c9b which added the
      functionality the release note refers to.
      e33dc6b0
    • Sjoerd Meijer's avatar
      [AArch64] MI Scheduler LDP combine follow up (#79003) · 88418460
      Sjoerd Meijer authored
      This is a follow up of 75d820dc, adding more opcodes to the combine
      target hook enabling more LDP creation.
      
      Patch co-authored by Cameron McInally.
      88418460
    • Sam McCall's avatar
      [AST] Add dump() method to TypeLoc (#65484) · 8d1b1c9b
      Sam McCall authored
      The ability to dump AST nodes is important to ad-hoc debugging, and
      the fact this doesn't work with TypeLoc nodes is an obvious missing
      feature in e.g. clang-query (`set output dump` simply does nothing).
      
      Having TypeLoc::dump(), and enabling DynTypedNode::dump() for such nodes
      seems like a clear win.
      
      It looks like this:
      ```
      int main(int argc, char **argv);
      
      FunctionProtoTypeLoc <test.cc:3:1, col:31> 'int (int, char **)' cdecl
      |-ParmVarDecl 0x30071a8 <col:10, col:14> col:14 argc 'int'
      | `-BuiltinTypeLoc <col:10> 'int'
      |-ParmVarDecl 0x3007250 <col:20, col:27> col:27 argv 'char **'
      | `-PointerTypeLoc <col:20, col:26> 'char **'
      |   `-PointerTypeLoc <col:20, col:25> 'char *'
      |     `-BuiltinTypeLoc <col:20> 'char'
      `-BuiltinTypeLoc <col:1> 'int'
      ```
      
      It dumps the lexically nested tree of type locs.
      This often looks similar to how types are dumped, but unlike types
      we don't look at desugaring e.g. typedefs, as their underlying types
      are not lexically spelled here.
      
      ---
      
      Less clear is exactly when to include these nodes in existing text AST
      dumps rooted at (TranslationUnit)Decls.
      These already omit supported nodes sometimes, e.g. NestedNameSpecifiers
      are often mentioned but not recursively dumped.
      
      TypeLocs are a more extreme case: they're ~always more verbose
      than the current AST dump.
      So this patch punts on that, TypeLocs are only ever printed recursively
      as part of a TypeLoc::dump() call.
      
      It would also be nice to be able to invoke `clang` to dump a typeloc
      somehow, like `clang -cc1 -ast-dump`. But I don't know exactly what the
      best verison of that is, so this patch doesn't do it.
      
      ---
      
      There are similar (less critical!) nodes: TemplateArgumentLoc etc,
      these also don't have dump() functions today and are obvious extensions.
      
      I suspect that we should add these, and Loc nodes should dump each other
      (e.g. the ElaboratedTypeLoc `vector<int>::iterator` should dump
      the NestedNameSpecifierLoc `vector<int>::`, which dumps the
      TemplateSpecializationTypeLoc `vector<int>::` etc).
      
      Maybe this generalizes further to a "full syntactic dump" mode, where
      even Decls and Stmts would print the TypeLocs they lexically contain.
      But this may be more complex than useful.
      
      ---
      
      While here, ConceptReference JSON dumping must be implemented. It's not
      totally clear to me why this implementation wasn't required before but
      is now...
      8d1b1c9b
    • AdityaK's avatar
      Fix: CMake Error at cmake/modules/LLVMExternalProjectUtils.cmake:86 (is_msvc_triple) (#80071) · c651b2b0
      AdityaK authored
      Adding quotes around the `${target_triple}`
      
      Fix: #78530
      c651b2b0
    • Shimin Cui's avatar
      Move the PowerPC/PPCMergeStringPool work to initializer (#77352) · 1bab570e
      Shimin Cui authored
      Currently, the `PPCMergeStringPool` merges the global variable after the
      `AsmPrinter` initializer adds the global variables to its symbol list.
      This is to move the merging work of `PPCMergeStringPool` to its
      initializer, just like what GlobalMerge does, to avoid adding merged
      global variables to the `AsmPrinter` symbol lis.  
      1bab570e
    • Boian Petkantchin's avatar
      [mlir][mesh] Refactoring code organization, tests and docs (#79606) · 31fc0a12
      Boian Petkantchin authored
      * Split out `MeshDialect.h` form `MeshOps.h` that defines the dialect
      class. Reduces include clutter if you care only about the dialect and
      not the ops.
      
      * Expose functions `getMesh` and `collectiveProcessGroupSize`. There
      functions are useful for outside users of the dialect.
      
      * Remove unused code.
      
      * Remove examples and tests of mesh.shard attribute in tensor encoding.
      Per the decision that Spmdization would be performed on sharding
      annotations and there will be no tensors with sharding specified in the
      type.
      For more info see this RFC comment:
      https://discourse.llvm.org/t/rfc-sharding-framework-design-for-device-mesh/73533/81
      31fc0a12
    • Erich Keane's avatar
      Revert "[Clang][Sema] fix outline member function template with defau… (#80144) · 6e6aa44c
      Erich Keane authored
      …lt align crash (#78400)"
      
      This reverts commit 7b338998.
      
      A regression was discovered here:
      https://github.com/llvm/llvm-project/pull/78400
      
      and the author requested a revert to give time to review.
      6e6aa44c
    • Timm Baeder's avatar
      47df3912
    • jeanPerier's avatar
      [flang] Lower ASYNCHRONOUS variables and IO statements (#80008) · 4679132a
      jeanPerier authored
      Finish plugging-in ASYNCHRONOUS IO in lowering (GetAsynchronousId was
      not used yet).
      
      Add a runtime implementation for GetAsynchronousId (only the signature
      was defined). Always return zero since flang runtime "fakes"
      asynchronous IO (data transfer are always complete, see
      flang/docs/IORuntimeInternals.md).
      
      Update all runtime integer argument and results for IDs to use the
      AsynchronousId int alias for consistency.
      
      In lowering, asynchronous attribute is added on the hlfir.declare of
      ASYNCHRONOUS variable, but nothing else is done. This is OK given the
      synchronous aspects of flang IO, but it would be safer to treat these
      variable as volatile (prevent code motion of related store/loads) since
      the asynchronous data change can also be done by C defined user
      procedure (see 18.10.4 Asynchronous communication). Flang lowering
      anyway does not give enough info for LLVM to do such code motions (the
      variables that are passed in a call are not given the noescape
      attribute, so LLVM will assume any later opaque call may modify the
      related data and would not move load/stores of such variables
      before/after calls even if it could from a pure Fortran point of view
      without ASYNCHRONOUS).
      4679132a
    • Benjamin Kramer's avatar
      Revert "[mlir][complex] Prevent underflow in complex.abs (#79786)" · 70fb96a2
      Benjamin Kramer authored
      This reverts commit 4effff21. It makes
      `complex.abs(-1)` return `-1`.
      70fb96a2
    • Quentin Dian's avatar
      [MIRPrinter] Don't print space when there is no successor (#80143) · b7738e27
      Quentin Dian authored
      Extra space causes the checks generated by update_mir_test_checks to be
      unavailable.
      
      ```
      # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
      # RUN: llc -mtriple=x86_64-- -o - %s -run-pass=none -verify-machineinstrs -simplify-mir | FileCheck %s
      ---
      name: foo
      body: |
        ; CHECK-LABEL: name: foo
        ; CHECK: bb.0:
        ; CHECK-NEXT:   successors:
        ; CHECK-NEXT: {{  $}}
        ; CHECK-NEXT: {{  $}}
        ; CHECK-NEXT: bb.1:
        ; CHECK-NEXT:   RET 0, $eax
        bb.0:
          successors:
      
        bb.1:
          RET 0, $eax
      ...
      ```
      
      The failure log is as follows:
      
      ```
      llvm/test/CodeGen/MIR/X86/unreachable-block-print.mir:9:16: error: CHECK-NEXT: is on the same line as previous match
       ; CHECK-NEXT: {{ $}}
                     ^
      <stdin>:21:13: note: 'next' match was here
       successors:
                  ^
      <stdin>:21:13: note: previous match ended here
       successors:
      ```
      b7738e27
    • Andrey Ali Khan Bolshakov's avatar
      [clang] Represent array refs as `TemplateArgument::Declaration` (#80050) · 9bf4e54e
      Andrey Ali Khan Bolshakov authored
      This returns (probably temporarily) array-referring NTTP behavior to
      which was prior to #78041 because ~~I'm fed up~~ have no time to fix
      regressions.
      9bf4e54e
    • Guray Ozen's avatar
      [mlir] Lower math dialect later in gpu-lower-to-nvvm-pipeline (#78556) · 74bf0b1c
      Guray Ozen authored
      This PR moves lowering of math dialect later in the pipeline. Because
      math dialect is lowered correctly by `createConvertGpuOpsToNVVMOps` for
      GPU target, and it needs to run it first.
      74bf0b1c
    • Nikita Popov's avatar
      [AA][JumpThreading] Don't use DomTree for AA in JumpThreading (#79294) · 4f32f5d5
      Nikita Popov authored
      JumpThreading may perform AA queries while the dominator tree is not up
      to date, which may result in miscompilations.
      
      Fix this by adding a new AAQI option to disable the use of the dominator
      tree in BasicAA.
      
      Fixes https://github.com/llvm/llvm-project/issues/79175.
      4f32f5d5
    • Zahira Ammarguellat's avatar
      [Driver] Fix erroneous warning for -fcx-limited-range and -fcx-fortran-rules. (#79821) · e538486e
      Zahira Ammarguellat authored
      The options `-fcx-limited-range` and `-fcx-fortran-rules` were added in
      _https://github.com/llvm/llvm-project/pull/70244_
      
      The code adding the options introduced an erroneous warning.
      `$ clang -c -fcx-limited-range t1.c` 
      `clang: warning: overriding '' option with '-fcx-limited-range'
      [-Woverriding-option]`
      and
      `$ clang -c -fcx-fortran-rules t1.c`
      `clang: warning: overriding '' option with '-fcx-fortran-rules'
      [-Woverriding-option]`
      
      The warning doesn't make sense. This patch removes it.
      e538486e