1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
Commit Graph

209514 Commits

Author SHA1 Message Date
Simon Moll
97946e16bb [VP] ISD helper functions [VE] isel for vp_add, vp_and
This implements vp_add, vp_and for the VE target by lowering them to the
VVP_* layer. We also add helper functions for VP SDNodes (isVPSDNode,
getVPMaskIdx, getVPExplicitVectorLengthIdx).

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D93766
2021-01-08 14:29:45 +01:00
Mark Murray
9ad1687341 [AArch64] Add +flagm archictecture option, allowing the v8.4a flag modification extension.
Differential Revision: https://reviews.llvm.org/D94081
2021-01-08 13:21:12 +00:00
Mark Murray
1bb511bb4c [AArch64] Add +pauth archictecture option, allowing the v8.3a pointer authentication extension.
Differential Revision: https://reviews.llvm.org/D94083
2021-01-08 13:21:11 +00:00
Sanjay Patel
0132b1afa9 [SLP] limit verifyFunction to debug build (PR48689)
As noted in PR48689, the verifier may have some kind
of exponential behavior that should be addressed
separately. For now, only run it in debug mode to
prevent problems for release+asserts.
That limit is what we had before D80401, and I'm
not sure if there was a reason to change it in that
patch.
2021-01-08 08:10:17 -05:00
Kazushi (Jam) Marukawa
6e69ff3625 [VE][NFC] Clean ISel patterns for LSV and LVS
Clean ISel patterns for LSV and LVS before upstream more hand-written
ISel patterns.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D94291
2021-01-08 21:47:33 +09:00
Nicholas Guy
338f32fab6 [AArch64] Fix crash caused by invalid vector element type
Fixes a crash caused by D91255, when LLVMTy is null when
calling changeExtendedVectorElementType.

Differential Revision: https://reviews.llvm.org/D94234
2021-01-08 12:02:54 +00:00
Cullen Rhodes
c86066d035 [LV] Legalize scalable VF hints
In the following loop:

  void foo(int *a, int *b, int N) {
    for (int i=0; i<N; ++i)
      a[i + 4] = a[i] + b[i];
  }

The loop dependence constrains the VF to a maximum of (4, fixed), which
would mean using <4 x i32> as the vector type in vectorization.
Extending this to scalable vectorization, a VF of (4, scalable) implies
a vector type of <vscale x 4 x i32>. To determine if this is legal
vscale must be taken into account. For this example, unless
max(vscale)=1, it's unsafe to vectorize.

For SVE, the number of bits in an SVE register is architecturally
defined to be a multiple of 128 bits with a maximum of 2048 bits, thus
the maximum vscale is 16. In the loop above it is therefore unfeasible
to vectorize with SVE. However, in this loop:

  void foo(int *a, int *b, int N) {
    #pragma clang loop vectorize_width(X, scalable)
    for (int i=0; i<N; ++i)
      a[i + 32] = a[i] + b[i];
  }

As long as max(vscale) multiplied by the number of lanes 'X' doesn't
exceed the dependence distance, it is safe to vectorize. For SVE a VF of
(2, scalable) is within this constraint, since a vector of <16 x 2 x 32>
will have no dependencies between lanes. For any number of lanes larger
than this it would be unsafe to vectorize.

This patch extends 'computeFeasibleMaxVF' to legalize scalable VFs
specified as loop hints, implementing the following behaviour:
  * If the backend does not support scalable vectors, ignore the hint.
  * If scalable vectorization is unfeasible given the loop
    dependence, like in the first example above for SVE, then use a
    fixed VF.
  * Accept scalable VFs if it's safe to do so.
  * Otherwise, clamp scalable VFs that exceed the maximum safe VF.

Reviewed By: sdesmalen, fhahn, david-arm

Differential Revision: https://reviews.llvm.org/D91718
2021-01-08 10:49:44 +00:00
Simon Moll
04d52fc380 [VE] Expand single-element BUILD_VECTOR to INSERT_VECTOR_ELT
We do this mostly to be able to test the insert_vector_elt isel
patterns. As long as we don't, most single element insertions show up as
`BUILD_VECTOR` in the backend.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D93759
2021-01-08 11:48:01 +01:00
Simon Moll
a2f27abba6 [VE] Extract & insert vector element isel
Isel and tests for extract_vector_elt and insert_vector_elt.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D93687
2021-01-08 11:46:59 +01:00
Christian Sigg
7814cef668 Fix two pessimizing moves.
See https://en.cppreference.com/w/cpp/language/return#Automatic_move_from_local_variables_and_parameters

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D94218
2021-01-08 11:44:29 +01:00
Qiu Chaofan
b09bb79732 [NFC] Update some PPC tests marked as auto-generated
Update CodeGen regression tests with marker at first line telling it's
auto-generated by the script, under PowerPC directory. For some reason,
these tests are generated but manually written, which makes things
unclear when someone's change affecting them.

