SuccessChanges

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

Summary

  1. [flang] Fix pimpl idiom for IntrinsicProcTable. (details)
  2. [AMDGPU] Cleanup AMDGPUUsage.rst (details)
  3. [lldb] Fix building with GCC 7. NFC. (details)
  4. [lldb] [Process/NetBSD] Use XStateRegSet for all FPU registers (details)
  5. [SystemZ] Define MaxInstLength to have the value of 6. (details)
  6. [BasicAA] Fix caching in the presence of phi cycles (details)
  7. [BasicAA] Avoid duplicate cache lookup (NFCI) (details)
  8. [LegalizeTypes] Legalize vector rotate operations (details)
  9. [DAG] Add BuildVectorSDNode::getRepeatedSequence helper to recognise multi-element splat patterns (details)
  10. [InstCombine] narrowFunnelShift - fold trunc/zext or(shl(a,x),lshr(b,sub(bw,x))) -> fshl(a,b,x) (PR35155) (details)
  11. Fix some signed/unsigned comparison gcc warnings from D87930 (details)
  12. [JITLink][ELF] PCRel32GOTLoad relocations are resolved like regular PCRel32 ones (details)
  13. [jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON (details)
  14. [LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form (details)
  15. Revert "[jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON" (details)
  16. [NPM] Port -loop-versioning-licm to NPM (details)
  17. [Flang][Driver] Add infrastructure for basic frontend actions and file I/O (details)
  18. [JITLink][ELF] PCRel32GOTLoad edge offset can be smaller three (details)
  19. Reapply "[jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON" (details)
  20. [flang][tests] Fix Python bug in the lit config (details)
Commit d590c854303959bcaa78746a62b9a8f81583c111 by llvm-project
[flang] Fix pimpl idiom for IntrinsicProcTable.

The class IntrinsicProcTable uses the pimpl idiom and manages its own pointer-to-implementation.  However, it violates the rule-of-five and does not implement a move-constructor or assignment-operator. Due to differences between compilers in implementation copy elision, these may or may not be used. Due to the missing user implementation for resource handling, using the results in runtime errors.

Fix my using `std::unique_ptr` instead of custom resource management.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D88794
The file was modifiedflang/include/flang/Evaluate/intrinsics.h
The file was modifiedflang/include/flang/Common/idioms.h
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
Commit bf6518a806acc3fc20e5413586607d045b7c2732 by Tony.Tye
[AMDGPU] Cleanup AMDGPUUsage.rst

- Layout and typo improvements.
- Add memory spaces section.
- reStructure syntax fixes.

Differential Revision: https://reviews.llvm.org/D90002
The file was modifiedllvm/docs/AMDGPUUsage.rst
Commit 84ce6b9991bb6db1c37897aca55978a377ce931a by martin
[lldb] Fix building with GCC 7. NFC.
The file was modifiedlldb/source/Target/Target.cpp
Commit d96cb52830fd7109cead60956a9b108935988e5c by mgorny
[lldb] [Process/NetBSD] Use XStateRegSet for all FPU registers

Unify the x86 regset API to use XStateRegSet for all FPU registers,
therefore eliminating the legacy API based on FPRegSet.  This makes
the code a little bit simpler but most notably, it provides future
compatibility for register caching.

Since the NetBSD kernel takes care of providing compatibility with
pre-XSAVE processors, PT_{G,S}ETXSTATE can be used on systems supporting
only FXSAVE or even plain FSAVE (and unlike PT_{G,S}ETXMMREGS, it
clearly indicates that XMM registers are not supported).

Differential Revision: https://reviews.llvm.org/D90034
The file was modifiedlldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
The file was modifiedlldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
Commit 7c026a83ee903f00cb0a2827519ccd6f16b6ed03 by paulsson
[SystemZ] Define MaxInstLength to have the value of 6.

This value had the default value of 4 which caused branch relaxation to fail.

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D90065
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
The file was addedllvm/test/CodeGen/SystemZ/Large/branch-range-13.py
Commit d09c5921421c362ecc24c9a804e87c2bc1d48997 by nikita.ppv
[BasicAA] Fix caching in the presence of phi cycles

Any time we insert a block into VisitedPhiBBs, previously cached
values may no longer be valid for the recursive alias queries. As
such, perform them using an empty AAQueryInfo.

Note that if we recurse to the same phi, the block will already
be inserted, so we reuse the old AAQueryInfo, and thus still
protect against infinite recursion.

This problem can appear with with an without BatchAA, but is more
likely to occur with BatchAA, as more values are cached.

Differential Revision: https://reviews.llvm.org/D90066
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
The file was modifiedllvm/unittests/Analysis/AliasAnalysisTest.cpp
Commit 1a7a9efec3cf872dcf3e1a6e6fe39e797c4d9fc6 by nikita.ppv
[BasicAA] Avoid duplicate cache lookup (NFCI)

Rather than performing the cache lookup with both possible orders
for the locations, use the same canonicalization as the other
AliasCache lookups in BasicAA.
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
Commit 62b17a76971cd17c1ebd4ce00a536b0b74af98b2 by llvm-dev
[LegalizeTypes] Legalize vector rotate operations

Lower vector rotate operations as long as the legalization occurs outside of LegalizeVectorOps.

This fixes https://bugs.llvm.org/show_bug.cgi?id=47320

Patch By: @rsanthir.quic (Ryan Santhirarajan)

Differential Revision: https://reviews.llvm.org/D89497
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
The file was addedllvm/test/CodeGen/AArch64/expand-vector-rot.ll
The file was modifiedllvm/include/llvm/CodeGen/TargetLowering.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
Commit ce356e1546c9c538134dcdfc9f2d728b8ba0719c by llvm-dev
[DAG] Add BuildVectorSDNode::getRepeatedSequence helper to recognise multi-element splat patterns

Replace the X86 specific isSplatZeroExtended helper with a generic BuildVectorSDNode method.

I've just used this to simplify the X86ISD::BROADCASTM lowering so far (and remove isSplatZeroExtended), but we should be able to use this in more places to lower to complex broadcast patterns.

Differential Revision: https://reviews.llvm.org/D87930
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAGNodes.h
The file was modifiedllvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit 310f62b4ff3ecb67cf696a977b194cceb326fa43 by llvm-dev
[InstCombine] narrowFunnelShift - fold trunc/zext or(shl(a,x),lshr(b,sub(bw,x))) -> fshl(a,b,x) (PR35155)

As discussed on PR35155, this extends narrowFunnelShift (recently renamed from narrowRotate) to support basic funnel shift patterns.

Unlike matchFunnelShift we don't include the computeKnownBits limitation as extracting the pattern from the zext/trunc layers should be a indicator of reasonable funnel shift codegen, in D89139 we demonstrated how to efficiently promote funnel shifts to wider types.

Differential Revision: https://reviews.llvm.org/D89542
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/funnel.ll
Commit b481e00bf4de31eeb20b95f83b1eae3dcdb4b79c by llvm-dev
Fix some signed/unsigned comparison gcc warnings from D87930
The file was modifiedllvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
Commit 138b9f1928454a6096bb928195bacb7ccd46fd00 by Stefan Gränitz
[JITLink][ELF] PCRel32GOTLoad relocations are resolved like regular PCRel32 ones

The difference is that the former are indirect and go to the GOT while the latter go to the target directly. This info can be used to relax indirect ones that don't need the GOT (because the target is in range). We check for this optimization beforehand. For formal correctness and to avoid confusion, we should only change the relocation kind if we actually apply the relaxation.
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
Commit e9955b0843cc1e5876430f3f051494d4197419f3 by Stefan Gränitz
[jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON

Symbols with special section index SHN_COMMON (0xfff2) haven't been handled so far and caused an invalid section error.

This is a more or less straightforward use of the code commented out at the end of the function. I checked with the ELF spec, that the symbol value gives the alignment.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D89795
The file was addedllvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_common.s
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
Commit 060a4fccf101b120cc9c36d4aa1041ee07044766 by tu.da.wei
[LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form

The exit blocks of the versioned and non-versioned loops are not dedicated and thus the two loops are not in simplify form.
Insert dummy exit blocks after loop versioning with `formDedicatedExits()` to preserve the simplify form for subsequence passes.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D89569
The file was modifiedllvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll
The file was modifiedllvm/test/Transforms/LoopVersioning/add-phi-update-users.ll
The file was modifiedllvm/lib/Transforms/Utils/LoopVersioning.cpp
The file was modifiedllvm/test/Transforms/LoopDistribute/outside-use.ll
The file was modifiedllvm/test/Transforms/LoopVersioning/basic.ll
The file was modifiedllvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
The file was modifiedllvm/test/Transforms/LoopDistribute/followup.ll
The file was modifiedllvm/test/Transforms/LoopVersioning/incorrect-phi.ll
Commit 10b1a61bafba39fd7400a814a7272f41222ad579 by Stefan Gränitz
Revert "[jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON"

This reverts commit e9955b0843cc1e5876430f3f051494d4197419f3. Cannot reproduce the buildbot failures yet. Reverting in the meantime.
The file was removedllvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_common.s
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
Commit 65a36bbc3d79f4f23843ec632e86363bc87b02d9 by tu.da.wei
[NPM] Port -loop-versioning-licm to NPM

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D89371
The file was modifiedllvm/lib/Transforms/Scalar/Scalar.cpp
The file was modifiedllvm/test/Transforms/LoopVersioningLICM/convergent.ll
The file was addedllvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
The file was modifiedllvm/test/Transforms/LoopVersioningLICM/loopversioningLICM1.ll
The file was modifiedllvm/include/llvm/InitializePasses.h
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/test/Transforms/LoopVersioningLICM/loopversioningLICM3.ll
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
The file was modifiedllvm/test/Transforms/LoopVersioningLICM/metadata.ll
The file was modifiedllvm/test/Transforms/LoopVersioningLICM/loopversioningLICM2.ll
Commit 4c5906cffd04202387d2f6b50a47d39c0e4f2c0e by andrzej.warzynski
[Flang][Driver] Add infrastructure for basic frontend actions and file I/O

This patch introduces the dependencies required to read and manage input files
provided by the command line option. It also adds the infrastructure to create
and write to output files. The output is sent to either stdout or a file
(specified with the `-o` flag).

Separately, in order to be able to test the code for file I/O, it adds
infrastructure to create frontend actions. As a basic testable example, it adds
the `InputOutputTest` FrontendAction. The sole purpose of this action is to
read a file from the command line and print it either to stdout or the output
file.  This action is run by using the `-test-io` flag also introduced in this
patch (available for `flang-new` and `flang-new -fc1`). With this patch:
```
flang-new -test-io input-file.f90
```
will read input-file.f90 and print it in the output file.

The `InputOutputTest` frontend action has been introduced primarily to
facilitate testing. It is hidden from users (i.e. it's only displayed with
`--help-hidden`). Currently Clang doesn’t have an equivalent action.

`-test-io` is used to trigger the InputOutputTest action in the Flang frontend
driver. This patch makes sure that “flang-new” forwards it to “flang-new -fc1"
by creating a preprocessor job. However, in Flang.cpp, `-test-io` is passed to
“flang-new -fc1” without `-E`. This way we make sure that the preprocessor is
_not_ run in the frontend driver. This is the desired behaviour: `-test-io`
should only read the input file and print it to the output stream.

co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>

Differential Revision: https://reviews.llvm.org/D87989
The file was modifiedclang/include/clang/Driver/Options.h
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedflang/lib/Frontend/CompilerInstance.cpp
The file was addedflang/include/flang/Frontend/FrontendAction.h
The file was modifiedclang/lib/Driver/Types.cpp
The file was modifiedflang/lib/Frontend/FrontendOptions.cpp
The file was modifiedclang/test/Driver/immediate-options.c
The file was modifiedflang/include/flang/Frontend/CompilerInvocation.h
The file was addedflang/lib/Frontend/FrontendAction.cpp
The file was addedflang/test/Frontend/multiple-input-files.f90
The file was modifiedflang/lib/Frontend/CMakeLists.txt
The file was addedflang/lib/Frontend/FrontendActions.cpp
The file was modifiedclang/lib/Driver/ToolChains/Flang.cpp
The file was modifiedflang/unittests/Frontend/CompilerInstanceTest.cpp
The file was modifiedflang/test/Flang-Driver/emit-obj.f90
The file was modifiedflang/tools/flang-driver/fc1_main.cpp
The file was addedflang/test/Frontend/Inputs/hello-world.f90
The file was modifiedclang/lib/Driver/Driver.cpp
The file was modifiedflang/include/flang/FrontendTool/Utils.h
The file was addedflang/unittests/Frontend/InputOutputTest.cpp
The file was modifiedflang/lib/FrontendTool/CMakeLists.txt
The file was modifiedflang/test/Flang-Driver/driver-help.f90
The file was modifiedflang/unittests/Frontend/CMakeLists.txt
The file was modifiedflang/test/lit.cfg.py
The file was addedflang/test/Frontend/input-output-file.f90
The file was modifiedflang/include/flang/Frontend/CompilerInstance.h
The file was addedflang/include/flang/Frontend/FrontendActions.h
The file was modifiedflang/include/flang/Frontend/FrontendOptions.h
The file was modifiedflang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedflang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
The file was addedflang/test/Flang-Driver/driver-help-hidden.f90
Commit b6ef40891c7fb076a2f4ea860f8ee4135ae72aae by Stefan Gränitz
[JITLink][ELF] PCRel32GOTLoad edge offset can be smaller three

Offset is 2 for MOVL instruction in test ELF_x86-64_common. This should fix the test failures.

Differential Revision: https://reviews.llvm.org/D89795
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
Commit 66abe650fff6031074171ea9c7c6aa180bc2cbe9 by Stefan Gränitz
Reapply "[jitlink][ELF] Add zero-fill blocks for symbols in section SHN_COMMON"

Root cause of the test failure was fixed with:
[JITLink][ELF] PCRel32GOTLoad edge offset can be smaller three

This reverts commit 10b1a61bafba39fd7400a814a7272f41222ad579.
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
The file was addedllvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_common.s
Commit cbb7f1420b747aae09a7f728c186bb0c2702eb02 by andrzej.warzynski
[flang][tests] Fix Python bug in the lit config

Without this change LIT tests for Flang fail with:
```
TypeError: append() takes exactly one argument (2 given)
```
The file was modifiedflang/test/lit.cfg.py