1. Aug 06, 2021
  2. Aug 05, 2021
  3. Aug 04, 2021
  4. Aug 03, 2021
    • Cullen Rhodes's avatar
      [ReleaseNotes] Add scalable matrix extension support to AArch64 changes · eff062e5
      Cullen Rhodes authored
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D106853
      eff062e5
    • Muhammad Omair Javaid's avatar
      [llvm][Release notes] Add AArch64 SVE, PAC and LLDB prebuilt binary · 9413df38
      Muhammad Omair Javaid authored
      This patch updates LLVM release notes to add a announcement about
      AArch64 SVE, PAC and LLDB prebuilt binary.
      9413df38
    • David Spickett's avatar
    • David Spickett's avatar
      [lldb][AArch64] Mark mismatched tags in tag read output · 0b8dc914
      David Spickett authored
      The "memory tag read" command will now tell you
      when the allocation tag read does not match the logical
      tag.
      
      (lldb) memory tag read mte_buf+(8*16) mte_buf+(8*16)+48
      Logical tag: 0x9
      Allocation tags:
      [0xfffff7ff7080, 0xfffff7ff7090): 0x8 (mismatch)
      [0xfffff7ff7090, 0xfffff7ff70a0): 0x9
      [0xfffff7ff70a0, 0xfffff7ff70b0): 0xa (mismatch)
      
      The logical tag will be taken from the start address
      so the end could have a different tag. You could for example
      read from ptr_to_array_1 to ptr_to_array_2. Where the latter
      is tagged differently to prevent buffer overflow.
      
      The existing command will read 1 granule if you leave
      off the end address. So you can also use it as a quick way
      to check a single location.
      
      (lldb) memory tag read mte_buf
      Logical tag: 0x9
      Allocation tags:
      [0xfffff7ff7000, 0xfffff7ff7010): 0x0 (mismatch)
      
      This avoids the need for a seperate "memory tag check" command.
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D106880
      
      (cherry picked from commit 98b5659b)
      0b8dc914
    • David Spickett's avatar
      [lldb] Correct format of qMemTags type field · c47d79b3
      David Spickett authored
      The type field is a signed integer.
      (https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html)
      
      However it's not packed in the packet in the way
      you might think. For example the type -1 should be:
      qMemTags:<addr>,<len>:ffffffff
      Instead of:
      qMemTags:<addr>,<len>:-1
      
      This change makes lldb-server's parsing more strict
      and adds more tests to check that we handle negative types
      correctly in lldb and lldb-server.
      
      We only support one tag type value at this point,
      for AArch64 MTE, which is positive. So this doesn't change
      any of those interactions. It just brings us in line with GDB.
      
      Also check that the test target has MTE. Previously
      we just checked that we were AArch64 with a toolchain
      that supports MTE.
      
      Finally, update the tag type check for QMemTags to use
      the same conversion steps that qMemTags now does.
      Using static_cast can invoke UB and though we do do a limit
      check to avoid this, I think it's clearer with the new method.
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D104914
      
      (cherry picked from commit 555cd031)
      c47d79b3
    • David Spickett's avatar
      [lldb][AArch64] Annotate synchronous tag faults · bc0cc109
      David Spickett authored
      In the latest Linux kernels synchronous tag faults
      include the tag bits in their address.
      This change adds logical and allocation tags to the
      description of synchronous tag faults.
      (asynchronous faults have no address)
      
      Process 1626 stopped
      * thread #1, name = 'a.out', stop reason = signal SIGSEGV: sync tag check fault (fault address: 0x900fffff7ff9010 logical tag: 0x9 allocation tag: 0x0)
      
      This extends the existing description and will
      show as much as it can on the rare occasion something
      fails.
      
      This change supports AArch64 MTE only but other
      architectures could be added by extending the
      switch at the start of AnnotateSyncTagCheckFault.
      The rest of the function is generic code.
      
      Tests have been added for synchronous and asynchronous
      MTE faults.
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D105178
      
      (cherry picked from commit d510b5f1)
      bc0cc109
    • David Spickett's avatar
      [lldb] Add "memory tag write" --end-addr option · dc00e191
      David Spickett authored
      The default mode of "memory tag write" is to calculate the
      range from the start address and the number of tags given.
      (just like "memory write" does)
      
      (lldb) memory tag write mte_buf 1 2
      (lldb) memory tag read mte_buf mte_buf+48
      Logical tag: 0x0
      Allocation tags:
      [0xfffff7ff9000, 0xfffff7ff9010): 0x1
      [0xfffff7ff9010, 0xfffff7ff9020): 0x2
      [0xfffff7ff9020, 0xfffff7ff9030): 0x0
      
      This new option allows you to set an end address and have
      the tags repeat until that point.
      
      (lldb) memory tag write mte_buf 1 2 --end-addr mte_buf+64
      (lldb) memory tag read mte_buf mte_buf+80
      Logical tag: 0x0
      Allocation tags:
      [0xfffff7ff9000, 0xfffff7ff9010): 0x1
      [0xfffff7ff9010, 0xfffff7ff9020): 0x2
      [0xfffff7ff9020, 0xfffff7ff9030): 0x1
      [0xfffff7ff9030, 0xfffff7ff9040): 0x2
      [0xfffff7ff9040, 0xfffff7ff9050): 0x0
      
      This is implemented using the QMemTags packet previously
      added. We skip validating the number of tags in lldb and send
      them on to lldb-server, which repeats them as needed.
      
      Apart from the number of tags, all the other client side checks
      remain. Tag values, memory range must be tagged, etc.
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D105183
      
      (cherry picked from commit 6eded00e)
      dc00e191
    • David Spickett's avatar
      [lldb] Add "memory tag write" command · 45d98857
      David Spickett authored
      This adds a new command for writing memory tags.
      It is based on the existing "memory write" command.
      
      Syntax: memory tag write <address-expression> <value> [<value> [...]]
      (where "value" is a tag value)
      
      (lldb) memory tag write mte_buf 1 2
      (lldb) memory tag read mte_buf mte_buf+32
      Logical tag: 0x0
      Allocation tags:
      [0xfffff7ff9000, 0xfffff7ff9010): 0x1
      [0xfffff7ff9010, 0xfffff7ff9020): 0x2
      
      The range you are writing to will be calculated by
      aligning the address down to a granule boundary then
      adding as many granules as there are tags.
      
      (a repeating mode with an end address will be in a follow
      up patch)
      
      This is why "memory tag write" uses MakeTaggedRange but has
      some extra steps to get this specific behaviour.
      
      The command does all the usual argument validation:
      * Address must evaluate
      * You must supply at least one tag value
        (though lldb-server would just treat that as a nop anyway)
      * Those tag values must be valid for your tagging scheme
        (e.g. for MTE the value must be > 0 and < 0xf)
      * The calculated range must be memory tagged
      
      That last error will show you the final range, not just
      the start address you gave the command.
      
      (lldb) memory tag write mte_buf_2+page_size-16 6
      (lldb) memory tag write mte_buf_2+page_size-16 6 7
      error: Address range 0xfffff7ffaff0:0xfffff7ffb010 is not in a memory tagged region
      
      (note that we do not check if the region is writeable
      since lldb can write to it anyway)
      
      The read and write tag tests have been merged into
      a single set of "tag access" tests as their test programs would
      have been almost identical.
      (also I have renamed some of the buffers to better
      show what each one is used for)
      
      Reviewed By: omjavaid
      
      Differential Revision: https://reviews.llvm.org/D105182
      
      (cherry picked from commit 6a7a2ee8)
      45d98857
    • Matheus Izvekov's avatar
      [clang] fix concepts crash on substitution failure during normalization · 4ae33534
      Matheus Izvekov authored
      
      
      When substitution failed on the first constrained template argument (but
      only the first), we would assert / crash. Checking for failure was only
      being performed from the second constraint on.
      
      This changes it so the checking is performed in that case,
      and the code is also now simplified a little bit to hopefully
      avoid this confusion.
      
      Signed-off-by: default avatarMatheus Izvekov <mizvekov@gmail.com>
      
      Reviewed By: rsmith
      
      Differential Revision: https://reviews.llvm.org/D106907
      4ae33534
    • Markus Böck's avatar
      [mlir] Change ABI breaking use of NDEBUG to LLVM_ENABLE_ABI_BREAKING_CHECKS · a7eab64b
      Markus Böck authored
      The `DataLayout` class currently contains the member `layoutStack` which is hidden behind a preprocessor region dependant on the NDEBUG macro. Code wise this makes a lot of sense, as the `layoutStack` is used for extra assertions that users will want when compiling a debug build.
      It however has the uncomfortable consequence of leading to a different ABI in Debug and Release builds. This I think is a bit annoying for downstream projects and others as they may want to build against a stable Release of MLIR in Release mode, but be able to debug their own project depending on MLIR.
      
      This patch changes the related uses of NDEBUG to LLVM_ENABLE_ABI_BREAKING_CHECKS. As the macro is computed at configure time of LLVM, it may not change based on compiler settings of a downstream projects like NDEBUG would.
      
      Differential Revision: https://reviews.llvm.org/D107227
      
      (cherry picked from commit 97335ad1)
      a7eab64b
    • Sanjay Patel's avatar
      [Analysis] improve function signature checking for snprintf · d6974c01
      Sanjay Patel authored
      The check for size_t parameter 1 was already here for snprintf_chk,
      but it wasn't applied to regular snprintf. This could lead to
      mismatching and eventually crashing as shown in:
      https://llvm.org/PR50885
      
      (cherry picked from commit 7f555577)
      d6974c01
    • Jose M Monsalve Diaz's avatar
      [OpenMP] Fixing llvm-omp-device-info compilation with runtimes · 60c388a4
      Jose M Monsalve Diaz authored
      When using `-DLLVM_ENABLED_RUNTIMES` instead of `-DLLVM_ENABLED_PROJECTS`
      the `llvm-omp-device-info` tool is not compiled or installed.
      In general, no llvm tool would be build on runtimes, because the
      -DLLVM_BUILD_TOOLS flag is removed by the way runtimes compilation calls
      cmake again.
      
      This patch is simple. Just forward the value of this flag to the
      runtime cmake command.
      
      I'm also removing an unnecessary comment in the compilation of the tool
      
      Differential Revision: https://reviews.llvm.org/D107177
      
      (cherry picked from commit 5424ceed)
      60c388a4
    • Simon Pilgrim's avatar
      [X86][AVX] Add test case for PR51281 · ec7ef426
      Simon Pilgrim authored
      (cherry picked from commit 6569b7f9)
      ec7ef426
    • Dmitry Vyukov's avatar
      Revert "sanitizers: increase .clang-format columns to 100" · 73249a83
      Dmitry Vyukov authored
      This reverts commit 5d1df6d2.
      
      There is a strong objection to this change:
      https://reviews.llvm.org/D106436#2905618
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D106847
      
      (cherry picked from commit 440e936c)
      73249a83
    • Tom Stellard's avatar
      Revert "[Preprocessor] Implement -fminimize-whitespace." · 4a450da7
      Tom Stellard authored
      This reverts commit ae6b4000.
      
      llvm.org/PR51300
      4a450da7
    • Sanjay Patel's avatar
      [DAGCombiner] don't try to partially reduce add-with-overflow ops · 3bce6131
      Sanjay Patel authored
      This transform was added with D58874, but there were no tests for overflow ops.
      We need to change this one way or another because it can crash as shown in:
      https://llvm.org/PR51238
      
      Note that if there are no uses of an overflow op's bool overflow result, we
      reduce it to a regular math op, so we continue to fold that case either way.
      If we have uses of both the math and the overflow bool, then we are likely
      not saving anything by creating an independent sub instruction as seen in
      the test diffs here.
      
      This patch makes the behavior in SDAG consistent with what we do in
      instcombine AFAICT.
      
      Differential Revision: https://reviews.llvm.org/D106983
      
      (cherry picked from commit fa6b2c99)
      3bce6131
    • Sanjay Patel's avatar
      [AArch64][x86] add tests for add-with-overflow folds; NFC · e6ca0238
      Sanjay Patel authored
      There's a generic combine for these, but no test coverage.
      It's not clear if this is actually a good fold.
      The combine was added with D58874, but it has a bug that
      can cause crashing ( https://llvm.org/PR51238 ).
      
      (cherry picked from commit e427077e)
      e6ca0238
    • Sanjay Patel's avatar
      [DivRemPairs] make sure we have a valid CFG for hoisting division · 2f43c816
      Sanjay Patel authored
      This transform was added with e38b7e89
      and as shown in:
      https://llvm.org/PR51241
      ...it could crash without an extra check of the blocks.
      
      There might be a more compact way to write this constraint,
      but we can't just count the successors/predecessors without
      affecting a test that includes a switch instruction.
      
      (cherry picked from commit 5b83261c)
      2f43c816
    • Craig Topper's avatar
      [RISCV] Restrict performANY_EXTENDCombine to prevent an infinite loop. · 9ac5717f
      Craig Topper authored
      The sign_extend we insert here can get turned into a zero_extend if
      the sign bit is known zero. This can enable a setcc combine that
      shrinks compares with zero_extend. This reduces the use count of
      the zero_extend allowing other combines to turn it back into an
      any_extend.
      
      This restricts the combine to only cases where the result is used
      by a CopyToReg. This works for my original motivating case. I
      hope the CopyToReg use will prevent any converted extends from
      turning back into an any_extend.
      
      Reviewed By: luismarques
      
      Differential Revision: https://reviews.llvm.org/D106754
      
      (cherry picked from commit 54588bcc)
      9ac5717f