[all-commits] [llvm/llvm-project] 1b1113: [RISCV] Fix assertion failure when zcmp extension ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Aug 31 23:27:37 PDT 2023

  Branch: refs/heads/release/17.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b1113731fefb9d30f9167514a6cdf3b3f0ee007
  Author: Garvit Gupta <quic_garvgupt at quicinc.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    A llvm/test/CodeGen/RISCV/zcmp-prolog-epilog-crash.mir

  Log Message:
  [RISCV] Fix assertion failure when zcmp extension is enabled.

Before accessing "getOpcode" thorugh machine instruction, check if the iterator
has reached the end of Machine basic block otherwise we will crash at the
assertion `!NodePtr->isKnownSentinel()`.

The above assertion is hit in "Prologue/Epilogue Insertion & Frame Finalization

Reviewed By: craig.topper, wangpc

Differential Revision: https://reviews.llvm.org/D158256

(cherry picked from commit fdef7952cbc26fd31d0d92a4f14dde58bc461fe9)

  Commit: 4a999da2142229f0d2a3598331ce55a1323929bd
  Author: Yuxuan Shui <yshuiv7 at gmail.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M lldb/source/Host/windows/FileSystem.cpp

  Log Message:
  [lldb][windows] _wsopen_s does not accept bits other than `_S_IREAD | _S_IWRITE`

When sending file from a Linux host to a Windows remote, Linux host will try to copy the source file's permission bits, which will contain `_S_I?GRP` and `_S_I?OTH` bits. Those bits are rejected by `_wsopen_s`, causing it to return EINVAL.

This patch masks out the rejected bits.

GitHub issue: #64313

Reviewed By: jasonmolenda, DavidSpickett

Differential Revision: https://reviews.llvm.org/D156817

(cherry picked from commit 9a4b3fdb82327e808213070fd157be3c557b8b9d)

  Commit: 078e20cade5518d7df48c75ac25c3179f825f70a
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M libcxx/include/__format/format_functions.h
    M libcxx/test/std/utilities/format/format.functions/format_tests.h
    M libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp

  Log Message:
  [libc++][format] Fixes out of bounds access.

Fixes https://llvm.org/PR65011

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158940

(cherry picked from commit 8930d04d5580c6a2cf04545c87387cd150cd7b46)

  Commit: 844f1e5a026c43ffc556679dcec767ece704a40d
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    A llvm/test/CodeGen/AArch64/memtag-loop-nzcv.ll

  Log Message:
  [AArch64] Add Defs=[NZCV] to MTE loop pseudos.

The `STGloop` family of pseudo-instructions all expand to a loop which
iterates over a region of memory setting all its MTE tags to a given
value. The loop writes to the flags in order to check termination. But
the unexpanded pseudo-instructions were not marked as modifying the
flags. Therefore it was possible for one to end up in a location where
the flags were live, and then the loop would corrupt them.

We spotted the effect of this in a libc++ test involving a lot of
complicated inlining, and haven't been able to construct a smaller
test case that demonstrates actual incorrect output code. So my test
here is just checking that `implicit-def $nzcv` shows up on the
pseudo-instructions as they're output from isel.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D158262

(cherry picked from commit b09c575975b691e988a0f2e31d632c5f1038ab1d)

  Commit: 2b3336fa54af70d885b8d795d69337d5b05913e5
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M lld/ELF/Arch/PPC.cpp
    M lld/ELF/Arch/PPC64.cpp
    M lld/ELF/Target.h
    M lld/test/ELF/ppc32-tls-ie.s
    M lld/test/ELF/ppc64-tls-ie.s
    M lld/test/ELF/ppc64-tls-pcrel-ie.s

  Log Message:
  [PowerPC][lld] Account for additional X-Forms -> D-Form/DS-Forms load/stores when relaxing initial-exec to local-exec

D153645 added additional X-Form load/stores that can be generated for TLS accesses.
However, these added instructions have not been accounted for in lld. As a result,
lld does not know how to handle them and cannot relax initial-exec to local-exec
when the initial-exec sequence contains these additional load/stores.

This patch aims to resolve https://github.com/llvm/llvm-project/issues/64424.

Differential Revision: https://reviews.llvm.org/D158197

