1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

196942 Commits

Author SHA1 Message Date
Matt Arsenault
bef13abfaf GlobalISel: Fix IRTranslator for constantexpr selects
This was assuming a select is always an instruction, which is not
true.
2020-05-19 09:52:48 -04:00
Sam Parker
c326fd4f01 [NFC][ARM] Add more tail predication tests 2020-05-19 14:01:10 +01:00
Alexey Bataev
4d63a4a7ab [OPENMP50]Add initial support for 'affinity' clause.
Summary:
Added parsing/sema/serialization support for affinity clause in task
directives.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, arphaman, llvm-commits, cfe-commits, caomhin

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D80148
2020-05-19 08:19:09 -04:00
Jay Foad
437e1e1fd3 [IR] Revert r119493
r119493 protected against PHINode::hasConstantValue returning the PHI
node itself, but a later fix in r159687 means that can never happen, so
the workarounds are no longer required.
2020-05-19 13:17:11 +01:00
Simon Pilgrim
92f1bddf01 ObjectCache.h - replace unnecessary MemoryBuffer.h include with forward declarations. NFC. 2020-05-19 13:12:41 +01:00
Simon Pilgrim
714f7215de GlobalVariable.h - remove unused PointerUnion.h include. NFC 2020-05-19 13:12:41 +01:00
Carl Ritson
b9625555fe [AMDGPU] Add more VMEM to SALU WAR hazard tests. NFC 2020-05-19 19:52:13 +09:00
Simon Pilgrim
d577a5531c GlobPattern.h - remove unnecessary StringRef.h include. NFC
Use forward declaration instead.

Remove unnecessary BitVector forward declaration while we're here - we need to include BitVector.h.
2020-05-19 11:27:40 +01:00
Georgii Rymar
11f7be54a0 [yaml2obj] - Stop using square brackets for unique suffixes.
For describing section/symbol names we can use unique suffixes,
e.g:

