SuccessChanges

Summary

  1. Revert "[LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic" (details)
  2. Revert "[CFGuard] Add address-taken IAT tables and delay-load support" (details)
  3. [APFloat] convert SNaN to QNaN in convert() and raise Invalid signal (details)
  4. [CMake] Use -isystem flag to access libc++ headers (details)
  5. [InstCombine] Fix select operand simplification with undef (PR47696) (details)
  6. [PDB] Use one func id DenseMap instead of per-source maps, NFC (details)
  7. [lit] Fix Python 2/3 compat in new winreg search code (details)
  8. [CMake][Fuchsia] Don't set WIN32 API, rely on autodetection (details)
  9. Raland D87318 [LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic (details)
  10. [clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast (details)
  11. [AArch64][GlobalISel] Camp oversize v4s64 G_FPEXT operations. (details)
  12. [AArch64][GlobalISel] Use custom legalization for G_TRUNC for v8i8 vectors. (details)
  13. libclc: Use find_package to find Python 3 and require it (details)
  14. [gn build] Support building with ThinLTO (details)
  15. [AArch64][GlobalISel] Merge G_SHL, G_ASHR and G_LSHR legalizer rules together. (details)
  16. [lldb] Skip unique_ptr import-std-module tests on Linux (details)
  17. [LLD][COFF] Fix crash with /summary and PCH input files (details)
  18. [AArch64][GlobalISel] Make <8 x s8> shifts legal. (details)
  19. Revert "[AArch64][GlobalISel] Make <8 x s8> shifts legal." (details)
Commit 5f3e565f59ee8c5614663a484df1dc853ca3694d by stefanp
Revert "[LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic"

This reverts commit 79122868f9a3909cfd94d51e9bfe960917a1be05.
The file was modifiedlld/ELF/Arch/PPC64.cpp
The file was modifiedlld/ELF/Relocations.cpp
The file was removedlld/test/ELF/ppc64-tls-pcrel-gd.s
Commit 499260c03b916920d77c5833022937fd0e20d2c0 by aeubanks
Revert "[CFGuard] Add address-taken IAT tables and delay-load support"

This reverts commit ef4e971e5e18ae796466623df8f26265ba6bdfb5.
The file was modifiedlld/COFF/InputFiles.cpp
The file was removedlld/test/COFF/giats.s
The file was modifiedllvm/include/llvm/MC/MCObjectFileInfo.h
The file was removedllvm/test/CodeGen/WinCFGuard/cfguard-giats.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
The file was modifiedllvm/tools/llvm-readobj/COFFDumper.cpp
The file was modifiedllvm/lib/MC/MCObjectFileInfo.cpp
The file was modifiedlld/COFF/DLL.cpp
The file was modifiedlld/COFF/ICF.cpp
The file was modifiedlld/COFF/Writer.cpp
The file was modifiedlld/COFF/InputFiles.h
The file was modifiedlld/COFF/Symbols.h
Commit 149f5b573c79eac0c519ada4d2f7c50e17796cdf by spatel
[APFloat] convert SNaN to QNaN in convert() and raise Invalid signal

This is an alternate fix (see D87835) for a bug where a NaN constant
gets wrongly transformed into Infinity via truncation.
In this patch, we uniformly convert any SNaN to QNaN while raising
'invalid op'.
But we don't have a way to directly specify a 32-bit SNaN value in LLVM IR,
so those are always encoded/decoded by calling convert from/to 64-bit hex.

See D88664 for a clang fix needed to allow this change.

Differential Revision: https://reviews.llvm.org/D88238
The file was modifiedllvm/unittests/ADT/APFloatTest.cpp
The file was modifiedclang/test/CodeGen/builtin-nan-legacy.c
The file was modifiedllvm/lib/Support/APFloat.cpp
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/nancvt.ll
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
The file was modifiedclang/test/CodeGen/builtin-nan-exception.c
The file was modifiedllvm/test/Transforms/InstSimplify/ConstProp/cast.ll
The file was modifiedllvm/lib/IR/AsmWriter.cpp
The file was modifiedclang/test/CodeGen/mips-unsupported-nan.c
Commit 8d26760a95bae34aa5c1161a1c2ab8c1cdaa10a1 by phosek
[CMake] Use -isystem flag to access libc++ headers

This is a partial revert of D62155. Rather than copying libc++ headers
into the build directory to be later overwritten by the final headers,
use -isystem flag to access libc++ headers during CMake checks. This
should address the occasional flake we've seen, especially on Windows
builders where CMake fails to overwrite __config with the final version.

Differential Revision: https://reviews.llvm.org/D88454
The file was modifiedlibcxx/include/CMakeLists.txt
The file was modifiedllvm/runtimes/CMakeLists.txt
Commit 9d1c8c0ba94a273c53829f0800335045e547db88 by nikita.ppv
[InstCombine] Fix select operand simplification with undef (PR47696)

When replacing X == Y ? f(X) : Z with X == Y ? f(Y) : Z, make sure
that Y cannot be undef. If it may be undef, we might end up picking
a different value for undef in the comparison and the select
operand.
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineInternal.h
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
Commit 5d46d7e8b288a52de1eff97d6c5b44039ede6661 by rnk
[PDB] Use one func id DenseMap instead of per-source maps, NFC

This avoids some DenseMap copies when /Zi is in use, and results in
fewer data structures.

Differential Revision: https://reviews.llvm.org/D88617
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/DebugTypes.h
Commit d12ae042e17b27ebc8d2b5ae3d8dd5f88384d093 by rnk
[lit] Fix Python 2/3 compat in new winreg search code

This should fix the test failures on the clang win64 bot:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/18830
It has been red since Sept 23-ish.

This was subtle to debug. Windows has 'find' and 'sort' utilities in
C:\Windows\system32, but they don't support all the same flags as the
coreutils programs. I configured the buildbot above with Python 2.7
64-bit (hey, it was set up in 2016). When I installed git for Windows, I
opted to add all the Unix utilities that come with git to the system
PATH. This is *almost* enough to make the LLVM tests pass, but not
quite, because if you use the system PATH, the Windows version of find
and sort come first, but the tests that use diff, cmp, etc, will all
pass. So only a handful of tests will fail, and with cryptic error
messages.

The code changed in this CL doesn't work with Python 2. Before
Python 3.2, the winreg.OpenKey function did not accept the `access=`
keyword argument, the caller was required to pass an unused `reserved`
positional argument of 0. The try/except/pass around the OpenKey
operation masked this usage error in Python 2.

Further, the result of the registry operation has to be converted from
unicode to add it to the environment, but that was incidental.
The file was modifiedllvm/utils/lit/lit/llvm/config.py
Commit de47e7122f69d56399c4f8864ba279e5ce635970 by phosek
[CMake][Fuchsia] Don't set WIN32 API, rely on autodetection

We prefer autodetection here to avoid persisting this configuration
in the generated __config header which is shared across targets.

Differential Revision: https://reviews.llvm.org/D88694
The file was modifiedclang/cmake/caches/Fuchsia-stage2.cmake
Commit 88f2fe5cad6cc3a3830448cb8a88b52ee449f2d1 by i
Raland D87318 [LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic

Add Thread Local Storage support for the 34 bit relocation R_PPC64_GOT_TLSGD_PCREL34 used in General Dynamic.

The compiler will produce code that looks like:
```
pla r3, x@got@tlsgd@pcrel            R_PPC64_GOT_TLSGD_PCREL34
bl __tls_get_addr@notoc(x@tlsgd)     R_PPC64_TLSGD
                                     R_PPC64_REL24_NOTOC
```
LLD should be able to correctly compute the relocation for  R_PPC64_GOT_TLSGD_PCREL34 as well as do the following two relaxations where possible:
General Dynamic to Local Exec:
```
paddi r3, r13, x@tprel
nop
```
and General Dynamic to Initial Exec:
```
pld r3, x@got@tprel@pcrel
add r3, r3, r13
```
Note:
This patch adds support for the PC Relative (no TOC) version of General Dynamic on top of the existing support for the TOC version of General Dynamic.
The ABI does not provide any way to tell by looking only at the relocation `R_PPC64_TLSGD` when it is being used in a TOC instruction sequence or and when it is being used in a no TOC sequence. The TOC sequence should always be 4 byte aligned. This patch adds one to the offset of the relocation when it is being used in a no TOC sequence. In this way LLD can tell by looking at the alignment of the offset of `R_PPC64_TLSGD` whether or not it is being used as part of a TOC or no TOC sequence.

Reviewed By: NeHuang, sfertile, MaskRay

Differential Revision: https://reviews.llvm.org/D87318
The file was modifiedlld/ELF/Relocations.cpp
The file was modifiedlld/ELF/Arch/PPC64.cpp
The file was addedlld/test/ELF/ppc64-tls-pcrel-gd.s
Commit 35ecc7fe49ba881a77e8146b51870a60a52b211f by hubert.reinterpretcast
[clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast

Fix premature decision in the presence of type-dependent expression
operands on whether AltiVec vector initializations from single
expressions are "splat" operations.

Verify that the instantiation is able to determine the correct cast
semantics for both the scalar type and the vector type case.

Note that, because the change only affects the single-expression
case (and the target type is an AltiVec-style vector type), the
replacement of a parenthesized list with a parenthesized expression
does not change the semantics of the program in a program-observable
manner.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D88526
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was addedclang/test/SemaTemplate/pr47676.cpp
Commit 4c265ce665630b74ad9f25f67cd2114714b9aaab by Amara Emerson
[AArch64][GlobalISel] Camp oversize v4s64 G_FPEXT operations.
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/legalize-fpext.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Commit 73457536ff335a2cbe2381354512e0fcf9d703fd by Amara Emerson
[AArch64][GlobalISel] Use custom legalization for G_TRUNC for v8i8 vectors.

Truncating to v8i8 is a case where we want to split the source but also generate
intermediate truncates to reduce the size of the source vector before truncating
down to v8i8. This implements the same strategy as what SelectionDAG does, but
I'm not certain where if anywhere in generic code it should live.

Use it for legalization of v8s8 = G_ICMP v8s32.

Differential Revision: https://reviews.llvm.org/D88191
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-vector-icmp.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.h
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Commit 1c1a8105580784c96212db1afc097a844740bc69 by aaronpuchert
libclc: Use find_package to find Python 3 and require it

The script's shebang wants Python 3, so we use FindPython3. The
original code didn't work when an unversioned python was not available.
This is explicitly allowed in PEP 394. ("Distributors may choose to set
the behavior of the python command as follows: python2, python3, not
provide python command, allow python to be configurable by an end user
or a system administrator.")

Also I think it's actually required, so let the configuration fail if we
can't find it.

Lastly remove the shebang, since the script is only run via interpreter
and doesn't have the executable bit set anyway.

Reviewed By: jvesely

Differential Revision: https://reviews.llvm.org/D88366
The file was modifiedlibclc/generic/lib/gen_convert.py
The file was modifiedlibclc/CMakeLists.txt
Commit b29573b672d795dfc58aaf70c70511229584e3c3 by aeubanks
[gn build] Support building with ThinLTO

Differential Revision: https://reviews.llvm.org/D88584
The file was modifiedllvm/utils/gn/build/BUILD.gn
The file was modifiedllvm/utils/gn/build/buildflags.gni
Commit 9f6acb13586b0b3b4e83dc03648ced02517bd236 by Amara Emerson
[AArch64][GlobalISel] Merge G_SHL, G_ASHR and G_LSHR legalizer rules together.

There's no need for any difference between these.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-shift.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Commit 15ea45f16b261521e3251b4ff0bceaadf31a4515 by Raphael Isemann
[lldb] Skip unique_ptr import-std-module tests on Linux

This seems to fail on ubuntu 18.04.5 with Clang 9 due to:

Error output:
error: Couldn't lookup symbols:
  std::__1::default_delete<int>::operator()(int) const
The file was modifiedlldb/test/API/commands/expression/import-std-module/unique_ptr/TestUniquePtrFromStdModule.py
The file was modifiedlldb/test/API/commands/expression/import-std-module/unique_ptr-dbg-info-content/TestUniquePtrDbgInfoContent.py
Commit 4140f0744fb2deccb74e77282e23ff731f67821b by alexandre.ganea
[LLD][COFF] Fix crash with /summary and PCH input files

Before this patch /summary was crashing with some .PCH.OBJ files, because tpiMap[srcIdx++] was reading at the wrong location. When the TpiSource depends on a .PCH.OBJ file, the types should be offset by the previously merged PCH.OBJ set of indices.

Differential Revision: https://reviews.llvm.org/D88678
The file was addedlld/test/COFF/Inputs/precomp2-a.yaml
The file was addedlld/test/COFF/Inputs/precomp2.yaml
The file was modifiedlld/COFF/DebugTypes.cpp
The file was addedlld/test/COFF/precomp-summary-fail.test
Commit 8071c2f5c6149d0dc976819002dc46d9e7edfa40 by Amara Emerson
[AArch64][GlobalISel] Make <8 x s8> shifts legal.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-shift.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
Commit 9a2b3bbc59d57c4cf3a3b898cbfa805c4cc9263f by Amara Emerson
Revert "[AArch64][GlobalISel] Make <8 x s8> shifts legal."

Accidentally pushed this.
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-shift.mir