Changes

Summary

  1. [gn build] (manually) port 480dcdc8975d8 (llvm-ifs OptTable) (details)
  2. [RISCV] Add initial test coverage for LSR (details)
  3. [InstructionSimplify] Remove multiple 'break' after 'return'. NFC (details)
  4. Revert "[ConstantRange] Improve the implementation of binaryOr" (details)
  5. Update fuzzing test to comply with new optimisation. (details)
  6. Adapt C++ std::string dataformatter for D125496 (details)
  7. Fix up fuzzing test on Windows. (details)
  8. Avoid uninitialized Diag.ID (which we pass but never read) (details)
  9. Add some diagnostics to diagnose bot-only failures for TestIgnoredExceptions.py (details)
  10. Recommit "[ConstantRange] Improve the implementation of binaryOr" (details)
  11. [AArch64] Use proper instruction mnemonics for FPRs (details)
  12. [CodeView] Combine variable def ranges that are continuous. (details)
  13. Reland "[clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks"" (details)
  14. [Libomptarget] Add branch prediction intrinsic to state check (details)
  15. [clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated-headers (details)
  16. [clang-tidy] modernize-deprecated-headers should ignore system headers (details)
  17. Mark new TSan test as unsupported on PPC. (details)
  18. Add a page to track C defect report status (details)
  19. [OpenMP] Fix partial unrolling off-by-one. (details)
  20. Add 'ppc' as a target (for both 32- and 64-bit ppc). (details)
  21. [lldb] Consider binary as module of last resort (details)
  22. [lldb] Fix spurious assertion in PrintCommandOutput (details)
  23. PPC+TSan whack-a-mole, round 3. (details)
  24. [LLVM] Add a check if should cast atomic operations to integer type (details)
  25. [NVPTX] Enable AtomicExpandPass for NVPTX (details)
  26. [mlir][sparse] Support more complex operations. (details)
  27. [lld-macho] Stop crash when emitting personalities with -dead_strip (details)
Commit 98d141481e0410bb830fb257be7099edfca6e17f by thakis
[gn build] (manually) port 480dcdc8975d8 (llvm-ifs OptTable)
The file was modifiedllvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn
Commit 923831ebc37c258268db57856f066980aa3eef18 by listmail
[RISCV] Add initial test coverage for LSR

Establish the most basic possible test coverage for LSR transformation on RISCV.

Original patch by eopXD (D123458), modified by me to cleanup/simplify tests.
The file was addedllvm/test/CodeGen/RISCV/loop-strength-reduce-loop-invar.ll
The file was addedllvm/test/CodeGen/RISCV/loop-strength-reduce-add-cheaper-than-mul.ll
Commit f2df53b75071736009d68ba73e86edf7e25cebbd by craig.topper
[InstructionSimplify] Remove multiple 'break' after 'return'. NFC
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 54e3bf5f37d67441dafbc66838a54a385293a2e1 by douglas.yung
Revert "[ConstantRange] Improve the implementation of binaryOr"

This reverts commit 6990e7477d24ff585ae86549f5280f0be65422a6.

This change was causing the test compiler-rt/test/fuzzer/merge_two_step.test to fail on
our internal bot as well as other build bots such as https://lab.llvm.org/buildbot/#/builders/179/builds/3712.
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
The file was modifiedllvm/lib/IR/ConstantRange.cpp
Commit 3bd112c720dc614a59e3f34ebf9b45075037bfa0 by 31459023+hctim
Update fuzzing test to comply with new optimisation.

https://reviews.llvm.org/D125933 improved some of LLVM's handling of
binary ORs, which meant we have one less conditional branch, because the
'if (Size > 5 && Data[5] == 'R')' and 'if (bits == 63)' branches are now
correctly folded.
The file was modifiedcompiler-rt/test/fuzzer/merge_two_step.test
Commit f4570ce442b492d436a0e314c6ea14bf299af0d3 by Adrian Prantl
Adapt C++ std::string dataformatter for D125496

https://reviews.llvm.org/D125496 changed the layout of std::string
without updating the LLDB dataformatter. This patch adds code to
recognize the new format.

Differential Revision: https://reviews.llvm.org/D126080
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
Commit 80ac0b9bc8865e6cf6bdc9436405dae1a4ec0e38 by 31459023+hctim
Fix up fuzzing test on Windows.

3bd112c720dc fixed the fuzzing test on Linux, which, after
https://reviews.llvm.org/D125933, has one less branch. Turns out, on
Windows, that it still has the extra branch. I'm guessing that's because
exit() isn't known to be noreturn on Windows or something.

Either way, just make the test more tolerant.
The file was modifiedcompiler-rt/test/fuzzer/merge_two_step.test
Commit 1fef69da0bfd51de916f0a869f97740c51211cc1 by github
Avoid uninitialized Diag.ID (which we pass but never read)
The file was modifiedclang-tools-extra/clangd/Diagnostics.h
Commit 9385a6d6eaa3f4caebdee2eb53b5bf4ca1f1b832 by jingham
Add some diagnostics to diagnose bot-only failures for TestIgnoredExceptions.py

The test for commit bff4673b41781ec5bff6b96b52cf321d2271726c is failing on the
GreenDragon bot but none of us can repro the failure locally.  Adding some logging
to the test failure to help diagnose the issue.
The file was modifiedlldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
Commit 9398caf399ae04d3f331c7d766ee9884f794d4f2 by ashaposhnikov
Recommit "[ConstantRange] Improve the implementation of binaryOr"

This recommits https://reviews.llvm.org/rG6990e7477d24ff585ae86549f5280f0be65422a6
as the problematic test has been updated updated in
https://reviews.llvm.org/rG3bd112c720dc614a59e3f34ebf9b45075037bfa0.
The file was modifiedllvm/lib/IR/ConstantRange.cpp
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
Commit d497129f9bfaeff9fd2a57d75186ef0966758ca4 by isanbard
[AArch64] Use proper instruction mnemonics for FPRs

The FPR128 regs need MOVIv2d_ns and SVE regs need DUP_ZI_D.

Differential Revision: https://reviews.llvm.org/D126083
The file was modifiedllvm/lib/Target/AArch64/AArch64FrameLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/zero-call-used-regs.ll
Commit 9886046289fa63d8acf7e50cef59122d4b6ccb1f by zequanwu
[CodeView] Combine variable def ranges that are continuous.

It saves about 1.13% size for chrome.dll.pdb on chrome official build.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D125721
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
The file was modifiedllvm/test/DebugInfo/COFF/pieces.ll
Commit 665bfbb98daa0e40a2e6cecfbbfd6949980d8f2f by balazs.benics
Reland "[clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks""

This partially reverts commit e8cae487022c2216182ae1ec24f248f287a614b7.
Changes since that commit:
- Use `SourceManager::isBeforeInTranslationUnit` instead of the fancy
   decomposed decl logarithmic search.
- Add a test for including a system header containing a deprecated
   include.
- Add `REQUIRES: system-linux` clause to the test.

Reviewed By: LegalizeAdulthood, whisperity

Differential Revision: https://reviews.llvm.org/D125209
The file was modifiedclang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h
The file was addedclang-tools-extra/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/mysystemlib.h
The file was modifiedclang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
The file was addedclang-tools-extra/test/clang-tidy/checkers/Inputs/modernize-deprecated-headers/mylib.h
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was addedclang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
Commit 20ec4161d7c9e146c844fadf5af2a44afb9e7a60 by jhuber6
[Libomptarget] Add branch prediction intrinsic to state check

Summary:
We usually used the `OMP_LIKELY` and `OMP_UNLIKELY` macros to add branch
prediction intrinsics to help the optimizer ignore unlikely loops. This
wasn't applied to this one loop so add that in.
The file was modifiedopenmp/libomptarget/DeviceRTL/src/State.cpp
Commit 0606467ea122da5cb23a588e1222a4140445734a by balazs.benics
[clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated-headers

Unfortunately, we must restrict the checker to warn for deprecated headers
only if the header is included directly from a c++ source file.

For header files, we cannot know if the project has a C source file
that also directly/indirectly includes the offending header file
otherwise. Thus, it's better to be on the safe side and suppress those
reports.

One can opt-in the old behavior, emitting diagnostics into header files,
if one explicitly sets the WarnIntoHeaders=true, in which case nothing
will be changed.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125769
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-headers.rst
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was modifiedclang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h
Commit 6fa82e344c291cf0e1134b357b1f09fd2dcd3f4f by balazs.benics
[clang-tidy] modernize-deprecated-headers should ignore system headers

The end-user has no way of 'fixing' bugs in the system library anyway.
Let's suppress these as well.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125770
The file was modifiedclang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/modernize-deprecated-headers-extern-c.cpp
Commit b517d679dd69a30ed84e9782a2e902cf4284ebc7 by 31459023+hctim
Mark new TSan test as unsupported on PPC.

Notably fails under PPC. For now, just exclude it. More details in the
original Phabricator review, https://reviews.llvm.org/D110552.
The file was modifiedcompiler-rt/test/tsan/lock_free_stack.cpp
Commit ade5b55af5747413dab8dd57896532fdee19cdf5 by aaron
Add a page to track C defect report status

We currently have a page for tracking defects against the C++ standard,
but we don't have the same information for the C standard. This starts
us down the path of being able to track that in a way our users can see.

There are *a lot* of entries marked as "Unknown". As we validate
Clang's behavior for a given DR by adding a test case for it, we can
slowly begin to improve this page over time.

This page is now linked from the existing C status page, which was
updated slightly as a result of these changes as well.

Note, unlike with the C++ defect report page, this content is not auto-
generated from a source document and is not automatically updated from
test comments. It may be worthwhile to automate the updates based on
our test coverage, but that can happen later.
The file was modifiedclang/www/c_status.html
The file was addedclang/www/c_dr_status.html
Commit acec07005e038ab2891f235ae60ba2f0236bb952 by llvm-project
[OpenMP] Fix partial unrolling off-by-one.

Even though the comment description is ".unroll_inner.iv < NumIterations", the code emitted a BO_LE ('<=') operator for the inner loop that is to be unrolled. This lead to one additional copy of the body code in a partially unrolled. It only manifests when the unrolled loop is consumed by another loop-associated construct. Fix by using the BO_LT operator instead.

The condition for the outer loop and the corresponding code for tiling correctly used BO_LT already.

Fixes #55236
The file was modifiedclang/test/OpenMP/unroll_codegen_for_collapse_outer.cpp
The file was modifiedclang/test/OpenMP/unroll_codegen_parallel_for_factor.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/test/OpenMP/unroll_codegen_tile_for.cpp
The file was modifiedclang/test/OpenMP/unroll_codegen_unroll_for_attr.cpp
The file was modifiedclang/test/OpenMP/irbuilder_unroll_partial_heuristic_for_collapse.c
The file was modifiedclang/test/OpenMP/unroll_codegen_for_partial.cpp
The file was modifiedclang/test/OpenMP/irbuilder_unroll_partial_factor_for_collapse.c
The file was modifiedclang/test/OpenMP/unroll_codegen_unroll_for.cpp
Commit bd62b70b515bcbded99ea2debe1d1f54acbb38cd by 31459023+hctim
Add 'ppc' as a target (for both 32- and 64-bit ppc).

Needed for a TSan test that won't pass on PPC. Relevant information is
in https://reviews.llvm.org/D110552.
The file was modifiedcompiler-rt/test/lit.common.cfg.py
Commit a3c3482ceb529206b0ae4e7782e5496da5e0879d by Jonas Devlieghere
[lldb] Consider binary as module of last resort

When setting an address breakpoint using a non-section address in lldb
before having ever run the program, the binary itself is not considered
a module. As a result, the breakpoint is unresolved (and never gets
resolved subsequently).

This patch changes that behavior: as a last resort, the binary is
considered as a module when resolving a non-section address breakpoint.

Differential revision: https://reviews.llvm.org/D124731
The file was addedlldb/test/API/commands/breakpoint/set/address-nomodule/TestBreakpointAddressNoModule.py
The file was modifiedlldb/source/Breakpoint/BreakpointResolverAddress.cpp
The file was modifiedlldb/source/Commands/Options.td
The file was addedlldb/test/API/commands/breakpoint/set/address-nomodule/Makefile
The file was addedlldb/test/API/commands/breakpoint/set/address-nomodule/inferior.c
Commit d252d9231c4a5008a69c6791db498aaf95bda8e7 by Jonas Devlieghere
[lldb] Fix spurious assertion in PrintCommandOutput

When the string passed to PrintCommandOutput doesn't end with a newline,
`written` will exceed `size` and result in an lldbassert.

After 8e776bb660dda6c51ce7ca6cea641db1f47aa9cf we don't really need
written anymore and we can check whether `str` is empty instead. This
patch simplifies the code and removes the assert that's no longer
relevant.

Differential revision: https://reviews.llvm.org/D126081
The file was modifiedlldb/source/Interpreter/CommandInterpreter.cpp
Commit de066267254acb97424bea008195d47de689aca4 by 31459023+hctim
PPC+TSan whack-a-mole, round 3.

More details in https://reviews.llvm.org/D110552.

Last try until I revert the whole shenanigans.
The file was modifiedcompiler-rt/test/lit.common.cfg.py
Commit ff60a0a364b49f1b52883b032f719548685081bd by i
[LLVM] Add a check if should cast atomic operations to integer type

Currently for atomic load, store, and rmw instructions, as long as the
operand is floating-point value, they are casted to integer. Nowadays many
targets can actually support part of atomic operations with floating-point
operands. For example, NVPTX supports atomic load and store of floating-point
values. This patch adds a series interface functions `shouldCastAtomicXXXInIR`,
and the default implementations are same as what we currently do. Later for
targets can have their specialization.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D125652
The file was modifiedllvm/lib/CodeGen/AtomicExpandPass.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetLowering.h
Commit ecf5b780538ecb643462fcb522440ea65d82483c by i
[NVPTX] Enable AtomicExpandPass for NVPTX

This patch enables `AtomicExpandPass` for NVPTX.

Depend on D125652.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D125639
The file was modifiedllvm/lib/Target/NVPTX/NVPTXISelLowering.h
The file was modifiedllvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
The file was modifiedllvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
The file was addedllvm/test/CodeGen/NVPTX/atomicrmw-expand.ll
Commit d390035b46907f1c421d312bdd33f44ad7580415 by bixia1
[mlir][sparse] Support more complex operations.

Add complex operations abs, neg, sin, log1p, sub and div.

Add test cases.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126027
The file was addedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_complex_ops.mlir
The file was modifiedmlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Utils/Merger.h
Commit 190b0f42cf559af7299c53ff010b55bc9b4f5f8c by abrachet
[lld-macho] Stop crash when emitting personalities with -dead_strip

The <internal> symbol was tripping an assertion in getVA() because it
was not marked as used. Per the comment above that symbols creation,
dead stripping has already occurred so marking this symbol as used is
accurate.

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

Differential revision: https://reviews.llvm.org/D126072
The file was modifiedlld/test/MachO/weak-definition-gc.s
The file was modifiedlld/MachO/UnwindInfoSection.cpp