1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Commit Graph

217109 Commits

Author SHA1 Message Date
Alexey Bataev
b6a5326556 [SLP]Improve gathering of scalar elements.
1. Better sorting of scalars to be gathered. Trying to insert
   constants/arguments/instructions-out-of-loop at first and only then
   the instructions which are inside the loop. It improves hoisting of
   invariant insertelements instructions.
2. Better detection of shuffle candidates in gathering function.
3. The cost of insertelement for constants is 0.

Part of D57059.

Differential Revision: https://reviews.llvm.org/D103458
2021-06-09 05:23:21 -07:00
Max Kazantsev
6d15bbb3de [Test] Add more elaborate case of symbolic execution of 1-iteration loop 2021-06-09 19:08:54 +07:00
Meera Nakrani
0d90ee064b [AArch64LoadStoreOptimizer] Generate more STPs by renaming registers earlier
Our initial motivating case was memcpy's with alignments > 16. The
loads/stores, to which small memcpy's expand, are kept together in
several places so that we get a sequence like this for a 64 bit copy:
LD w0
LD w1
ST w0
ST w1
The load/store optimiser can generate a LDP/STP w0, w1 from this because
the registers read/written are consecutive. In our case however, the
sequence is optimised during ISel, resulting in:
LD w0
ST w0
LD w0
ST w0
This instruction reordering allows reuse of registers. Since the registers
are no longer consecutive (i.e. they are the same), it inhibits LDP/STP
creation. The approach here is to perform renaming:
LD w0
ST w0
LD w1
ST w1
to enable the folding of the stores into a STP. We do not yet generate
the LDP due to a limitation in the renaming implementation, but plan to
look at that in a follow-up so that we fully support this case. While
this was initially motivated by certain memcpy's, this is a general
approach and thus is beneficial for other cases too, as can be seen
in some test changes.

Differential Revision: https://reviews.llvm.org/D103597
2021-06-09 11:25:26 +00:00
Fraser Cormack
cb0fa6245f [ValueTypes][RISCV] Cap RVV fixed-length vectors by size
This patch changes RVV's policy for its supported list of fixed-length
vector types by capping by vector size rather than element count. Now
all 1024-byte vectors (of supported element types) are supported, rather
than all 256-element vectors.

This is a more natural fit for the architecture, and allows us to, for
example, improve the support for vector bitcasts.

This change necessitated the adding of some new simple types to avoid
"regressing" on the number of currently-supported vectors. We round out
the 1024-byte types by adding `v512i8`, `v1024i8`, `v512i16` and
`v512f16`.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103884
2021-06-09 12:15:37 +01:00
Nico Weber
179e9325b0 Revert "[SROA] Avoid splitting loads/stores with irregular type"
This reverts commit 905f4eb537c118783969fded19e96fe6504c2956.
Breaks check-llvm on most (all?) bots, see https://reviews.llvm.org/D99435
2021-06-09 06:32:58 -04:00
LemonBoy
bc23f01f35 [SROA] Avoid splitting loads/stores with irregular type
Upon encountering loads/stores on types whose size is not a multiple of 8 bits the SROA pass would either trip an assertion or use logic that was not meant to work with such irregularly-sized types.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D99435
2021-06-09 11:48:20 +02:00
Jim Lin
65da76df22 [docs] Fix load instructions in chapter 7 of the tutorial
Loads in the first half of the chapter are missing the type argument.

Patched By: klao (Mihaly Barasz)

Reviewed By: Jim

Differential Revision: https://reviews.llvm.org/D90326
2021-06-09 17:39:11 +08:00
Lang Hames
f1e7b7b70f [JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.
The C-string section splitting support added in f9649d123db triggered an assert
("Duplicate canonical symbol at address") when multiple symbols were defined at
the the same offset within a C-string block (this triggered on arm64, where we
always add a block start symbol). The bug was caused by a failure to update the
record of the last canonical symbol address. The fix was to maintain this record
correctly, and move the auto-generation of the block-start symbol above the
handling for symbols defined in the object itself so that all symbols
(auto-generated and defined) are processed in address order.
2021-06-09 19:16:49 +10:00
Florian Hahn
37c3bfd1ce [LTO] Support new PM in ThinLTOCodeGenerator.
This patch adds initial support for using the new pass manager when
doing ThinLTO via libLTO.

Reviewed By: steven_wu

Differential Revision: https://reviews.llvm.org/D102627
2021-06-09 10:05:14 +01:00
Fraser Cormack
1baf7d8c9b [RISCV] Fix failing RVV MC tests
I believe these failures were introduced by D103790's changes to the
VType formatting found in vsetvli/vsetivli instructions.
2021-06-09 09:47:18 +01:00
Fraser Cormack
2a2d2b1c73 [ValueTypes] Add missing enum names for MVTs
These types are (presumably) never used in the generated TableGen files.
The `default` switch case silences any compiler warnings for these
missing types so it's easy to miss.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103883
2021-06-09 09:41:36 +01:00
Jingu Kang
a06dee18e5 [LoopBoundSplit] Ignore phi node which is not scevable
There was a bug in LoopBoundSplit. The pass should ignore phi node which is not
scevable.

Differential Revision: https://reviews.llvm.org/D103913
2021-06-09 09:44:36 +01:00
Jan Kratochvil
c90315c834 Revert "[llvm] Sync DebugInfo.h with DebugInfoFlags.def"
This reverts commit 093750dd0be6b0729f8e817766c3d5849545e10c.

It broke buildbots, goint to investigate it more.
2021-06-09 10:39:57 +02:00
Florian Hahn
92b2a39d20 [ScalarEvolution] Add test for preserving add overflow flags. 2021-06-09 09:20:02 +01:00
Fraser Cormack
1661b75919 [RISCV] Support CONCAT_VECTORS on scalable masks
This patch is a simple fix which registers CONCAT_VECTORS as
custom-lowered for scalable mask vectors. This follows the pattern of
all other scalable-vector types, as the default expansion of
CONCAT_VECTORS cannot handle scalable types, and even if it did it'd go
through the stack and generate worse code.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103896
2021-06-09 09:07:44 +01:00
Jan Kratochvil
191a799f53 [llvm] Sync DebugInfo.h with DebugInfoFlags.def
Command to see the differences:
  diff -u <(sed -n 's#^HANDLE_DI_FLAG *([^,]*, *\([^()]*\)) *\(//.*\)\?$#\1#p' <llvm/include/llvm/IR/DebugInfoFlags.def | grep -vw Largest) <(sed -n 's#^ *LLVMDIFlag\([^ ]*\) *= (\?[0-9].*$#\1#p' <llvm/include/llvm-c/DebugInfo.h)

OCaml binding is more seriously out of sync but I have not tried to sync it.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D103910
2021-06-09 10:11:23 +02:00
Esme-Yi
3fd7a0db05 Fix the 4203-Buildbot failure in LLVM Buildbot on llvm-clang-win-x-aarch64
Failure in llvm/test/tools/llvm-objdump/XCOFF/section-headers.test:

    SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
                 in position 24-25: truncated \xXX escape
2021-06-09 07:23:51 +00:00
Guillaume Chatelet
06979257cf [NFC] Reformat MachineValueType
This is a follow up patch based on https://reviews.llvm.org/D103251#2804016.

Differential Revision: https://reviews.llvm.org/D103893
2021-06-09 07:20:51 +00:00
Jim Lin
a138169412 [Docs] Fix incorrect return type for example code 2021-06-09 15:22:49 +08:00
Kai Luo
d4ac5d338c [PowerPC] Make sure the first probe is full size or is the last probe when stack is realigned
When `-fstack-clash-protection` is enabled and stack has to be realigned, some parts of redzone is written prior the probe, so probe might overwrite content already written in redzone. To avoid it, we have to make sure the first probe is at full probe size or is the last probe so that we can skip redzone.

It also fixes violation of ABI under PPC where `r1` isn't updated atomically.

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

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D100290
2021-06-09 06:35:35 +00:00
Esme-Yi
df64e3b863 Remove white space in llvm-objdump/XCOFF/section-headers.test 2021-06-09 05:35:52 +00:00
Sterling Augustine
59049d1a79 Add Twine support for std::string_view.
With Twine now ubiquitous after rG92a79dbe91413f685ab19295fc7a6297dbd6c824,
it needs support for string_view when building clang with newer C++ standards.

This is similar to how StringRef is handled.

Differential Revision: https://reviews.llvm.org/D103935
2021-06-08 20:19:04 -07:00
Jim Lin
5c02f8612f [RISCV][NFC] Add a single space after comma for VType
In most of cases, it has a single space after comma in assembly operands.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103790
2021-06-09 11:18:22 +08:00
Esme-Yi
3c03ef6aee [NFC][XCOFF] Use yaml2obj in llvm-objdump/XCOFF/section-headers.test instead of binary files.
Summary: This a minor patch to refactor the test file,
llvm-objdump/XCOFF/section-headers.test, to use yaml2obj
for this testing rather than a canned binary.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D103146
2021-06-09 03:11:33 +00:00
Kai Luo
2aa3720382 [PowerPC][Dwarf] Assign MMA register's dwarf register number to negative value
According to ELF V2 ABI, `0` should be the dwarf number of `r0`. Currently MMA's register also uses `0` as its dwarf number, this confuses `RegisterInfoEmitter` and generates wrong dwarf -> llvm mapping.
```
extern const MCRegisterInfo::DwarfLLVMRegPair PPCDwarfFlavour1Dwarf2L[] = {
  { 0U, PPC::VSRp31 },
```
This leads to wrong cfi output in https://reviews.llvm.org/D100290.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D103761
2021-06-09 02:24:01 +00:00
Brendon Cahoon
3a664dba6e Reland "[AMDGPU] Add gfx1013 target"
This reverts commit 211e584fa2a4c032e4d573e7cdbffd622aad0a8f.

Fixed a use-after-free error that caused the sanitizers to fail.
2021-06-08 21:15:35 -04:00
Lang Hames
81cfcb1033 [JITLink][MachO] Split C-string literal sections on null-terminators.
MachO C-string literal sections should be split on null-terminator boundaries,
rather than the usual symbol boundaries. This patch updates
MachOLinkGraphBuilder to do that.
2021-06-09 10:19:27 +10:00
Quinn Pham
6ce8448c70 [NFC] In the future, all intrinsics defined for compatibility with the XL
compiler will be placed in this collection.

This patch has no functional changes.

Differential revision: https://reviews.llvm.org/D103921
2021-06-08 17:58:02 -05:00
Sami Tolvanen
dd2d6bb1ca LTO: Export functions referenced by non-canonical CFI jump tables
LowerTypeTests pass adds functions with a non-canonical jump table
to cfiFunctionDecls instead of cfiFunctionDefs. As the jump table
is in the regular LTO object, these functions will also need to be
exported. This change fixes the non-canonical jump table case and
adds a test similar to the existing one for canonical jump tables.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D103120
2021-06-08 14:57:43 -07:00
Whitney Tsang
c40da26524 Revert "Revert "[LoopNest] Fix Wdeprecated-copy warnings""
This reverts commit 07ef5805abe5d4576eb5528eab63e75505bfd0bd.

The broke of the sanitizer-windows bot:
https://lab.llvm.org/buildbot/#/builders/127/builds/12064
is not caused by the original commit.

Differential Revision: https://reviews.llvm.org/D103752
2021-06-08 21:51:53 +00:00
Kevin Athey
df6a87605d Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
In addition:
  - optionally add global flag to capture compile intent for UAR:
    __asan_detect_use_after_return_always.
    The global is a SANITIZER_WEAK_ATTRIBUTE.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103304
2021-06-08 14:39:06 -07:00
Jonas Paulsson
e4de68ed74 [SystemZ] Return true from convertSetCCLogicToBitwiseLogic for scalar integer.
Review: Ulrich Weigand
2021-06-08 16:27:28 -05:00
Sanjay Patel
26c9404ebd [InstCombine] fix nsz (fast-math) propagation from fneg-of-select
As discussed in the post-commit comments for:
3cdd05e519dd

It seems to be safe to propagate all flags from the final fneg
except for 'nsz' to the new select:
https://alive2.llvm.org/ce/z/J_APDc

nsz has unique FMF semantics: it is not poison, it is only
"insignificant" in the calculation according to the LangRef.
2021-06-08 17:04:30 -04:00
Sanjay Patel
86c02600f6 [InstCombine] add FMF tests for fneg-of-select; NFC
As noted in the post-commit comments for 3cdd05e519d,
we need to be more careful about FMF propagation.
2021-06-08 17:04:29 -04:00
David Green
e8a32c1c88 [DSE] Add another multiblock loop DSE test. NFC
As reported in D100464, the stores in these loops should not be removed.
2021-06-08 21:54:59 +01:00
Whitney Tsang
d1d5a06d3d Revert "[LoopNest] Fix Wdeprecated-copy warnings"
This reverts commit dee1f0cb348b0a56375d9b563fb4d6918c431ed1.

It appears that this change broke the sanitizer-windows bot:
https://lab.llvm.org/buildbot/#/builders/127/builds/12064

Differential Revision: https://reviews.llvm.org/D103752
2021-06-08 20:46:12 +00:00
Jonas Paulsson
3edbda39e8 [SystemZ] Return true from isMaskAndCmp0FoldingBeneficial().
Return true if the mask is a constant uint of 2 bytes, in which case TMLL is
available.

Review: Ulrich Weigand
2021-06-08 15:42:46 -05:00
Brendon Cahoon
8238dc695f Revert "[AMDGPU] Add gfx1013 target"
This reverts commit ea10a86984ea73fcec3b12d22404a15f2f59b219.

A sanitizer buildbot reports an error.
2021-06-08 16:29:41 -04:00
David Green
80ea5748b2 Revert "[DSE] Remove stores in the same loop iteration"
Apparently non-dead stores are being removed, as noted in D100464.

This reverts commit 222aeb4d51a46c5a81c9e4ccb16d1d19dd21ec95.
2021-06-08 21:23:08 +01:00
David Green
d86568b0fb [ARM] Generate VDUP(Const) from constant buildvectors
If we cannot otherwise use a VMOVimm/VMOVFPimm/VMVNimm, fall back to
producing a VDUP(const) as opposed to a constant pool load. This will at
least be smaller codesize and can allow the VDUP to be folded into other
instructions.

Differential Revision: https://reviews.llvm.org/D103808
2021-06-08 20:51:33 +01:00
Eric Astor
c4ebd16614 [ms] [llvm-ml] Disambiguate size directives and variable declarations
MASM allows statements of the form:
	<VAR> DWORD 5
to declare a variable with name <VAR>, while:
	call dword ptr [<value>]
is a valid instruction. To disambiguate, we recognize size directives by the trailing "ptr" token.

As discussed in https://lists.llvm.org/pipermail/llvm-dev/2021-May/150774.html

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D103257
2021-06-08 15:44:31 -04:00
Michael Liao
a01383c7cf [amdgpu] Add -enable-ocl-mangling-mismatch-workaround.
- Add `-enable-ocl-mangling-mismatch-workaround` to work around the
  mismatch on OCL name mangling so far.

Reviewed By: yaxunl, rampitec

Differential Revision: https://reviews.llvm.org/D103920
2021-06-08 15:42:27 -04:00
Nico Weber
1f78d78c62 [gn build] (semi-manually) port 944b3c53aec5 2021-06-08 15:21:03 -04:00
Abhina Sreeskantharajan
f48a352265 [SystemZ][z/OS] Pass OpenFlags when creating tmp files
This patch https://reviews.llvm.org/D102876 caused some lit regressions on z/OS because tmp files were no longer being opened based on binary/text mode. This patch passes OpenFlags when creating tmp files so we can open files in different modes.

Reviewed By: amccarth

Differential Revision: https://reviews.llvm.org/D103806
2021-06-08 14:45:34 -04:00
Matt Arsenault
fca6ba66d2 GlobalISel: Avoid use of G_INSERT in insertParts
G_INSERT legalization is incomplete and doesn't work very
well. Instead try to use sequences of G_MERGE_VALUES/G_UNMERGE_VALUES
padding with undef values (although this can get pretty large).

For the case of load/store narrowing, this is still performing the
load/stores in irregularly sized pieces. It might be cleaner to split
this down into equal sized pieces, and rely on load/store merging to
optimize it.
2021-06-08 14:44:24 -04:00
Matt Arsenault
96cc3e31f6 GlobalISel: Hide virtual register creation in MIRBuilder 2021-06-08 14:44:24 -04:00
David Green
8d169a9697 [ARM] A couple of extra VMOVimm tests, useful for showing BE codegen. NFC 2021-06-08 19:39:45 +01:00
Artur Pilipenko
c3b99fe293 Add an option to hide "cold" blocks from CFG graph
Introduce a new cl::opt to hide "cold" blocks from CFG DOT graphs.
Use BFI to get block relative frequency. Hide the block if the
frequency is below the threshold set by the command line option value.

Reviewed By: davidxl, hoy
Differential Revision: https://reviews.llvm.org/D103640
2021-06-08 11:29:27 -07:00
Craig Topper
8382e711cc [RISCV] Remove dead code from fixed-vectors-abs.ll test cases. NFC
We had two pointer arguments and a dead load presumably copied
from a binary operation test and modified into unary abs.
2021-06-08 11:24:23 -07:00
Justin Bogner
880a1f20ab [FuzzMutate] Fix getWeight of InstDeleterIRStrategy
The comment states the following, for calculating the Line variable:

> Draw a line starting from when we only have 1k left and increasing
> linearly to double the current weight.

However, the value was not calculated as described. Instead, it would
result in a negative value, which resulted in the function always
returning 0 afterwards.

```
// Invariant: CurrentSize <= MaxSize - 200
// Invariant: CurrentWeight >= 0
int Line = (-2 * CurrentWeight) * (MaxSize - CurrentSize + 1000);
// {Line <= 0}
```

This commit fixes the issue and linearly interpolates as described.

Patch by Loris Reiff. Thanks!

Differential Revision: https://reviews.llvm.org/D96207
2021-06-08 11:14:33 -07:00