Changes

Summary

  1. Revert "[SCEV] Handle zero stride correctly in howManyLessThans" (details)
  2. [AArch64] Fix AArch64::dsub's size (details)
  3. [AArch64] rm unused subreg's (details)
  4. [NFC][sanitizer] Simplify MapPackedCounterArrayBuffer (details)
  5. [CSSPGO][llvm-profgen] Allow multiple executable load segments. (details)
  6. [CSSPGO] Do not import pseudo probe desc in thinLTO (details)
  7. [NFC][CSSPGO] Rename the name of an enum value. (details)
  8. Fix test trying to write a spurious output file into the source (details)
  9. [SCEV] Handle zero stride correctly in howManyLessThans (details)
  10. [AbstractAttributor] Fold function calls to `__kmpc_is_spmd_exec_mode` if possible (details)
  11. [CSSPGO][llvm-profgen] Fix a missing initalization (details)
  12. Revert "[CSSPGO][llvm-profgen] Fix a missing initalization" (details)
  13. [CSSPGO][llvm-profgen] Fix a missing initalization (details)
  14. [AIX] Update testcase to use aix triple (details)
  15. [Polly] Fix typo. NFC. (details)
  16. [sanitizer] Convert script to python 3 (details)
  17. Revert "[clang] Refactor AST printing tests to share more infrastructure" (details)
  18. [sanitizer] Upgrade android scripts to python 3 (details)
Commit 5738819679fd3bb08c4848129b27c63690d937a5 by aeubanks
Revert "[SCEV] Handle zero stride correctly in howManyLessThans"

This reverts commit 4df591b5c960affd1612e330d0c9cd3076c18053.

Causes crashes, see comments on D105921.
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
Commit 6377388c32ffc1f5c054a813d0bc81ac118108af by Jon Roelofs
[AArch64] Fix AArch64::dsub's size
The file was modifiedllvm/lib/Target/AArch64/AArch64RegisterInfo.td
Commit 87c6bf92a9c7722b18643ea73f76623f2463c5bb by Jon Roelofs
[AArch64] rm unused subreg's
The file was modifiedllvm/lib/Target/AArch64/AArch64RegisterInfo.td
Commit 35ce66330a2686878ea0a1da93e0a94961933006 by Vitaly Buka
[NFC][sanitizer] Simplify MapPackedCounterArrayBuffer
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
Commit 071203845887a2ff0347747bd5864f8738d17eef by hoy
[CSSPGO][llvm-profgen] Allow multiple executable load segments.

The linker or post-link optimizer can create an ELF image with multiple executable segments each of which will be loaded separately at run time. This breaks the assumption of llvm-profgen that currently only supports one base load address. What it ends up with is that the subsequent mmap events will be treated as an overwrite of the first mmap event which will in turn screw up address mapping. While it is non-trivial to support multiple separate load addresses and given that on x64 those segments will always be loaded at consecutive addresses (though via separate mmap
sys calls), I'm adding an error checking logic to bail out if that's violated and keep using a single load address which is the address of the first executable segment.

Also changing the disassembly output from printing section offset to printing the virtual address instead, which matches the behavior of objdump.

Differential Revision: https://reviews.llvm.org/D103178
The file was modifiedllvm/tools/llvm-profgen/PerfReader.h
The file was addedllvm/test/tools/llvm-profgen/symbolize.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
The file was modifiedllvm/test/tools/llvm-profgen/mmapEvent.test
The file was addedllvm/test/tools/llvm-profgen/multi-load-segs.test
The file was addedllvm/test/tools/llvm-profgen/disassemble.test
The file was addedllvm/test/tools/llvm-profgen/Inputs/symbolize.ll
The file was removedllvm/test/tools/llvm-profgen/disassemble.s
The file was addedllvm/test/tools/llvm-profgen/Inputs/multi-load-segs.perfbin
The file was addedllvm/test/tools/llvm-profgen/Inputs/symbolize.perfbin
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was addedllvm/test/tools/llvm-profgen/Inputs/multi-load-segs.perfscript
The file was removedllvm/test/tools/llvm-profgen/symbolize.ll
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.cpp
Commit 74b99b5c2eacbdef15b99b3e0a8073598f985bb4 by hoy
[CSSPGO] Do not import pseudo probe desc in thinLTO

Previously we reliedy on pseudo probe descriptors to look up precomputed GUID during probe emission for inlined probes. Since we are moving to always using unique linkage names, GUID for functions can be computed in place from dwarf names. This eliminates the need of importing pseudo probe descs in thinlto, since those descs should be emitted by the original modules.

This significantly reduces thinlto memory footprint in some extreme case where the number of imported modules for a single module is massive.

Test Plan:

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D105248
The file was modifiedllvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.h
The file was addedllvm/test/ThinLTO/X86/pseudo-probe-desc-import.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedllvm/lib/Linker/IRMover.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp
The file was addedllvm/test/ThinLTO/X86/Inputs/pseudo-probe-desc-import.ll
Commit cda2394d9768f97cbacbbf8a5c6288c1015b981a by hoy
[NFC][CSSPGO] Rename the name of an enum value.
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
Commit 8a0f1163d02c77c6e764929b66c26ba196cfc549 by richard
Fix test trying to write a spurious output file into the source
directory.

