Changes

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

Summary

  1. [RISCV] Fix incorrect operand type of inst alias for InstR4 (details)
  2. [TTI] getUserCost - Ensure a vector insert/extract index is in unsigned 32-bit range (details)
  3. tsan: uninline RacyStacks::operator== (details)
  4. [ARM] Fix Arm block placement creating branches after jump tables. (details)
  5. [MLIR] Add functionality to remove redundant local variables (details)
  6. [DAG] combineShiftToMULH - move getValueType() inside assert. NFCI. (details)
  7. [IR] DIBuilder::createEnumerator - pass APSInt by const reference (details)
  8. [CMake] Consistently use the LibXml2::LibXml2 target instead of LIBXML2_LIBRARIES (details)
  9. [InstCombine] Ensure shifts are in range for (X << C1) / C2 -> X fold. (details)
  10. [fir] Add desc to fir.array_load op and update operand name (details)
  11. [lldb] Convert misc. StringConvert uses (details)
  12. [X86] combineShiftToPMULH - relax from ISA from SSE41 to SSE2 (details)
  13. [X86] X86FastISel::fastMaterializeConstant - break if-else chain to fix llvm-else-after-return warning. NFCI (details)
  14. [X86][SSE] combineMulToPMADDWD - enable sext(v8i16) -> zext(v8i16) fold on pre-SSE41 targets (details)
  15. [Mips] Remove redundant declarations (NFC) (details)
  16. [X86][SSE] combineMulToPMADDWD - enable sext(v8i16) -> zext(v8i16) fold on sub-128 bit vectors (details)
  17. [X86][SSE] combineMulToPMADDWD - mask off upper bits of sign-extended vXi32 constants (details)
  18. [CostModel][X86] Adjust vXi32 multiply costs if it can be performed using PMADDWD (details)
  19. [clang-format] Left/Right alignment fixer can cause false positive replacements when they don't actually change anything (details)
  20. [DAG] ReduceLoadOpStoreWidth - replace getABITypeAlign with allowsMemoryAccess (PR45116) (details)
  21. [ORC] Introduce EPCGenericRTDyldMemoryManager. (details)
  22. [lli] Add ChildTarget dependence on OrcTargetProcess library. (details)
  23. Revert "[ORC] Introduce EPCGenericRTDyldMemoryManager." (details)
  24. [ELF][test] Improve test coverage (details)
  25. [ORC-RT] ExecutorAddrDiff ergonomic improvements; contains and overlaps methods (details)
  26. [BasicAA] Don't consider Argument as escape source (NFCI) (details)
  27. [DSE] Make capture check more precise (details)
  28. [AA] Move earliest escape tracking from DSE to AA (details)
  29. [ELF] Default gotBaseSymInGotPlt to false (NFC for most architectures) (details)
Commit ed687c021161b87858260f8583bfc8b178903593 by jim
[RISCV] Fix incorrect operand type of inst alias for InstR4

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D110381
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
Commit 993f3c61b31d3917e0809bf1925c97fc0a61ce90 by llvm-dev
[TTI] getUserCost - Ensure a vector insert/extract index is in unsigned 32-bit range

Otherwise fallback to the generic 'unknown index' path

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29050
The file was modifiedllvm/include/llvm/Analysis/TargetTransformInfoImpl.h
The file was modifiedllvm/test/Transforms/LICM/crash.ll
Commit b02938439dab1f282d28a4a94419de505f0f9c6e by dvyukov
tsan: uninline RacyStacks::operator==

It's only used during race reporting.
There is no point in polluting the main header file with it.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D110470
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.h
Commit 883758ed480012a875146bc206cb8bcdd384405b by david.green
[ARM] Fix Arm block placement creating branches after jump tables.

Given:
- A jump table
- Which jumps to the next block
- The next block ends in a WLS
- Where the WLS conditionally jumps to block earlier in the program.