However, some tests only show simple change after re-generated, like
extra blank lines, disappearing '.localentry', etc. Besides, some tests
are generated but added checks for debug output. This commit doesn't try
updating them.
2021-01-08 17:59:13 +08:00
Jan Svoboda
550fdcecfd Revert "[clang][cli] Port DiagnosticOpts to new option parsing system"
This reverts commit 8e3230ff
2021-01-08 10:53:12 +01:00
David Green
40a4684746 [LV] Don't sink into replication regions
The new test case here contains a first order recurrences and an
instruction that is replicated. The first order recurrence forces an
instruction to be sunk _into_, as opposed to after the replication
region. That causes several things to go wrong including registering
vector instructions multiple times and failing to create dominance
relations correctly.

Instead we should be sinking to after the replication region, which is
what this patch makes sure happens.

Differential Revision: https://reviews.llvm.org/D93629
2021-01-08 09:50:10 +00:00
Kazushi (Jam) Marukawa
b3f3566228 [VE] Add SVOB intrinsic instruction
Add SVOB intrinsic instruction and a regression test.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D94279
2021-01-08 18:49:17 +09:00
Jan Svoboda
2946e24cb2 [clang][cli] Port DiagnosticOpts to new option parsing system
This patch introduces additional infrastructure necessary to accommodate DiagnosticOptions.

DiagnosticOptions are unique in that they are parsed by the same function in cc1 AND in the Clang driver. The call to the parsing function from the driver occurs early on in the compilation process, where no proper DiagnosticEngine exists, because the diagnostic options (passed through command line) are not known yet.

To preserve the current behavior, we need to be able to selectively parse:
* all options (for -cc1),
* only diagnostic options (for driver).

This patch achieves that in the following way:
* new MacroPrefix field is added to the Option TableGen class,
* new IsDiag TableGen mixin sets MacroPrefix to "DIAG_",
* TableGen backend serializes option records into a macro with the prefix,
* CompilerInvocation parse/generate methods define the [DIAG_]OPTION_WITH_MARSHALLING macros to handle diagnostic options separately.

Depends on D93700, D93701 & D93702.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D84673
2021-01-08 10:44:22 +01:00
Sjoerd Meijer
8c005c9213 [MachineLoop] New helper isLoopInvariant()
This factors out code from MachineLICM that determines whether an instruction
is loop-invariant, which is a generally useful function. Thus this allows to
use that helper elsewhere too.

Differential Revision: https://reviews.llvm.org/D94082
2021-01-08 09:04:56 +00:00
David Sherwood
aafed2f066 [AArch64][SVE] Add lowering for llvm abs intrinsic
Add functionality to permit lowering of the abs and neg intrinsics
using the passthru variants.

Differential Revision: https://reviews.llvm.org/D94160
2021-01-08 08:55:25 +00:00
Martin Storsjö
f2ee9eef1a [llvm-readobj] [ARMWinEH] Clearly print an invalid case of packed unwind info as such
As the actual windows unwinder doesn't support this case, don't
pretend that it is supported when dumping the generated unwind info
either, even if it would be possible to interpret it as something
sensible.

