SuccessChanges

Summary

  1. [AArch64][GlobalISel] Support truncstorei8/i16 w/ combine to form truncating G_STOREs. (details)
  2. [GlobalOpt] Remove heap SROA (details)
  3. [X86] X86TTIImpl::getInterleavedMemoryOpCostAVX2(): canonicalize to integer type (details)
  4. [lld][WebAssembly] Convert test to assembly. NFC. (details)
  5. [clang] Support -fpic -fno-semantic-interposition for RISCV (details)
  6. [OpenMP] Use compound operators for reduction combiner if available. (details)
  7. [libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows. (details)
  8. Add an "interrupt timeout" to Process, and pipe that through the (details)
  9. [lld][WebAssembly] Remove relocation target verification (details)
Commit ae2b36e8bdfa612649c6f2d8b6b9079679cb2572 by Amara Emerson
[AArch64][GlobalISel] Support truncstorei8/i16 w/ combine to form truncating G_STOREs.

This needs some tablegen changes so that we can actually import the patterns properly.

Differential Revision: https://reviews.llvm.org/D102204
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp (diff)
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-lowering-truncstore.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-store.mir (diff)
The file was modifiedllvm/utils/TableGen/GlobalISelEmitter.cpp (diff)
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td (diff)
The file was modifiedllvm/include/llvm/Target/TargetSelectionDAG.td (diff)
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp (diff)
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic.ll (diff)
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir (diff)
Commit 129f466e222e13fdf680356831bb935e1229bdf4 by i
[GlobalOpt] Remove heap SROA

GlobalOpt implements a heap SROA (SROA for an malloc allocatated struct or array
of structs) which is largely undertested (heap-sra-[1234].ll are basically the
same test with very little difference) and does not trigger at all when
bootstrapping clang (it only supports the case of one single store).

The heap SROA implementation causes PR50027 (GEP is not properly handled; crash or miscompile).
Just drop the implementation. I have deleted some obviously duplicated tests
but kept `heap-sra-[12]{,-no-nullopt}.ll`.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D102257
The file was removedllvm/test/Transforms/GlobalOpt/heap-sra-3.ll
The file was modifiedllvm/test/Transforms/GlobalOpt/heap-sra-1.ll (diff)
The file was modifiedllvm/test/Transforms/GlobalOpt/heap-sra-2.ll (diff)
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp (diff)
The file was modifiedllvm/test/Transforms/GlobalOpt/heap-sra-phi.ll (diff)
The file was modifiedllvm/test/Transforms/GlobalOpt/MallocSROA-section.ll (diff)
The file was removedllvm/test/Transforms/GlobalOpt/heap-sra-3-no-null-opt.ll
The file was removedllvm/test/Transforms/GlobalOpt/heap-sra-4-no-null-opt.ll
The file was removedllvm/test/Transforms/GlobalOpt/heap-sra-4.ll
Commit 97e04d41e646aa13b0cc5ff3812bfb7305fa4756 by lebedev.ri
[X86] X86TTIImpl::getInterleavedMemoryOpCostAVX2(): canonicalize to integer type

This way we don't have to duplicate i32/f32 and i64/f64 entries,
which was already forgotten to be done for a few tuples.
The file was modifiedllvm/lib/Target/X86/X86TargetTransformInfo.cpp (diff)
Commit b2f227c6c87c16fa593e643a487efd9326249066 by sbc
[lld][WebAssembly] Convert test to assembly. NFC.

Differential Revision: https://reviews.llvm.org/D102264
The file was removedlld/test/wasm/reloc-addend.ll
The file was addedlld/test/wasm/reloc-addend.s
Commit 2075f2b296b0fa90cb7597f0f318232940d29e95 by i
[clang] Support -fpic -fno-semantic-interposition for RISCV

-fno-semantic-interposition (only effective with -fpic) can optimize default
visibility external linkage (non-ifunc-non-COMDAT) variable access and function
calls to avoid GOT/PLT, by using local aliases, e.g.
```
int var;
__attribute__((optnone)) int fun(int x) { return x * x; }
int test() { return fun(var); }
```

-fpic (var and fun are dso_preemptable)
```
test:
.LBB1_1:
        auipc   a0, %got_pcrel_hi(var)
        ld      a0, %pcrel_lo(.LBB1_1)(a0)
        lw      a0, 0(a0)
// fun is preemptible by default in ld -shared mode. ld will create a PLT.
        tail    fun@plt
```

vs -fpic -fno-semantic-interposition (var and fun are dso_local)
```
test:
.Ltest$local:
.LBB1_1:
        auipc   a0, %pcrel_hi(.Lvar$local)
        addi    a0, a0, %pcrel_lo(.LBB1_1)
        lw      a0, 0(a0)
// The assembler either resolves .Lfun$local at assembly time (-mno-relax
// -fno-function-sections), or produces a relocation referencing a non-preemptible
// local symbol (which can avoid PLT).
        tail    .Lfun$local
```

Note: Clang's default -fpic is more aggressive than GCC -fpic: interprocedural
optimizations (including inlining) are available but local aliases are not used.
-fpic -fsemantic-interposition can disable interprocedural optimizations.

Depends on D101875

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D101876
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp (diff)
The file was modifiedclang/test/Driver/fsemantic-interposition.c (diff)
Commit f90abac6caab3b44e6a000de8cb72d204e74eb76 by michael.p.rice
[OpenMP] Use compound operators for reduction combiner if available.

The OpenMP spec seems to require the compound operators be used for
+, *, &, |, and ^ reduction.  So use these if a class has those operators.
If not try the simple operators as we did previously to limit the impact
to existing code.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=48584

Differential Revision: https://reviews.llvm.org/D101941
The file was modifiedclang/test/OpenMP/parallel_for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/taskloop_in_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp (diff)
The file was addedclang/test/OpenMP/reduction_compound_op.cpp
The file was modifiedclang/test/OpenMP/target_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp (diff)
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_master_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/taskloop_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/task_in_reduction_message.cpp (diff)
The file was modifiedclang/test/OpenMP/nvptx_target_parallel_reduction_codegen_tbaa_PR46146.cpp (diff)
The file was modifiedclang/test/OpenMP/target_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_sections_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_parallel_for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/distribute_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/master_taskloop_in_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_parallel_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/master_taskloop_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_teams_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_teams_distribute_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/taskloop_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/taskgroup_task_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/teams_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/teams_distribute_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/parallel_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/for_reduction_messages.cpp (diff)
The file was modifiedclang/test/OpenMP/sections_reduction_messages.cpp (diff)
Commit 384dd9ddaf616a1563ee1c1a8a1347b7658e7a70 by vvereschaka
[libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows.

Fix for substitutes-in-compile-flags.sh.cpp to run it properly on Windows platform.

Differential Revision: https://reviews.llvm.org/D102048
The file was modifiedlibcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp (diff)
Commit 9558b602b22cb7d681757c5f56d941e39a9d9d19 by jingham
Add an "interrupt timeout" to Process, and pipe that through the
ProcessGDBRemote plugin layers.

Also fix a bug where if we tried to interrupt, but the ReadPacket
wakeup timer woke us up just after the timeout, we would break out
the switch, but then since we immediately check if the response is
empty & fail if it is, we could end up actually only giving a
small interval to the interrupt.

Differential Revision: https://reviews.llvm.org/D102085
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h (diff)
The file was modifiedlldb/include/lldb/Target/Process.h (diff)
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (diff)
The file was modifiedlldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp (diff)
The file was modifiedlldb/unittests/tools/lldb-server/tests/TestClient.cpp (diff)
The file was modifiedlldb/source/Target/Process.cpp (diff)
The file was modifiedlldb/source/Target/TargetProperties.td (diff)
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp (diff)
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (diff)
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (diff)
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (diff)
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py (diff)
The file was modifiedlldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (diff)
The file was modifiedlldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp (diff)
Commit b49a798e71f922a68628ad9e31ca12fdb864c2f5 by sbc
[lld][WebAssembly] Remove relocation target verification

We have this extra step in wasm-ld that doesn't exist in other lld
backend which verifies the existing contents of the relocation targets.
This was originally intended as an extra form of double checking and an
aid to compiler developers.   However it has always been somewhat
controversial and there have been suggestions in the past the we simply
remove it.

My motivation for removing it now is that its causing me a headache
when trying to fix an issue with negative addends.  In the case of
negative addends that final result can be wrapped/negative but this
checking code would require significant modification to be able to deal
with that case.  For example with some test cases I'm looking at I'm
seeing error like this:

```
wasm-ld: warning: /usr/local/google/home/sbc/dev/wasm/llvm-build/tools/lld/test/wasm/Output/merge-string.s.tmp.o:(.rodata_relocs): unexpected existing value for R_WASM_MEMORY_ADDR_I32: existing=FFFFFFFA expected=FFFFFFFFFFFFFFFA
```

Rather than try to refactor `calcExpectedValue` to somehow return two
different types of results (32 and 64-bit) depending on the relocation
type, I think we can just remove this code.

Differential Revision: https://reviews.llvm.org/D102265
The file was modifiedlld/test/wasm/reloc-addend.s (diff)
The file was modifiedlld/wasm/InputChunks.cpp (diff)
The file was modifiedlld/wasm/InputFiles.cpp (diff)
The file was modifiedlld/wasm/InputFiles.h (diff)