SuccessChanges

Summary

  1. [flang][OpenMP] Place the insertion point to the start of the block (details)
  2. [NFC] Fix comment for DataOp (details)
  3. [lld-macho] Implement support for PIC (details)
  4. [lld-macho] Support -bundle (details)
  5. [lld-macho] Allow the entry symbol to be dynamically bound (details)
  6. [lld-macho] Support absolute symbols (details)
  7. [lld-macho] Always include custom syslibroot when running tests (details)
  8. [lld-macho] Ignore a few more undocumented flags (details)
  9. [Coroutine] Split PHI Nodes in `cleanuppad` blocks in a way that obeys EH pad rules (details)
  10. [WebAssembly] Check features before making SjLj vars thread-local (details)
  11. [lldb] Pass reference instead of pointer in protected SBAddress methods. (details)
  12. Add a verifier check that rejects non-distinct DISubprogram function (details)
  13. [LoopReroll][NewPM] Port -loop-reroll to NPM (details)
  14. [InstCombine] collectBitParts - add fshl/fshr handling (details)
  15. [IRSim] Adding basic implementation of llvm-sim. (details)
Commit d2f1f530430e9dbdd69c3ed173ced076f4bb933e by SourabhSingh.Tomar
[flang][OpenMP] Place the insertion point to the start of the block

After skeleton of the `Parallel Op` is created set the insertion point to start of the block. So that later `CodeGen` can proceed.

Note: This patch reflects the work that can be upstreamed from PR(merged)
PR: https://github.com/flang-compiler/f18-llvm-project/pull/424

Reviewed By: schweitz, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D88221
The file was modifiedflang/lib/Lower/OpenMP.cpp
Commit 06104cb9f21d3f4b0f0feba7b35744284203164c by clementval
[NFC] Fix comment for DataOp
The file was modifiedmlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Commit e4e673e75a067236c9c4ff2e1ab19d6a3a87003d by jezng
[lld-macho] Implement support for PIC

* Implement rebase opcodes. Rebase opcodes tell dyld where absolute
  addresses have been encoded in the binary. If the binary is not loaded
  at its preferred address, dyld has to rebase these addresses by adding
  an offset to them.
* Support `-pie` and use it to test rebase opcodes.

This is necessary for absolute address references in dylibs, bundles etc
to work.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D87199
The file was modifiedlld/test/MachO/x86-64-reloc-unsigned.s
The file was modifiedlld/test/MachO/dylink-lazy.s
The file was modifiedlld/MachO/Arch/X86_64.cpp
The file was modifiedlld/MachO/Config.h
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/SyntheticSections.h
The file was addedlld/test/MachO/compact-unwind-pie.s
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/local-got.s
Commit f23f5126912b7da3f2a118a7cb1bcf6be3d8c1bc by jezng
[lld-macho] Support -bundle

Not 100% sure but it appears that bundles are almost identical to
dylibs, aside from the fact that they do not contain `LC_ID_DYLIB`. ld64's code
seems to treat bundles and dylibs identically in most places.

Supporting bundles allows us to run e.g. XCTests, as all test suites are
compiled into bundles which get dynamically loaded by the `xctest` test runner.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D87856
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/test/MachO/load-commands.s
Commit c7c9776f77712eb4311708d884c0c70ccaa7125b by jezng
[lld-macho] Allow the entry symbol to be dynamically bound

Apparently this is used in real programs. I've handled this by reusing
the logic we already have for branch (function call) relocations.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D87852
The file was modifiedlld/MachO/Arch/X86_64.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/test/MachO/entry-symbol.s
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/SyntheticSections.h
Commit 62a3f0c9844bb89a48173440145b26212be60f83 by jezng
[lld-macho] Support absolute symbols

They operate like Defined symbols but with no associated InputSection.

Note that `ld64` seems to treat the weak definition flag like a no-op for
absolute symbols, so I have replicated that behavior.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D87909
The file was addedlld/test/MachO/abs-symbols.s
The file was modifiedlld/MachO/Symbols.cpp
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/MachO/ExportTrie.cpp
The file was modifiedlld/MachO/InputFiles.h
The file was addedlld/test/MachO/invalid/abs-duplicate.s
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/MachO/SymbolTable.cpp
The file was modifiedlld/test/MachO/invalid/dso-handle-duplicate.s
Commit 643ec67a64ad7a686361b1d309e5088ad8f228e9 by jezng
[lld-macho] Always include custom syslibroot when running tests

