SuccessChanges

Summary

  1. GlobalISel: Move AArch64 AssignFnVarArg to base class (details)
  2. GlobalISel: Split ValueHandler into assignment and emission classes (details)
  3. GlobalISel: Make constant fields const (details)
  4. AMDGPU: Fix assert on constant load from addrspacecasted pointer (details)
  5. GlobalISel: Don't hardcode varargs=false in resultsCompatible (details)
  6. Fix bad mangling of <data-member-prefix> for a closure in the initializer of a variable at global namespace scope. (details)
  7. Add test for PR50039. (details)
  8. Revert "Fix bad mangling of <data-member-prefix> for a closure in the initializer of a variable at global namespace scope." (details)
  9. [lld][WebAssembly] Fix for string merging + negative addends (details)
  10. This test is failing on Linux, skip while I investigate. (details)
  11. AMDGPU: Fix SILoadStoreOptimizer for gfx90a (details)
  12. Removing test... (details)
  13. [LoopInterchange] Handle lcssa PHIs with multiple predecessors (details)
  14. [NFC][msan] Move setlocale test into sanitizer_common (details)
Commit 2bdfcf0cac148ada8d3ec36f551c45efb604ac49 by Matthew.Arsenault
GlobalISel: Move AArch64 AssignFnVarArg to base class

We can handle the distinction easily enough in the generic code, and
this makes it easier to abstract the selection of type/location from
the code to insert code.
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
Commit 24e2e5df0e7eb017c64142c1f5899146fa52abba by Matthew.Arsenault
GlobalISel: Split ValueHandler into assignment and emission classes

Currently the ValueHandler handles both selecting the type and
location for arguments, as well as inserting instructions needed to
handle them. Split this so that the determination of the argument
handling is independent of the function state. Currently the checks
for tail call compatibility do not follow the full assignment logic,
so it misses cases where arguments require nontrivial legalization.

This should help avoid targets ending up in a buggy state where the
argument evaluation may change in different contexts.
The file was modifiedllvm/lib/Target/X86/X86CallLowering.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
The file was modifiedllvm/lib/Target/ARM/ARMCallLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
Commit 6ecbdb761ffd684dc5fe624c0058fe7527a01881 by Matthew.Arsenault
GlobalISel: Make constant fields const
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
Commit a15ed701ab30d0073f46139df850fe23b03fd3ac by Matthew.Arsenault
AMDGPU: Fix assert on constant load from addrspacecasted pointer

This was trying to create a bitcast between different address spaces.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
The file was addedllvm/test/CodeGen/AMDGPU/amdgpu-late-codegenprepare.ll
Commit 6f5ddf67319b50664f3f5a4001723454696594b4 by Matthew.Arsenault
GlobalISel: Don't hardcode varargs=false in resultsCompatible
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Commit 697ac15a0fc71888c372667bdbc5583ab42d4695 by richard
Fix bad mangling of <data-member-prefix> for a closure in the initializer of a variable at global namespace scope.

This implements the direction proposed in
https://github.com/itanium-cxx-abi/cxx-abi/pull/126.

Differential Revision: https://reviews.llvm.org/D101968
The file was modifiedclang/test/CodeGenCXX/clang-abi-compat.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedclang/lib/AST/ItaniumMangle.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was modifiedclang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp
The file was modifiedclang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
Commit 3978333b71bff3516ad69aac484b808617976c7a by richard
Add test for PR50039.

I believe Clang's behavior is correct according to the standard here,
but this is an unusual situation for which we had no test coverage, so
I'm adding some.
The file was modifiedclang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
Commit bb726383ac7554857c62edd2d19e83dc713165ee by richard
Revert "Fix bad mangling of <data-member-prefix> for a closure in the initializer of a variable at global namespace scope."

This reverts commit 697ac15a0fc71888c372667bdbc5583ab42d4695, for which
review was not complete. That change was accidentally pushed when
an unrelated change was pushed.
The file was modifiedclang/lib/AST/ItaniumMangle.cpp
The file was modifiedclang/test/CodeGenCXX/clang-abi-compat.cpp
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was modifiedclang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp
The file was modifiedclang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
Commit 19cedd3cd3ab2144f7e477bb90d5f7ba8e500abb by sbc
[lld][WebAssembly] Fix for string merging + negative addends

Don't include the relocation addend when calculating the
virtual address of a symbol.  Instead just pass the symbol's
offset and add the addend afterwards.

Without this fix we hit the `offset is outside the section`
error in MergeInputSegment::getSegmentPiece.

This fixes a real world error we were are seeing in emscripten.

Differential Revision: https://reviews.llvm.org/D102271
The file was modifiedlld/wasm/InputFiles.cpp
The file was modifiedlld/wasm/Symbols.h
The file was modifiedlld/test/wasm/merge-string.s
The file was modifiedlld/wasm/Symbols.cpp
Commit 0f2eb7e6e5dc2c1b5d1080160733b3a49e00c99c by jingham
This test is failing on Linux, skip while I investigate.

The gdb-remote tests are a bit artificial, depending on
Python threading, and sleeps.  So I'm not 100% surprised it doesn't
work straight up on another XSsystem.
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
Commit cc79aaced0a405c7448c832a0974a694494496ca by Matthew.Arsenault
AMDGPU: Fix SILoadStoreOptimizer for gfx90a

This was hardcoding the register class to use for the newly created
pointer registers, violating the aligned VGPR requirement.
The file was addedllvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm-gfx90a.mir
The file was modifiedllvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm.ll
Commit 10c309ad81e2be156ab44a83ee56cddea20637cc by jingham
Removing test...

Actually, I don't think this test is going to be stable enough
to be worthwhile.  Let me see if I can think of a better way to
test this.
The file was removedlldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
Commit 3f8be15f2911a3d3645030911be83a115bfe9e5c by congzhecao
[LoopInterchange] Handle lcssa PHIs with multiple predecessors

This is a bugfix in the transformation phase.

If the original outer loop header branches to both the inner loop
(header) and the outer loop latch, and if there is an lcssa PHI
node outside the loop nest, then after interchange the new outer latch
will have an lcssa PHI node inserted which has two predecessors, i.e.,
the original outer header and the original outer latch. Currently
the transformation assumes it has only one predecessor (the original
outer latch) and crashes, since the inserted lcssa PHI node does
not take both predecessors as incoming BBs.

Reviewed By: Whitney

Differential Revision: https://reviews.llvm.org/D100792
The file was modifiedllvm/lib/Transforms/Scalar/LoopInterchange.cpp
The file was modifiedllvm/test/Transforms/LoopInterchange/lcssa.ll
Commit 7d101e0f6a38b95f512dc5d78bc9b508f4ee6da0 by Vitaly Buka
[NFC][msan] Move setlocale test into sanitizer_common
The file was addedcompiler-rt/test/sanitizer_common/TestCases/setlocale.cpp
The file was removedcompiler-rt/test/msan/setlocale.cpp