```
- Name: '.foo [1]`
- Name: '.foo [2]`
```

It can be a problem (see https://reviews.llvm.org/D79984#inline-734829),
because `[]` are sometimes used to describe a macros:

```
- Name: "[[a0]]"
```

Seems the better approach is to use something else, like "()".
This patch does it and refactors the code related.

Differential revision: https://reviews.llvm.org/D80123
2020-05-19 12:59:13 +03:00
Simon Pilgrim
4cbdb6203c TargetIntrinsicInfo.h - remove unnecessary Compiler.h include. NFC.
We don't need use compiler specific attributes so don't need Compiler.h
2020-05-19 09:28:13 +01:00
Simon Pilgrim
dd58bbb170 TargetLoweringObjectFile.h - remove unnecessary includes. NFCI.
Replace with forward declarations and move includes down to source files where required.

I also needed to move the TargetLoweringObjectFile::SectionForGlobal wrapper implementation down into TargetLoweringObjectFile.cpp
2020-05-19 09:28:13 +01:00
Jonas Paulsson
f87041e363 [SystemZ] Eliminate the need to create a zero vector by reusing the VPERM mask.
Try to avoid creating VGBMs by reusing the permutation mask if it contains a
zero. If the first byte was into (any byte of) a zero vector, then the first
byte of the mask can become zero and reused by putting the mask also as the
first operand. If there instead was a first-byte use of the other source
operand, then that zero index can be reused if the mask is placed as the
second operand.

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D79925
2020-05-19 09:37:19 +02:00
Igor Kudrin
ff36ba2fe6 [DebugInfo] Add a test for dumping DWARF64 CIEs and FDEs (8/8).
This adds a test to check that Length and CIE_id/CIE_pointer fields in
.debug_frame section are printed as 16-digit hex values if the records
are in the DWARF64 format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:36:07 +07:00
Igor Kudrin
ad1b73ac01 [DebugInfo] Dump offsets in .debug_str_offsets according to the DWARF format (7/8).
The patch changes dumping of offsets in .debug_str_offsets sections so
that they are printed as 16-digit hex values if the contribution is in
the DWARF64 format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:58 +07:00
Igor Kudrin
c5c4099633 [DebugInfo] Dump values in .debug_pubnames and .debug_pubtypes according to the DWARF format (6/8).
The patch changes dumping of unit_length, debug_info_offset, and
debug_info_length fields in headers in .debug_pubname and
.debug_pubtypes sections so that they are printed as 16-digit hex values
if the contribution is in the DWARF64 format. Dumping of offsets in the
tables is changed in the same way.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:48 +07:00
Igor Kudrin
de5a895fe7 [DebugInfo] Dump values in .debug_loclists and .debug_rnglists according to the DWARF format (5/8).
The patch changes dumping of a unit_length field and offsets in headers
in .debug_loclists and .debug_rnglists sections so that they are printed
as 16-digit hex values if the contribution is in the DWARF64 format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:41 +07:00
Igor Kudrin
967d1a864c [DebugInfo] Dump length in .debug_line according to the DWARF format (4/8).
The patch changes dumping of unit_length and header_length fields in
headers in .debug_line sections so that they are printed as 16-digit hex
values if the contribution is in the DWARF64 format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:31 +07:00
Igor Kudrin
b9fa4397be [DebugInfo] Dump length of CUs and TUs according to the DWARF format (3/8).
The patch changes dumping of the unit_length field in a unit header so
that it is printed as a 16-digit hex value if the unit is in the DWARF64
format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:20 +07:00
Igor Kudrin
4771f1fb66 [DebugInfo] Dump form values according to the DWARF format (2/8).
The patch changes dumping of DWARF form values which sizes depend on
the DWARF format so that they are printed as 16-digit hex values for
DWARF64.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:35:07 +07:00
Igor Kudrin
36a0e66a05 [DebugInfo] Dump fields in .debug_aranges according to the DWARF format (1/8).
The patch changes dumping of unit_length and debug_info_offset fields in
an address range header so that they are printed as 16-digit hex values
if the contribution is in the DWARF64 format.

Differential Revision: https://reviews.llvm.org/D79997
2020-05-19 13:34:54 +07:00
Igor Kudrin
7d5b354df8 [DebugInfo] Remove an outdated test.
64-bit DWARF is supported for most of the sections now, and there are
separate tests for each of them. This test uses a binary input, while
the preferable way is to have a text-based source. Thus, it looks like
this test may be safely removed.

Differential Revision: https://reviews.llvm.org/D80122
2020-05-19 13:32:48 +07:00
LLVM GN Syncbot
b8f2bd0df3 [gn build] Port bcc0c894f38 2020-05-19 06:07:14 +00:00
Qiu Chaofan
5ddde47cb9 [NFC] [PowerPC] Refresh fma-mutate.ll using script
This is a clean-up after D78989. The old comments are out of date.
2020-05-19 13:39:58 +08:00
Yonghong Song
9757c9a661 [BPF] fix an asan issue when disassemble an illegal instruction
Commit 8e8f1bd75a9a ("[BPF] Return fail if disassembled insn registers
out of range") tried to fix a segfault when an illegal instruction
is decoded. A test case is added to emulate such an illegal instruction.

The llvm buildbot reported an asan issue with this test case.
  ERROR: AddressSanitizer: global-buffer-overflow on address ...
  decodeMemoryOpValue(llvm::MCInst&, unsigned int, ...)
  llvm::MCDisassembler::DecodeStatus llvm::decodeToMCInst<unsigned long>(...)
  llvm::MCDisassembler::DecodeStatus llvm::decodeInstruction<unsigned long>(...)
  in (anonymous namespace)::BPFDisassembler::getInstruction(...)
  ...

Basically, the fix in Commit 8e8f1bd75a9a is too later to prevent
the asan. The fix in this patch moved the register number check earlier
during decodeInstruction(). It will return fail for decodeInstruction()
if the register number is out of range.

Note that DecodeGPRRegisterClass() and DecodeGPR32RegisterClass()
already have register number checking, so here we only check
decodeMemoryOpValue().
2020-05-18 22:33:34 -07:00
LLVM GN Syncbot
c8b778bfd6 [gn build] Port 62a9eca859d 2020-05-19 05:18:58 +00:00
Sameer Sahasrabuddhe
11bc679be9 [LoopSimplify] don't separate nested loops with convergent calls
Summary:
When a loop has multiple backedges, loop simplification attempts to
separate them out into nested loops. This results in incorrect control
flow in the presence of some functions like a GPU barrier. This change
skips the transformation when such "convergent" function calls are
present in the loop body.

Reviewed By: nhaehnle

Differential Revision: https://reviews.llvm.org/D80078
2020-05-19 09:22:39 +05:30
Chen Zheng
67a09d59fc [PowerPC-QPX] adjust operands order of qpx fma instructions.
convert
  %3 = QVFMADD %2, %0, %1, implicit $rm
to
  %3 = QVFMADD %2, %1, %0, implicit $rm

Reviewed By: hfinkel, steven.zhang

Differential Revision: https://reviews.llvm.org/D78986
2020-05-18 22:59:51 -04:00
LLVM GN Syncbot
8ff874aead [gn build] Port e7e84ff24a5 2020-05-19 02:41:51 +00:00
Eli Friedman
8ed9557076 [NFC] Replace MaybeAlign with Align in TargetTransformInfo. 2020-05-18 19:25:49 -07:00
Yonghong Song
7968749f42 [BPF] Return fail if disassembled insn registers out of range
Daniel reported a llvm-objdump segfault like below:
  $ llvm-objdump -D bpf_xdp.o
  ...
  0000000000000000 <.strtab>:
       0:       00 63 69 6c 69 75 6d 5f <unknown>
       1:       6c 62 36 5f 61 66 66 69 w2 <<= w6
  ...
  (llvm-objdump: lib/Target/BPF/BPFGenAsmWriter.inc:1087: static const char*
   llvm::BPFInstPrinter::getRegisterName(unsigned int): Assertion
   `RegNo && RegNo < 25 && "Invalid register number!"' failed.
   Stack dump:
   0.      Program arguments: llvm-objdump -D bpf_xdp.o
    ...
    abort
    ...
    llvm::BPFInstPrinter::getRegisterName(unsigned int)
    llvm::BPFInstPrinter::printMemOperand(llvm::MCInst const*,
                          int, llvm::raw_ostream&, char const*)
    llvm::BPFInstPrinter::printInstruction(llvm::MCInst const*,
                          unsigned long, llvm::raw_ostream&)
    llvm::BPFInstPrinter::printInst(llvm::MCInst const*,
                          unsigned long, llvm::StringRef, llvm::MCSubtargetInfo const&,
                          llvm::raw_ostream&)
   ...

