SuccessChanges

Summary

  1. [flang] More clean-up of CookedSource API (details)
  2. Revert "[libc++] Make rotate a constexpr." (details)
  3. [Take 2] [libc++] Make rotate a constexpr. (details)
  4. [flang] Fix bug for forward referenced type (details)
  5. [GlobalISel] Add G_UNMERGE_VALUES(G_MERGE_VALUES) combine (details)
  6. Revert "[docs][NewPM] Add docs for writing NPM passes" (details)
  7. [GISel]: Add combine for G_FABS to G_FABS (details)
  8. Reland [docs][NewPM] Add docs for writing NPM passes (details)
  9. [Hexagon] Some HVX DAG combines (details)
  10. [Hexagon] Widen loads and handle any-/sign-/zero-extensions (details)
  11. [Hexagon] Add more detailed testcase for widening truncates (details)
  12. [Sema] Address-space sensitive index check for unbounded arrays (details)
  13. [X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract. (details)
  14. [GlobalISel] Add G_UNMERGE(Cst) -> Cst1, Cst2, ... combine (details)
  15. [Asan] Accept __lsan_ignore_object for redzone pointer (details)
  16. [AArch64] Statepoint support for AArch64. (details)
  17. [flang] Allow Fortran comments after #include path (details)
  18. Revert "[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract." (details)
  19. [X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract (details)
  20. [flang] Respect BZ mode in exponent parts, too (details)
  21. [libc++abi] Do not declare __cxa_finalize and __cxa_atexit in <cxxabi.h> (details)
  22. [GlobalISel] Add `X,Y<dead> = G_UNMERGE Z` -> X = G_TRUNC Z (details)
Commit 5881bf0050398f4bb2d9761167d06a9ecfc8a371 by pklausler
[flang] More clean-up of CookedSource API

The std::string holding the content of a CookedSource no longer
needs to be exposed in its API after the recent work that allows
the parsing context to hold multiple instances of a CookedSource.
So clean the API.  These changes were extracted from some work in
progress that was made easier by the API changes.

Differential Revision: https://reviews.llvm.org/D87635
The file was modifiedflang/lib/Parser/prescan.cpp
The file was modifiedflang/lib/Parser/provenance.cpp
The file was modifiedflang/include/flang/Parser/provenance.h
The file was modifiedflang/include/flang/Parser/parse-state.h
The file was modifiedflang/lib/Lower/OpenACC.cpp
The file was modifiedflang/include/flang/Semantics/semantics.h
The file was modifiedflang/unittests/Evaluate/intrinsics.cpp
The file was modifiedflang/tools/f18/f18.cpp
Commit ed653184ac6385945e32535feb7af2876ec52d40 by zoecarver
Revert "[libc++] Make rotate a constexpr."

This reverts commit 1ec02efee9b1d01cde89f31ca9ba6a46b7662ac5.
The file was modifiedlibcxx/www/cxx2a_status.html
The file was modifiedlibcxx/include/algorithm
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
The file was modifiedlibcxx/include/iterator
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
Commit 3ed89b51da38f081fedb57727076262abb81d149 by Louis Dionne
[Take 2] [libc++] Make rotate a constexpr.

This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.

This patch was previously reverted in ed653184ac63 because it was missing
some UNSUPPORTED markup for older compilers. This commit adds it.

Differential Revision: https://reviews.llvm.org/D65721
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp
The file was modifiedlibcxx/include/algorithm
The file was modifiedlibcxx/include/iterator
The file was modifiedlibcxx/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
The file was modifiedlibcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp
The file was modifiedlibcxx/www/cxx2a_status.html
Commit cdbfb47998cd37ab0384ad944fa8e4ba1e1b47d0 by psteinfeld
[flang] Fix bug for forward referenced type

A type name in an IMPLICIT declaration that was later used in a PARAMETER
statement caused problems because the default symbol scope had not yet been
initialized.  I avoided dereferencing in the situation where the default scope
was uninitialized and added a test that triggers the problem.

Also, once I corrected the bad dereference, the compiler was putting out
misleading error messages.  The underlying error us due to violating section
7.5.10, paragraph 4, which states:
  A structure constructor shall not appear before the referenced type is
  defined.

I fixed this by testing to see if a type that is used in a structure
constructor is forward referenced.

Differential Revision: https://reviews.llvm.org/D87535
The file was modifiedflang/lib/Semantics/expression.cpp
The file was modifiedflang/test/Semantics/bad-forward-type.f90
Commit 670c276232ec2233323fab5ad4c1aeef923e9e48 by qcolombet
[GlobalISel] Add G_UNMERGE_VALUES(G_MERGE_VALUES) combine

Add the matching and applying function to the combiner helper for
G_UNMERGE_VALUES(G_MERGE_VALUES).

This combine also supports any merge-like input nodes, like G_BUILD_VECTORS
and is robust against bitcasts in between int unmerge and merge nodes.

When the input type of the merge node and the output type of the unmerge
node are not the same, but the sizes are, the combine still applies but
creates bitcasts between the sources and the destinations instead of
reusing the destinations directly.

Long term, the artifact combiner should probably reuse that helper, but
as of today, it doesn't use any outside helper, so I kept it this way.

Differential Revision: https://reviews.llvm.org/D87117
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/combine-unmerge.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Commit 39ec36415df5162fcffae09fde9b931e336a6f3d by aeubanks
Revert "[docs][NewPM] Add docs for writing NPM passes"

This reverts commit c2590de30df23ef0db39b496cdec62a83a61fbfa.

Breaks shared libs build
The file was removedllvm/docs/WritingAnLLVMNewPMPass.rst
The file was modifiedllvm/lib/Transforms/LLVMBuild.txt
The file was removedllvm/test/Transforms/HelloNew/helloworld.ll
The file was removedllvm/lib/Transforms/HelloNew/LLVMBuild.txt
The file was modifiedllvm/lib/Passes/LLVMBuild.txt
The file was removedllvm/include/llvm/Transforms/HelloNew/HelloWorld.h
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was removedllvm/utils/gn/secondary/llvm/lib/Transforms/HelloNew/BUILD.gn
The file was removedllvm/lib/Transforms/HelloNew/HelloWorld.cpp
The file was modifiedllvm/docs/UserGuides.rst
The file was removedllvm/lib/Transforms/HelloNew/CMakeLists.txt
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/docs/WritingAnLLVMPass.rst
The file was modifiedllvm/lib/Transforms/CMakeLists.txt
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Passes/BUILD.gn
Commit 46f9137e43f3eb2de9990765a4c482b45b0f8dd5 by aditya_nandakumar
[GISel]: Add combine for G_FABS to G_FABS

https://reviews.llvm.org/D87554

Patch adds one new GICombinerRule for G_FABS. The combine rule folds G_FABS(G_FABS(X)) to G_FABS(X).
Patch additionally adds new combiner tests for the AArch64 target to test this new combiner rule.

Patch by mkitzan.
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/combine-fabs.mir
Commit 10b12d4035de40e5eaedddda82d9c533854eefcb by aeubanks
Reland [docs][NewPM] Add docs for writing NPM passes

As to not conflict with the legacy PM example passes under
llvm/lib/Transforms/Hello, this is under HelloNew. This makes the
CMakeLists.txt and general directory structure less confusing for people
following the example.

Much of the doc structure was taken from WritinAnLLVMPass.rst.

This adds a HelloWorld pass which simply prints out each function name.

More will follow after this, e.g. passes over different units of IR, analyses.
https://llvm.org/docs/WritingAnLLVMPass.html contains a lot more.

Relanded with missing "Support" dependency in LLVMBuild.txt.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D86979
The file was addedllvm/test/Transforms/HelloNew/helloworld.ll
The file was modifiedllvm/lib/Transforms/LLVMBuild.txt
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was addedllvm/utils/gn/secondary/llvm/lib/Transforms/HelloNew/BUILD.gn
The file was addedllvm/docs/WritingAnLLVMNewPMPass.rst
The file was modifiedllvm/lib/Transforms/CMakeLists.txt
The file was modifiedllvm/docs/UserGuides.rst
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Passes/BUILD.gn
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was addedllvm/lib/Transforms/HelloNew/HelloWorld.cpp
The file was addedllvm/include/llvm/Transforms/HelloNew/HelloWorld.h
The file was modifiedllvm/docs/WritingAnLLVMPass.rst
The file was modifiedllvm/lib/Passes/LLVMBuild.txt
The file was addedllvm/lib/Transforms/HelloNew/CMakeLists.txt
The file was addedllvm/lib/Transforms/HelloNew/LLVMBuild.txt
Commit 6352381039c43c66f01a23be19472f7e611ffcdf by kparzysz
[Hexagon] Some HVX DAG combines

1. VINSERTW0 x, undef -> x
2. VROR (VROR x, a), b) -> VROR x, a+b
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp
Commit bb877d1af2ec2f624caa380350c8da00c984e754 by kparzysz
[Hexagon] Widen loads and handle any-/sign-/zero-extensions
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLowering.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonPatternsHVX.td
The file was modifiedllvm/lib/Target/Hexagon/HexagonISelLowering.h
The file was addedllvm/test/CodeGen/Hexagon/autohvx/widen-ext.ll
Commit f35617ad809b978635d10c0c39553840a03ac41f by kparzysz
[Hexagon] Add more detailed testcase for widening truncates
The file was addedllvm/test/CodeGen/Hexagon/autohvx/widen-trunc.ll
Commit da55e9ba1273284f1af61bceeaeb25e487838034 by Chris.Hamilton
[Sema] Address-space sensitive index check for unbounded arrays

Check applied to unbounded (incomplete) arrays and pointers
to spot cases where the computed address is beyond the
largest possible addressable extent of the array, based
on the address space in which the array is delcared, or
which the pointer refers to.

Check helps to avoid cases of nonsense pointer math and
array indexing which could lead to linker failures or
runtime exceptions.  Of particular interest when building
for embedded systems with small address spaces.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D86796
The file was modifiedclang/test/Sema/const-eval.c
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was addedclang/test/Sema/unbounded-array-bounds.c
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was modifiedclang/test/SemaCXX/constant-expression-cxx1y.cpp
Commit 32515938901685bcbc438d5f5bb03cb8a9f4c637 by craig.topper
[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract.

Fixes PR47525
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was addedllvm/test/CodeGen/X86/pr47525.ll
Commit a36278c2f8b5ba7e964ef2cdc14ef8c3f8b8a045 by qcolombet
[GlobalISel] Add G_UNMERGE(Cst) -> Cst1, Cst2, ... combine

Add a combiner helper that replaces G_UNMERGE of big constants into direct
use of smaller constants.

Differential Revision: https://reviews.llvm.org/D87166
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/combine-unmerge.mir
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/ssubsat.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/saddsat.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Commit 1d70984fa220f966ddcecd7906c5f10368fe1b93 by Vitaly Buka
[Asan] Accept __lsan_ignore_object for redzone pointer

The check that the pointer inside of the user part of the chunk does not
adds any value, but it's the last user of AddrIsInside.

I'd like to simplify AsanChunk in followup patches.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D87642
The file was modifiedcompiler-rt/test/asan/TestCases/lsan_annotations.cpp
The file was modifiedcompiler-rt/lib/asan/asan_allocator.cpp
Commit e6bc7037d386184d94bf68b184d0ac62b96a4098 by listmail
[AArch64] Statepoint support for AArch64.

Differential Revision: https://reviews.llvm.org/D66012
Patch By: loicottet (with major rebase by me)
The file was addedllvm/test/CodeGen/AArch64/statepoint-call-lowering.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64InstrInfo.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
Commit 4706880f06fbaf5f95dab2b6fd4cd2a5cf1693e6 by pklausler
[flang] Allow Fortran comments after #include path

C-style /*comments*/ are removed during preprocessing directive
tokenization, but Fortran !comments need to be specifically
allowed.

Fixes LLVM bugzilla 47466.

Differential Revision: https://reviews.llvm.org/D87638
The file was addedflang/test/Preprocessing/include-comment.F90
The file was addedflang/test/Preprocessing/empty.h
The file was modifiedflang/lib/Parser/preprocessor.cpp
Commit da1aaa0b7080049e0d6ef82a4a6784e89c20f059 by craig.topper
Revert "[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract."

I got the bug number wrong.

This reverts commit 32515938901685bcbc438d5f5bb03cb8a9f4c637.
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was removedllvm/test/CodeGen/X86/pr47525.ll
Commit 46673763fe598aa9d3f0edaf1ba7a1645c4eacfe by craig.topper
[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract

Fixes PR47482
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was addedllvm/test/CodeGen/X86/pr47482.ll
Commit b2cf572b562048f54b774d9cef88cf792a33ab31 by pklausler
[flang] Respect BZ mode in exponent parts, too

The Fortran standard discusses BZ mode (treat blanks as zero digits)
explicitly in its effect on the editing of the digits prior to the
exponent part, but doesn't mention it in description of the
exponent part.  Other compilers honor BZ mode in the exponent,
so we should do so too.  So "1 e 1 " is 1.E11 in BZ mode.

Differential Revision: https://reviews.llvm.org/D87653
The file was modifiedflang/runtime/edit-input.cpp
The file was modifiedflang/unittests/Runtime/hello.cpp
Commit 8bd0dc5bfe23fdfba110eefd33ff658289a307ab by Louis Dionne
[libc++abi] Do not declare __cxa_finalize and __cxa_atexit in <cxxabi.h>

These functions are not defined by libc++abi, so they don't belong in <cxxabi.h>.

Differential Revision: https://reviews.llvm.org/D75795
The file was modifiedlibcxxabi/include/cxxabi.h
Commit d2321129bda712a0e7ee222c7cb6a62e5ca5b6f4 by qcolombet
[GlobalISel] Add `X,Y<dead> = G_UNMERGE Z` -> X = G_TRUNC Z

Add a combiner helper that replaces G_UNMERGE where all the destination lanes
are dead except the first one with a G_TRUNC.

Differential Revision: https://reviews.llvm.org/D87174
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.ll
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/combine-unmerge.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-select.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/combine-shl-narrow.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.s.buffer.load.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.store.2d.d16.ll