This should reduce the risk of us emitting such a case in code
(although it's unlikely as long as the unwind info is generated
through the SEH opcodes, as the opcodes can't describe this case).

Differential Revision: https://reviews.llvm.org/D91529
2021-01-08 10:04:44 +02:00
Arthur Eubanks
17f2d36a06 [NewPM] Don't error when there's an unrecognized pass name
This currently blocks --print-before/after with a legacy PM pass, for
example when we use the new PM for the optimization pipeline but the
legacy PM for the codegen pipeline. Also in the future when the codegen
pipeline works with the new PM there will be multiple places to specify
passes, so even when everything is using the new PM, there will still be
multiple places that can accept different pass names.

Reviewed By: hoy, ychen

Differential Revision: https://reviews.llvm.org/D94283
2021-01-07 22:33:32 -08:00
Raul Tambre
6b18c766ea [CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath
When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).

Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D93177
2021-01-08 08:31:10 +02:00
Christudasan Devadasan
43a26ec463 AMDGPU/GlobalISel: Enable sret demotion 2021-01-08 10:56:35 +05:30
Kazu Hirata
b5842245e1 [Target] Use llvm::find_if (NFC) 2021-01-07 20:29:36 -08:00
Kazu Hirata
b5d840801d [llvm] Use *Set::contains (NFC) 2021-01-07 20:29:34 -08:00
Kazu Hirata
6b0ca140b9 [CodeGen] Remove unused function isCallerPreservedOrConstPhysReg (NFC)
The last use of the function was removed on Oct 20, 2018 in commit
8d6ff4c0af843e1a61b76d89812aed91e358de34.
2021-01-07 20:29:32 -08:00
LLVM GN Syncbot
24d9c59a2f [gn build] Port 6b0ee02747e 2021-01-08 04:23:02 +00:00
David Blaikie
44884bbbce Fix print-dot-ddg.ll so it doesn't try to write to the source tree (& uses the test temp paths instead) 2021-01-07 19:57:14 -08:00
Nico Weber
c19eaf196b [gn build] (manually) merge a whole bunch of libc++ header files
I noticed __availability was missing, so I manually diffed the
file lists and put all recently(ish) added headers:
* __availability from 2eadbc86142ba
* concepts from 601f7631827ae
* execution from 0a06eb911b830
* numbers from 4f6c4b473c4a5

Also remove libcxx_install_support_headers like the CMake build did in
6706342f48bea, and unconditionally copy
support/win32/{limits_msvc_win32.h,locale_win32.h} like the CMake
build always did as far as I can tell.
2021-01-07 22:09:35 -05:00
LLVM GN Syncbot
3c9a944600 [gn build] Port b12f26733a4 2021-01-08 02:19:24 +00:00
Ruiling Song
d4718580b5 [Cloning] Copy metadata of global declarations
We have modules with metadata on declarations, and out-of-tree passes
use that metadata, and we need to clone those modules. We really expect
such metadata is kept during the clone operation.

Reviewed by: arsenm, aprantl

Differential Revision: https://reviews.llvm.org/D93451
2021-01-08 08:21:18 +08:00
Evandro Menezes
da94ce92ed [RISCV] Define the vfsqrt RVV intrinsics
Define the `vfsqrt` IR intrinsics for the respective V instructions.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>

Differential Revision: https://reviews.llvm.org/D93745
2021-01-07 17:29:29 -06:00
Roman Lebedev
56d34ce62d [SimplifyCFG] markAliveBlocks(): switch to non-permissive DomTree updates
No actual changes needed, invoke can't have the same block as an unwind
destination and a normal destination.
2021-01-08 02:15:27 +03:00
Roman Lebedev
b2fa375285 [SimplifyCFG] removeUnwindEdge(): switch to non-permissive DomTree updates
No actual changes needed, Catchswitch cannot unwind to one of its catchpads.
2021-01-08 02:15:27 +03:00
Roman Lebedev
033a378324 [SimplifyCFG] changeToCall(): switch to non-permissive DomTree updates
No actual changes needed, normal and unwind destinations of an invoke
can never be identical.
2021-01-08 02:15:27 +03:00
Roman Lebedev
0e4d9c06e4 [SimplifyCFG] DeleteDeadBlocks(): switch to non-permissive DomTree updates
No actual changes needed, DetatchDeadBlocks() was already doing the right thing.
2021-01-08 02:15:27 +03:00
Roman Lebedev
06e8402548 [SimplifyCFG] MergeBlockIntoPredecessor(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same successor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev
561c5ece8e [SimplifyCFG] changeToUnreachable(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev
85cf8f344d [NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations 2021-01-08 02:15:26 +03:00
Roman Lebedev
f6303c71bb [SimplifyCFG] removeUnreachableBlocks(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:26 +03:00
Roman Lebedev
b5f8b4de21 [NFC][SimplifyCFG] Add test with an unreachable block with two identical successors 2021-01-08 02:15:25 +03:00
Roman Lebedev
5bb87e1419 [SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
    by not processing the same predecessor more than once.
2021-01-08 02:15:25 +03:00
Roman Lebedev
8cb44d8699 [SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in indirectbr handling
... which requires not deleting edges that were just deleted already.
2021-01-08 02:15:25 +03:00
Roman Lebedev
61cfb7f757 [NFC][SimlifyCFG] Add some indirectbr-of-blockaddress tests 2021-01-08 02:15:25 +03:00
Roman Lebedev
9972af1139 [SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in SwitchInst handling
... which requires not deleting edges that will still be present.
2021-01-08 02:15:24 +03:00
Roman Lebedev
3be56d0764 [SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier
We need to handle this case before dealing with the case of constant
branch condition, because if the destinations match, latter fold
would try to remove the DomTree edge that would still be present.

This allows to make that particular DomTree update non-permissive
2021-01-08 02:15:24 +03:00
Roman Lebedev
10be98c1df [NFC][SimplifyCFG] Add a test with cond br on constant w/ identical destinations 2021-01-08 02:15:24 +03:00
Arthur Eubanks
1374d1a4d3 [NewPM][NVPTX] Port NVPTX opt passes
There are only two used in the IR optimization pipeline.
Port these and add them to the default pipeline.

Similar to https://reviews.llvm.org/D93863.

I added -mtriple to some tests since under the new PM, the passes are
only available when the TargetMachine is specified.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D93930
2021-01-07 15:12:35 -08:00
Arthur Eubanks
50616d8f56 [NewPM][Hexagon] Fix HexagonVectorLoopCarriedReusePass position in pipeline
In https://reviews.llvm.org/D88138 this was incorrectly added with
registerOptimizerLastEPCallback(), when it should be
registerLoopOptimizerEndEPCallback(), matching the legacy PM's
EP_LoopOptimizerEnd.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D93929
2021-01-07 15:04:28 -08:00
Matt Arsenault
d3b4c81d08 GlobalISel: Fail legalization on narrowing extload below memory size 2021-01-07 17:40:34 -05:00
Craig Topper
05e081e550 [TableGen] Make CodeGenDAGPatterns::getSDNodeNamed take a StringRef instead of const std::string &.
All callers use a string literal and the getDef method the string
is passed to already takes a StringRef.
2021-01-07 14:20:16 -08:00
David Blaikie
6d236cf44b Fixup Asserts+!AbiBreakingChecks fallout from db33f85c7124 2021-01-07 14:18:19 -08:00