Basically, since -D enables disassembly for all sections, .strtab is also disassembled,
but some strings are decoded as legal instructions but with illegal register numbers.
When llvm-objdump tries to print register name for these illegal register numbers,
assertion and segfault happens.

The patch fixed the issue by returning fail for a disassembled insn if
that insn contains a reg operand with illegal reg number.
The insn will be printed as "<unknown>" instead of causing an assertion.
2020-05-18 18:53:23 -07:00
Chen Zheng
c210c2e1da fix build failure due to commit rGddcb3cf213e8 2020-05-18 21:47:40 -04:00
Chen Zheng
fed38390c1 [TargetInstrInfo] add override function setSpecialOperandAttr - NFC 2020-05-18 21:20:52 -04:00
Chen Zheng
c5d8af7592 [PowerPC][MachineCombiner] add testcase for reassociating FMA - NFC 2020-05-18 21:18:01 -04:00
Yonghong Song
e02a784f03 [BPF] Prevent disassembly segfault for NOP insn
For a simple program like below:
  -bash-4.4$ cat t.c
  int test() {
    asm volatile("r0 = r0" ::);
    return 0;
  }
compiled with
  clang -target bpf -O2 -c t.c
the following llvm-objdump command will segfault.
  llvm-objdump -d t.o

  0:       bf 00 00 00 00 00 00 00 nop
  llvm-objdump: ../include/llvm/ADT/SmallVector.h:180
  ...
  Assertion `idx < size()' failed
  ...
  abort
  ...
  llvm::BPFInstPrinter::printOperand
  llvm::BPFInstPrinter::printInstruction
  ...

The reason is both NOP and MOV_rr (r0 = r0) having the same encoding.
The disassembly getInstruction() decodes to be a NOP instruciton but
during printInstruction() the same encoding is interpreted as
a MOV_rr instruction. Such a mismatcch caused the segfault.

The fix is to make NOP instruction as CodeGen only so disassembler
will skip NOP insn for disassembling.

Note that instruction "r0 = r0" should not appear in non inline
asm codes since BPF Machine Instruction Peephole optimization will
remove it.

Differential Revision: https://reviews.llvm.org/D80156
2020-05-18 17:40:18 -07:00
Reid Kleckner
4fb2315347 Re-land [Debug][CodeView] Emit fully qualified names for globals
This reverts commit 525a591f0f48b9d54018bf5245f2abee09c9c1c8.

Fixed an issue with pointers to members based on typedefs. In this case,
LLVM would emit a second UDT. I fixed it by not passing the class type
to getTypeIndex when the base type is not a function type. lowerType
only uses the class type for direct function types. This suggests if we
have a PMF with a function typedef, there may be an issue, but that can
be solved separately.
2020-05-18 17:31:00 -07:00
Amara Emerson
91ec0c59f4 [AArch64][GlobalISel] Add legalizer & selector support for G_FREEZE.
These should legalize like undefs and select into copies.

The ll test is copied from the x86 test, minus the half fp case because
we don't currently support that.
2020-05-18 16:25:33 -07:00
Ayal Zaks
61c8b82179 [LV] Fix FoldTail under user VF and UF
LV considers an internally computed MaxVF to decide if a constant trip-count is
a multiple of any subsequently chosen VF, and conclude that no scalar remainder
iterations (tail) will be left for Fold Tail to handle. If an external VF is
provided via -force-vector-width, it must be considered instead of the internal
MaxVF.
If an external UF is provided via -force-vector-interleave, it too must be
considered in addition to MaxVF or user VF.

Fixes PR45679.

Differential Revision: https://reviews.llvm.org/D80085
2020-05-19 01:32:25 +03:00
LLVM GN Syncbot
8d5e57fd01 [gn build] Port 9d69072fb80 2020-05-18 22:19:17 +00:00
Matt Arsenault
d224a8d691 GlobalISel: Fold G_MUL x, 0, and G_*DIV 0, x 2020-05-18 18:08:26 -04:00
Francesco Petrogalli
8076ec1cfb [llvm][sve] Intrinsics for SVE sudot and usdot instructions.
Summary:
This patch adds IR intrinsics for the mnemonics USDOT and SUDOT of the
8.6 extension of Armv8-a.

Reviewers: sdesmalen, efriedma, david-arm

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79876
2020-05-18 22:02:19 +00:00
Francesco Petrogalli
ad66823c9e [llvm][SVE] IR intrinscs for matrix multiplication instructions.
Summary:
Instructions:

* SMMLA
* UMMLA
* USMMLA
* FMMLA

Reviewers: sdesmalen, efriedma, kmclaughlin

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79638
2020-05-18 22:02:19 +00:00
Amara Emerson
5a7ec90efd [GlobalISel] Add support for using vector values in memset inlining. 2020-05-18 14:56:16 -07:00
Sanjay Patel
9d7c7852e7 [x86] add tests for heroic horizontal ops; NFC 2020-05-18 17:21:09 -04:00
Sanjay Patel
d7d37bf173 [x86] add tests for disguised horizontal ops; NFC 2020-05-18 17:21:09 -04:00
Stanislav Mekhanoshin
77e3cbb0fa [AMDGPU] Fixed selection error for 64 bit extract_subvector
Differential Revision: https://reviews.llvm.org/D80155
2020-05-18 14:17:59 -07:00
Matt Arsenault
ce0a216e94 DAG: Use correct pointer size for llvm.ptrmask
This was ignoring the address space, and would assert on address
spaces with a different size from the default.
2020-05-18 16:46:11 -04:00
Craig Topper
0fe1404812 Fix several places that were calling verifyFunction or verifyModule without checking the return value.
verifyFunction/verifyModule don't assert or error internally. They
also don't print anything if you don't pass a raw_ostream to them.
So the caller needs to check the result and ideally pass a stream
to get the messages. Otherwise they're just really expensive no-ops.

I've filed PR45965 for another instance in SLPVectorizer
that causes a lit test failure.

Differential Revision: https://reviews.llvm.org/D80106
2020-05-18 13:28:46 -07:00
Nikita Popov
0a9209ea96 [Sanitizers] Use getParamByValType() (NFC)
Instead of fetching the pointer element type.
2020-05-18 22:06:18 +02:00
Jean-Michel Gorius
63eeb3f8ce [x86] Propagate memory operands during ISel DAG postprocessing
Summary:
Propagate memory operands when folding test instructions.

This was split from D80062.

Reviewers: craig.topper, rnk, lebedev.ri

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80140
2020-05-18 21:35:31 +02:00
Matt Arsenault
38c9856b3c AMDGPU: Fix illegally constant folding from V_MOV_B32_sdwa
This was assumed to be a simple move, and interpreting the immediate
modifier operand as a materialized immediate. Apparently the SDWA pass
never produces these, but GlobalISel does emit these for some vector
shuffles.
2020-05-18 15:34:33 -04:00