1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00
Commit Graph

200317 Commits

Author SHA1 Message Date
Nekotekina
5836324d64 X86: fixup (V)PMADDWD detection
Fix some bugs (missing checks).
Add constant support.
2021-05-17 08:18:22 +03:00
Nekotekina
a7dd06b0f0 X86: improve (V)PMADDWD detection
In function combineMulToPMADDWD, if 17 bit are sign bits,
not just zero bits, the optimization can be applied sometimes.
For now, detect and replace SRA pairs with SRL.
2021-05-13 20:20:14 +03:00
Nekotekina
8ed5423cd2 X86: modify PreserveAll CC to save full AVX-512 state 2021-05-13 11:24:49 +03:00
Nekotekina
dba114a311 More gcc-11 fixes 2021-05-13 11:23:30 +03:00
xddxd
4d88105d4a More C++20 fixes 2021-04-18 16:27:47 +03:00
xddxd
5d8643e8eb C++20 fixes 2021-03-28 16:25:43 +03:00
Nekotekina
716bb292ba Fix possible compilation issue with gcc-11 2021-01-09 09:45:29 +03:00
RipleyTom
cb7748dfa0 Remove tensorflow support 2020-12-03 11:23:43 +03:00
Ani
d74d689f19 Host: Add workaround for Zen3
Treat Zen3 as Zen2 until upstream adds Zen3 support
2020-11-06 08:16:10 +00:00
Ani
662c2b4870 test: Remove test files
The test directory severely inflates the size of the AUR clone, and 
we're not even using the tests
2020-11-03 19:07:27 +00:00
Ivan
8c02f52a12 Set up CI with Azure Pipelines 2020-11-02 19:38:46 +03:00
Nekotekina
ec657b923d X86: avoid vector-scalar shifts if splat amount is directly a vector ADD/SUB/AND op.
Prefer vector-vector shifts if available (AVX2+).
Improves code generated for rotate and funnel shifts.
Otherwise it would generate a shuffle + slower vector-scalar shift.
2020-11-02 16:33:21 +03:00
Nekotekina
9c0f762155 X86: add patterns for X86ISD::VSHLV and X86ISD::VSRLV
Replace VSELECT instruction which zeroes their result on exceeding legal SHL/SRL shift amount.
2020-11-02 16:33:21 +03:00
Nekotekina
3223efa093 X86: add pattern for X86ISD::VSRAV
Detect clamping ashr shift amount to max legal value
2020-11-02 16:33:21 +03:00
Nekotekina
b7587d5ebe X86: expand detectAVGPattern()
Allow all integer widths in the pattern, allow ashr
Handle signed and mixed cases, allowing to replace truncation
2020-11-02 16:33:21 +03:00
Nekotekina
883d6df927 X86: optimize VSELECT for v16i8 with shl + sign bit test 2020-11-02 16:33:21 +03:00
Nekotekina
999da05669 X86: LowerShift: new algorithm for vector-vector shifts
Emit pair of shifts of double size if possible
2020-11-02 16:33:21 +03:00
Nekotekina
e9d729dcca X86: add RTM to Haswell+ features 2020-11-02 02:50:53 +03:00
Nekotekina
9eac890236 DenseMap: add workaround for C++2a builds
Hide operator !=
2020-11-02 02:50:53 +03:00
Nekotekina
c9f0684580 Disable GDBRegistrationListener
It makes emitting object extremely slow.
GDB doesn't work properly with it anyway.
GDB also often crashes because it cannot read the format.
2020-11-02 02:50:53 +03:00
Nekotekina
5a08b9c29b MCJIT: don't finalize modules on symbol lookup (workaround)
This is extremely slow yet unnecessary with manual finalization.
In LLVM 6 this wasn't a problem.
2020-11-02 02:50:53 +03:00
Nekotekina
391548e226 X86: Fix/workaround Small Code Model for JIT
Force RIP-relative jump tables and global values
Force RIP-relative all zeros / all ones constants
These things were causing crashes due to use of absolute addressing
2020-11-02 02:28:12 +03:00
Bill Wendling
1739071165 [CodeGen][TailDuplicator] Don't duplicate blocks with INLINEASM_BR
Tail duplication of a block with an INLINEASM_BR may result in a PHI
node on the indirect branch. This is okay, but it also introduces a copy
for that PHI node *after* the INLINEASM_BR, which is not okay.

See: https://github.com/ClangBuiltLinux/linux/issues/1125

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

(cherry picked from commit d2c61d2bf9bd1efad49acba2f2751112522686aa)
2020-10-07 12:10:48 +02:00
Qiu Chaofan
ce106590bf [SelectionDAG] Don't remove unused negated constant immediately
This reverts partial of a2fb5446 (actually, 2508ef01) about removing
negated FP constant immediately if it has no uses. However, as discussed
in bug 47517, there're cases when NegX is folded into constant from
other places while NegY is removed by that line of code and NegX is
equal to NegY. In these cases, NegX is deleted before used and crash
happens. So revert the code and add necessary test case.

(cherry picked from commit b326d4ff946d2061a566a3fcce9f33b484759fe0)
2020-10-06 16:04:19 +02:00
Hans Wennborg
67f791eb79 ReleaseNotes: mention the machine outliner for ARM
As suggested by Yvan.
2020-10-05 13:38:48 +02:00
Ahsan Saghir
6228b2b331 Fix indentation for PowerPC ReleaseNotes 2020-10-01 13:28:35 -05:00
Hans Wennborg
f137979135 LLVM release notes: JIT changes
By Lang Hames!
2020-10-01 09:22:05 +02:00
Sanjay Patel
eaf26356d1 [APFloat] prevent NaN morphing into Inf on conversion (PR43907)
We shift the significand right on a truncation, but that needs to be made NaN-safe:
always set at least 1 bit in the significand.
https://llvm.org/PR43907

See D88238 for the likely follow-up (but needs some plumbing fixes before it can proceed).

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

(cherry picked from commit e34bd1e0b03d20a506ada156d87e1b3a96d82fa2)
2020-09-30 13:28:43 +02:00
Amara Emerson
b8f4c2339b [GlobalISel] Fix multiply with overflow intrinsics legalization generating invalid MIR.
During lowering of G_UMULO and friends, the previous code moved the builder's
insertion point to be after the legalizing instruction. When that happened, if
there happened to be a "G_CONSTANT i32 0" immediately after, the CSEMIRBuilder
would try to find that constant during the buildConstant(zero) call, and since
it dominates itself would return the iterator unchanged, even though the def
of the constant was *after* the current insertion point. This resulted in the
compare being generated *before* the constant which it was using.

There's no need to modify the insertion point before building the mul-hi or
constant. Delaying moving the insert point ensures those are built/CSEd before
the G_ICMP is built.

Fixes PR47679

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

(cherry picked from commit 1d54e75cf26a4c60b66659d5d9c62f4bb9452b03)
2020-09-30 13:05:48 +02:00
Ulrich Weigand
5603084580 [LLVM 11] Add SystemZ changes to release notes
Differential Revision: https://reviews.llvm.org/D88479
2020-09-29 14:59:38 +02:00
Hans Wennborg
2e0afe6e1a Fix mysterious failure of SupportTests FileCheckTest.Binop
The test would fail in no-asserts release builds using MSVC
for 64-bit Windows:

Unexpected error message:
TestBuffer:1:1: error: implicit format conflict between 'FOO' (%u) and '18\0' (%x), need an explicit format specifier

Error message(s) not found:
{implicit format conflict between 'FOO' (%u) and 'BAZ' (%x), need an explicit format specifier}

It seems a string from a previous test case is finding its way
into the latter one.

This doesn't reproduce on master anymore after 998709b7d, so let's
just hack around it here for the branch.
2020-09-28 15:35:06 +02:00
Robert Widmann
8a3d6aad2f [LLVM-C] Turn a ShuffleVector Constant Into a Getter.
It is not a good idea to expose raw constants in the LLVM C API. Replace this with an explicit getter.

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

(cherry picked from commit 55f727306e727ea9f013d09c9b8aa70dbce6a1bd)
2020-09-28 12:36:28 +02:00
Craig Disselkoen
810086af1d C API: functions to get mask of a ShuffleVector
This commit fixes a regression (from LLVM 10 to LLVM 11 RC3) in the LLVM
C API.

Previously, commit 1ee6ec2bf removed the mask operand from the
ShuffleVector instruction, storing the mask data separately in the
instruction instead; this reduced the number of operands of
ShuffleVector from 3 to 2. AFAICT, this change unintentionally caused
a regression in the LLVM C API. Specifically, it is no longer possible
to get the mask of a ShuffleVector instruction through the C API. This
patch introduces new functions which together allow a C API user to get
the mask of a ShuffleVector instruction, restoring the functionality
which was previously available through LLVMGetOperand().

This patch also adds tests for this change to the llvm-c-test
executable, which involved adding support for InsertElement,
ExtractElement, and ShuffleVector itself (as well as constant vectors)
to echo.cpp. Previously, vector operations weren't tested at all in
echo.ll.

I also fixed some typos in comments and help-text nearby these changes,
which I happened to spot while developing this patch. Since the typo
fixes are technically unrelated other than being in the same files, I'm
happy to take them out if you'd rather they not be included in the patch.

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

(cherry picked from commit 51cad041e0cb26597c7ccc0fbfaa349b8fffbcda)
2020-09-28 12:36:16 +02:00
Simon Atanasyan
172c27d8f3 [CodeGen] Do not call emitGlobalConstantLargeInt for constant requires 8 bytes to store
This is a fix for PR47630. The regression is caused by the D78011. After
this change the code starts to call the `emitGlobalConstantLargeInt` even
for constants which requires eight bytes to store.

Differential revision: https://reviews.llvm.org/D88261

(cherry picked from commit c6c5629f2fb4ddabd376fbe7c218733283e91d09)
2020-09-28 11:52:59 +02:00
Matt Arsenault
8cd42ca0d2 AArch64/GlobalISel: Narrow stack passed argument access size
This fixes a verifier error in the testcase from bug 47619.

The stack passed s3 value was widened to 4-bytes, and producing a
4-byte memory access with a < 1 byte result type. We need to either
widen the result type or narrow the access size. This copies the code
directly from the AMDGPU handling, which narrows the load size. I
don't like that every target has to handle this, but this is currently
broken on the 11 release branch and this is the simplest fix.

This reverts commit 42bfa7c63b85e76fe16521d1671afcafaf8f64ed.

(cherry picked from commit 6cb0d23f2ea6fb25106b0380797ccbc2141d71e1)
2020-09-28 11:43:55 +02:00
Matt Arsenault
2d82761ec3 AArch64/GlobalISel: Reduced patch for bug 47619
This is the relevant portions of an assert fixed by
b98f902f1877c3d679f77645a267edc89ffcd5d6.
2020-09-25 13:16:13 +02:00
Hans Wennborg
6dd12f31d5 release notes: mention zig as an external project 2020-09-24 16:17:13 +02:00
Hans Wennborg
ca00b88799 llvm index.rst: Drop in-progress warning 2020-09-22 16:53:33 +02:00
Lucas Prates
8fcafdf787 [CodeGen] Fixing inconsistent ABI mangling of vlaues in SelectionDAGBuilder
SelectionDAGBuilder was inconsistently mangling values based on ABI
Calling Conventions when getting them through copyFromRegs in
SelectionDAGBuilder, causing duplicate value type convertions for
function arguments. The checking for the mangling requirement was based
on the value's originating instruction and was performed outside of, and
inspite of, the regular Calling Convention Lowering.

The issue could be observed in a scenario such as:

```
%arg1 = load half, half* %const, align 2
%arg2 = call fastcc half @someFunc()
call fastcc void @otherFunc(half %arg1, half %arg2)
; Here, %arg2 was incorrectly mangled twice, as the CallConv data from
; the call to @someFunc() was taken into consideration for the check
; when getting the value for processing the call to @otherFunc(...),
; after the proper convertion had taken place when lowering the return
; value of the first call.
```

This patch fixes the issue by disregarding the Calling Convention
information for such copyFromRegs, making sure the ABI mangling is
properly contanined in the Calling Convention Lowering.

This fixes Bugzilla #47454.

Reviewed By: efriedma

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

(cherry picked from commit 53d238a961d14eae46f6f2b296ce48026c7bd0a1)
2020-09-22 11:45:22 +02:00
James Y Knight
5f31397e39 PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after an INLINEASM_BR.
findPHICopyInsertPoint special cases placement in a block with a
callbr or invoke in it. In that case, we must ensure that the copy is
placed before the INLINEASM_BR or call instruction, if the register is
defined prior to that instruction, because it may jump out of the
block.

Previously, the code placed it immediately after the last def _or
use_. This is wrong, if the use is the instruction which may jump.  We
could correctly place it immediately after the last def (ignoring
uses), but that is non-optimal for register pressure.

Instead, place the copy after the last def, or before the
call/inlineasm_br, whichever is later.

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

(cherry picked from commit f7a53d82c0902147909f28a9295a9d00b4b27d38)
2020-09-22 11:36:19 +02:00
David Blaikie
a654ae5458 [llvm] Add contains(KeyType) -> bool methods to SmallPtrSet
Matches C++20 API addition.

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

(cherry picked from commit a0385bd7acd6e1d16224b4257f4cb50e59f1d75e)
2020-09-22 11:36:17 +02:00
Qiu Chaofan
b157b648ba [SelectionDAG] Check any use of negation result before removal
2508ef01 fixed a bug about constant removal in negation. But after
sanitizing check I found there's still some issue about it so it's
reverted.

Temporary nodes will be removed if useless in negation. Before the
removal, they'd be checked if any other nodes used it. So the removal
was moved after getNode. However in rare cases the node to be removed is
the same as result of getNode. We missed that and will be fixed by this
patch.

Reviewed By: steven.zhang

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

(cherry picked from commit a2fb5446be960ad164060b3c05fc268f7f72d67a)
2020-09-17 13:37:11 +02:00
Ben Dunbobbin
d8484b56e4 [X86][ELF] Prefer lowering MC_GlobalAddress operands to .Lfoo$local for STV_DEFAULT only
This patch restricts the behaviour of referencing via .Lfoo$local
local aliases, introduced in https://reviews.llvm.org/D73230, to
STV_DEFAULT globals only.

Hidden symbols via --fvisiblity=hidden (https://gcc.gnu.org/wiki/Visibility)
is an important scenario.

Benefits:

- Improves the size of object files by using fewer STT_SECTION symbols.

- The code reads a bit better (it was not obvious to me without going
  back to the code reviews why the canBenefitFromLocalAlias function
  currently doesn't consider visibility).

- There is also a side benefit in restoring the effectiveness of the
  --wrap linker option and making the behavior of --wrap consistent
  between LTO and normal builds for references within a translation-unit.
  Note: this --wrap behavior (which is specific to LLD) should not be
  considered reliable. See comments on https://reviews.llvm.org/D73230
  for more.

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

(cherry picked from commit 4cb016cd2d8467c572b2e5c5d34f376ee79e4ac1)
2020-09-17 13:23:29 +02:00
Hans Wennborg
e9634e03cf llvm release notes: drop in-progress warnings; minor cleanups 2020-09-16 17:03:14 +02:00
Hans Wennborg
88fac78839 ReleaseNotes: PowerPC changes
By Ahsan Saghir!
2020-09-15 20:18:03 +02:00
Hans Wennborg
068754a1d5 Revert "RegAllocFast: Record internal state based on register units"
This seems to have caused incorrect register allocation in some cases,
breaking tests in the Zig standard library (PR47278).

As discussed on the bug, revert back to green for now.

> Record internal state based on register units. This is often more
> efficient as there are typically fewer register units to update
> compared to iterating over all the aliases of a register.
>
> Original patch by Matthias Braun, but I've been rebasing and fixing it
> for almost 2 years and fixed a few bugs causing intermediate failures
> to make this patch independent of the changes in
> https://reviews.llvm.org/D52010.

This reverts commit 66251f7e1de79a7c1620659b7f58352b8c8e892e, and
follow-ups 931a68f26b9a3de853807ffad7b2cd0a2dd30922
and 0671a4c5087d40450603d9d26cf239f1a8b1367e. It also adjust some
test expectations.

(cherry picked from commit a21387c65470417c58021f8d3194a4510bb64f46)
2020-09-15 19:12:48 +02:00
Teresa Johnson
73b4967b30 [Docs] Add/update release notes for D71913 (LTO WPD changes)
This adds documentation for the options added / changed by D71913, which
enabled aggressive WPD under LTO. The lld release notes already
mentioned it, but I expanded the note.

Differential Revision: https://reviews.llvm.org/D86958
2020-09-15 08:51:56 -07:00
Qiu Chaofan
4daf36af28 Revert "[SelectionDAG] Remove unused FP constant in getNegatedExpression"
2508ef01 doesn't totally fix the issue since we did not handle the case
when unused temporary negated result is the same with the result, which
is found by address sanitizer.

(cherry picked from commit e1669843f2aaf1e4929afdd8f125c14536d27664)
2020-09-15 16:57:03 +02:00
Hans Wennborg
d3f2114698 Revert "Double check that passes correctly set their Modified status"
This check fires during self-host.

> The approach is simple: if a pass reports that it's not modifying a
> Function/Module, compute a loose hash of that Function/Module and compare it
> with the original one. If we report no change but there's a hash change, then we
> have an error.
>
> This approach misses a lot of change but it's not super intrusive and can
> detect most of the simple mistakes.
>
> Differential Revision: https://reviews.llvm.org/D80916

This reverts commit 3667d87a33d3c8d4072a41fd84bb880c59347dc0.
2020-09-15 16:47:29 +02:00
Craig Topper
7b6b353218 [FastISel] Bail out of selectGetElementPtr for vector GEPs.
The code that decomposes the GEP into ADD/MUL doesn't work properly
for vector GEPs. It can create bad COPY instructions or possibly
assert.

For now just bail out to SelectionDAG.

Fixes PR45906

(cherry picked from commit 4208ea3e19f8e3e8cd35e6f5a6c43f4aa066c6ec)
2020-09-15 13:55:38 +02:00