SuccessChanges

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

Summary

  1. Reland [X86] Codegen for preallocated (details)
  2. [libcxx] Remove swap for std::span (details)
  3. [llvm] [CodeGen] [X86] Fix issues with v4i1 instruction selection (details)
  4. [libcxx][test] Portability fix for some locale-dependent tests. (details)
  5. [NFC][InstCombine] Negator: tests for extractelement negation (details)
  6. [InstCombine] Negator: `extractelement` is negatible if src is negatible (details)
  7. [NFC][InstCombine] Negator: tests for insertelement negation (details)
  8. [InstCombine] `insertelement` is negatible if both sources are negatible (details)
  9. [mlir][spirv] Adapt subview legalization to the updated op semantics. (details)
  10. [OPENMP]Fix PR45911: Data sharing and lambda capture. (details)
  11. [lldb] Allows customizing libxml2 for darwin (details)
  12. [lldb] Cleans up system_libs (details)
  13. [lldb/Driver] Print snippet before exiting with unknown argument. (details)
  14. [sanitizer_symbolizer] Add __isinf to symbols list. (details)
  15. [lldb/Reproducers] Add instrumentation to SBEnvironment (details)
Commit 8a88755610d0f7ae630b5e6124cc0579cb1c32c8 by aeubanks
Reland [X86] Codegen for preallocated

See https://reviews.llvm.org/D74651 for the preallocated IR constructs
and LangRef changes.

In X86TargetLowering::LowerCall(), if a call is preallocated, record
each argument's offset from the stack pointer and the total stack
adjustment. Associate the call Value with an integer index. Store the
info in X86MachineFunctionInfo with the integer index as the key.

This adds two new target independent ISDOpcodes and two new target
dependent Opcodes corresponding to @llvm.call.preallocated.{setup,arg}.

The setup ISelDAG node takes in a chain and outputs a chain and a
SrcValue of the preallocated call Value. It is lowered to a target
dependent node with the SrcValue replaced with the integer index key by
looking in X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to an
%esp adjustment, the exact amount determined by looking in
X86MachineFunctionInfo with the integer index key.

The arg ISelDAG node takes in a chain, a SrcValue of the preallocated
call Value, and the arg index int constant. It produces a chain and the
pointer fo the arg. It is lowered to a target dependent node with the
SrcValue replaced with the integer index key by looking in
X86MachineFunctionInfo. In
X86TargetLowering::EmitInstrWithCustomInserter() this is lowered to a
lea of the stack pointer plus an offset determined by looking in
X86MachineFunctionInfo with the integer index key.

Force any function containing a preallocated call to use the frame
pointer.

Does not yet handle a setup without a call, or a conditional call.
Does not yet handle musttail. That requires a LangRef change first.

Tried to look at all references to inalloca and see if they apply to
preallocated. I've made preallocated versions of tests testing inalloca
whenever possible and when they make sense (e.g. not alloca related,
inalloca edge cases).

Aside from the tests added here, I checked that this codegen produces
correct code for something like

```
struct A {
        A();
        A(A&&);
        ~A();
};

void bar() {
        foo(foo(foo(foo(foo(A(), 4), 5), 6), 7), 8);
}
```

by replacing the inalloca version of the .ll file with the appropriate
preallocated code. Running the executable produces the same results as
using the current inalloca implementation.

Reverted due to unexpectedly passing tests, added REQUIRES: asserts for reland.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77689
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
The file was modifiedllvm/test/Transforms/GlobalOpt/fastcc.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/FastISel.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetLowering.h
The file was modifiedllvm/lib/Target/X86/X86FastISel.cpp
The file was addedllvm/test/CodeGen/X86/preallocated.ll
The file was modifiedllvm/test/CodeGen/X86/musttail-thiscall.ll
The file was modifiedllvm/lib/Target/X86/X86MachineFunctionInfo.h
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/include/llvm/Target/Target.td
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86RegisterInfo.cpp
The file was modifiedllvm/include/llvm/IR/Argument.h
The file was modifiedllvm/lib/Target/X86/X86CallingConv.td
The file was modifiedllvm/test/Transforms/Attributor/value-simplify.ll
The file was addedllvm/test/CodeGen/X86/preallocated-x64.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/include/llvm/CodeGen/ISDOpcodes.h
The file was modifiedllvm/include/llvm/CodeGen/TargetCallingConv.h
The file was modifiedllvm/lib/Transforms/Coroutines/CoroSplit.cpp
The file was modifiedllvm/lib/Transforms/IPO/Attributor.cpp
The file was modifiedllvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/MSSA/simple-todo.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/Transforms/DeadArgElim/keepalive.ll
The file was modifiedllvm/test/Transforms/DeadStoreElimination/simple.ll
The file was addedllvm/test/Transforms/InstCombine/call-cast-target-preallocated.ll
The file was modifiedllvm/include/llvm/Support/TargetOpcodes.def
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/test/Transforms/FunctionAttrs/readattrs.ll
The file was modifiedllvm/lib/Transforms/IPO/FunctionAttrs.cpp
The file was modifiedllvm/lib/IR/Function.cpp
The file was modifiedllvm/include/llvm/IR/Attributes.h
The file was modifiedllvm/include/llvm/IR/InstrTypes.h
The file was modifiedllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
The file was modifiedllvm/test/CodeGen/X86/musttail-indirect.ll
The file was addedllvm/test/CodeGen/X86/preallocated-nocall.ll
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp
The file was modifiedllvm/test/CodeGen/X86/shrink-wrap-chkstk.ll
The file was modifiedllvm/lib/IR/Attributes.cpp
The file was modifiedllvm/test/CodeGen/X86/arg-copy-elide.ll
The file was modifiedllvm/include/llvm/Target/TargetCallingConv.td
The file was modifiedllvm/test/CodeGen/X86/tail-call-mutable-memarg.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Commit 416b1560c597455dfae9e58d2a249d4061d729bf by Louis Dionne
[libcxx] Remove swap for std::span

This change removes both the member function swap and the free function
overload of swap for std::span. While swap is a member and overloaded
for every other container in the standard library [1], it is neither a
member function nor a free function overload for std::span [2].
Thus the corresponding implementation should be removed.

[1] https://eel.is/c++draft/libraryindex#:swap
[2] https://eel.is/c++draft/span.overview

Differential Revision: https://reviews.llvm.org/D69827
The file was modifiedlibcxx/include/span
Commit 645bba8d3d776841c3eda4b31dd9a908f1140bba by ajcbik
[llvm] [CodeGen] [X86] Fix issues with v4i1 instruction selection

Summary:
Fixes issue
https://bugs.llvm.org/show_bug.cgi?id=45995

Reviewers: mehdi_amini, nicolasvasilache, reidtatge, craig.topper, ftynse, bkramer

Reviewed By: craig.topper

Subscribers: RKSimon, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80231
The file was addedllvm/test/CodeGen/X86/pr45995.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was addedllvm/test/CodeGen/X86/pr45995-2.ll
Commit 9f19cc8cac893a887e1952ce764bb6b09a6785df by Louis Dionne
[libcxx][test] Portability fix for some locale-dependent tests.

Tests for `std::system_error` constructor marked as slightly non-portable.
One (but not the only one) reason for such non-portability is that these
tests assume the default locale to be set to "C" (or "POSIX").

However, the default locale for the process depends on OS and
environment. This patch adds explicit setting of the correct
locale expected by the tests.

Thanks to Andrey Maksimov for the patch.

Differential Revision: https://reviews.llvm.org/D72456
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp
The file was modifiedlibcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp
Commit 952e7106b34097ba447326a58e51778af25f070f by lebedev.ri
[NFC][InstCombine] Negator: tests for extractelement negation
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit ebed96fdbf26c081ecbff990fc7f5ae35e9ad2c7 by lebedev.ri
[InstCombine] Negator: `extractelement` is negatible if src is negatible

----------------------------------------
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1 = extractelement <2 x i4> %t0, i32 %y
  %t2 = sub i4 %z, %t1
  ret i4 %t2
}
=>
define i4 @negate_extractelement(<2 x i4> %x, i32 %y, i4 %z) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %x
  call void @use_v2i4(<2 x i4> %t0)
  %t1.neg = extractelement <2 x i4> %x, i32 %y
  %t2 = add i4 %t1.neg, %z
  ret i4 %t2
}
Transformation seems to be correct!
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit a6097cebe9cd0887478cb81f9b09f1c48ae13b4f by lebedev.ri
[NFC][InstCombine] Negator: tests for insertelement negation
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
Commit 55430f53f397e942b91d8379b5dbae5d2c852986 by lebedev.ri
[InstCombine] `insertelement` is negatible if both sources are negatible

----------------------------------------
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t0 = sub <2 x i4> { 0, 0 }, %src
  %t1 = sub i4 0, %a
  %t2 = insertelement <2 x i4> %t0, i4 %t1, i32 %x
  %t3 = sub <2 x i4> %b, %t2
  ret <2 x i4> %t3
}
=>
define <2 x i4> @negate_insertelement(<2 x i4> %src, i4 %a, i32 %x, <2 x i4> %b) {
%0:
  %t2.neg = insertelement <2 x i4> %src, i4 %a, i32 %x
  %t3 = add <2 x i4> %t2.neg, %b
  ret <2 x i4> %t3
}
Transformation seems to be correct!
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
Commit 0e88eb5c514ab59d63c7503b6055a2ced62a870b by ravishankarm
[mlir][spirv] Adapt subview legalization to the updated op semantics.

The subview semantics changes recently to allow for more natural
representation of constant offsets and strides. The legalization of
subview op for lowering to SPIR-V needs to account for this.
Also change the linearization to use the strides from the affine map
of a memref.

Differential Revision: https://reviews.llvm.org/D80270
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/LegalizeStandardForSPIRV.cpp
The file was modifiedmlir/test/Conversion/StandardToSPIRV/subview-to-spirv.mlir
The file was modifiedmlir/test/Conversion/GPUToSPIRV/loop.mlir
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.td
The file was modifiedmlir/test/Conversion/GPUToSPIRV/load-store.mlir
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp
Commit 414afdf940e8473db4156d0c1bc500ec527f1a1f by a.bataev
[OPENMP]Fix PR45911: Data sharing and lambda capture.

Summary:
No need to generate inlined OpenMP region for variables captured in
lambdas or block decls, only for implicitly captured variables in the
OpenMP region.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79966
The file was modifiedclang/test/OpenMP/task_firstprivate_codegen.cpp
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
Commit 780d7d77327c3537cc2c2aa9314aa2ad92cfe070 by hhb
[lldb] Allows customizing libxml2 for darwin

Summary:
This changes allows to disable or use customized libxml2 for lldb.

1. Removes redundant include_directories. The one in LLDBConfig.cmake should be enough.

2. Link to ${LIBXML2_LIBRARIES} if xml2 is enabled.

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80257
The file was modifiedlldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
The file was modifiedlldb/source/Plugins/SymbolVendor/MacOSX/CMakeLists.txt
The file was modifiedlldb/cmake/modules/LLDBConfig.cmake
The file was modifiedlldb/source/Host/CMakeLists.txt
Commit 04daba967031b7e3a72935613f23cb0051b56fc8 by hhb
[lldb] Cleans up system_libs

Summary:
Long long ago system_libs was appended to LLDB_SYSTEM_LIBS in
cmake/LLDBDependencies.cmake. After that file was removed, system_libs
is orphaned.

Currently the only user is source/Utility. Move the logic there and
remove system_libs.

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80253
The file was modifiedlldb/cmake/modules/LLDBConfig.cmake
The file was modifiedlldb/source/Utility/CMakeLists.txt
Commit ce19664d94b7dacc7291e947b19f5ccab0bba981 by Jonas Devlieghere
[lldb/Driver] Print snippet before exiting with unknown argument.

Print a little snippet before exiting when passed unrecognized
arguments. The goal is twofold:

- Point users to lldb --help.
- Make it clear that we exited the debugger.
The file was modifiedlldb/tools/driver/Driver.cpp
The file was modifiedlldb/test/Shell/Driver/TestPositionalArgs.test
Commit 8817e6ab31e46bb92081cf4b5497f42297623e42 by mascasa
[sanitizer_symbolizer] Add __isinf to symbols list.
The file was modifiedcompiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
Commit 690993a09a0df0d54a5cec7f06fffb6e2210ab8b by Jonas Devlieghere
[lldb/Reproducers] Add instrumentation to SBEnvironment

This class should've been instrumented when it landed. Whether the class
is "highly mutable" or not doesn't affect that.

With this patch TestSBEnvironment.py now passes when replayed.
The file was modifiedlldb/source/API/SBEnvironment.cpp
The file was modifiedlldb/source/API/SBReproducer.cpp