SuccessChanges

Summary

  1. [msan] Support %ms in scanf. (details)
  2. AMDGPU/GlobalISel: Enable s_{and|or}n2_{b32|b64} patterns (details)
  3. [AMDGPU] Correct missing sram-ecc target feature for gfx906 (details)
  4. BPF: fix libLLVMBPFCodeGen.so build failure (details)
  5. [ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0 (details)
  6. [NewPM][GuardWidening] Fix loop guard widening tests under NPM (details)
  7. [gn build] mac: use frameworks instead of libs where appropriate (details)
  8. GlobalISel: Implement lower for G_INSERT_VECTOR_ELT (details)
  9. Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC) (details)
Commit aa57cabae2fc5abc08ab3e17b45f2890fc7c9e42 by eugenis
[msan] Support %ms in scanf.

Differential Revision: https://reviews.llvm.org/D85350
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
The file was addedcompiler-rt/test/msan/scanf-allocate.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp
Commit 87b2af814078d319dd823eb9c0a279a96ae5f349 by Matthew.Arsenault
AMDGPU/GlobalISel: Enable s_{and|or}n2_{b32|b64} patterns
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/orn2.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/andn2.ll
Commit ce74e97d9b15514020bd7ffa1917291240b4e693 by Tony.Tye
[AMDGPU] Correct missing sram-ecc target feature for gfx906

Differential Revision: https://reviews.llvm.org/D85476
The file was modifiedllvm/docs/AMDGPUUsage.rst
Commit c50f5dece9728c377e6f77cb3874de2e406c4268 by yhs
BPF: fix libLLVMBPFCodeGen.so build failure

Buildbot reported a build failure when building shared
library libLLVMBPFCodeGen.so with unknown reference to
"createCFGSimplificationPass".

Commit 87cba434027b ("BPF: add a SimplifyCFG IR pass during
generic Scalar/IPO optimization") added an IR pass SimplifyCFG
by BPF target. The commit called function
createCFGSimplificationPass() defined in "Scalar" library.
Add this library in Target/BPF/LLVMBuild.txt so
shared library build can succeed.
The file was modifiedllvm/lib/Target/BPF/LLVMBuild.txt
Commit 004be4037e1e9c6092323c5c9268acb3ecf9176c by maskray
[ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0

tl;dr See D81784 for the 'tombstone value' concept. This patch changes our behavior to be almost the same as GNU ld (except that we also use 1 for .debug_loc):

* .debug_ranges & .debug_loc: 1 (LLD<11: 0+addend; GNU ld uses 1 for .debug_ranges)
* .debug_*: 0 (LLD<11: 0+addend; GNU ld uses 0; future LLD: -1)

We make the tweaks because:

1) The new tombstone is novel and needs more time to be adopted by consumers before it's the default.
2) The old (gold) strategy had problems with zero-length functions - so rather than going back that, we're going to the GNU ld strategy which doesn't have that problem.
3) One slight tweak to (2) is to apply the .debug_ranges workaround to .debug_loc for the same reasons it applies to debug_ranges - to avoid terminating lists early.

-----

http://lists.llvm.org/pipermail/llvm-dev/2020-July/143482.html

The tombstone value -1 in .debug_line caused problems to lldb (fixed by D83957;
will be included in 11.0.0) and breakpad (fixed by
https://crrev.com/c/2321300). It may potentially affects other DWARF consumers.

For .debug_ranges & .debug_loc: 1, an argument preferring 1 (GNU ld for .debug_ranges) over -2 is that:
```
{-1, -2}    <<< base address selection entry
{0, length} <<< address range
```
may create a situation where low_pc is greater than high_pc. So we use
1, the GNU ld behavior for .debug_ranges

For other .debug_* sections, there haven't been many reports. One issue is that
bloaty (src/dwarf.cc) can incorrectly count address ranges in .debug_ranges . To
reduce similar disruption, this patch changes the tombstone values to be similar to GNU ld.

This does mean another behavior change to the default trunk behavior. Sorry
about it. The default trunk behavior will be similar to release/11.x while we work on a transition plan for LLD users.

Reviewed By: dblaikie, echristo

Differential Revision: https://reviews.llvm.org/D84825
The file was modifiedlld/ELF/InputSection.cpp
The file was modifiedlld/test/ELF/debug-dead-reloc.s
The file was modifiedlld/test/ELF/debug-dead-reloc-tls-arm.s
The file was modifiedlld/test/ELF/debug-dead-reloc-icf.s
The file was modifiedlld/test/ELF/dead-reloc-in-nonalloc.s
The file was modifiedlld/test/ELF/debug-dead-reloc-32.s
The file was modifiedlld/test/ELF/debug-dead-reloc-tls.s
Commit 039fb7f68af9f89f8116d769a9e4cae458baca38 by aeubanks
[NewPM][GuardWidening] Fix loop guard widening tests under NPM

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D85394
The file was modifiedllvm/test/Transforms/GuardWidening/basic-loop.ll
The file was modifiedllvm/test/Transforms/GuardWidening/loop-schedule.ll
Commit 92d58392975b908055e22c9f24dcf8e84cc58a1b by thakis
[gn build] mac: use frameworks instead of libs where appropriate

As of GN 3028c6a426a4, the hack that transformed "libs" ending in
".framework" from -l arguments to -framework arguments has been removed.
Instead, "frameworks" must be used, and the toolchain must provide
support.

Differential Revision: https://reviews.llvm.org/D84219
The file was modifiedllvm/utils/gn/build/toolchain/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/tools/dsymutil/BUILD.gn
Commit 1ad051dd8c86d62f60e62295daa670c5cfb7d8fb by Matthew.Arsenault
GlobalISel: Implement lower for G_INSERT_VECTOR_ELT
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/insertelement-stack-lower.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-insert-vector-elt.mir
Commit 243903f3262d0e1727fe7d473da741c4a742a937 by Adrian Prantl
Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC)

The implementation of these classes was copied & pasted from the
iPhone simulator plugin with only a handful of configuration
parameters substituted. This patch moves the redundant implementations
into the base class PlatformAppleSimulator.

Differential Revision: https://reviews.llvm.org/D85243
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
The file was modifiedlldb/unittests/Platform/PlatformAppleSimulatorTest.cpp
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h