The Arm block placement pass would attempt to move the block containing
the WLS earlier, as the WLS instruction can only branch forward. In
doing so it would add a branch from the jumptable block to the WLS
block, thinking it previously fell-through.

This in itself would be fine, if a little inefficient, but the constant
island pass expects all instructions after a jump-table branch to have
been removed by analyzeBranch. So it gets confused and can assign the
same labels to multiple jump table blocks.

I've changed the condition to the same as used in analyzeBranch.
The file was modifiedllvm/test/CodeGen/Thumb2/mve-wls-block-placement.mir
The file was modifiedllvm/lib/Target/ARM/ARMBlockPlacement.cpp
Commit 0f78ece1690255e52d87bd367c63c2a1ccf17430 by arjunpitchanathan
[MLIR] Add functionality to remove redundant local variables

This patch adds functionality to FlatAffineConstraints to remove local
variables using equalities. This helps in keeping output representation of
FlatAffineConstraints smaller.

This patch is part of a series of patches aimed at generalizing affine
dependence analysis.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D110056
The file was modifiedmlir/unittests/Analysis/AffineStructuresTest.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
Commit 6bd5b1b1ce0b7b206ce98f42287521ecf8a9bea6 by llvm-dev
[DAG] combineShiftToMULH - move getValueType() inside assert. NFCI.

Avoids an unnecessary (void).
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit ee267b1c7c0147925af8ca4c9d694d7c658b5fbd by llvm-dev
[IR] DIBuilder::createEnumerator - pass APSInt by const reference

Avoid unnecessary copy by value.
The file was modifiedllvm/lib/IR/DIBuilder.cpp
The file was modifiedllvm/include/llvm/IR/DIBuilder.h
Commit 0b61f43b6096a9e98652991cba34e8ad44d35101 by markus.boeck02
[CMake] Consistently use the LibXml2::LibXml2 target instead of LIBXML2_LIBRARIES

Linking against the LibXml2::LibXml2 target has the advantage of not only importing the library, but also adding the include path as well as any definitions the library requires. In case of a static build of libxml2, eg. a define is set on Windows to remove any DLL imports and export.

LLVM already makes use of the target, but c-index-test and lldb were still linking against the library only.

The workaround for Mac OS-X that I removed seems to have also been made redundant since https://reviews.llvm.org/D84563 I believe

Differential Revision: https://reviews.llvm.org/D109975
The file was modifiedclang/tools/c-index-test/CMakeLists.txt
The file was modifiedlldb/source/Host/CMakeLists.txt
Commit 5a14edd8edb4d560e8a6420fffb490498baee0cf by llvm-dev
[InstCombine] Ensure shifts are in range for (X << C1) / C2 -> X fold.

We can get here before out of range shift amounts have been handled - limit to BW-2 for sdiv and BW-1 for udiv

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38078
The file was modifiedllvm/test/Transforms/InstCombine/shift.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Commit 2c28e3f008b6b93a58635999ff20572de01e8392 by clementval
[fir] Add desc to fir.array_load op and update operand name

This patch is part of the upstreaming effort from fir-dev branch.

Add a description for the fir.array_load opeartion and rename lenParams to typeparams.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D110393

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
The file was modifiedflang/include/flang/Optimizer/Dialect/FIROps.td
Commit 3a6ba3675177cb5e47dee325f300aced4cd864ed by mgorny
[lldb] Convert misc. StringConvert uses

Replace misc. StringConvert uses with llvm::to_integer()
and llvm::to_float(), except for cases where further refactoring is
planned.  The purpose of this change is to eliminate the StringConvert
API that is duplicate to LLVM, and less correct in behavior at the same
time.

Differential Revision: https://reviews.llvm.org/D110447
The file was modifiedlldb/source/Interpreter/OptionValueArray.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
The file was modifiedlldb/source/Interpreter/OptionValueFileSpecList.cpp
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
The file was modifiedlldb/source/Target/UnixSignals.cpp
The file was modifiedlldb/unittests/debugserver/RNBSocketTest.cpp
The file was modifiedlldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
The file was modifiedlldb/source/Interpreter/OptionValuePathMappings.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Interpreter/OptionValueSInt64.cpp
The file was modifiedlldb/source/Interpreter/OptionValueUInt64.cpp
The file was modifiedlldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
The file was modifiedlldb/tools/lldb-server/lldb-gdbserver.cpp
The file was modifiedlldb/source/Interpreter/Property.cpp
Commit a25f25c3b7ebce869c33cb7ae48ebf9681b99210 by llvm-dev
[X86] combineShiftToPMULH - relax from ISA from SSE41 to SSE2

With improved shuffle combines (in particular canonicalizeShuffleWithBinOps), we can now usefully perform this on any SSE2+ target.

We should be able to remove this entirely and just use DAGCombiner's combineShiftToMULH if we can someday get it to support illegal (pre-widened) types.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/pmulh.ll
Commit 4c72b10f0a28be7beb6f7a8cd7d031c9810dc23b by llvm-dev
[X86] X86FastISel::fastMaterializeConstant - break if-else chain to fix llvm-else-after-return warning. NFCI

All previous if-else cases return
The file was modifiedllvm/lib/Target/X86/X86FastISel.cpp
Commit f5a26ccae24caa21f7adafe0aab704fd0bc5a618 by llvm-dev
[X86][SSE] combineMulToPMADDWD - enable sext(v8i16) -> zext(v8i16) fold on pre-SSE41 targets

We already do this on SSE41 targets where we have sext/zext instructions, now that combineShiftToPMULH handles SSE2 targets, we can enable this here as well.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/madd.ll
Commit 44c401bdc355baf0fc1264f13d9c31d0c72b7e8e by kazu
[Mips] Remove redundant declarations (NFC)

Note that identical declarations immediately precede what's being
removed in this patch.

Identified with readability-redundant-declaration.
The file was modifiedllvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
Commit 2a4fa0c27c938b9767dd42d57cc7c4e5a670b302 by llvm-dev
[X86][SSE] combineMulToPMADDWD - enable sext(v8i16) -> zext(v8i16) fold on sub-128 bit vectors
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/shrink_vmul.ll
Commit eb7c78c2c5223b60e1f4f03876beceb46c26dd48 by llvm-dev
[X86][SSE] combineMulToPMADDWD - mask off upper bits of sign-extended vXi32 constants

If we are multiplying by a sign-extended vXi32 constant, then we can mask off the upper 16 bits to allow folding to PMADDWD and make use of its implicit sign-extension from i16
The file was modifiedllvm/test/CodeGen/X86/shrink_vmul.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 8c83bd3bd4c482b22abf7468687269ba010d36e4 by llvm-dev
[CostModel][X86] Adjust vXi32 multiply costs if it can be performed using PMADDWD

Update the costs to match the codegen from combineMulToPMADDWD - not only can we use PMADDWD is its zero-extended, but also if its a constant or sign-extended from a vXi16 (which can be replaced with a zero-extension).
The file was modifiedllvm/test/Analysis/CostModel/X86/mul32.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/X86/mul_slm_16bit.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/slm-arith-costs.ll
The file was modifiedllvm/lib/Target/X86/X86TargetTransformInfo.cpp
Commit c2ec5dd209532b1d618958ade6a7d550a0c31ea5 by mydeveloperday
[clang-format] Left/Right alignment fixer can cause false positive replacements when they don't actually change anything

Earlier during the development of {D69764} I felt it was no longer necessary to
ensure we were not trying to change code which didn't need to change
and we felt this could be removed, however I'd like to bring this back for now
as I am seeing some false positives in terms of the "replacements"

What I see is the generation of a replacement which is a "No Op" on the original
code, I think this comes about because of the merging of replacements:

```
static const a;
->
const static a;
->
static const a;
```

The replacements don't really merge, in such a way as to identify when we have gone
back to the original

Also remove the Penalty as I'm not using it (and it became marked as set and no used,
I'd rather get rid of it if it means nothing)

I think we need to do this step for now, as many people use the --output-replacements-xml
to identify that the file "needs a clang-format"

The same can be seen with the -n or --dry-run option as this uses the replacements
to drive the error/warning output.

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D110392
The file was modifiedclang/lib/Format/QualifierAlignmentFixer.cpp
The file was modifiedclang/unittests/Format/QualifierFixerTest.cpp
Commit 18c8ed54160bec12344288c6993b0f548fbe809e by llvm-dev
[DAG] ReduceLoadOpStoreWidth - replace getABITypeAlign with allowsMemoryAccess (PR45116)

One of the cases identified in PR45116 - we don't need to limit store narrowing to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory access by checking allowsMisalignedMemoryAccesses as a fallback.
The file was modifiedllvm/test/CodeGen/X86/narrow_op-1.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/X86/i1narrowfail.ll
Commit bef55a2b47a938ef35cbd7b61a1e5fa74e68c9ed by Lang Hames
[ORC] Introduce EPCGenericRTDyldMemoryManager.

EPCGenericRTDyldMemoryMnaager is an EPC-based implementation of the
RuntimeDyld::MemoryManager interface. It enables remote-JITing via EPC (backed
by a SimpleExecutorMemoryManager instance on the executor side) for RuntimeDyld
clients.

The lli and lli-child-target tools are updated to use SimpleRemoteEPC and
SimpleRemoteEPCServer (rather than OrcRemoteTargetClient/Server), and
EPCGenericRTDyldMemoryManager for MCJIT tests.

By enabling remote-JITing for MCJIT and RuntimeDyld-based ORC clients,
EPCGenericRTDyldMemoryManager allows us to deprecate older remote-JITing
support, including OrcTargetClient/Server, OrcRPCExecutorProcessControl, and the
Orc RPC system itself. These will be removed in future patches.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
The file was addedllvm/lib/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
The file was modifiedllvm/tools/lli/ChildTarget/ChildTarget.cpp
The file was modifiedllvm/tools/lli/lli.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
The file was removedllvm/tools/lli/RemoteJITUtils.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
The file was addedllvm/tools/lli/ForwardingMemoryManager.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/CMakeLists.txt
The file was addedllvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
Commit 7a219d801bf2c3006482cf3cbd3170b3b4ea2e1b by Lang Hames
[lli] Add ChildTarget dependence on OrcTargetProcess library.

ChildTarget depends on OrcTargetProcess after bef55a2b47a.
The file was modifiedllvm/tools/lli/ChildTarget/CMakeLists.txt
Commit 99951a56842d8e4cd0706cd17a04f77b5d0f6dd0 by Lang Hames
Revert "[ORC] Introduce EPCGenericRTDyldMemoryManager."

This reverts commit bef55a2b47a938ef35cbd7b61a1e5fa74e68c9ed while I investigate
failures on some bots. Also reverts "[lli] Add ChildTarget dependence on
OrcTargetProcess library." (7a219d801bf2c3006482cf3cbd3170b3b4ea2e1b) which was
a fallow-up to bef55a2b47a.
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
The file was modifiedllvm/tools/lli/ChildTarget/CMakeLists.txt
The file was removedllvm/lib/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.cpp
The file was modifiedllvm/tools/lli/lli.cpp
The file was removedllvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
The file was removedllvm/tools/lli/ForwardingMemoryManager.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/CMakeLists.txt
The file was modifiedllvm/tools/lli/ChildTarget/ChildTarget.cpp
The file was addedllvm/tools/lli/RemoteJITUtils.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
Commit a892c0e49e8de6daf141af23b396cf21b4471299 by i
[ELF][test] Improve test coverage
The file was modifiedlld/test/ELF/common-page.s
The file was modifiedlld/test/ELF/linkerscript/memory-err.s
The file was addedlld/test/ELF/start-group.s
The file was modifiedlld/test/ELF/warn-backrefs.s
Commit 897eb579c615260d68fee7ecc11a5d1773fa3781 by Lang Hames
[ORC-RT] ExecutorAddrDiff ergonomic improvements; contains and overlaps methods

