SuccessChanges

Summary

  1. [ms] [llvm-ml] Warn on command-line redefinition (details)
  2. [mlir-vscode] Fix dependencies to enable packaging the extension properly. (details)
  3. [libc] Add implementation of expm1f. (details)
  4. [lld-macho][nfc] Fix uninitialized members warning from Coverity (details)
  5. [ARM] Ensure instructions are simplified prior to GatherScatter lowering. (details)
  6. [OpenMP] Implement '#pragma omp unroll'. (details)
  7. [libcxx][ranges][nfc] moves view concepts into `__ranges/concepts.h` (details)
  8. [gn build] Port bbb3d03f93b8 (details)
  9. Move code for checking loop metadata into Analysis [nfc] (details)
  10. Move variable only used inside an assert into the assert. (details)
  11. [SCEV] Use mustprogress flag on loops (in addition to function attribute) (details)
  12. [ELF][RISCV] Resolve branch relocations referencing undefined weak to current location if not using PLT (details)
  13. [ELF] Simplify getAArch64UndefinedRelativeWeakVA. NFC (details)
  14. [libc++] Remove unnecessary header in enable_view.h (which caused a cycle) (details)
  15. [LI] Add a cover function for checking if a loop is mustprogress [nfc] (details)
  16. [ARM] Fix Changed status in MVEGatherScatterLoweringPass. (details)
Commit f03a3caac5e5ac9a440bea1b8ad1485c714f156b by epastor
[ms] [llvm-ml] Warn on command-line redefinition

If a macro is defined on the command line and then overridden in the source code, this is likely to be an error in the user's build system. We should warn on this.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D104008
The file was addedllvm/test/tools/llvm-ml/command_line_defines_errors.asm
The file was modifiedllvm/lib/MC/MCParser/MasmParser.cpp
The file was modifiedllvm/test/tools/llvm-ml/command_line_defines.asm
Commit c0e6f2f43a4cf894173b78cc95b6c29c9fe1ab94 by riddleriver
[mlir-vscode] Fix dependencies to enable packaging the extension properly.
The file was modifiedmlir/utils/vscode/package.json
The file was modifiedmlir/utils/vscode/package-lock.json
Commit 4e5f8b4d8d9d7a6039e10b9507dac896eed92040 by lntue
[libc] Add implementation of expm1f.

Use expm1f(x) = exp(x) - 1 for |x| > ln(2).
For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/8], [-1/8, 1/8], [1/8, ln2]
and use a degree-6 polynomial approximation generated by Sollya's fpminmax for each interval.
Errors < 1.5 ULPs when we use fma to evaluate the polynomials.

Differential Revision: https://reviews.llvm.org/D101134
The file was addedlibc/src/math/generic/expm1f.cpp
The file was modifiedlibc/utils/MPFRWrapper/MPFRUtils.h
The file was modifiedlibc/test/src/math/differential_testing/CMakeLists.txt
The file was addedlibc/src/math/expm1f.h
The file was addedlibc/utils/FPUtil/PolyEval.h
The file was modifiedlibc/utils/FPUtil/generic/FMA.h
The file was modifiedlibc/utils/FPUtil/BitPatterns.h
The file was modifiedlibc/config/linux/aarch64/entrypoints.txt
The file was modifiedlibc/src/math/CMakeLists.txt
The file was modifiedlibc/spec/stdc.td
The file was addedlibc/test/src/math/expm1f_test.cpp
The file was addedlibc/utils/mathtools/expm1f.sollya
The file was modifiedlibc/utils/MPFRWrapper/MPFRUtils.cpp
The file was modifiedlibc/test/src/math/CMakeLists.txt
The file was addedlibc/test/src/math/differential_testing/expm1f_diff.cpp
The file was modifiedlibc/test/src/math/exhaustive/CMakeLists.txt
The file was modifiedlibc/config/linux/x86_64/entrypoints.txt
The file was addedlibc/test/src/math/differential_testing/expm1f_perf.cpp
The file was modifiedlibc/utils/FPUtil/CMakeLists.txt
The file was modifiedlibc/src/math/generic/CMakeLists.txt
The file was addedlibc/test/src/math/exhaustive/expm1f_test.cpp
Commit 4b5c6c5c4b9293557ec8e76d6500527e5d8f9611 by jezng
[lld-macho][nfc] Fix uninitialized members warning from Coverity