This causes test failures if the source directory is read-only.
The file was modifiedclang/test/CodeGen/builtins-ppc-xlcompat-pwr9.c
The file was modifiedclang/test/CodeGen/builtins-ppc-xlcompat-pwr9-64bit.c
Commit 205ed009a44c2b04a15aea039d8947e74856f158 by efriedma
[SCEV] Handle zero stride correctly in howManyLessThans

This is split from D105216, but the code is hoisted much earlier into
the path where we can actually get a zero stride flowing through. Some
fairly simple proofs handle the cases which show up in practice. The
only test changes are the cases where we really do need a non-zero
divider to produce the right result.

Recommitting with isLoopInvariant() check.

Differential Revision: https://reviews.llvm.org/D105921
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
Commit 1100e4aafea233bc8bbc307c5758a7d287ad3bae by tianshilei1992
[AbstractAttributor] Fold function calls to `__kmpc_is_spmd_exec_mode` if possible

In the device runtime there are many function calls to `__kmpc_is_spmd_exec_mode`
to query the execution mode of current kernels. In many cases, user programs
only contain target region executing in one mode. As a consequence, those runtime
function calls will only return one value. If we can get rid of these function
calls during compliation, it can potentially improve performance.

In this patch, we use `AAKernelInfo` to analyze kernel execution. Basically, for
each kernel (device) function `F`, we collect all kernel entries `K` that can
reach `F`. A new AA, `AAFoldRuntimeCall`, is created for each call site. In each
iteration, it will check all reaching kernel entries, and update the folded value
accordingly.

In the future we will support more function.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D105787
The file was modifiedllvm/test/Transforms/OpenMP/custom_state_machines.ll
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
The file was addedllvm/test/Transforms/OpenMP/is_spmd_exec_mode_fold.ll
Commit fef5f4456abcb1ea052206db6c232468d70b07f2 by hoy
[CSSPGO][llvm-profgen] Fix a missing initalization

Fixing a missing initalization that accidentaly caused by https://reviews.llvm.org/D103178 .
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
Commit 597e9c61cee39071141f3c8f31f47561d2844196 by hoy
Revert "[CSSPGO][llvm-profgen] Fix a missing initalization"

This reverts commit fef5f4456abcb1ea052206db6c232468d70b07f2.
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
Commit 6b04ecaab355f0dfce8a980cb67a39662759734c by hoy
[CSSPGO][llvm-profgen] Fix a missing initalization

Fixing a missing initalization that accidentaly caused by https://reviews.llvm.org/D103178 .
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
Commit 64785ac12ef8b94fe7281e2cbe2db68d64d55e4c by Jinsong Ji
[AIX] Update testcase to use aix triple

We have implemented the basic MCAsmParser now, we can use the triple
directly now.
The file was modifiedllvm/test/MC/PowerPC/modern-aix-as.s
Commit d5c0b0102a25c27f41137588422d368eb42d971e by llvm-project
[Polly] Fix typo. NFC.

Thanks to Mugerwa Martin for reporting.
The file was modifiedpolly/docs/Architecture.rst
Commit ba127a45701b5fa870a1df6b1fb09a351ad14051 by Vitaly Buka
[sanitizer] Convert script to python 3
The file was modifiedcompiler-rt/test/sanitizer_common/android_commands/android_compile.py
Commit 40ce58d0ca10a1195da82895749b67f30f000243 by david.green
Revert "[clang] Refactor AST printing tests to share more infrastructure"

This reverts commit 20176bc7dd3f431db4c3d59b51a9f53d52190c82 as some
versions of GCC do not seem to handle the new code very well. They
complain about:

/tmp/ccqUQZyw.s: Assembler messages:
/tmp/ccqUQZyw.s:1151: Error: symbol `_ZNSt14_Function_base13_Base_managerIN5clangUlPKNS1_4StmtEE2_EE10_M_managerERSt9_Any_dataRKS7_St18_Manager_operation' is already defined
/tmp/ccqUQZyw.s:11963: Error: symbol `_ZNSt17_Function_handlerIFbPKN5clang4StmtEENS0_UlS3_E2_EE9_M_invokeERKSt9_Any_dataOS3_' is already defined

This seems like it is some GCC issue, but multiple buildbots (and my
local machine) are all failing because of it.
The file was modifiedclang/unittests/AST/StmtPrinterTest.cpp
The file was modifiedclang/unittests/AST/ASTPrint.h
The file was modifiedclang/unittests/AST/DeclPrinterTest.cpp
The file was modifiedclang/unittests/AST/NamedDeclPrinterTest.cpp
Commit 94210b12d1d6454c6de8ca4c83a82a1148b5cd1a by Vitaly Buka
[sanitizer] Upgrade android scripts to python 3
The file was modifiedcompiler-rt/test/sanitizer_common/android_commands/android_common.py
The file was modifiedcompiler-rt/test/sanitizer_common/android_commands/android_run.py