Renames StartAddress and EndAddress members to Start and End.

Adds contains and overlap methods.

Adds a constructor from an address and size.

These changes are counterparts to LLVM commits ef391df2b6332, c0d889995e708, and
37f1b7a3f35fd.
The file was modifiedcompiler-rt/lib/orc/macho_platform.cpp
The file was modifiedcompiler-rt/lib/orc/elfnix_platform.cpp
The file was modifiedcompiler-rt/lib/orc/executor_address.h
The file was modifiedcompiler-rt/lib/orc/unittests/CMakeLists.txt
The file was addedcompiler-rt/lib/orc/unittests/executor_address_test.cpp
Commit 1c3859f31d0ef8e99c4aabbcfd11e5eea03e3c15 by nikita.ppv
[BasicAA] Don't consider Argument as escape source (NFCI)

The case of an Argument and an identified function local is already
handled earlier, because we don't care about captures in that case.
As such, we don't need to additionally consider the combination of
an Argument with a non-escaping identified function local.

This ensures that isEscapeSource() only returns true for
instructions, which is necessary for D110368.
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
Commit 327bbbb10bfd95db38ae3406c87d481a07f67633 by nikita.ppv
[DSE] Make capture check more precise

It is sufficient that the object has not been captured before the
load that produces the pointer we're loading. A capture after that
can not affect the already loaded pointer.

This is small part of D110368 applied separately.
The file was modifiedllvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Commit ba664d906644e62ac30e9a92edf48391c923992c by nikita.ppv
[AA] Move earliest escape tracking from DSE to AA

This is a followup to D109844 (and alternative to D109907), which
integrates the new "earliest escape" tracking into AliasAnalysis.
This is done by replacing the pre-existing context-free capture
cache in AAQueryInfo with a replaceable (virtual) object with two
implementations: The SimpleCaptureInfo implements the previous
behavior (check whether object is captured at all), while
EarliestEscapeInfo implements the new behavior from DSE.

This combines the "earliest escape" analysis with the full power of
BasicAA: It subsumes the call handling from D109907, considers a
wider range of escape sources, and works with AA recursion. The
compile-time cost is slightly higher than with D109907.

Differential Revision: https://reviews.llvm.org/D110368
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
The file was modifiedllvm/include/llvm/Analysis/AliasAnalysis.h
The file was modifiedllvm/test/Transforms/DeadStoreElimination/captures-before-call.ll
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
The file was modifiedllvm/unittests/Analysis/BasicAliasAnalysisTest.cpp
The file was modifiedllvm/lib/Analysis/AliasAnalysis.cpp
Commit 40cd4db442994e2bac6704e34580246c1d0bd91d by i
[ELF] Default gotBaseSymInGotPlt to false (NFC for most architectures)

Most architectures use .got instead of .got.plt, so switching the default can
minimize customization.

This fixes an issue for SPARC V9 which uses .got .
AVR, AMDGPU, and MSP430 don't seem to use _GLOBAL_OFFSET_TABLE_.
The file was modifiedlld/ELF/Arch/X86.cpp
The file was modifiedlld/ELF/Arch/Mips.cpp
The file was modifiedlld/ELF/Arch/PPC.cpp
The file was modifiedlld/ELF/Arch/RISCV.cpp
The file was modifiedlld/ELF/Arch/PPC64.cpp
The file was modifiedlld/ELF/Arch/ARM.cpp
The file was modifiedlld/ELF/Arch/AArch64.cpp
The file was modifiedlld/ELF/Arch/Hexagon.cpp
The file was modifiedlld/ELF/Target.h
The file was modifiedlld/ELF/Arch/X86_64.cpp