This greatly reduces the amount of boilerplate in our tests.

Reviewed By: #lld-macho, compnerd

Differential Revision: https://reviews.llvm.org/D87960
The file was modifiedlld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s
The file was modifiedlld/test/MachO/x86-64-reloc-got-load.s
The file was modifiedlld/test/MachO/static-link.s
The file was modifiedlld/test/MachO/invalid/order-file-bad-objfile.test
The file was addedlld/test/MachO/lit.local.cfg
The file was modifiedlld/test/MachO/invalid/invalid-stub.s
The file was modifiedlld/test/MachO/syslibroot.test
The file was modifiedlld/test/MachO/platform-version.s
The file was modifiedlld/test/MachO/indirect-symtab.s
The file was modifiedlld/test/MachO/invalid/abs-duplicate.s
The file was modifiedlld/test/MachO/invalid/alignment-too-large.yaml
The file was modifiedlld/test/MachO/load-commands.s
The file was modifiedlld/test/MachO/x86-64-reloc-signed.s
The file was modifiedlld/test/MachO/invalid/bad-got-to-tlv-reference.s
The file was modifiedlld/test/MachO/subsections-section-relocs.s
The file was modifiedlld/test/MachO/silent-ignore.test
The file was modifiedlld/test/MachO/dylink.s
The file was modifiedlld/test/MachO/archive.s
The file was modifiedlld/test/MachO/invalid/no-id-dylink.yaml
The file was modifiedlld/test/MachO/bss.s
The file was modifiedlld/test/MachO/subsections-symbol-relocs.s
The file was modifiedlld/test/MachO/stub-framework.s
The file was modifiedlld/test/MachO/search-paths.test
The file was modifiedlld/test/MachO/invalid/bad-archive.s
The file was modifiedlld/test/MachO/section-headers.s
The file was modifiedlld/test/MachO/rpath.s
The file was modifiedlld/test/MachO/fat-arch.s
The file was modifiedlld/test/MachO/stub-link.s
The file was modifiedlld/test/MachO/arch.s
The file was modifiedlld/test/MachO/weak-binding.s
The file was modifiedlld/test/MachO/invalid/undefined-symbol.s
The file was modifiedlld/test/MachO/weak-definition-indirect-fetch.s
The file was modifiedlld/test/MachO/invalid/missing-dylib.s
The file was modifiedlld/test/MachO/reexport-stub.s
The file was modifiedlld/test/MachO/weak-import.s
The file was modifiedlld/test/MachO/link-search-order.s
The file was modifiedlld/test/MachO/objc.s
The file was modifiedlld/test/MachO/dylib.s
The file was modifiedlld/test/MachO/lc-build-version.s
The file was modifiedlld/test/MachO/compact-unwind-pie.s
The file was modifiedlld/test/MachO/common-symbol-resolution.s
The file was modifiedlld/test/MachO/invalid/bad-tlv-relocation.s
The file was modifiedlld/test/MachO/abs-symbols.s
The file was modifiedlld/test/MachO/invalid/invalid-fat-offset.s
The file was modifiedlld/test/MachO/invalid/bad-tlv-opcode.s
The file was modifiedlld/test/MachO/invalid/duplicate-symbol.s
The file was modifiedlld/test/MachO/invalid/reserved-section-name.s
The file was modifiedlld/test/MachO/invalid/invalid-relocation-length.yaml
The file was modifiedlld/test/MachO/invalid/dso-handle-duplicate.s
The file was modifiedlld/test/MachO/sub-library.s
The file was modifiedlld/test/MachO/force-load.s
The file was modifiedlld/test/MachO/invalid/invalid-relocation-pcrel.yaml
The file was modifiedlld/test/MachO/section-merge.s
The file was modifiedlld/test/MachO/tlv.s
The file was modifiedlld/test/MachO/invalid/stub-link.s
The file was modifiedlld/test/MachO/dso-handle.s
The file was modifiedlld/test/MachO/invalid/order-file-bad-arch.test
The file was modifiedlld/test/MachO/dylink-lazy.s
The file was modifiedlld/test/MachO/x86-64-reloc-unsigned.s
The file was modifiedlld/test/MachO/compact-unwind.test
The file was modifiedlld/test/MachO/invalid/archive-no-index.s
The file was modifiedlld/test/MachO/framework.s
The file was modifiedlld/test/MachO/linkedit-contiguity.s
The file was modifiedlld/test/MachO/resolution.s
The file was modifiedlld/test/MachO/weak-header-flags.s
The file was modifiedlld/test/MachO/invalid/no-filelist.s
The file was modifiedlld/test/MachO/symtab.s
The file was modifiedlld/test/MachO/invalid/invalid-executable.s
The file was modifiedlld/test/MachO/invalid/bad-tlv-def.s
The file was modifiedlld/test/MachO/relocations.s
The file was modifiedlld/test/MachO/segments.s
The file was modifiedlld/test/MachO/invalid/invalid-fat-narch.s
The file was modifiedlld/test/MachO/order-file.s
The file was modifiedlld/test/MachO/entry-symbol.s
The file was modifiedlld/test/MachO/filelist.s
The file was modifiedlld/test/MachO/invalid/no-such-file.s
The file was modifiedlld/test/MachO/tlv-dylib.s
The file was modifiedlld/test/MachO/headerpad.s
The file was modifiedlld/test/MachO/nonweak-definition-override.s
The file was modifiedlld/test/MachO/weak-definition-direct-fetch.s
The file was modifiedlld/test/MachO/no-unneeded-dyld-info.s
The file was modifiedlld/test/MachO/export-trie.s
The file was modifiedlld/test/MachO/sectcreate.s
The file was modifiedlld/test/MachO/weak-definition-over-dysym.s
The file was modifiedlld/test/MachO/local-got.s
The file was modifiedlld/test/MachO/symbol-order.s
The file was modifiedlld/test/MachO/common-symbol-coalescing.s
The file was modifiedlld/test/MachO/weak-definition-order.s
The file was modifiedlld/test/MachO/no-exports-dylib.s
Commit 2c2a7494482133ecdd681869e1ccc53b71d27385 by jezng
[lld-macho] Ignore a few more undocumented flags

Reviewed By: #lld-macho, compnerd

Differential Revision: https://reviews.llvm.org/D88268
The file was modifiedlld/test/MachO/silent-ignore.test
The file was modifiedlld/MachO/Options.td
Commit d2166076b882e38becf3657ea830ffd2b6a5695e by xun
[Coroutine] Split PHI Nodes in `cleanuppad` blocks in a way that obeys EH pad rules

Issue Details:
In order to support coroutine splitting, any multi-value PHI node in a coroutine is split into multiple blocks with single-value PHI Nodes, which then allows a subsequent transform to generate `reload` instructions as required (i.e., to reload the value if required if the coroutine has been resumed). This causes issues with EH pads (`catchswitch` and `catchpad`) as all pads within a `catchswitch` must have the same unwind destination, but the coroutine splitting logic may modify them to each have a unique unwind destination if there is a PHI node in the unwind `cleanuppad` that is set from values in the `catchswitch` and `cleanuppad` blocks.

Fix Details:
During splitting, if such a PHI node is detected, then create a "dispatcher" `cleanuppad` as well as the blocks with single-value PHI Nodes: thus the "dispatcher" is the unwind destination and it will detect which predecessor called it and then branch to the appropriate single-value PHI node block, which will then branch back to the original `cleanuppad` block.

Reviewed By: GorNishanov, lxfind

Differential Revision: https://reviews.llvm.org/D88059
The file was addedllvm/test/Transforms/Coroutines/coro-catchswitch-cleanuppad.ll
The file was modifiedllvm/lib/Transforms/Coroutines/CoroFrame.cpp
Commit 89fe083c197951a1380ee70e9e36e2aa95659da5 by tlively
[WebAssembly] Check features before making SjLj vars thread-local

1c5a3c4d3823 updated the variables inserted by Emscripten SjLj lowering to be
thread-local, depending on the CoalesceFeaturesAndStripAtomics pass to downgrade
them to normal globals if the target features did not support TLS. However, this
had the unintended side effect of preventing all non-TLS-supporting objects from
being linked into modules with shared memory, because stripping TLS marks an
object as thread-unsafe. This patch fixes the problem by only making the SjLj
lowering variables thread-local if the target machine supports TLS so that it
never introduces new usage of TLS that will be stripped. Since SjLj lowering
works on Modules instead of Functions, this required that the
WebAssemblyTargetMachine have its feature string updated to reflect the
coalesced features collected from all the functions so that a
WebAssemblySubtarget can be created without using any particular function.

Differential Revision: https://reviews.llvm.org/D88323
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
The file was modifiedllvm/include/llvm/Target/TargetMachine.h
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
Commit 6cd4a4cd02dba6aed33c447114587eebf6854c43 by Jonas Devlieghere
[lldb] Pass reference instead of pointer in protected SBAddress methods.

Every call to the protected SBAddress constructor and the SetAddress
method takes the address of a valid object which means we might as well
pass it as a const reference instead of a pointer and drop the null
check.

Differential revision: https://reviews.llvm.org/D88249
The file was modifiedlldb/source/API/SBInstruction.cpp
The file was modifiedlldb/source/API/SBQueueItem.cpp
The file was modifiedlldb/source/API/SBFrame.cpp
The file was modifiedlldb/source/API/SBLineEntry.cpp
The file was modifiedlldb/source/API/SBFunction.cpp
The file was modifiedlldb/source/API/SBBreakpointLocation.cpp
The file was modifiedlldb/source/API/SBSymbol.cpp
The file was modifiedlldb/include/lldb/API/SBAddress.h
The file was modifiedlldb/source/API/SBAddress.cpp
The file was modifiedlldb/source/API/SBValue.cpp
Commit 137597d4f47854bb1701f6883d5c91e8a14d29a2 by Adrian Prantl
Add a verifier check that rejects non-distinct DISubprogram function
attachments. They would crash the backend, which expects all
DISubprograms that are not part of the type system to have a unit field.

Clang right before https://reviews.llvm.org/D79967 would generate this
kind of broken IR.

rdar://problem/69534688

Thanks to Fangrui for fixing an assembler test I had missed!

https://reviews.llvm.org/D88270
The file was modifiedllvm/test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll
The file was addedllvm/test/Verifier/unique-disubprogram.ll
The file was modifiedllvm/lib/IR/Verifier.cpp
Commit d3f6972abb9c0ac06ddabf61697754c3c6f5d11b by aeubanks
[LoopReroll][NewPM] Port -loop-reroll to NPM

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87957
The file was addedllvm/include/llvm/Transforms/Scalar/LoopReroll.h
The file was modifiedllvm/lib/Transforms/Scalar/LoopRerollPass.cpp
The file was modifiedllvm/test/Transforms/LoopReroll/basic.ll
The file was modifiedllvm/include/llvm/InitializePasses.h
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/lib/Transforms/Scalar/Scalar.cpp
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
Commit 2a0ca17f66f7776ade251fd40dc9a4f981b2a673 by llvm-dev
[InstCombine] collectBitParts - add fshl/fshr handling

Pulled from D87452, this is a fixed version of the collectBitParts fshl/fshr handling which as @nikic noticed wasn't checking for different providers or had correct bit ordering (which was hid by only testing shift amounts of bitwidth/2).

Differential Revision: https://reviews.llvm.org/D88292
The file was modifiedllvm/test/Transforms/InstCombine/bswap.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
Commit 15645d044bcfe2a0f63156048b302f997a717688 by andrew.litteken
[IRSim] Adding basic implementation of llvm-sim.

This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs

Differential Revision: https://reviews.llvm.org/D86974
The file was modifiedllvm/tools/LLVMBuild.txt
The file was addedllvm/tools/llvm-sim/CMakeLists.txt
The file was addedllvm/test/tools/llvm-sim/Inputs/sim1.ll
The file was addedllvm/test/tools/llvm-sim/fail-cases.test
The file was addedllvm/test/tools/llvm-sim/single-sim-file.test
The file was addedllvm/tools/llvm-sim/LLVMBuild.txt
The file was addedllvm/test/tools/llvm-sim/single-sim.test
The file was addedllvm/tools/llvm-sim/llvm-sim.cpp