We were always assigning to this member before using it, but just to be
safe...

See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151029.html
The file was modifiedlld/MachO/InputSection.h
Commit e0c605f6383c5a3aa8f5fa34ed4be9dc51b4a2ae by david.green
[ARM] Ensure instructions are simplified prior to GatherScatter lowering.

Surprisingly, not all instructions are always simplified after unrolling
and before MVE gather/scatter lowering. Notably dead gather operations
can be left around which cause the gather/scatter lowering pass to crash
if there are multiple gathers, some of which are dead.

This patch ensures they are simplified before we modify anything, which
can change some of the existing tests, including making them no-longer
test what they originally tested. This uses a combination of disabling
the gather/scatter lowering pass and adjusting the test to keep them as
before.

Differential Revision: https://reviews.llvm.org/D103150
The file was modifiedllvm/test/CodeGen/Thumb2/mve-pred-xor.ll
The file was addedllvm/test/CodeGen/Thumb2/mve-gather-unused.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vqdmulh.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/remat-vctp.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-scatter-optimisation.ll
The file was modifiedllvm/test/CodeGen/Thumb2/lsll0.ll
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-phireg.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-selectcc.ll
Commit a22236120f17074532bec70f5916a235beddd475 by llvm-project
[OpenMP] Implement '#pragma omp unroll'.

Implementation of the unroll directive introduced in OpenMP 5.1. Follows the approach from D76342 for the tile directive (i.e. AST-based, not using the OpenMPIRBuilder). Tries to use `llvm.loop.unroll.*` metadata where possible, but has to fall back to an AST representation of the outer loop if the partially unrolled generated loop is associated with another directive (because it needs to compute the number of iterations).

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D99459
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedclang/lib/AST/StmtOpenMP.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was addedclang/test/OpenMP/unroll_codegen_for_partial.cpp
The file was addedclang/test/OpenMP/unroll_codegen_full.cpp
The file was addedclang/test/OpenMP/unroll_codegen_partial.cpp
The file was modifiedclang/tools/libclang/CXCursor.cpp
The file was modifiedclang/lib/CodeGen/CGStmt.cpp
The file was modifiedclang/include/clang/AST/StmtOpenMP.h
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/lib/AST/StmtProfile.cpp
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was addedclang/test/OpenMP/unroll_codegen_unroll_for.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/AST/StmtPrinter.cpp
The file was addedclang/test/OpenMP/unroll_codegen_heuristic.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was addedclang/test/OpenMP/unroll_codegen_for_collapse_outer.cpp
The file was addedclang/test/OpenMP/unroll_ast_print.cpp
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngine.cpp
The file was modifiedclang/lib/Basic/OpenMPKinds.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMP.td
The file was modifiedclang/include/clang/Basic/StmtNodes.td
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was modifiedclang/include/clang/AST/RecursiveASTVisitor.h
The file was addedclang/test/OpenMP/unroll_codegen_factor.cpp
The file was modifiedclang/include/clang/Serialization/ASTBitCodes.h
The file was modifiedclang/lib/Sema/SemaExceptionSpec.cpp
The file was addedclang/test/OpenMP/unroll_messages.cpp
The file was modifiedclang/include/clang/AST/OpenMPClause.h
The file was addedclang/test/OpenMP/unroll_codegen_parallel_for_factor.cpp
The file was addedclang/test/OpenMP/unroll_codegen_tile_for.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/AST/OpenMPClause.cpp
The file was modifiedclang/include/clang-c/Index.h
The file was modifiedclang/lib/Sema/TreeTransform.h
The file was modifiedclang/lib/Serialization/ASTWriterStmt.cpp
Commit bbb3d03f93b86ccef7581f34c7582ebd70c80a19 by cjdb
[libcxx][ranges][nfc] moves view concepts into `__ranges/concepts.h`
The file was modifiedlibcxx/include/ranges
The file was removedlibcxx/include/__ranges/view.h
The file was modifiedlibcxx/include/__ranges/view_interface.h
The file was modifiedlibcxx/include/__ranges/concepts.h
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/include/__ranges/enable_view.h
Commit 14097fbb0818dab80676c0cd909116b1720f2c9f by llvmgnsyncbot
[gn build] Port bbb3d03f93b8
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit b6ee5f2b1df66987e65e1b636ba9ae1554b0334b by listmail
Move code for checking loop metadata into Analysis [nfc]