(cherry picked from commit 698b45aa902de4d30c798e8d6bd080c8e31bade8)

  Commit: b879e0f5c402dd8f0e18e8c5ea64774a407390c6
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp
    A llvm/test/CodeGen/RISCV/pr65025.ll

  Log Message:
  [RISCV] Prevent tryToFoldBNEOnCmpXchgResult from deleting AND if it has others users.

This disables the transform if the branch does not have the kill
flag set for the AND we want to delete.

Ideally we'd be able to share the AND with the AND we create in
the expansion, but that's a more complex transform. So this starts
with the simple approach to fix miscompile.

This should be backported to LLVM 17.

Fixes PR65025.ll

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D158962

(cherry picked from commit ff6d33382faf3709fa270ae0abb8d165142df9ae)

  Commit: dc2d2f9ba1bc3e72d011c6203eb986e8d0f5ca32
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M clang-tools-extra/clangd/IncludeCleaner.cpp
    M clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp

  Log Message:
  [clangd] Respect IWYU keep pragma for standard headers.

see the issue https://github.com/llvm/llvm-project/issues/64191

Differential Revision: https://reviews.llvm.org/D156650

(cherry picked from commit dcb28244faa88cb566a852533790bcac75daaa0f)

  Commit: a0de0b440fa606805749dc7469a1b7dcae851eba
  Author: Phoebe Wang <phoebe.wang at intel.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/bfloat.ll

  Log Message:
  [X86][BF16] Add test coverage for AVX-NE-CONVERT

Split from D158952.

(cherry picked from commit 30ec9473c6685d64d5caa17e2a6e8f4ccf275159)

  Commit: e9eaf3dc64a62f3991c03f4176eb7f92034469a3
  Author: Phoebe Wang <phoebe.wang at intel.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86InstrAVX512.td
    M llvm/lib/Target/X86/X86InstrSSE.td
    M llvm/test/CodeGen/X86/avxneconvert-intrinsics.ll
    M llvm/test/CodeGen/X86/bfloat.ll

  Log Message:
  [X86][BF16] Lower FP_ROUND for vector types under AVX512BF16

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D158952

(cherry picked from commit b667e9c23d6d2f1c7371eb4a03b30de4a6f8b7b6)

  Commit: c138c8a72e360c65da7cfe0cd4b716d78cdc428d
  Author: Ying Yi <ying.yi at sony.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M clang/include/clang/Basic/Sanitizers.h
    M clang/lib/Basic/CMakeLists.txt
    M clang/lib/Basic/Sanitizers.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/test/CodeGenObjCXX/crash-function-type.mm
    M clang/test/Driver/fsanitize.c

  Log Message:
  [UBSan] Disable the function and kcfi sanitizers on an execute-only target.

An execute-only target disallows data access to code sections.
-fsanitize=function and -fsanitize=kcfi instrument indirect function
calls to load a type hash before the function label. This results in a
non-execute access to the code section and a runtime error.

To solve the issue, -fsanitize=function should not be included in any
check group (e.g. undefined) on an execute-only target. If a user passes
-fsanitize=undefined, there is no error and no warning. However, if the
user explicitly passes -fsanitize=function or -fsanitize=kcfi on an
execute-only target, an error will be emitted.

Fixes: https://github.com/llvm/llvm-project/issues/64931.

Reviewed By: MaskRay, probinson, simon_tatham

Differential Revision: https://reviews.llvm.org/D158614

  Commit: 051aa171d2177776964cc309d14d8333af66135f
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M clang/include/clang/Basic/Sanitizers.h
    M clang/lib/Basic/CMakeLists.txt
    M clang/lib/Basic/Sanitizers.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    M llvm/include/llvm/Option/ArgList.h
    M llvm/lib/Option/ArgList.cpp

  Log Message:
  [Driver] Adjust -fsanitize=function & -mexecute-only interop after D158614

clangDriver depends on clangBasic, so clangBasic should not depend on
clangDriver, even just its header. Also remove clangBasic's dependency
on LLVMOption.

The issue can be seen through the bazel commit
d26dd681f9726ed7d43d7c0bdd8ee3cb2db69a2b which is reverted now.

Add hasFlagNoClaim and use it as we don't want to suppress
-Wunused-command-line-argument for -mexecute-only just because
-fsanitize= is specified.

Compare: https://github.com/llvm/llvm-project/compare/b66219d73500...051aa171d217

More information about the All-commits mailing list