SuccessChanges

Summary

  1. [ELF] Support copy relocation on non-default version symbols (details)
  2. [llvm-diff] Create libLLVMDiff library (details)
  3. [NFC][Codegen][X86] Add testcase that hanged after D107009 (details)
  4. [NFC][X86] combineX86ShuffleChain(): hoist Mask variable higher up (details)
  5. [clang] Replace asm with __asm__ in cuda header (details)
  6. Remove unintended commit. (details)
  7. [libc] Add diff and perf targets for more math functions (details)
  8. [Bazel] Update for 9854f2f30f (Diff library) (details)
  9. sanitizer_common: disable thread safety annotations for googletest (details)
  10. Revert "[llvm-diff] Create libLLVMDiff library" (details)
  11. {DebugInfo][LSR] Don't cache dbg.value that are already undef (details)
  12. [libc++] IWYU to fix complaints when compiling with Modules. NFCI. (details)
  13. Enable extra coverage counters on Windows (details)
  14. [AArch64][GlobalISel] Legalize ctpop s128 (details)
  15. [llvm-diff] Create libLLVMDiff library (details)
  16. [clang] Implement -falign-loops=N (N is a power of 2) for non-LTO (details)
  17. [libFuzzer] Add missing include on Darwin. (details)
  18. [Polly][test] Test difference between isl::stat:ok() and isl::stat::error(). (details)
  19. [Polly][test] Add tests for IslMaxOperationsGuard. (details)
  20. [gn build] manually port 4d293f215dfb (LLVMDiff lib) (details)
  21. [lldb] Remove a few unused .exports files (details)
  22. Clean up instcombine stpcpy test (details)
  23. [lldb] Stop referencing "host_lib" in cmake files (details)
  24. [msan] Don't track origns in signal handlers (details)
  25. [AArch64][GlobalISel] Overhaul G_EXTRACT legalization (details)
Commit 72d070b4db2da7216f63f09407bd96f49dc90bd1 by i
[ELF] Support copy relocation on non-default version symbols

Copy relocation on a non-default version symbol is unsupported and can crash at
runtime. Fortunately there is a one-line fix which works for most cases:
ensure `getSymbolsAt` unconditionally returns `ss`.

If two non-default version symbols are defined at the same place and both
are copy relocated, our implementation will copy relocated them into different
addresses. The pointer inequality is very unlikely an issue. In GNU ld, copy
relocating version aliases seems to create more pointer inequality problems than
us.

(
In glibc, sys_errlist@GLIBC_2.2.5 sys_errlist@GLIBC_2.3 sys_errlist@GLIBC_2.4
are defined at the same place, but it is unlikely they are all copy relocated in
one executable. Even if so, the variables are read-only and pointer inequality
should not be a problem.
)

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D107535
The file was modifiedlld/ELF/Relocations.cpp
The file was modifiedlld/test/ELF/copy-rel-version.s
The file was modifiedlld/test/ELF/Inputs/copy-rel-version.s
Commit 9854f2f30f84123ca78aa3603102e7cef4ec33c8 by isanbard
[llvm-diff] Create libLLVMDiff library

Some tools may want to use the LLVM "diff" code. Move the code into a
library for easy use.

No functionality change intende.

Differential Revision: https://reviews.llvm.org/D107392
The file was removedllvm/tools/llvm-diff/DifferenceEngine.cpp
The file was removedllvm/tools/llvm-diff/DiffConsumer.h
The file was addedllvm/tools/llvm-diff/lib/DiffLog.cpp
The file was addedllvm/tools/llvm-diff/lib/DiffConsumer.cpp
The file was addedllvm/tools/llvm-diff/lib/DifferenceEngine.h
The file was removedllvm/tools/llvm-diff/DiffLog.cpp
The file was removedllvm/tools/llvm-diff/DiffConsumer.cpp
The file was addedllvm/tools/llvm-diff/lib/DifferenceEngine.cpp
The file was removedllvm/tools/llvm-diff/DiffLog.h
The file was addedllvm/tools/llvm-diff/lib/DiffLog.h
The file was modifiedllvm/tools/llvm-diff/CMakeLists.txt
The file was addedllvm/tools/llvm-diff/lib/CMakeLists.txt
The file was addedllvm/tools/llvm-diff/lib/DiffConsumer.h
The file was removedllvm/tools/llvm-diff/DifferenceEngine.h
The file was modifiedllvm/tools/llvm-diff/llvm-diff.cpp
The file was addedllvm/tools/llvm-livepatch/CMakeLists.txt
Commit 16605aea844060c2973df079c9f91650132c099d by lebedev.ri
[NFC][Codegen][X86] Add testcase that hanged after D107009

From Benjamin Kramer @ https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20210802/945642.html
The file was modifiedllvm/test/CodeGen/X86/oddshuffles.ll
Commit c0586ff05dd08e4cbfc6fb7881274d8d89913463 by lebedev.ri
[NFC][X86] combineX86ShuffleChain(): hoist Mask variable higher up

Having `NewMask` outside of an if and rebinding `BaseMask` `ArrayRef`
to it is confusing. Instead, just move the `Mask` vector higher up,
and change the code that earlier had no access to it but now does
to use `Mask` instead of `BaseMask`.

This has no other intentional changes.

This is a recommit of 35c0848b570214ed2b2d96cca4dd62bb7ae725cd,
that was reverted to simplify reversion of an earlier change.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 509854b69cea0c9261ac21ceb22012a53e7a800b by jonathanchesterfield
[clang] Replace asm with __asm__ in cuda header

Asm is a gnu extension for C, so at present -fopenmp -std=c99
and similar fail to compile on nvptx, bug 51344

Changing to `__asm__` or `__asm` works for openmp, all three appear to work
for cuda. Suggesting `__asm__` here as `__asm` is used by MSVC with different
syntax, so this should make for better error diagnostics if the header is
passed to a compiler other than clang.

Reviewed By: tra, emankov

Differential Revision: https://reviews.llvm.org/D107492
The file was modifiedclang/lib/Headers/__clang_cuda_device_functions.h
Commit fec8f1a008c311d96689dbe7876b23ecc82d00d5 by isanbard
Remove unintended commit.
The file was removedllvm/tools/llvm-livepatch/CMakeLists.txt
Commit a9628e96ca5b3d264d88147494c82cb63e8ac973 by hedingarcia
[libc] Add diff and perf targets for more math functions

Comparing the run time of math functions from LLVM libc
with the MSVCRT libc:
|function |perf-LLVM libc     |perf-MSVCRT
|ceilf |2.36 mins (141491389600 ns)|47.10 sec (47100940100 ns)
|exp2f             |6.37 mins (358441794700 ns)|12.39 mins (719404388300 ns)
|expf |6.35 mins (381204661800 ns)|6.17 mins (346150163200 ns)
|fabsf |1.18 mins (78425546600 ns) |53.75 sec (53745301900 ns)
|floorf |3.15 mins (164770963800 ns)|45.94 sec (45935988400 ns)
|logbf |4.38 mins (262508058800 ns)|55.47 sec (55466377700 ns)
|nearbyintf |3.20 mins (167972868000 ns)|9.13 mins (523822963600 ns)
|rintf |3.20 mins (168001498700 ns)|22.35 mins (1341266448800 ns)
|roundf |2.35 mins (141151500600 ns)|1.42 mins (85326429800 ns)
|truncf |2.31 mins (114846424000 ns)|59.41 sec (59414309100 ns)

Evaluating the number of differing results in Windows:
|function |diff
|ceilf          |8388606 differing results
|exp2f         |213303887 differing results
|expf           |193922 differing results
|fabsf          |8388606 differing results
|floorf         |8388606 differing results
|logbf          |0 differing results
|nearbyintf     |0 differing results
|rintf          |0 differing results
|roundf         |0 differing results
|truncf |0 differing results

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D107462
The file was addedlibc/test/src/math/differential_testing/exp2f_perf.cpp
The file was addedlibc/test/src/math/differential_testing/exp2f_diff.cpp
The file was addedlibc/test/src/math/differential_testing/truncf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/expf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/fabsf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/rintf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/roundf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/ceilf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/logbf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/ceilf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/nearbyintf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/nearbyintf_perf.cpp
The file was modifiedlibc/test/src/math/differential_testing/sqrtf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/roundf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/logbf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/fabsf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/floorf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/expf_diff.cpp
The file was addedlibc/test/src/math/differential_testing/truncf_perf.cpp
The file was modifiedlibc/test/src/math/differential_testing/CMakeLists.txt
The file was modifiedlibc/test/src/math/differential_testing/sqrtf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/floorf_perf.cpp
The file was addedlibc/test/src/math/differential_testing/rintf_diff.cpp
Commit f8b6e1faa913748695fa920a6d4d91f780c291f8 by gcmn
[Bazel] Update for 9854f2f30f (Diff library)

Updates the Bazel build for
https://github.com/llvm/llvm-project/commit/9854f2f30f by extracting a
library from llvm-diff. Note that this does not include the new
llvm-livepatch binary, for which the CMake file was added accidentally
and reverted in https://github.com/llvm/llvm-project/commit/fec8f1a008.

Differential Revision: https://reviews.llvm.org/D107586
The file was modifiedutils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Commit b260f3fdda63bbddb7834c42cfeeb2b0a8b86a23 by dimitry
sanitizer_common: disable thread safety annotations for googletest

Recently in 0da172b1766e thread safety warnings-as-errors were enabled.
However, googletest is currently not compatible with thread safety
annotations. On FreeBSD, which has the pthread functions marked with
such annotations, this results in errors when building the compiler-rt
tests:

    In file included from compiler-rt/lib/interception/tests/interception_test_main.cpp:15:
    In file included from llvm/utils/unittest/googletest/include/gtest/gtest.h:62:
    In file included from llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:40:
    llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1636:3: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis]
      }
      ^
    llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1633:32: note: mutex acquired here
        GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
                                   ^
    llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h:1645:32: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis]
        GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
                                   ^
    2 errors generated.

At some point googletest will hopefully be made compatible with thread
safety annotations, but for now add corresponding `-Wno-thread-*` flags
to `COMPILER_RT_GTEST_CFLAGS` to silence these warnings-as-errors.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D107491
The file was modifiedcompiler-rt/CMakeLists.txt
Commit ec5137029bf267bf3b6a52f035cf02ddc1932539 by mascasa
Revert "[llvm-diff] Create libLLVMDiff library"

This reverts commit 9854f2f30f84123ca78aa3603102e7cef4ec33c8 since it
broke all the builds.
The file was modifiedllvm/tools/llvm-diff/CMakeLists.txt
The file was removedllvm/tools/llvm-diff/lib/DiffLog.cpp
The file was addedllvm/tools/llvm-diff/DiffLog.cpp
The file was addedllvm/tools/llvm-diff/DiffConsumer.cpp
The file was removedllvm/tools/llvm-diff/lib/DiffLog.h
The file was removedllvm/tools/llvm-diff/lib/DiffConsumer.cpp
The file was removedllvm/tools/llvm-diff/lib/DifferenceEngine.cpp
The file was removedllvm/tools/llvm-diff/lib/DifferenceEngine.h
The file was modifiedllvm/tools/llvm-diff/llvm-diff.cpp
The file was addedllvm/tools/llvm-diff/DifferenceEngine.cpp
The file was addedllvm/tools/llvm-diff/DifferenceEngine.h
The file was addedllvm/tools/llvm-diff/DiffLog.h
The file was addedllvm/tools/llvm-diff/DiffConsumer.h
The file was removedllvm/tools/llvm-diff/lib/DiffConsumer.h
The file was removedllvm/tools/llvm-diff/lib/CMakeLists.txt
Commit 113a06f7a50010b555a0fdabc9db0a8338e2f2a8 by chris.jackson
{DebugInfo][LSR] Don't cache dbg.value that are already undef

The SCEV-based salvaging method caches dbg.value information pre-LSR so
that salvaging may be attempted post-LSR. If the dbg.value are already
undef pre-LSR then a salvage attempt would be fruitless, so avoid
caching them.

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D107448
The file was modifiedllvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
The file was modifiedllvm/test/Transforms/LoopStrengthReduce/pr51329.ll
Commit 892990c56cc05188ad38c29c0acb283dcdf05b1e by arthur.j.odwyer
[libc++] IWYU to fix complaints when compiling with Modules. NFCI.

Differential Revision: https://reviews.llvm.org/D107583
The file was modifiedlibcxx/include/__ranges/common_view.h
The file was modifiedlibcxx/include/__ranges/transform_view.h
The file was modifiedlibcxx/include/__ranges/subrange.h
The file was modifiedlibcxx/include/__ranges/take_view.h
The file was modifiedlibcxx/include/__ranges/ref_view.h
The file was modifiedlibcxx/include/__iterator/iter_swap.h
The file was modifiedlibcxx/include/__ranges/access.h
The file was modifiedlibcxx/include/__iterator/counted_iterator.h
The file was modifiedlibcxx/include/__ranges/single_view.h
Commit 881faf41909b47376595e8d7bb9c9a109182d20b by mascasa
Enable extra coverage counters on Windows

- Enable extra coverage counters on Windows.
- Update extra_counters.test to run on Windows also.
- Update TableLookupTest.cpp to include the required pragma/declspec for the extra coverage counters.

Patch By: MichaelSquires

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D106676
The file was addedcompiler-rt/lib/fuzzer/FuzzerExtraCountersWindows.cpp
The file was modifiedcompiler-rt/test/fuzzer/extra-counters.test
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
The file was addedcompiler-rt/lib/fuzzer/FuzzerExtraCountersDarwin.cpp
The file was modifiedcompiler-rt/test/fuzzer/TableLookupTest.cpp
The file was modifiedcompiler-rt/lib/fuzzer/CMakeLists.txt
Commit 98f38c151b5a8272c7e9a609f6c7c71623fb652b by jonathan_roelofs
[AArch64][GlobalISel] Legalize ctpop s128

This is re-landing the same patch again, but without the changes to
LegalizerHelper that regressed the Mips test:

test/CodeGen/Mips/GlobalISel/llvm-ir/ctpop.ll

Differential revision: https://reviews.llvm.org/D106494
The file was modifiedllvm/test/CodeGen/AArch64/popcount.ll
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-ctpop.mir
Commit 4d293f215dfb6ab6af966175717e86468f708b1c by isanbard
[llvm-diff] Create libLLVMDiff library

Some tools may want to use the LLVM "diff" code. Move the code into a
library for easy use.

No functionality change intende.

Differential Revision: https://reviews.llvm.org/D107392
The file was addedllvm/tools/llvm-diff/lib/DiffConsumer.cpp
The file was removedllvm/tools/llvm-diff/DiffLog.h
The file was removedllvm/tools/llvm-diff/DifferenceEngine.h
The file was modifiedllvm/tools/llvm-diff/CMakeLists.txt
The file was addedllvm/tools/llvm-diff/lib/DifferenceEngine.h
The file was removedllvm/tools/llvm-diff/DiffConsumer.cpp
The file was removedllvm/tools/llvm-diff/DiffConsumer.h
The file was addedllvm/tools/llvm-diff/lib/DiffLog.h
The file was modifiedllvm/tools/llvm-diff/llvm-diff.cpp
The file was removedllvm/tools/llvm-diff/DiffLog.cpp
The file was addedllvm/tools/llvm-diff/lib/DifferenceEngine.cpp
The file was addedllvm/tools/llvm-diff/lib/CMakeLists.txt
The file was removedllvm/tools/llvm-diff/DifferenceEngine.cpp
The file was addedllvm/tools/llvm-diff/lib/DiffLog.cpp
The file was addedllvm/tools/llvm-diff/lib/DiffConsumer.h
Commit c38efb4899eac7b82daaf1320ad79f6271f9648a by i
[clang] Implement -falign-loops=N (N is a power of 2) for non-LTO

GCC supports multiple forms of -falign-loops=.
-falign-loops= is currently ignored in Clang.

This patch implements the simplest but the most useful form where N is a
power of 2.

The underlying implementation uses a `llvm::TargetOptions` option for now.
Bitcode generation ignores this option.

Differential Revision: https://reviews.llvm.org/D106701
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/include/clang/Basic/LangOptions.def
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
The file was modifiedclang/test/Driver/clang_f_opts.c
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was addedclang/test/Driver/falign-loops.c
The file was addedclang/test/CodeGen/align-loops.c
Commit 7ca2b9aac782c223a9b3d59af9572a574e3a21d8 by mascasa
[libFuzzer] Add missing include on Darwin.
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerExtraCountersDarwin.cpp
Commit 50eaa82cdbc72588f0841658bbad9695855eba85 by llvm-project
[Polly][test] Test difference between isl::stat:ok() and isl::stat::error().

The foreach callback wrappers tests check the return values of isl::stat:ok() and isl::stat::error() separately. However, due to the the container they are iterating over containing just one element, they are actually not testing the difference between them.

This patch changes to set to be iterated over to contain 2 element to make returning sl::stat:ok (continue iterating the next element) and isl::stat::error (break after current element) have different effects other than the return value of the foreach itself.

Reviewed By: patacca

Differential Revision: https://reviews.llvm.org/D107395
The file was modifiedpolly/unittests/Isl/IslTest.cpp
Commit 0f50ffb3365eefaf114f3d1de6e8acee4fe8f169 by llvm-project
[Polly][test] Add tests for IslMaxOperationsGuard.

Add unittests for IslMaxOperationsGuard and the behaviour of the isl-noexception.h wrapper under exceeded max_operations.

Reviewed By: patacca

Differential Revision: https://reviews.llvm.org/D107401
The file was modifiedpolly/unittests/Isl/IslTest.cpp
Commit ddb26e2e003bd21de5a021bea67cf70c9c5b6e4b by thakis
[gn build] manually port 4d293f215dfb (LLVMDiff lib)
The file was modifiedllvm/utils/gn/secondary/llvm/tools/llvm-diff/BUILD.gn
The file was addedllvm/utils/gn/secondary/llvm/tools/llvm-diff/lib/BUILD.gn
Commit 11565320fd55117f04b9cc812e28a30962283c3e by thakis
[lldb] Remove a few unused .exports files

They used to be referenced from the .xcodeproj files, but those are long gone.

No behavior change.

Differential Revision: https://reviews.llvm.org/D107444
The file was removedlldb/source/API/liblldb.xcode.exports
The file was removedlldb/tools/argdumper/argdumper.exports
The file was removedlldb/tools/lldb-server/lldb-server.exports
Commit 7dd29ad4ae49b2716483f50af5661abc98f484e0 by nathan
Clean up instcombine stpcpy test

Deduplicate some code and add an additional test to verify that the
sprintf->stpcpy optimization still works on android21 (which properly
supports it).

This follows up 58481663692b55.

Differential Revision: https://reviews.llvm.org/D107526
The file was modifiedllvm/test/Transforms/InstCombine/sprintf-1.ll
Commit e71fdc1acf054271031200f87a6bfc276d8a1ebd by thakis
[lldb] Stop referencing "host_lib" in cmake files

It hasn't had an effect since https://reviews.llvm.org/rG7b968969db.

No behavior change.

Differential Revision: https://reviews.llvm.org/D107446
The file was modifiedlldb/tools/lldb-test/CMakeLists.txt
The file was modifiedlldb/tools/lldb-vscode/CMakeLists.txt
Commit c2a3fb303f1fffeb0856863cc5eff1529e1db5e7 by Vitaly Buka
[msan] Don't track origns in signal handlers

Origin::CreateHeapOrigin is not async-signal-safe and can deadlock.

Differential Revision: https://reviews.llvm.org/D107431
The file was modifiedcompiler-rt/lib/msan/msan_poisoning.cpp
The file was addedcompiler-rt/test/msan/poison_in_signal.cpp
Commit 51bd4e874fa51412e7399fe7f863169b4f4829bc by Jessica Paquette
[AArch64][GlobalISel] Overhaul G_EXTRACT legalization

This simplifies our existing G_EXTRACT rules and adds some test coverage. Mostly
changing this because it should make it easier to improve legalization for
instructions which use G_EXTRACT as part of the legalization process.

This also adds support for legalizing some weird types. Similar to other recent
legalizer changes, this changes the order of widening/clamping.

There was some dead code in our existing rules (e.g. the p0 case would never get
hit), so this knocks those out and makes the types we want to handle explicit.

This also removes some checks which, nowadays, are handled by the
MachineVerifier.

Differential Revision: https://reviews.llvm.org/D107505
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-combines.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir