SuccessChanges

Summary

  1. [MLIR] Add idempotent trait folding (details)
  2. [llc] Use -filetype=null to disable MIR printing (details)
  3. [AMDGPU] Add new llvm.amdgcn.fma.legacy intrinsic (details)
  4. [libc++] Move the oss-fuzz script to libc++ (details)
  5. [libc++] Move the oss-fuzz script to libcxx/utils/ci (details)
  6. [MemProf] Memory profiling runtime support (details)
  7. [llvm-objdump] Implement --prefix option (details)
  8. [libc++] Avoid relying on `realpath` being installed on the system (details)
  9. [GlobalISel] Add translation support for vector reduction intrinsics. (details)
  10. [AArch64][GlobalISel] Add basic legalizer rules for supported add/fadd reductions. (details)
  11. [AArch64][GlobalISel] Regbankselect reductions to use FPR bank for scalars. (details)
  12. [MemProf] Don't build memprof if sanitizer not being built (details)
  13. [AMDGPU][HIP] Switch default DWARF version to 5 (details)
  14. [Indvars][NFCI] Simplify assertion. (details)
  15. [libcxx] [test] Fix string type handling in a few fairly trivial class.path tests (details)
  16. [gn build] (manually) port 3d4bba302d246 (details)
  17. [gn build] Port 3d4bba302d2 (details)
  18. [test] Pin null-function.ll to legacy PM (details)
  19. [AArch64][GlobalISel] Add selection support for v2s32 and v2s64 reductions for FADD/ADD. (details)
  20. [llvm-objdump][test] Delete source-interleave-prefix-windows.test (details)
  21. Add support for more OS types to AddClangModuleCompilationOptionsForSDKType() (details)
  22. [llvm-objdump][test] Unsupport system-windows for source-interleave-prefix.test (details)
  23. [docs] Fix some out-of-date / inaccurate text and missing formatting in the User's Manual. (details)
  24. [mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects. (details)
  25. [mlir] Optimize symbol related checks in SymbolDCE (details)
  26. [mlir] Add a new SymbolUserOpInterface class (details)
  27. [mlir] Update SCCP and the Inliner to use SymbolTableCollection for symbol lookups (details)
Commit 7dff6b818b1cdd52fbc99f6256760d6eb02a7622 by lyandy
[MLIR] Add idempotent trait folding

This trait simply adds a fold of f(f(x)) = f(x) when an operation is labelled as idempotent

Reviewed By: rriddle, andyly

Differential Revision: https://reviews.llvm.org/D89421
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/test/mlir-tblgen/trait.mlir
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 0c1381d79567f58655561bd39f5efb1d468c930a by jay.foad
[llc] Use -filetype=null to disable MIR printing

If you use -stop-after or similar options, llc will normally print MIR.
This patch checks for -filetype=null as a special case to disable MIR
printing. As the comment says, "The Null output is intended for use for
performance analysis ...", and I found this useful for timing a subset
of the passes that llc runs without the significant overhead of printing
MIR just to send it to /dev/null.

Differential Revision: https://reviews.llvm.org/D89476
The file was modifiedllvm/lib/CodeGen/LLVMTargetMachine.cpp
The file was addedllvm/test/tools/llc/filetype-null-stop-after.ll
Commit 1417abe54c28854094230f6d3b743d5578f95dff by jay.foad
[AMDGPU] Add new llvm.amdgcn.fma.legacy intrinsic

Differential Revision: https://reviews.llvm.org/D89558
The file was modifiedllvm/lib/Analysis/ConstantFolding.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
The file was addedllvm/test/Transforms/InstSimplify/ConstProp/AMDGPU/fma_legacy.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
The file was addedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.fma.legacy.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsAMDGPU.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/VOP3Instructions.td
Commit e1612c38665e136279ff460e79e93fd7b37a4559 by Louis Dionne
[libc++] Move the oss-fuzz script to libc++

Instead of having this script be part of the OSS-Fuzz repository, I think
it makes more sense to have it alongside the rest of the fuzzing targets
in libc++.
The file was addedlibcxx/test/libcxx/fuzzing/oss-fuzz.sh
Commit 880fc4d581b091dbb68703c3e55c2ca2f94192c2 by Louis Dionne
[libc++] Move the oss-fuzz script to libcxx/utils/ci
The file was removedlibcxx/test/libcxx/fuzzing/oss-fuzz.sh
The file was addedlibcxx/utils/ci/oss-fuzz.sh
Commit 3d4bba302d2460b9ac6463ef920c301f1f40fb41 by tejohnson
[MemProf] Memory profiling runtime support

See RFC for background:
http://lists.llvm.org/pipermail/llvm-dev/2020-June/142744.html

Follow on companion to the clang/llvm instrumentation support in D85948
and committed earlier.

This patch adds the compiler-rt runtime support for the memory
profiling.

Note that much of this support was cloned from asan (and then greatly
simplified and renamed). For example the interactions with the
sanitizer_common allocators, error handling, interception, etc.

The bulk of the memory profiling specific code can be found in the
MemInfoBlock, MemInfoBlockCache, and related classes defined and used
in memprof_allocator.cpp.

For now, the memory profile is dumped to text (stderr by default, but
honors the sanitizer_common log_path flag). It is dumped in either a
default verbose format, or an optional terse format.

This patch also adds a set of tests for the core functionality.

Differential Revision: https://reviews.llvm.org/D87120
The file was addedcompiler-rt/test/memprof/TestCases/test_memintrin.cpp
The file was addedcompiler-rt/test/memprof/TestCases/interface_test.cpp
The file was modifiedcompiler-rt/CMakeLists.txt
The file was addedcompiler-rt/lib/memprof/memprof_internal.h
The file was addedcompiler-rt/lib/memprof/memprof_descriptions.h
The file was addedcompiler-rt/test/memprof/TestCases/realloc.cpp
The file was addedcompiler-rt/lib/memprof/memprof.syms.extra
The file was addedcompiler-rt/lib/memprof/memprof_stats.h
The file was modifiedcompiler-rt/include/CMakeLists.txt
The file was addedcompiler-rt/lib/memprof/memprof_stats.cpp
The file was addedcompiler-rt/test/memprof/TestCases/malloc_hook.cpp
The file was modifiedcompiler-rt/test/lit.common.cfg.py
The file was addedcompiler-rt/test/memprof/TestCases/print_miss_rate.cpp
The file was addedcompiler-rt/lib/memprof/memprof_rtl.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_flags.inc
The file was addedcompiler-rt/lib/memprof/README.txt
The file was addedcompiler-rt/lib/memprof/memprof_malloc_linux.cpp
The file was addedcompiler-rt/test/memprof/TestCases/test_new_load_store.cpp
The file was addedcompiler-rt/lib/memprof/memprof_flags.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_report.cpp
The file was modifiedcompiler-rt/test/lit.common.configured.in
The file was addedcompiler-rt/lib/memprof/memprof_allocator.h
The file was addedcompiler-rt/test/memprof/TestCases/unaligned_loads_and_stores.cpp
The file was addedcompiler-rt/test/memprof/lit.site.cfg.py.in
The file was addedcompiler-rt/lib/memprof/memprof_init_version.h
The file was modifiedcompiler-rt/test/CMakeLists.txt
The file was addedcompiler-rt/lib/memprof/CMakeLists.txt
The file was addedcompiler-rt/lib/memprof/memprof_interceptors.cpp
The file was addedcompiler-rt/test/memprof/TestCases/stress_dtls.c
The file was addedcompiler-rt/test/memprof/TestCases/default_options.cpp
The file was addedcompiler-rt/lib/memprof/memprof_shadow_setup.cpp
The file was addedcompiler-rt/test/memprof/CMakeLists.txt
The file was addedcompiler-rt/test/memprof/TestCases/test_malloc_load_store.c
The file was addedcompiler-rt/lib/memprof/memprof_linux.cpp
The file was addedcompiler-rt/lib/memprof/memprof_new_delete.cpp
The file was addedcompiler-rt/lib/memprof/memprof_stack.cpp
The file was addedcompiler-rt/lib/memprof/memprof_preinit.cpp
The file was addedcompiler-rt/lib/memprof/memprof_thread.h
The file was addedcompiler-rt/test/memprof/TestCases/malloc-size-too-big.cpp
The file was modifiedcompiler-rt/lib/CMakeLists.txt
The file was addedcompiler-rt/lib/memprof/memprof_flags.h
The file was addedcompiler-rt/lib/memprof/memprof_flags.inc
The file was addedcompiler-rt/lib/memprof/memprof_interceptors_memintrinsics.cpp
The file was addedcompiler-rt/lib/memprof/memprof_interceptors_memintrinsics.h
The file was addedcompiler-rt/test/memprof/TestCases/mem_info_cache_entries.cpp
The file was addedcompiler-rt/lib/memprof/memprof_stack.h
The file was addedcompiler-rt/test/memprof/TestCases/test_terse.cpp
The file was addedcompiler-rt/lib/memprof/memprof_mapping.h
The file was addedcompiler-rt/test/memprof/TestCases/atexit_stats.cpp
The file was addedcompiler-rt/test/memprof/TestCases/dump_process_map.cpp
The file was modifiedcompiler-rt/cmake/config-ix.cmake
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
The file was addedcompiler-rt/lib/memprof/memprof_interface_internal.h
The file was addedcompiler-rt/test/memprof/lit.cfg.py
The file was addedcompiler-rt/test/memprof/TestCases/log_path_test.cpp
The file was addedcompiler-rt/test/memprof/TestCases/memprof_options-help.cpp
The file was addedcompiler-rt/lib/memprof/memprof_allocator.cpp
The file was addedcompiler-rt/lib/memprof/memprof_thread.cpp
The file was addedcompiler-rt/lib/memprof/memprof_descriptions.cpp
The file was addedcompiler-rt/test/memprof/TestCases/free_hook_realloc.cpp
The file was addedcompiler-rt/include/sanitizer/memprof_interface.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_report.h
The file was addedcompiler-rt/lib/memprof/weak_symbols.txt
The file was addedcompiler-rt/lib/memprof/memprof_interceptors.h
The file was addedcompiler-rt/lib/memprof/memprof_posix.cpp
Commit e95f9a23fad52ffa3a5b6466c7dcdf910d099956 by rengolin
[llvm-objdump] Implement --prefix option

The prefix given to --prefix will be added to GNU absolute paths when
used with --source option (source interleaved with the disassembly).

This matches GNU's objdump behavior.

GNU and C++17 rules for absolute paths are different.

Differential Revision: https://reviews.llvm.org/D85024

Fixes PR46368.

Differential Revision: https://reviews.llvm.org/D85024
The file was addedllvm/test/tools/llvm-objdump/X86/source-interleave-prefix-non-windows.test
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.h
The file was addedllvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
The file was modifiedllvm/docs/CommandGuide/llvm-objdump.rst
The file was modifiedllvm/docs/llvm-objdump.1
The file was addedllvm/test/tools/llvm-objdump/X86/source-interleave-prefix-windows.test
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
Commit 2408fc2a1e85c0e9e9c6e8b1dd00d2507dda38f4 by Louis Dionne
[libc++] Avoid relying on `realpath` being installed on the system

It doesn't appear to be a standard utility.
The file was modifiedlibcxx/utils/ci/apple-install-libcxx.sh
Commit 6042c25b0a7a9d812ace6ffe164628af9a1e1259 by Amara Emerson
[GlobalISel] Add translation support for vector reduction intrinsics.

In order to prevent the ExpandReductions pass from expanding some intrinsics
before they get to codegen, I had to add a -disable-expand-reductions flag
for testing purposes.

Differential Revision: https://reviews.llvm.org/D89028
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/irtranslator-reductions.ll
Commit 9190411fcf65188ea8cb032253302dd4ce4baede by Amara Emerson
[AArch64][GlobalISel] Add basic legalizer rules for supported add/fadd reductions.

NEON is pretty limited in it's reduction support. As a first step add some
basic rules for the legal types we can select.

Differential Revision: https://reviews.llvm.org/D89070
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/legalize-reduce-fadd.mir
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/legalize-reduce-add.mir
Commit 32f77eea2d0f0660647e4222332ccf5c6dfc98e6 by Amara Emerson
[AArch64][GlobalISel] Regbankselect reductions to use FPR bank for scalars.

Differential Revision: https://reviews.llvm.org/D89075
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/regbankselect-reductions.mir
Commit 3ed77ecd0a5d5e5c33770f0f9d3d75cf2f80c80b by tejohnson
[MemProf] Don't build memprof if sanitizer not being built

This should fix a couple of debian bot failures:
http://lab.llvm.org:8011/#builders/14/builds/380
http://lab.llvm.org:8011/#builders/109/builds/533

They disable building of the sanitizer, which memprof relies on. So
disable building of memprof in that case.
The file was modifiedcompiler-rt/lib/CMakeLists.txt
Commit c4d10e7e9bb47b77fad43d8ddcfa328298f36c88 by scott.linder
[AMDGPU][HIP] Switch default DWARF version to 5

Another attempt at this, see D59008 for previous attempt.

Reviewed By: kzhuravl, t-tye

Differential Revision: https://reviews.llvm.org/D89484
The file was modifiedclang/test/Driver/amdgpu-toolchain.c
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.h
The file was modifiedclang/test/Driver/hip-toolchain-dwarf.hip
The file was modifiedclang/lib/Driver/ToolChains/HIP.h
Commit b740899c500ba6a707711b74bfdacf104e8a8067 by benny.kra
[Indvars][NFCI] Simplify assertion.

This should be semantically identical. Also avoids unused variable
warnings in Release builds.
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit 3784bdf2176f38cc30134fab776efb43506c0c54 by martin
[libcxx] [test] Fix string type handling in a few fairly trivial class.path tests

Use string() for convenience for testing where possible, but keep using
native() for move tests where we want to check that no allocations are
made, constructing a reference fs::path::string_type instead.

Use the right value_type in a few places.

Make the synop test check for the right types and for the expected
preferred separator.

Differential Revision: https://reviews.llvm.org/D89537
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
The file was modifiedlibcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp
Commit 98e134f5d01afbcdf74a7ee0af8fe3bed0201e54 by thakis
[gn build] (manually) port 3d4bba302d246
The file was modifiedllvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
Commit 1c54a91d11aeb5f8d5d9f299509c6bda8d993f14 by llvmgnsyncbot
[gn build] Port 3d4bba302d2
The file was modifiedllvm/utils/gn/secondary/compiler-rt/include/BUILD.gn
Commit 53b69820f420ad896780d22fd241581a779b7c2b by aeubanks
[test] Pin null-function.ll to legacy PM

The NPM prints CGSCCs in a different way.
The file was modifiedllvm/test/Transforms/Inline/null-function.ll
Commit 39c05a1a7153379f308a080b3efc5ba3ccc8be0d by Amara Emerson
[AArch64][GlobalISel] Add selection support for v2s32 and v2s64 reductions for FADD/ADD.

We'll need legalizer lower() support for the other types to work.

Differential Revision: https://reviews.llvm.org/D89159
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vabs.ll
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/select-reduce-add.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir
Commit 0b1b2a180c66d894da3202b2b56a8e11be5f7a08 by i
[llvm-objdump][test] Delete source-interleave-prefix-windows.test

It needs more work: http://45.33.8.238/win/25999/step_11.txt
The file was removedllvm/test/tools/llvm-objdump/X86/source-interleave-prefix-windows.test
Commit cf245086518efbdf96c2d86697298a8da5c97669 by Adrian Prantl
Add support for more OS types to AddClangModuleCompilationOptionsForSDKType()

This patch also avoids hardcoding the clang options, which makes it
less likely for them to become out-of-date.

rdar://problem/63791367+66927829

Differential Revision: https://reviews.llvm.org/D89428
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
Commit 08d6650b7bf2d923dfc8255c090f0fbd64f5691f by i
[llvm-objdump][test] Unsupport system-windows for source-interleave-prefix.test
The file was modifiedllvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
Commit dd4e8a54b2ba9cec78441ba537b94f4eaa5acd84 by richard
[docs] Fix some out-of-date / inaccurate text and missing formatting in the User's Manual.
The file was modifiedclang/docs/UsersManual.rst
Commit f3df3b58e7dd7c400f9c18d16d92631823705ebd by riddleriver
[mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects.

(Note: This is a reland of D82597)

This class allows for defining thread local objects that have a set non-static lifetime. This internals of the cache use a static thread_local map between the various different non-static objects and the desired value type. When a non-static object destructs, it simply nulls out the entry in the static map. This will leave an entry in the map, but erase any of the data for the associated value. The current use cases for this are in the MLIRContext, meaning that the number of items in the static map is ~1-2 which aren't particularly costly enough to warrant the complexity of pruning. If a use case arises that requires pruning of the map, the functionality can be added.

This is especially useful in the context of MLIR for implementing thread-local caching of context level objects that would otherwise have very high lock contention. This revision adds a thread local cache in the MLIRContext for attributes, identifiers, and types to reduce some of the locking burden. This led to a speedup of several seconds when compiling a somewhat large mlir module.

Differential Revision: https://reviews.llvm.org/D89504
The file was modifiedmlir/lib/Support/StorageUniquer.cpp
The file was modifiedmlir/include/mlir/Support/StorageUniquer.h
The file was addedmlir/include/mlir/Support/ThreadLocalCache.h
The file was modifiedmlir/lib/IR/MLIRContext.cpp
Commit 7bc7d0ac7ae2e2c578463758422214e80ce5e056 by riddleriver
[mlir] Optimize symbol related checks in SymbolDCE

This revision contains two optimizations related to symbol checking:
* Optimize SymbolOpInterface to only check for a name attribute if the operation is an optional symbol.
This removes an otherwise unnecessary attribute lookup from a majority of symbols.
* Add a new SymbolTableCollection class to represent a collection of SymbolTables.
This allows for perfoming non-flat symbol lookups in O(1) time by caching SymbolTables for symbol table operations. This class is very useful for algorithms that operate on multiple symbol tables, either recursively or not.

Differential Revision: https://reviews.llvm.org/D89505
The file was modifiedmlir/lib/Transforms/SymbolDCE.cpp
The file was modifiedmlir/lib/IR/SymbolTable.cpp
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/include/mlir/IR/SymbolInterfaces.td
The file was modifiedmlir/include/mlir/IR/SymbolTable.h
Commit 71eeb5ec4d6edbbef31fec83fe75933d48f101df by riddleriver
[mlir] Add a new SymbolUserOpInterface class

The initial goal of this interface is to fix the current problems with verifying symbol user operations, but can extend beyond that in the future. The current problems with the verification of symbol uses are:
* Extremely inefficient:
Most current symbol users perform the symbol lookup using the slow O(N) string compare methods, which can lead to extremely long verification times in large modules.
* Invalid/break the constraints of verification pass
If the symbol reference is not-flat(and even if it is flat in some cases) a verifier for an operation is not permitted to touch the referenced operation because it may be in the process of being mutated by a different thread within the pass manager.

The new SymbolUserOpInterface exposes a method `verifySymbolUses` that will be invoked from the parent symbol table to allow for verifying the constraints of any referenced symbols. This method is passed a `SymbolTableCollection` to allow for O(1) lookups of any necessary symbol operation.

Differential Revision: https://reviews.llvm.org/D89512
The file was modifiedmlir/docs/SymbolsAndSymbolTables.md
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.td
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp
The file was modifiedmlir/docs/Interfaces.md
The file was modifiedmlir/lib/IR/SymbolTable.cpp
The file was modifiedmlir/include/mlir/IR/SymbolTable.h
The file was modifiedmlir/include/mlir/IR/SymbolInterfaces.td
Commit a5ea60456c16faf7c75df98b03d5de5b9b6f506d by riddleriver
[mlir] Update SCCP and the Inliner to use SymbolTableCollection for symbol lookups

This transforms the symbol lookups to O(1) from O(NM), greatly speeding up both passes. For a large MLIR module this shaved seconds off of the compilation time.

Differential Revision: https://reviews.llvm.org/D89522
The file was modifiedmlir/lib/Transforms/Inliner.cpp
The file was modifiedmlir/include/mlir/Interfaces/CallInterfaces.td
The file was modifiedmlir/lib/Analysis/CallGraph.cpp
The file was modifiedmlir/include/mlir/Analysis/CallGraph.h
The file was modifiedmlir/lib/Transforms/SCCP.cpp
The file was modifiedmlir/lib/Interfaces/CallInterfaces.cpp