Progress:
In progressChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [tblgen] Fold loop into assert to avoid unused variable warnings. NFCI. (details)
  2. DeclContext: Fix iterator category (details)
  3. [WebAssembly] Remove saturating fp-to-int target intrinsics (details)
  4. [ELF] Default to -z start-stop-gc with a glibc "__libc_" special case (details)
  5. [lldb] Add code and data address mask to Process (details)
  6. [AMDGPU] Enforce that gfx802/803/805 do not support XNACK (details)
  7. [TableGen] Predicate::operator== needs to compare the HwMode feature name in addition to the HwMode flag. (details)
  8. [AMDGPU] NFC, Comment in disassembler for dpp8 (details)
  9. [AMDGPU] Remove redundant field from DPP8 def (details)
  10. [TableGen] Fix -Wparentheses (details)
  11. [lld-macho] Initial groundwork for -bitcode_bundle (details)
  12. Simplify BitVector code (details)
  13. [lldb] Implement ABI::Fix{Code,Data}Address for AArch64 (details)
  14. [lldb] Set addressable bits from qHostInfo (details)
  15. [lld-macho] Add separator to error message (details)
  16. [sanitizer] GetTls: work around ppc64 with glibc<2.25(?) or GNU ld 2.30 (details)
  17. [lld] Canonicalize HAVE_LIBXAR (details)
  18. [libc] Extends the testing framework to support typed test (details)
  19. [funcattrs] Add the maximal set of implied attributes to definitions (details)
  20. [OpenMP] Allow affinity to re-detect for child processes (details)
  21. [libc] Add endianness support (details)
  22. [OpenMP] Implement GOMP task reductions (details)
  23. [libc] Fix wrongly deduced type (details)
Commit 7946cc404f435a7b609d4bb00c8378e8c783475a by benny.kra
[tblgen] Fold loop into assert to avoid unused variable warnings. NFCI.
The file was modifiedllvm/utils/TableGen/CodeGenDAGPatterns.cpp
Commit 46968577336f29ddc5fd30e87cb94b03fa3c9cd9 by bjoern
DeclContext: Fix iterator category

This amends 0cb7e7ca0c864e052bf49978f3bcd667c9e16930.
The iterator category of lookup_iterator was changed, but here it stayed
hardcoded as random access. Found while trying to build Clazy.

Differential-Revision: https://reviews.llvm.org/D100590
The file was modifiedclang/include/clang/AST/DeclBase.h
Commit 5c729750a6d75df4eeb3eaad72e0b4e93ea27c0e by tlively
[WebAssembly] Remove saturating fp-to-int target intrinsics

Use the target-independent @llvm.fptosi and @llvm.fptoui intrinsics instead.
This includes removing the instrinsics for i32x4.trunc_sat_zero_f64x2_{s,u},
which are now represented in IR as a saturating truncation to a v2i32 followed by
a concatenation with a zero vector.

Differential Revision: https://reviews.llvm.org/D100596
The file was modifiedllvm/include/llvm/IR/IntrinsicsWebAssembly.td
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td
The file was modifiedllvm/lib/Analysis/ConstantFolding.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
The file was removedllvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/trunc_saturate.ll
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/conv.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISD.def
The file was modifiedclang/test/CodeGen/builtins-wasm.c
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
Commit 6d2d3bd0a61f5fc7fd9f61f48bc30e9ca77cc619 by i
[ELF] Default to -z start-stop-gc with a glibc "__libc_" special case

Change the default to facilitate GC for metadata section usage, so that they
don't need SHF_LINK_ORDER or SHF_GROUP just to drop the unhelpful rule (if they
want to be unconditionally retained, use SHF_GNU_RETAIN
(`__attribute__((retain))`) or linker script `KEEP`).

The dropped SHF_GROUP special case makes the behavior of -z start-stop-gc and -z
nostart-stop-gc closer to GNU ld>=2.37 (https://sourceware.org/PR27451).

However, we default to -z start-stop-gc (which actually matches more closely to
GNU ld before 2015-10 https://sourceware.org/PR19167), which is different from
modern GNU ld (which has the unhelpful rule to work around glibc). As a
compensation, we special case `__libc_` sections as a workaround for glibc<2.34
(https://sourceware.org/PR27492).

Since -z start-stop-gc as the default actually matches the traditional GNU ld
behavior, there isn't much to be aware of. There was a systemd usage which has
been fixed by https://github.com/systemd/systemd/pull/19144
The file was modifiedlld/test/ELF/lto/section-name.ll
The file was modifiedlld/test/ELF/relocatable-gc.s
The file was modifiedlld/test/ELF/gc-sections-metadata-startstop.s
The file was modifiedlld/ELF/MarkLive.cpp
The file was modifiedlld/test/ELF/gc-sections-startstop.s
The file was modifiedlld/test/ELF/linkerscript/sections-gc2.s
The file was modifiedlld/ELF/Driver.cpp
Commit fdbb5a7a91b00d1e4a9a16fee96763917a411fff by Jonas Devlieghere
[lldb] Add code and data address mask to Process

Add a code and data address mask to Process with respective getters and
setters and a setting that allows the user to specify the mast as a
number of addressable bits. The masks will be used by FixCodeAddress and
FixDataAddress respectively in the ABI classes.

Differential revision: https://reviews.llvm.org/D100515
The file was modifiedlldb/source/Target/Process.cpp
The file was modifiedlldb/include/lldb/Target/Process.h
The file was modifiedlldb/source/Target/TargetProperties.td
Commit 13875aab4e7d907b1a934579be61dd936c2de17a by Tony.Tye
[AMDGPU] Enforce that gfx802/803/805 do not support XNACK

Reviewed By: kzhuravl

Differential Revision: https://reviews.llvm.org/D100679
The file was modifiedllvm/lib/Support/TargetParser.cpp
Commit 6b446310bef95eecea7afdd989e57e64d39a3b0d by craig.topper
[TableGen] Predicate::operator== needs to compare the HwMode feature name in addition to the HwMode flag.

This was causing GenerateVariants to lose some variants since
HwMode is expanded first. We were mistakenly thinking the HwMode
predicate matched and finding the variant was isomorphic to a
pattern in another HwMode and discarding it.

Found while investigating it if would be better to generate
variants before expanding HwModes to improve RISCV build time.
I noticed an increase in the number of Opc_MorphNodeTo in the table
which indicated that the number of patterns had changed.
The file was modifiedllvm/utils/TableGen/CodeGenDAGPatterns.h
Commit 919236e608685e1c5c43edb03b42b4d8acab45aa by Joseph.Nash
[AMDGPU] NFC, Comment in disassembler for dpp8

Gives reasoning for convertDPP8.
Also corrects typo in Operand type comment.

Reviewed By: rampitec

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

Change-Id: I33ff269db8072d83e5e0ecdbfb731d6000fc26c4
The file was modifiedllvm/lib/Target/AMDGPU/SIRegisterInfo.td
The file was modifiedllvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Commit a0ed70abded169a6e3d5a304aa2e120f3a78fd76 by Joseph.Nash
[AMDGPU] Remove redundant field from DPP8 def

These lines set the value to what it already was,
so they are redundant. NFC

Reviewed By: rampitec

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

Change-Id: Ibf6f27d50a7fa1f76c127f01b799821378bfd3b3
The file was modifiedllvm/lib/Target/AMDGPU/VOP1Instructions.td
The file was modifiedllvm/lib/Target/AMDGPU/VOP2Instructions.td
Commit 657b325416682e37c43756d55a31dc729a062387 by i
[TableGen] Fix -Wparentheses
The file was modifiedllvm/utils/TableGen/CodeGenDAGPatterns.cpp
Commit ca6751043d8899b12baeb48621e61fb352cfee09 by jezng
[lld-macho] Initial groundwork for -bitcode_bundle

This diff creates an empty XAR file and copies it into
`__LLVM,__bundle`. Follow-up work will actually populate the contents of
that XAR.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D100650
The file was modifiedlld/MachO/Driver.cpp
The file was addedlld/test/MachO/bitcode-bundle.ll
The file was modifiedlld/test/lit.site.cfg.py.in
The file was modifiedlld/MachO/Config.h
The file was modifiedlld/MachO/InputSection.h
The file was modifiedlld/test/lit.cfg.py
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/OutputSection.h
The file was modifiedlld/MachO/SyntheticSections.h
The file was addedlld/test/MachO/invalid/no-libxar.ll
The file was modifiedlld/MachO/Options.td
The file was modifiedlld/MachO/OutputSegment.h
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/tools/lld/CMakeLists.txt
Commit 550ed575cbbd2c81cb855d4debb4a215ae75ef1e by sguelton
Simplify BitVector code

Instead of managing memory by hand, delegate it to std::vector. This makes the
code much simpler, and also avoids repeatedly computing the storage size.

According to valgrind --tool=callgrind, this also slightly decreases the
instruction count, but by a small margin.

This is a recommit of 82f0e3d3ea6bf927e3397b2fb423abbc5821a30f with one usage
fixed in llvm/lib/CodeGen/RegisterScavenging.cpp.

Not the slight API change: BitVector::clear() now has the same behavior as any
other container: it does not free memory, but indeed sets the size of the
BitVector to 0. It is thus incorrect to access its content right afterwards, a
scenario which wasn't enforced in previous implementation.

Differential Revision: https://reviews.llvm.org/D100387
The file was modifiedllvm/lib/CodeGen/RegisterScavenging.cpp
The file was modifiedllvm/include/llvm/ADT/BitVector.h
Commit 8770b4ecca557b02d37188ae2fa5479e6136b2fb by Jonas Devlieghere
[lldb] Implement ABI::Fix{Code,Data}Address for AArch64

Implement FixCodeAddress and FixDataAddress for ABIMacOSX_arm64 and
ABISysV_arm64 and add missing calls to RegisterContextUnwind. We need
this to unwind on Apple Silicon where libraries like libSystem are
arm64e even when the program being debugged is arm64.

Differential revision: https://reviews.llvm.org/D100521
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h
The file was modifiedlldb/include/lldb/Target/ABI.h
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIAArch64.h
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
The file was modifiedlldb/source/Target/RegisterContextUnwind.cpp
Commit db2da0c8f907c444e0bf8b788d8186c4c67db0b2 by Jonas Devlieghere
[lldb] Set addressable bits from qHostInfo

Read the number of addressable bits from the qHostInfo packet and use it
to set the code and data address mask in the process. The data
(addressing_bits) is already present in the packet.

Differential revision: https://reviews.llvm.org/D100520
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Commit bb0e1ae7c4170b18247e5c7c226ed29689d552a5 by jezng
[lld-macho] Add separator to error message
The file was modifiedlld/MachO/SyntheticSections.cpp
Commit 08843a0c3f3ee572633b8ed8dda9dbacae9dd520 by i
[sanitizer] GetTls: work around ppc64 with glibc<2.25(?) or GNU ld 2.30

GNU ld 2.26 and GNU ld 2.31 seem fine but GNU ld 2.30 has mysterious
segfaults linking msan tests.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Commit 3e1045ec04a033c688aa40e961e26c38446f1139 by jezng
[lld] Canonicalize HAVE_LIBXAR

I think this should unbreak the build after D100650...
The file was modifiedlld/test/CMakeLists.txt
Commit 7c02dc22e487637abe752939c0e82d36be9921df by gchatelet
[libc] Extends the testing framework to support typed test

This patch provides `TYPED_TEST` and `TYPED_TEST_F` (similar in functionnality to gtest).
This is needed to extensively test building blocks for memory functions.

Example for `TYPED_TEST_F`:
```
template <typename T> class LlvmLibcMyTestFixture : public testing::Test {};

using Types = testing::TypeList<char, int, long>;

TYPED_TEST_F(LlvmLibcMyTestFixture, Simple, Types) {
  EXPECT_LE(sizeof(ParamType), 8UL);
}
```

Example for `TYPED_TEST`:
```
using Types = testing::TypeList<char, int, long>;

TYPED_TEST(LlvmLibcMyTest, Simple, Types) {
  EXPECT_LE(sizeof(ParamType), 8UL);
}
```

`ParamType` is displayed as fully qualified canonical type which can be difficult to read, the user can provide a more readable name by using the `REGISTER_TYPE_NAME` macro.

Differential Revision: https://reviews.llvm.org/D100631
The file was modifiedlibc/utils/UnitTest/LibcTest.h
Commit f549176ad976caa3e19edd036df9a7e12770af7c by listmail
[funcattrs] Add the maximal set of implied attributes to definitions

Have funcattrs expand all implied attributes into the IR. This expands the infrastructure from D100400, but for definitions not declarations this time.

Somewhat subtly, this mostly isn't semantic. Because the accessors did the inference, any client which used the accessor was already getting the stronger result. Clients that directly checked presence of attributes (there are some), will see a stronger result now.

The old behavior can end up quite confusing for two reasons:
* Without this change, we have situations where function-attrs appears to fail when inferring an attribute (as seen by a human reading IR), but that consuming code will see that it should have been implied. As a human trying to sanity check test results and study IR for optimization possibilities, this is exceeding error prone and confusing. (I'll note that I wasted several hours recently because of this.)
* We can have transforms which trigger without the IR appearing (on inspection) to meet the preconditions. This change doesn't prevent this from happening (as the accessors still involve multiple checks), but it should make it less frequent.

I'd argue in favor of deleting the extra checks out of the accessors after this lands, but I want that in it's own review as a) it's purely stylistic, and b) I already know there's some disagreement.

Once this lands, I'm also going to do a cleanup change which will delete some now redundant duplicate predicates in the inference code, but again, that deserves to be a change of it's own.

Differential Revision: https://reviews.llvm.org/D100226
The file was modifiedllvm/test/Other/cgscc-observe-devirt.ll
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll
The file was modifiedllvm/test/Other/cgscc-devirt-iteration.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/incompatible_fn_attrs.ll
The file was modifiedllvm/test/Transforms/Inline/cgscc-update.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/nounwind.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/nofree-attributor.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/nosync.ll
The file was modifiedllvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/willreturn-callsites.ll
The file was modifiedllvm/lib/Transforms/IPO/FunctionAttrs.cpp
The file was modifiedllvm/test/Transforms/FunctionAttrs/atomic.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/inline-attr.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/optnone.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/writeonly.ll
The file was modifiedllvm/test/Transforms/FunctionAttrs/nofree.ll
The file was modifiedclang/test/CodeGenOpenCL/convergent.cl
The file was modifiedllvm/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll
The file was modifiedllvm/test/Other/cgscc-iterate-function-mutation.ll
Commit 5ebbb366c4a369740c3a3fe1f673e0e8c1902e60 by jonathan.l.peyton
[OpenMP] Allow affinity to re-detect for child processes

Current atfork() handler for child processes does not reset
the affinity masks array which prevents users from setting their own
affinity in child processes.

Differential Revision: https://reviews.llvm.org/D99218
The file was addedopenmp/runtime/test/affinity/libomp_test_affinity.h
The file was addedopenmp/runtime/test/affinity/redetect.c
The file was modifiedopenmp/runtime/src/z_Linux_util.cpp
Commit 7e075ad0b261236dd0a01f0b5e01f3221b0700d7 by gchatelet
[libc] Add endianness support

Add endianness detection support. This will be useful to implement `memcmp`.

Differential Revision: https://reviews.llvm.org/D100571
The file was modifiedlibc/src/__support/CMakeLists.txt
The file was addedlibc/test/src/__support/CMakeLists.txt
The file was addedlibc/test/src/__support/endian_test.cpp
The file was modifiedlibc/test/src/CMakeLists.txt
The file was addedlibc/src/__support/endian.h
Commit 4457565757ea91207b7e5f2ce7b7bf173bfd2c0c by jonathan.l.peyton
[OpenMP] Implement GOMP task reductions

Implement the remaining GOMP_* functions to support task reductions
in taskgroup, parallel, loop, and taskloop constructs.  The unused mem
argument to many of the work-sharing constructs has to do with the
scan() directive/ inscan() modifier.  If mem is set, each function
will call KMP_FATAL() and tell the user scan/inscan is unsupported.  The
GOMP reduction implementation is kept separate from our implementation
because of how GOMP presents reduction data and computes the reductions.
GOMP expects the privatized copies to be present even after a #pragma
omp parallel reduction(task:...) region has ended so the data is stored
inside GOMP's uintptr_t* data pseudo-structure.  This style is tightly
coupled with GCC compiler codegen.  There also isn't any init(),
combiner(), fini() functions in GOMP's codegen so the two
implementations were to disparate to try to wrap GOMP's around our own.

Differential Revision: https://reviews.llvm.org/D98806
The file was modifiedopenmp/runtime/src/kmp_tasking.cpp
The file was addedopenmp/runtime/test/tasking/task_reduction3.c
The file was modifiedopenmp/runtime/src/kmp_ftn_os.h
The file was modifiedopenmp/runtime/test/tasking/omp_task_red_taskloop.c
The file was modifiedopenmp/runtime/src/kmp.h
The file was modifiedopenmp/runtime/src/kmp_gsupport.cpp
The file was addedopenmp/runtime/test/tasking/task_reduction1.c
The file was addedopenmp/runtime/test/tasking/task_reduction4.c
The file was addedopenmp/runtime/test/tasking/task_reduction2.c
Commit 2bfe15810defad3e0615f79e0bda375fc8f02f23 by gchatelet
[libc] Fix wrongly deduced type
The file was modifiedlibc/test/src/__support/endian_test.cpp