I need the mustprogress loop metadata in ScalarEvolution and it makes sense to keep all the accessors for quering loop metadate together.
The file was modifiedllvm/lib/Analysis/LoopInfo.cpp
The file was modifiedllvm/include/llvm/Analysis/LoopInfo.h
The file was modifiedllvm/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedllvm/include/llvm/Transforms/Utils/LoopUtils.h
Commit 1d3873d41eca67e974bafbaa91866581bcc0d973 by saugustine
Move variable only used inside an assert into the assert.

This prevents build failures with -Wunused.
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
Commit aaaeb4b160fe94e0ad3bcd6073eea4807f84a33a by listmail
[SCEV] Use mustprogress flag on loops (in addition to function attribute)

This addresses a performance regression reported against 3c6e4191.  That change (correctly) limited a transform based on assumed finiteness to mustprogress loops, but the previous change (38540d7) which introduced the mustprogress check utility only handled function attributes, not the loop metadata form.

It turns out that clang uses the function attribute form for C++, and the loop metadata form for C.  As a result, 3c6e4191 ended up being a large regression in practice for C code as loops weren't being considered mustprogress despite the language semantics.
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
Commit c03b6305d8419fda84a67f4fe357b69a86e4b54f by i
[ELF][RISCV] Resolve branch relocations referencing undefined weak to current location if not using PLT

In a -no-pie link we optimize R_PLT_PC to R_PC. Currently we resolve a branch
relocation to the link-time zero address. However such a choice tends to cause
relocation overflow possibility for RISC architectures.

* aarch64: GNU ld: rewrite the instruction to a NOP; ld.lld: branch to the next instruction
* mips: GNU ld: branch to the start of the text segment (?); ld.lld: branch to zero
* ppc32: GNU ld: rewrite the instruction to a NOP; ld.lld: branch to the current instruction
* ppc64: GNU ld: rewrite the instruction to a NOP; ld.lld: branch to the current instruction
* riscv: GNU ld: branch to the absolute zero address (with instruction rewriting)
* i386/x86_64: GNU ld/ld.lld: branch to the link-time zero address

I think that resolving to the same location is a good choice. The instruction,
if triggered, is clearly an undefined behavior. Resolving to the same location
can cause an infinite loop (making the user aware of the issue) while ensuring
no overflow.

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D103001
The file was modifiedlld/test/ELF/riscv-undefined-weak.s
The file was modifiedlld/ELF/InputSection.cpp
Commit 0995bbdb66ebd91097c344dfc6529cd05de4818d by i
[ELF] Simplify getAArch64UndefinedRelativeWeakVA. NFC
The file was modifiedlld/ELF/InputSection.cpp
Commit 859c924c5fd58865e824b02c8bea40e7cb55456e by Louis Dionne
[libc++] Remove unnecessary header in enable_view.h (which caused a cycle)
The file was modifiedlibcxx/include/__ranges/enable_view.h
Commit 7629b2a09c169bfd7f7295deb3678f3fa7755eee by listmail
[LI] Add a cover function for checking if a loop is mustprogress [nfc]

Essentially, the cover function simply combines the loop level check and the function level scope into one call.  This simplifies several callers and is (subjectively) less error prone.
The file was modifiedllvm/lib/Analysis/LoopInfo.cpp
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/include/llvm/Analysis/LoopInfo.h
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopUtils.cpp
Commit 5d5b686f6bf6b15b8fbd9ccf957295397f27afc9 by david.green
[ARM] Fix Changed status in MVEGatherScatterLoweringPass.

Now that we are calling SimplifyInstructionsInBlock, make sure we update
Changed when it reports alterations.
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp