SuccessChanges

Summary

  1. [SVE] Fix typo in CHECK lines for sve-fixed-length-int-reduce.ll (details)
  2. [scudo][standalone] Fix Primary's ReleaseToOS test (details)
  3. [OpenMP][VE plugin] Fixing failure to build VE plugin with consolidated error handling in libomptarget (details)
  4. SparcSubtarget.h - cleanup include dependencies. NFCI. (details)
  5. NVPTXTargetMachine.h - remove unused includes. NFCI. (details)
  6. MSP430TargetMachine.h - remove unused includes. NFCI. (details)
  7. [clangd] Disable msan instrumentation for generated Evaluate(). (details)
  8. NFC, add a missing stdlib include for the use of abort (details)
  9. [lldb] Configure LLDB_FRAMEWORK_DIR in multi-generator builds (details)
  10. [libc++] Fix tests on GCC 10 (details)
  11. [lldb] Also configure lldb_framework_dir in the lit.site.cfg.py (details)
  12. [InstCombine] visitTrunc - remove dead trunc(lshr (zext A), C) combine. NFCI. (details)
  13. [InstCombine] Fix the outofrange tests and add exact shift tests for D88429 (details)
  14. [libc++] Add a regression test for erasing from a vector (details)
  15. [flang][msvc] Avoid templated initializer list initialization of vector. NFC. (details)
  16. [COFF][CG Profile] set undefined symbol to external (details)
  17. [libc++][ci] Update how we build the Docker image (details)
  18. [clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines (details)
  19. [lldb] Remove redundant ctor call (NFC) (details)
  20. [mlir][openacc] Add shutdown operation (details)
  21. [BuildLibCalls] Add noundef to the returned pointers of allocators and argument of free (details)
  22. LanaiSubtarget.h - remove unnecessary includes. NFCI. (details)
  23. LanaiTargetMachine.h - remove unnecessary includes. NFCI. (details)
  24. [InstCombine] fix weird formatting in test file; NFC (details)
  25. [ELF] Fix multiple -mllvm after D70378 (details)
  26. [InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C) (details)
  27. [InstCombine] adjust duplicate test for masked load; NFC (details)
  28. Add -fprofile-update={atomic,prefer-atomic,single} (details)
  29. [NFC][regalloc] Unit test for AllocationOrder iteration. (details)
  30. Adds MLIR C-API for marshaling Python capsules. (details)
  31. [gn build] Port 6d193ba3337 (details)
Commit 01c95f79424d1083a6c06ed28c98c0a647b85711 by mcinally
[SVE] Fix typo in CHECK lines for sve-fixed-length-int-reduce.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-int-reduce.ll
Commit e456df77c2a5a2bf905f6848a09faf69b49c5752 by kostyak
[scudo][standalone] Fix Primary's ReleaseToOS test

Said test was flaking on Fuchsia for non-obvious reasons, and only
for ASan variants (the release was returning 0).

It turned out that the templating was off, `true` being promoted to
a `s32` and used as the minimum interval argument. This meant that in
some circumstances, the normal release would occur, and the forced
release would have nothing to release, hence the 0 byte released.

The symbols are giving it away (note the 1):
```
scudo::SizeClassAllocator64<scudo::FixedSizeClassMap<scudo::DefaultSizeClassConfig>,24ul,1,2147483647,false>::releaseToOS(void)
```

This also probably means that there was no MTE version of that test!

Differential Revision: https://reviews.llvm.org/D88457
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/primary_test.cpp
Commit c816ee13ad9e14ec1b69e07b1d3851d8b548ff8c by simon.moll
[OpenMP][VE plugin] Fixing failure to build VE plugin with consolidated error handling in libomptarget

The libomptarget VE plugin [[
http://lab.llvm.org:8014/builders/clang-ve-ninja/builds/8937/steps/build-unified-tree/logs/stdio
| fails zu build ]] after ae95ceeb8f98d81f615c69da02f73b5ee6b1519a .

Differential Revision: https://reviews.llvm.org/D88476
The file was modifiedopenmp/libomptarget/plugins/ve/src/rtl.cpp
Commit 30c0bea5714400d52ab50693e4a7e738ab789400 by llvm-dev
SparcSubtarget.h - cleanup include dependencies. NFCI.

TargetFrameLowering.h is guaranteed to be covered by SparcFrameLowering.h

Fix missing implicit Triple.h dependency.
The file was modifiedllvm/lib/Target/Sparc/SparcSubtarget.h
Commit 8f34216ece714f30f08092d108b85c0e7e77384a by llvm-dev
NVPTXTargetMachine.h - remove unused includes. NFCI.
The file was modifiedllvm/lib/Target/NVPTX/NVPTXTargetMachine.h
Commit a06581ef39284f8ec66778807adf0e2d244a33d1 by llvm-dev
MSP430TargetMachine.h - remove unused includes. NFCI.
The file was modifiedllvm/lib/Target/MSP430/MSP430TargetMachine.h
Commit a9f63d22fafb0d7de768efc6b7447f8e7f6bb220 by usx
[clangd] Disable msan instrumentation for generated Evaluate().

MSAN build times out for generated DecisionForest inference runtime.

A solution worth trying is splitting the function into 300 smaller
functions and then re-enable msan.

For now we are disabling instrumentation for the generated function.

Differential Revision: https://reviews.llvm.org/D88495
The file was modifiedclang-tools-extra/clangd/quality/CompletionModelCodegen.py
Commit 119274748bce6d1248aa57cb55d79bfeae8a2f8e by Alex Lorenz
NFC, add a missing stdlib include for the use of abort

The FatalErrorHandler.cpp file uses 'abort', but doesn't include
'stdlib.h'. This causes a build error when modules are used in clang.
The file was modifiedclang/tools/libclang/FatalErrorHandler.cpp
Commit d0ed45dc920004bb7b6642d6086b4722443eeba2 by Jonas Devlieghere
[lldb] Configure LLDB_FRAMEWORK_DIR in multi-generator builds
The file was modifiedlldb/test/API/CMakeLists.txt
The file was modifiedlldb/utils/lldb-dotest/lldb-dotest.in
The file was modifiedlldb/utils/lldb-dotest/CMakeLists.txt
Commit 3e5f9dacb092a1414f72500111c2b049673e0055 by Louis Dionne
[libc++] Fix tests on GCC 10

Also, remove workarounds for ancient Clangs from is_constructible tests.
The file was modifiedlibcxx/utils/ci/run-buildbot.sh
The file was modifiedlibcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
The file was modifiedlibcxx/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp
The file was modifiedlibcxx/include/type_traits
The file was modifiedlibcxx/test/std/namespace/addressable_functions.sh.cpp
Commit ccbb9827db4c30c93b92a204aeb2b98f9f3a723a by Jonas Devlieghere
[lldb] Also configure lldb_framework_dir in the lit.site.cfg.py

Configuring the variable in CMake isn't enought, because the build mode
can't be resolved until execution time, which requires the build mode to
be substituted by lit.
The file was modifiedlldb/test/API/lit.site.cfg.py.in
Commit b610d73b3fe67fe6b693740dfac5fd21a60b1e44 by llvm-dev
[InstCombine] visitTrunc - remove dead trunc(lshr (zext A), C) combine. NFCI.

I added additional test coverage at rG7a55989dc4305 - but all are handled independently of this combine and http://lab.llvm.org:8080/coverage/coverage-reports/ indicates the code is never used.

Differential revision: https://reviews.llvm.org/D88492
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
Commit e5f047f27ec121e63e765d30683a472d1ba19ca5 by llvm-dev
[InstCombine] Fix the outofrange tests and add exact shift tests for D88429
The file was modifiedllvm/test/Transforms/InstCombine/trunc-shift-trunc.ll
Commit 7bed95a856f1e0146e838e7575677159f42f3bf7 by Louis Dionne
[libc++] Add a regression test for erasing from a vector

After rebasing my trivially-relocatable branch, this behavior was broken...
but no libc++ unit test caught it! Add a regression test specifically for
erasing out of a vector.

Differential Revision: https://reviews.llvm.org/D88421
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
Commit d2d7a44facd2dc895d378f19233837147f587b6d by llvm-project
[flang][msvc] Avoid templated initializer list initialization of vector. NFC.

The Microsoft compiler emits an error when populating the vector with a single element of a templated argument using the brace syntax. The error is:
```
constant.h(102,1): error C2664: 'std::vector<Fortran::evaluate::value::Complex<...>, ...>::vector(std::initializer_list<_Ty>,const _Alloc &)': cannot convert argument 1 from 'initializer list' to 'std::initializer_list<_Ty>'
```
To work around this error, we replace the templated constructor with one for the expected type. Conversion to the element type has to be done by the caller.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D88163
The file was modifiedflang/include/flang/Evaluate/constant.h
Commit a9abe1f7859e4e1293969a93213294584a5aaba9 by zequanwu
[COFF][CG Profile] set undefined symbol to external

Differential Revision: https://reviews.llvm.org/D88456
The file was modifiedllvm/lib/MC/MCWinCOFFStreamer.cpp
The file was modifiedllvm/test/MC/COFF/cgprofile.s
Commit 2159ed811f96cb1aefecf3369d80e69e06fd32a3 by Louis Dionne
[libc++][ci] Update how we build the Docker image

This fixes a couple of issues, such as failing filesystem tests (due to
running the tests as root), and not running with the GCC we downloaded.
The file was modifiedlibcxx/utils/ci/Dockerfile
Commit d8ba6b4ab3eceb6bbcdf4371d4ffaab9d1a5cebe by platonov.aleksandr
[clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines

As @kadircet mentions in D84912#2184144, `findNearbyIdentifier()` traverses the whole file if there is no identifier for the word.
This patch ensures give up after 2^N lines in any case.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D87891
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/unittests/XRefsTests.cpp
Commit b4968c7001c2d7e2e607bef1bb11ae8f076e47e0 by Jonas Devlieghere
[lldb] Remove redundant ctor call (NFC)

As pointed out by Pavel in D88249.
The file was modifiedlldb/source/API/SBValue.cpp
Commit 9c77350b0c737f44732ee26b558b5f4868864a38 by clementval
[mlir][openacc] Add shutdown operation

This patch introduces the acc.shutdown operation that represents an OpenACC shutdown directive.
Clauses are derived from the spec 2.14.2

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D88272
The file was modifiedmlir/test/Dialect/OpenACC/invalid.mlir
The file was modifiedmlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
The file was modifiedmlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
The file was modifiedmlir/test/Dialect/OpenACC/ops.mlir
Commit 67aac915ba94a75cbdb3c9c5f6c8e9904829ce37 by aqjune
[BuildLibCalls] Add noundef to the returned pointers of allocators and argument of free

This patch adds noundef to the returned pointers of allocators (malloc, calloc, ...)
and the pointer argument of free.
The returned pointer of allocators cannot be poison or (partially) undef.
Since the pointer that is given to free should precisely have zero offset,
it cannot be poison or (partially) undef too.

For the size arguments of allocators, noundef wasn't attached simply because
I wasn't sure whether attaching it is okay or not.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D87984
The file was modifiedllvm/lib/Transforms/Utils/BuildLibCalls.cpp
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll
Commit ae7ab962840a8d6def1af64e89082e55adf50e2c by llvm-dev
LanaiSubtarget.h - remove unnecessary includes. NFCI.

TargetFrameLowering.h is guaranteed to be covered by LanaiFrameLowering.h
The file was modifiedllvm/lib/Target/Lanai/LanaiSubtarget.h
Commit 346199152fc1c70dd439b0adab8a5815e426b4c0 by llvm-dev
LanaiTargetMachine.h - remove unnecessary includes. NFCI.
The file was modifiedllvm/lib/Target/Lanai/LanaiTargetMachine.h
Commit 388b068956d4f169e868e7990d1cbc6066c3990c by spatel
[InstCombine] fix weird formatting in test file; NFC

It apparently didn't cause trouble for the parser or FileCheck,
but it was confusing to see a function def split by asserts.
The file was modifiedllvm/test/Transforms/InstCombine/masked_intrinsics.ll
Commit 259bb61c118bd7d15c3329ffb2daa9ceaea7302f by i
[ELF] Fix multiple -mllvm after D70378

Fixes https://reviews.llvm.org/D70378#2299569 Multiple -mllvm is intended to be supported.

We don't have a proper test for `-plugin-opt=-`. This patch adds the test as well.

Differential Revision: https://reviews.llvm.org/D88461
The file was modifiedlld/ELF/Driver.cpp
The file was addedlld/test/ELF/lto/mllvm.ll
Commit 0cf48a70651c722a5dabf0ca8ca246b110d7c2ab by llvm-dev
[InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C)

Attempt to fold trunc (*shr (trunc A), C) --> trunc(*shr A, C) iff the shift amount if small enough that all zero/sign bits created by the shift are removed by the last trunc.

Helps fix the regressions encountered in D88316.

I've tweaked a couple of shift values as suggested by @lebedev.ri to ensure we have coverage of shift values close (above/below) to the max limit.

Differential Revision: https://reviews.llvm.org/D88429
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/trunc-shift-trunc.ll
Commit 5409e4831fef7d2fa13fadd14ce53a85a99b1682 by spatel
[InstCombine] adjust duplicate test for masked load; NFC

The test after the changed test was checking exactly the same dereferenceable bytes.
The file was modifiedllvm/test/Transforms/InstCombine/masked_intrinsics.ll
Commit 3681be876fea9b270c7a1d2dc41679a399610e06 by i
Add -fprofile-update={atomic,prefer-atomic,single}

GCC 7 introduced -fprofile-update={atomic,prefer-atomic} (prefer-atomic is for
best efforts (some targets do not support atomics)) to increment counters
atomically, which is exactly what we have done with -fprofile-instr-generate
(D50867) and -fprofile-arcs (b5ef137c11b1cc6ae839ee75b49233825772bdd0).
This patch adds the option to clang to surface the internal options at driver level.

GCC 7 also turned on -fprofile-update=prefer-atomic when -pthread is specified,
but it has performance regression
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307). So we don't follow suit.

Differential Revision: https://reviews.llvm.org/D87737
The file was modifiedclang/test/CodeGen/tsan-instrprof-atomic.c
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/docs/UsersManual.rst
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def
The file was modifiedclang/test/CodeGen/code-coverage-tsan.c
The file was addedclang/test/Driver/fprofile-update.c
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
Commit 6d193ba3337e40be297c88ff8088d6cade3d5838 by mtrofin
[NFC][regalloc] Unit test for AllocationOrder iteration.

Added unittests. In the process, separated core construction - which just
needs the hits, order, and 'HardHints' values - from construction from
current register allocation state, to simplify testing.

Differential Revision: https://reviews.llvm.org/D88455
The file was modifiedllvm/lib/CodeGen/RegAllocGreedy.cpp
The file was modifiedllvm/lib/CodeGen/AllocationOrder.h
The file was modifiedllvm/lib/CodeGen/RegAllocBasic.cpp
The file was modifiedllvm/unittests/CodeGen/CMakeLists.txt
The file was modifiedllvm/lib/CodeGen/AllocationOrder.cpp
The file was addedllvm/unittests/CodeGen/AllocationOrderTest.cpp
Commit 543922cd3630ca3a1e06a6a946d148bc0e22e720 by stellaraccident
Adds MLIR C-API for marshaling Python capsules.

* Providing stable, C-accessible definitions for bridging MLIR Python<->C APIs, we eliminate inter-extension dependencies (i.e. they can all share a diamond dependency on the MLIR C-API).
* Just provides accessors for context and module right now.
* Needed in NPComp in ~a week or so for high level Torch APIs.

Differential Revision: https://reviews.llvm.org/D88426
The file was modifiedmlir/include/mlir-c/IR.h
The file was addedmlir/include/mlir-c/Bindings/Python/Interop.h
The file was modifiedmlir/lib/Bindings/Python/IRModules.h
The file was modifiedmlir/lib/Bindings/Python/IRModules.cpp
The file was modifiedmlir/test/Bindings/Python/ir_module.py
The file was modifiedmlir/test/Bindings/Python/context_lifecycle.py
Commit 4cda881e0d8b67d411b6a8daf55de53cf5d42ded by llvmgnsyncbot
[gn build] Port 6d193ba3337
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn