Changes

Summary

  1. [LoopIdiomRecognize][Remarks] Track loop-strided store to/from blocks (details)
  2. NFC. Add tests exposing missing analysis invalidation in LoopPredication. (details)
  3. [LoopPredication] Report changes correctly when attempting loop exit predication (details)
  4. [flang] More precise checks for NULL() operands (details)
  5. [Support] Convert BinaryStream class zoo to 64-bit offsets (details)
  6. [flang] Enforce array conformance in actual arguments to ELEMENTALs (details)
  7. Update LoopPredication test to fix buildbot failure. (details)
  8. [ORC] Add finalization & deallocation actions, SimpleExecutorMemoryManager class (details)
  9. [gn build] Port 78b083dbb725 (details)
  10. [compiler-rt][test] Add int128 requirement to TestCases/Misc/Linux/static-link.cpp (details)
  11. [flang] Fold COUNT() (details)
  12. [ELF] Clarify --export-dynamic-symbol/--dynamic-list. NFC (details)
  13. [compiler-rt][test] Ensure CMAKE_SYSROOT is added as a test cflag if provided (details)
  14. Extract LC_CODE_SIGNATURE related implementation out of LLD (details)
  15. [gn build] Port cc8229603b67 (details)
  16. Add MachO signature verification test (details)
Commit 4b19e7dfaee9a966f4bfb8e4378adb3bd43539de by Jon Roelofs
[LoopIdiomRecognize][Remarks] Track loop-strided store to/from blocks

Differential revision: https://reviews.llvm.org/D109929
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
The file was modifiedllvm/test/Transforms/LoopIdiom/memcpy-debugify-remarks.ll
The file was modifiedllvm/test/Transforms/LoopIdiom/memset-debugify-remarks.ll
Commit 5f2b7879f16ad5023f0684febeb0a20f7d53e4a8 by dsuchkov
NFC. Add tests exposing missing analysis invalidation in LoopPredication.
The file was addedllvm/test/Transforms/LoopPredication/invalidate-analyses.ll
Commit 0e362883182db53da9d6dd8e90f8eafb4e3b916c by dsuchkov
[LoopPredication] Report changes correctly when attempting loop exit predication

To make the IR easier to analyze, this pass makes some minor transformations.
After that, even if it doesn't decide to optimize anything, it can't report that
it changed nothing and preserved all the analyses.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D109855
The file was modifiedllvm/test/Transforms/LoopPredication/invalidate-analyses.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopPredication.cpp
Commit d9195d6603f2c95124e29beacec9129ae8fd616e by pklausler
[flang] More precise checks for NULL() operands

Improve checking for NULL() and NULL(MOLD=) when used as
variables and expressions outside the few contexts where
a disassociated pointer can be valid.  There were both
inappropriate errors and missing checks.

Differential Revision: https://reviews.llvm.org/D109905
The file was modifiedflang/test/Semantics/resolve63.f90
The file was modifiedflang/include/flang/Evaluate/expression.h
The file was modifiedflang/lib/Semantics/check-call.cpp
The file was modifiedflang/lib/Semantics/expression.cpp
The file was modifiedflang/lib/Semantics/check-omp-structure.cpp
The file was modifiedflang/lib/Evaluate/tools.cpp
Commit 646299d183ca72cbafd3a2d64629ce8cb3fcdd9d by thakis
[Support] Convert BinaryStream class zoo to 64-bit offsets

Most PDB fields on disk are 32-bit but describe the file in terms of MSF
blocks, which are 4 kiB by default.

So PDB files can be a bit larger than 4 GiB, and much larger if you create them
with a block size > 4 kiB.

This is a first (necessary, but by far not not sufficient) step towards
supporting such PDB files.  Now we don't truncate in-memory file offsets (which
are in terms of bytes, not in terms of blocks).

No effective behavior change. lld-link will still error out if it were to
produce PDBs > 4 GiB.

Differential Revision: https://reviews.llvm.org/D109923
The file was modifiedllvm/include/llvm/Support/BinaryStreamReader.h
The file was modifiedllvm/unittests/Support/BinaryStreamTest.cpp
The file was modifiedllvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
The file was modifiedllvm/lib/Support/BinaryStreamRef.cpp
The file was modifiedllvm/lib/Support/BinaryStreamWriter.cpp
The file was modifiedllvm/include/llvm/Support/BinaryItemStream.h
The file was modifiedllvm/tools/llvm-pdbutil/LinePrinter.cpp
The file was modifiedllvm/include/llvm/Support/BinaryStream.h
The file was modifiedllvm/include/llvm/Support/BinaryStreamWriter.h
The file was modifiedllvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
The file was modifiedllvm/include/llvm/Support/BinaryByteStream.h
The file was modifiedllvm/include/llvm/Support/BinaryStreamRef.h
The file was modifiedllvm/lib/Support/BinaryStreamReader.cpp
The file was modifiedllvm/tools/llvm-pdbutil/LinePrinter.h
The file was modifiedllvm/unittests/DebugInfo/MSF/MappedBlockStreamTest.cpp
The file was modifiedllvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
Commit 19afc495dc2797803b3da7f0797f214483215bb8 by pklausler
[flang] Enforce array conformance in actual arguments to ELEMENTALs

When the shapes of actual arguments to ELEMENTAL procedures are
sufficiently well known during semantics, require them to conform.

Differential Revision: https://reviews.llvm.org/D109909
The file was modifiedflang/lib/Semantics/check-call.cpp
The file was addedflang/test/Semantics/call22.f90
Commit fe950cba8f463562072e196a01409425b6ca0d40 by dsuchkov
Update LoopPredication test to fix buildbot failure.

This patch updates tests added in 5f2b7879f16ad5023f0684febeb0a20f7d53e4a8.
The file was modifiedllvm/test/Transforms/LoopPredication/invalidate-analyses.ll
Commit 78b083dbb725e1ec568d1b8ee523f5f025d25798 by Lang Hames
[ORC] Add finalization & deallocation actions, SimpleExecutorMemoryManager class

Finalization and deallocation actions are a key part of the upcoming
JITLinkMemoryManager redesign: They generalize the existing finalization and
deallocate concepts (basically "copy-and-mprotect", and "munmap") to include
support for arbitrary registration and deregistration of parts of JIT linked
code. This allows us to register and deregister eh-frames, TLV sections,
language metadata, etc. using regular memory management calls with no additional
IPC/RPC overhead, which should both improve JIT performance and simplify
interactions between ORC and the ORC runtime.

The SimpleExecutorMemoryManager class provides executor-side support for memory
management operations, including finalization and deallocation actions.

This support is being added in advance of the rest of the memory manager
redesign as it will simplify the introduction of an EPC based
RuntimeDyld::MemoryManager (since eh-frame registration/deregistration will be
expressible as actions). The new RuntimeDyld::MemoryManager will in turn allow
us to remove older remote allocators that are blocking the rest of the memory
manager changes.
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
The file was addedllvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink-executor/llvm-jitlink-executor.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
The file was addedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManagerTest.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.cpp
The file was addedllvm/unittests/ExecutionEngine/Orc/SimpleExecutorMemoryManagerTest.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
The file was addedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
Commit a9a6cdc1bdc0beeb55129e2b502b7c73101e139a by llvmgnsyncbot
[gn build] Port 78b083dbb725
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/ExecutionEngine/Orc/TargetProcess/BUILD.gn
Commit 47373f94a431d7fcc78c760ca6ca321f3742b746 by leonardchan
[compiler-rt][test] Add int128 requirement to TestCases/Misc/Linux/static-link.cpp

We hit some undefined symbol errors to 128-bit floating point functions when linking this test.

ld.lld: error: undefined symbol: __multf3
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced by strtof128_l.o:(round_and_return) in archive /usr/lib/x86_64-linux-gnu/libc.a
>>> referenced 4 more times
>>> did you mean: __muldf3
>>> defined in: /usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-1-master-fuchsia-toolchain/lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a

Host libc expects these to be defined, and compiler-rt will only define these
for certain platforms (see definition for CRT_LDBL_128BIT). Since we likely
can't do anything about the host libc, we can at least restrict the test to
check that these functions are supported.

Differential Revision: https://reviews.llvm.org/D109709
The file was modifiedcompiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp
Commit 26aff847d8860c14bc3e829e4bfe7980058504c0 by pklausler
[flang] Fold COUNT()

Complete folding of the intrinsic reduction function COUNT() for all
cases, including partial reductions with DIM= arguments.

Differential Revision: https://reviews.llvm.org/D109911
The file was modifiedflang/lib/Evaluate/fold-integer.cpp
The file was modifiedflang/lib/Evaluate/CMakeLists.txt
The file was modifiedflang/lib/Evaluate/fold-implementation.h
The file was modifiedflang/lib/Evaluate/fold-reduction.h
The file was addedflang/test/Evaluate/folding29.f90
The file was modifiedflang/lib/Evaluate/fold-logical.cpp
The file was addedflang/lib/Evaluate/fold-reduction.cpp
Commit 1d08a19a38a588a1ba39d1e0776ea331a451debd by i
[ELF] Clarify --export-dynamic-symbol/--dynamic-list. NFC
The file was modifiedlld/ELF/Driver.cpp
Commit f4092c769031f4dde5844ce57f1d47a7e7080311 by leonardchan
[compiler-rt][test] Ensure CMAKE_SYSROOT is added as a test cflag if provided

When running tests like SanitizerCommon-asan-x86_64-Linux :: Linux/crypt_r.cpp,
it may attempt to use the host header crypt.h rather than a sysroot header.
This is significant in the event where struct crypt_data defined on host is
different from the sysroot used to make the sanitizer runtime libraries. This
can result in logical differences between the expected size/layout of struct
crypt_data known by sanitizers and the strict crypt_data provided by the host crypt.h.

Since tests should still use the CMAKE_SYSROOT, this ensures that CMAKE_SYSROOT
is propagated to compiler-rt tests.

Differential Revision: https://reviews.llvm.org/D109796
The file was modifiedcompiler-rt/test/sanitizer_common/CMakeLists.txt
Commit cc8229603b67763e77a46894f88f7d3ddd04de34 by danielrodriguez
Extract LC_CODE_SIGNATURE related implementation out of LLD

Move the functionality in lld that handles writing of the LC_CODE_SIGNATURE load command and associated data section to a central reusable location.

This change is in preparation for another change that modifies llvm-objcopy to reproduce the LC_CODE_SIGNATURE load command and corresponding
data section to maintain the validity of signed macho object files passed through llvm-objcopy.

Reviewed By: #lld-macho, int3, oontvoo

Differential Revision: https://reviews.llvm.org/D109803
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedllvm/lib/Object/CMakeLists.txt
The file was addedllvm/lib/Object/CodeSignatureSection.cpp
The file was modifiedllvm/include/llvm/Object/MachO.h
Commit 2755670411d229bf134335d3b6ab071cf173a942 by llvmgnsyncbot
[gn build] Port cc8229603b67
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Object/BUILD.gn
Commit aaf00f3f19c1be69ce10d53236f824c2580c2139 by danielrodriguez
Add MachO signature verification test

Add a test to ensure that MachO files including
a LC_CODE_SIGNATURE load command produced by lld
are signed correctly.

Reviewed By: #lld-macho, int3

Differential Revision: https://reviews.llvm.org/D109840
The file was addedlld/test/MachO/adhoc-codesign-hash.s
The file was addedlld/test/MachO/Inputs/code-signature-check.py