Changes

Summary

  1. [Verifier] Fail on overrunning and invalid indices for {insert,extract} vector intrinsics (details)
  2. [lldb] Remove CommandReturnObject's SetError(StringRef) (details)
  3. [InstSimplify] Add more poison folding optimizations (details)
  4. Add support for #pragma system_header with -fms-extensions (details)
  5. [NFCI-ish][SimplifyCFGPass] Rework and generalize `ret` block tail-merging (details)
  6. [AIX][PowerPC] Remove error when specifying mabi=vec-default on AIX (details)
  7. [clang-format] Fix a bug that indents else-comment-if incorrectly (details)
  8. [AArch64] Add CodeGen tests for vector reduction intrinsics. NFC (details)
  9. [lldb][NFC] Remove some redundant semicolons on HostInfoMacOSX (details)
  10. [lldb] Remove asserts in CommandReturnObject SetError and AppendError (details)
  11. [ARMParallelDSP] Remove unnecessary wrapper function (NFC) (details)
  12. [NFC][ARM] Fix update_llc_test_checks for armv7-apple-ios, autogenerate ifcvt5.ll/ifcvt6.ll (details)
  13. [NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-ios, autogenerate switch-minsize.ll (details)
  14. [NFC][ARM] Fix update_llc_test_checks for aarch64-apple-ios/thumbv7s-apple-darwin, autogenerate a few tests (details)
  15. [NFC][AArch64] Autogenerate a few more tests (details)
  16. [NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-darwin, autogenerate thumb2-ifcvt1.ll (details)
  17. [AMDGPU] Remove unused multiclass MUBUF_Real_gfx10_with_name (details)
  18. Handle interactions between reserved identifier and user-defined suffixes (details)
  19. [NFC] Update arm_function_name.ll after 4de0c400317e5a92d57f2c76545061a9e7de22f8 (details)
  20. [libc++] Remove ad-hoc modules tests that are now unnecessary (details)
Commit 3c4dbf6ea9a06d0e5b460895bc5677ca7e382b4e by joe.ellis
[Verifier] Fail on overrunning and invalid indices for {insert,extract} vector intrinsics

With regards to overrunning, the langref (llvm/docs/LangRef.rst)
specifies:

   (llvm.experimental.vector.insert)
   Elements ``idx`` through (``idx`` + num_elements(``subvec``) - 1)
   must be valid ``vec`` indices. If this condition cannot be determined
   statically but is false at runtime, then the result vector is
   undefined.

   (llvm.experimental.vector.extract)
   Elements ``idx`` through (``idx`` + num_elements(result_type) - 1)
   must be valid vector indices. If this condition cannot be determined
   statically but is false at runtime, then the result vector is
   undefined.

For the non-mixed cases (e.g. inserting/extracting a scalable into/from
another scalable, or inserting/extracting a fixed into/from another
fixed), it is possible to statically check whether or not the above
conditions are met. This was previously missing from the verifier, and
if the conditions were found to be false, the result of the
insertion/extraction would be replaced with an undef.

With regards to invalid indices, the langref (llvm/docs/LangRef.rst)
specifies:

    (llvm.experimental.vector.insert)
    ``idx`` represents the starting element number at which ``subvec``
    will be inserted. ``idx`` must be a constant multiple of
    ``subvec``'s known minimum vector length.

    (llvm.experimental.vector.extract)
    The ``idx`` specifies the starting element number within ``vec``
    from which a subvector is extracted. ``idx`` must be a constant
    multiple of the known-minimum vector length of the result type.

Similarly, these conditions were not previously enforced in the
verifier. In some circumstances, invalid indices were permitted
silently, and in other circumstances, an undef was spawned where a
verifier error would have been preferred.

This commit adds verifier checks to enforce the constraints above.

Differential Revision: https://reviews.llvm.org/D104468
The file was modifiedllvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-cmpne.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-insert-vector.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/canonicalize-vector-extract.ll
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/test/Transforms/InstCombine/canonicalize-vector-insert.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-extract-vector.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert-subvector.ll
The file was addedllvm/test/Verifier/insert-extract-intrinsics-invalid.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-extract-subvector.ll
Commit 1b1c8e4a984c07a3c985408d3d80c8e24e60d3d1 by david.spickett
[lldb] Remove CommandReturnObject's SetError(StringRef)

Replacing existing uses with AppendError.

SetError is also part of the SBI API. This remains
but instead of calling the underlying SetError it
will call AppendError.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104768
The file was modifiedlldb/source/Commands/CommandObjectReproducer.cpp
The file was modifiedlldb/source/Commands/CommandObjectTrace.cpp
The file was modifiedlldb/include/lldb/Interpreter/CommandReturnObject.h
The file was modifiedlldb/source/API/SBCommandReturnObject.cpp
The file was modifiedlldb/source/Commands/CommandObjectThread.cpp
The file was modifiedlldb/source/Commands/CommandObjectType.cpp
The file was modifiedlldb/source/Commands/CommandObjectMultiword.cpp
The file was modifiedlldb/source/Commands/CommandObjectProcess.cpp
The file was modifiedlldb/source/Interpreter/CommandObject.cpp
The file was modifiedlldb/source/Commands/CommandObjectBreakpoint.cpp
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
Commit 5af8bacc940243038478da1c92c3481cbdfcece3 by aqjune
[InstSimplify] Add more poison folding optimizations

This adds more poison folding optimizations to InstSimplify.

Since all binary operators propagate poison, these are fine.

Also, the precondition of `select cond, undef, x` -> `x` is relaxed to allow the case when `x` is undef.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D104661
The file was modifiedllvm/test/Transforms/InstSimplify/select-inseltpoison.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstCombine/and-narrow.ll
The file was modifiedllvm/test/Transforms/InstCombine/getelementptr.ll
The file was modifiedllvm/test/Transforms/InstSimplify/shift.ll
The file was modifiedllvm/test/Transforms/InstSimplify/fcmp.ll
The file was modifiedllvm/test/Transforms/InstSimplify/mul.ll
The file was modifiedllvm/test/Transforms/InstSimplify/and.ll
The file was modifiedllvm/test/Transforms/InstSimplify/sub.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll
The file was modifiedllvm/test/Transforms/InstSimplify/ConstProp/poison.ll
The file was modifiedllvm/test/Transforms/InstSimplify/select.ll
The file was modifiedllvm/test/Transforms/InstSimplify/or.ll
Commit 24037c37b6c4043faae7bf396b735e1ba36e46e0 by hans
Add support for #pragma system_header with -fms-extensions

Clang already supports the pragma prefixed by "GCC" or "clang".

MSVC has more recently added support for the pragma, but without any prefix; see
https://devblogs.microsoft.com/cppblog/broken-warnings-theory/#external-headers

Differential revision: https://reviews.llvm.org/D104770
The file was modifiedclang/test/Preprocessor/pragma_sysheader.c
The file was modifiedclang/lib/Lex/Pragma.cpp
The file was modifiedclang/test/Lexer/pragma-operators.cpp
The file was addedclang/test/Preprocessor/Inputs/pragma_sysheader.h
The file was removedclang/test/Preprocessor/pragma_sysheader.h
Commit ff4b1d379f3f3d2dfd9f9b4fc5715676024b8024 by lebedev.ri
[NFCI-ish][SimplifyCFGPass] Rework and generalize `ret` block tail-merging

This changes the approach taken to tail-merge the blocks
to always create a new block instead of trying to reuse some block,
and generalizes it to support dealing not with just the `ret` in the future.

This effectively lifts the CallBr restriction, although this isn't really intentional.
That is the only non-NFC change here, i'm not sure if it's reasonable/feasible to temporarily retain it.

Other restrictions of the transform remain.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D104598
The file was modifiedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-no-new-successors.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/return-merge.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/pr48778-sdiv-speculation.ll
The file was modifiedllvm/test/CodeGen/ARM/speculation-hardening-sls.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
The file was modifiedllvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
The file was modifiedllvm/test/Transforms/SimplifyCFG/basictest.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/suppress-zero-branch-weights.ll
The file was modifiedllvm/test/Transforms/LoopUnroll/ARM/upperbound.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/rangereduce.ll
Commit 76c931ae42cf1080199a238446306e8554ebb6de by zarko
[AIX][PowerPC] Remove error when specifying mabi=vec-default on AIX

The default Altivec ABI was implemented but the clang error for specifying
its use still remains.  Users could get around this but not specifying the
type of Altivec ABI but we need to remove the error.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D102094
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was removedclang/test/Driver/aix-vec-extabi.c
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/test/Preprocessor/aix-vec_extabi.c
The file was modifiedclang/test/CodeGen/altivec.c
The file was addedclang/test/Driver/aix-vec_extabi.c
Commit ca7f4715858137dc97ac782cead65ba706bffa3c by owenca
[clang-format] Fix a bug that indents else-comment-if incorrectly

PR50809

Differential Revision: https://reviews.llvm.org/D104774
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/unittests/Format/FormatTest.cpp
Commit 12cb8ca6686041990f83eab1897b41f70f6f123c by rosie.sumpter
[AArch64] Add CodeGen tests for vector reduction intrinsics. NFC

Tests are added for vector reduce OR, AND and XOR.

Differential Revision: https://reviews.llvm.org/D104771
The file was addedllvm/test/CodeGen/AArch64/reduce-and.ll
The file was addedllvm/test/CodeGen/AArch64/reduce-or.ll
The file was addedllvm/test/CodeGen/AArch64/reduce-xor.ll
Commit 8a5165b3b9f20017ad28e28d7bc519f1855f0bfa by Raphael Isemann
[lldb][NFC] Remove some redundant semicolons on HostInfoMacOSX
The file was modifiedlldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
Commit fe63db25bcc0dd31fc471f60591a0f24ee8dbf57 by david.spickett
[lldb] Remove asserts in CommandReturnObject SetError and AppendError

I added asserts to these in https://reviews.llvm.org/D104525.
They are available (directly or otherwise) via the API so we
should not assert.

Restore the previous behaviour. If the message
is empty, we return early before printing anything.
For SetError don't assert that the error is a failure.

The remaining assert is in AppendRawError which
is not part of the API.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104778
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
Commit 8c01deb8e65490d730e8a2eac1e4ffa8822ce992 by nikita.ppv
[ARMParallelDSP] Remove unnecessary wrapper function (NFC)

AreSequentialAccesses() forwards directly to isConsecutiveAccess()
and has an unnecessary template parameter to boot.
The file was modifiedllvm/lib/Target/ARM/ARMParallelDSP.cpp
Commit 4de0c400317e5a92d57f2c76545061a9e7de22f8 by lebedev.ri
[NFC][ARM] Fix update_llc_test_checks for armv7-apple-ios, autogenerate ifcvt5.ll/ifcvt6.ll
The file was modifiedllvm/test/CodeGen/ARM/ifcvt5.ll
The file was modifiedllvm/utils/UpdateTestChecks/asm.py
The file was modifiedllvm/test/CodeGen/ARM/ifcvt6.ll
Commit 15be15073ef6eb2c4fd734917322909d405f16e2 by lebedev.ri
[NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-ios, autogenerate switch-minsize.ll
The file was modifiedllvm/test/CodeGen/ARM/switch-minsize.ll
The file was modifiedllvm/utils/UpdateTestChecks/asm.py
Commit 3c94869632d3f762c1699d4d920c1ac2721b95c0 by lebedev.ri
[NFC][ARM] Fix update_llc_test_checks for aarch64-apple-ios/thumbv7s-apple-darwin, autogenerate a few tests
The file was modifiedllvm/test/CodeGen/ARM/ifcvt-iter-indbr.ll
The file was modifiedllvm/utils/UpdateTestChecks/asm.py
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/swifterror.ll
The file was modifiedllvm/test/CodeGen/AArch64/branch-relax-asm.ll
The file was modifiedllvm/test/CodeGen/AArch64/swifterror.ll
Commit b77972ac4f05a45fabdd76f60ac1deb5816512b5 by lebedev.ri
[NFC][AArch64] Autogenerate a few more tests
The file was modifiedllvm/test/CodeGen/AArch64/sve-breakdown-scalable-vectortype.ll
The file was modifiedllvm/test/CodeGen/AArch64/check-sign-bit-before-extension.ll
Commit eb7ce97870d919961f5a41804d33684abbef1188 by lebedev.ri
[NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-darwin, autogenerate thumb2-ifcvt1.ll
The file was modifiedllvm/test/CodeGen/Thumb2/thumb2-ifcvt1.ll
The file was modifiedllvm/utils/UpdateTestChecks/asm.py
Commit a16cb95a3a44b471fcbdb67b0844de9018b27873 by jay.foad
[AMDGPU] Remove unused multiclass MUBUF_Real_gfx10_with_name
The file was modifiedllvm/lib/Target/AMDGPU/BUFInstructions.td
Commit a0d05ed848990c06c6dcdfc2e37bc8f13f7fe470 by sguelton
Handle interactions between reserved identifier and user-defined suffixes

According to https://eel.is/c++draft/over.literal

> double operator""_Bq(long double);  // OK: does not use the reserved identifier _­Bq ([lex.name])
> double operator"" _Bq(long double); // ill-formed, no diagnostic required: uses the reserved identifier _­Bq ([lex.name])

Obey that rule by keeping track of the operator literal name status wrt. leading whitespace.

Fix: https://bugs.llvm.org/show_bug.cgi?id=50644

Differential Revision: https://reviews.llvm.org/D104299
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Parse/ParseExprCXX.cpp
The file was modifiedclang/test/Sema/reserved-identifier.cpp
The file was modifiedclang/lib/AST/Decl.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
Commit 707224ea16f67c9a4fb97e89f5599838fd622841 by lebedev.ri
[NFC] Update arm_function_name.ll after 4de0c400317e5a92d57f2c76545061a9e7de22f8
The file was modifiedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/arm_function_name.ll.expected
Commit 0c0628c92c0d3638f5739ecb28ba554347feccdf by Louis Dionne
[libc++] Remove ad-hoc modules tests that are now unnecessary

Since we now have modules-enabled CI, it is now redundant to have ad-hoc
tests that check arbitrary things about our modules support. Instead,
the whole test suite should pass with modules enabled, period.

This patch also removes the module cache path workaround: one would
expect that modules work properly without that workaround. If that
isn't the case and we do run into flaky test failures, we can re-enable
the workaround temporarily (but that would be very vexing and we should
fix Clang ASAP if that's the case).

Differential Revision: https://reviews.llvm.org/D104746
The file was removedlibcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp
The file was removedlibcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp
The file was removedlibcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp
The file was modifiedlibcxx/utils/libcxx/test/features.py
The file was removedlibcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp
The file was removedlibcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp
The file was removedlibcxx/test/libcxx/modules/stds_include.sh.cpp