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

201817 Commits

Author SHA1 Message Date
Simon Pilgrim
91051f84c0 [X86][SSE] combineShuffleWithHorizOp - canonicalize SHUFFLE(HOP(X,Y),HOP(Y,X)) -> SHUFFLE(HOP(X,Y))
Attempt to canonicalize binary shuffles of HOPs with commuted operands to an unary shuffle.
2020-08-11 18:13:03 +01:00
Matt Arsenault
1c0be51aa1 GlobalISel: Fix typo 2020-08-11 13:08:56 -04:00
Lang Hames
f0d37fd69e [ORC] Move file-descriptor based raw byte channel into a public header.
This will enable re-use in other llvm tools.
2020-08-11 09:50:58 -07:00
Lang Hames
ab36f344d6 [llvm-jitlink] Fix a file comment. 2020-08-11 09:50:58 -07:00
Nikita Popov
577d874016 [InstSimplify] Forbid undef folds in expandBinOp
This is the replacement for D84250 based on D84792. As we recursively
fold with the same value twice, we need to disable undef folds,
to prevent an undef from being folded to two different values.

Reverting rG00f3579aea6e3d4a4b7464c3db47294f71cef9e4 and using the
test case from https://reviews.llvm.org/D83360#2145793, it no longer
performs the incorrect fold.

Differential Revision: https://reviews.llvm.org/D85684
2020-08-11 18:39:24 +02:00
Eric Christopher
0cfc3980c2 Fold Opcode into assert uses to fix an unused variable warning without asserts. 2020-08-11 09:30:51 -07:00
Xing GUO
774d3cafca [DWARFYAML] Teach yaml2obj emit the correct line table program.
The following issues are addressed in this patch.

1. The operands of DW_LNE_set_discriminator should be an ULEB128 number
   rather than an address.
2. Test the emitted opcodes.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D85717
2020-08-12 00:18:54 +08:00
Simon Pilgrim
16e7bf9043 [X86][SSE] combineShuffleWithHorizOp - avoid unnecessary subtraction. NFCI.
We can safely replace ((M - NumElts) % NumEltsPerLane) with (M % NumEltsPerLane) as the modulo result will be the same.
2020-08-11 17:07:32 +01:00
Matt Arsenault
3333ddf27a AMDGPU/GlobalISel: Manually select llvm.amdgcn.writelane
Fixup the special case constant bus handling pre-gfx10.
2020-08-11 11:56:16 -04:00
Whitney Tsang
2b7d760be9 [NFC][LoopUnrollAndJam] Use BasicBlock::replacePhiUsesWith instead of
static function updatePHIBlocks.

Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D85673
2020-08-11 15:35:14 +00:00
Jay Foad
928c1dd7ef [GlobalISel] Add G_ABS
This is equivalent to the new llvm.abs intrinsic added by D84125 with
is_int_min_poison=0.

Differential Revision: https://reviews.llvm.org/D85718
2020-08-11 16:34:37 +01:00
Sanjay Patel
5b7d18ac79 [InstSimplify] fold min/max with matching min/max operands
I think this is the last remaining translation of an existing
instcombine transform for the corresponding cmp+sel idiom.

This interpretation is more general though - we can remove
mismatched signed/unsigned combinations in addition to the
more obvious cases.

min/max(X, Y) must produce X or Y as the result, so this is
just another clause in the existing transform that was already
matching a min/max of min/max.
2020-08-11 11:23:15 -04:00
Sanjay Patel
66663f8432 [InstSimplify] add tests for min/max intrinsics with common operands; NFC
There are 4*4*4 = 64 variations. We currently handle some, but not all,
of the alternative patterns with cmp+sel in instcombine.
2020-08-11 11:23:15 -04:00
Sanjay Patel
48886146f5 [InstCombine] add tests for pointer casts with insertelement; NFC 2020-08-11 11:23:15 -04:00
Simon Pilgrim
77924cfcc9 [X86][SSE] Add HADD/SUB support to combineHorizOpWithShuffle
Handles some HOP(SHUFFLE,SHUFFLE) patterns and sets us up to improve some of the cases mentioned in PR41813.
2020-08-11 16:14:14 +01:00
Matt Arsenault
462335211d AMDGPU/GlobalISel: Prepare for more custom load lowerings
Slight restructuring of the code to avoid formatting changes when more
cases are handled here.
2020-08-11 11:09:05 -04:00
Matt Arsenault
eadb6d5dac AMDGPU/GlobalISel: Fix test bugs and add a few more cases
The wrong alignment or addrspace was used. Also add various cases to
stress a future patch.
2020-08-11 11:09:05 -04:00
Fangrui Song
367b809d42 [split-file] Fix sys::fs::remove() on Solaris after D83834
where stdio.h ::remove() may set errno to EEXIST instead of ENOTEMPTY.

POSIX.1-2017 allows EEXIST for unlink() (which is called by remove()):

> [EEXIST] or [ENOTEMPTY]
> The flag parameter has the AT_REMOVEDIR bit set and the path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.

Reviewed By: ro

Differential Revision: https://reviews.llvm.org/D85690
2020-08-11 08:05:10 -07:00
David Stenberg
9857b3e63f [DebugInfo] Allow GNU macro extension to be emitted
Allow the GNU .debug_macro extension to be emitted for DWARF versions
earlier than 5. The extension is basically what became DWARF 5's format,
except that a DW_AT_GNU_macros attribute is emitted, and some entries
like the strx entries are missing. In this patch I emit GNU's indirect
entries, which are the same as DWARF 5's strp entries.

This patch adds the extension behind a hidden LLVM flag,
-use-gnu-debug-macro. I would later want to enable it by default when
tuning for GDB and targeting DWARF versions earlier than 5.

The size of a Clang 8.0 binary built with RelWithDebInfo and the flags
"-gdwarf-4 -fdebug-macro" reduces from 1533 MB to 1349 MB with
.debug_macro (compared to 1296 MB without -fdebug-macro).

Reviewed By: SouraVX, dblaikie

Differential Revision: https://reviews.llvm.org/D82975
2020-08-11 17:00:25 +02:00
David Stenberg
9a1cd64d35 [DebugInfo] Simplify DwarfDebug::emitMacro
Broken out from a review comment on D82975. This is an NFC expect for
that the Macinfo macro string is now emitted using a single emitBytes()
invocation, so it can be done using a single string directive.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D83557
2020-08-11 17:00:25 +02:00
Benjamin Kramer
783c3b3ec3 [GlobalISel] Remove unused variable. NFC. 2020-08-11 16:56:45 +02:00
Xing GUO
6392103bc7 [DWARFYAML] Let the address size of line tables inferred from the object file.
Currently, the line table uses the first compilation unit's address size
as its address size. It's not the right behavior. The address size should be
inferred from the target machine.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D85707
2020-08-11 22:45:55 +08:00
Valentin Clement
402fcd0af2 [flang][directives] Use TableGen information for clause classes in parse-tree
This patch takes advantage of the directive information and tablegen generation
to replace the clauses class parse tree and in the dump parse tree sections.

Reviewed By: sscalpone

Differential Revision: https://reviews.llvm.org/D85549
2020-08-11 10:44:14 -04:00
Matt Arsenault
674304dfb1 GlobalISel: Implement bitcast action for G_INSERT_VECTOR_ELT
This mirrors the support for the equivalent extracts. This also
creates a huge mess that would be greatly improved if we had any bit
operation combines.
2020-08-11 10:39:14 -04:00
Dinar Temirbulatov
120cdeb9a9 [NFC] Guard the cost report block of debug outputs with NDEBUG and
switch to SmallString, this is part of D57779.
2020-08-11 16:34:47 +02:00
Matt Arsenault
c9ab6823ab TableGen/GlobalISel: Hack the operand order for atomic_store
ISD::ATOMIC_STORE arbitrarily has the operands in the opposite order
from regular ISD::STORE, which always introduced an annoying
duplication of patterns to handle both cases. Since in GlobalISel
there's just the one G_STORE, we need to swap the operands to
correctly emit the type check for the pointer operand.

Some work started in 20aafa31569b5157e792daa8860d71dd0df8a53a to
migrate SelectionDAG to use ISD::STORE for atomics, but that work
seems to have stalled. Since this is the pretty much the last
operation which matters which isn't supported for AMDGPU, use this
compatibility hack to unblock declaring it functionally complete.

Not sure what's going on with the pending_phis AArch64 test. It seems
it didn't always use atomics, and I'm not sure what it was originally
testing matters anymore.
2020-08-11 10:22:44 -04:00
Sam Parker
e6a76709fd [NFC][ARM][SimplifyCFG] Add some tests.
Add some tests around thresholds and minsize.
2020-08-11 15:13:58 +01:00
clementval
2623773dd2 Revert "[flang][directives] Use TableGen information for clause classes in parse-tree"
This reverts commit bf93edc4758b512e84b70ec6335d15b0cf386a18.

Buildbot failure
2020-08-11 09:54:04 -04:00
Georgii Rymar
9d31094c7b [llvm-readobj/elf] - Remove unwrapOrError calls from DumpStyle<ELFT>::printRelocationsHelper.
It removes all `unwrapOrError` calls except the first one, which
is is bit different and can be removed separately.

Differential revision: https://reviews.llvm.org/D85303
2020-08-11 16:49:37 +03:00
Georgii Rymar
ee3ce7d78d [llvm-readobj][test] - Rename gnu-phdrs.test to program-headers.test, NFCI.
program-headers.test was merged to gnu-phdrs.test and removed in D85526.
Now, gnu-phdrs.test contains tests for both GNU and LLVM style.

It was decided that this renaming should be done separately for a better
commit history and diffing purposes.
2020-08-11 16:46:05 +03:00
Valentin Clement
72a67d9950 [flang][directives] Use TableGen information for clause classes in parse-tree
This patch takes advantage of the directive information and tablegen generation
to replace the clauses class parse tree and in the dump parse tree sections.

Reviewed By: sscalpone

Differential Revision: https://reviews.llvm.org/D85549
2020-08-11 09:43:11 -04:00
Georgii Rymar
7f988db9cf [llvm-readobj] - Refine program headers testing (-l, --program-headers and --segment).
We have `gnu-phdrs.test` that tests
`-l`, `--program-headers` and `--segment` options for `llvm-readelf`.

We also have:
1) `program-headers.test` that tests `--program-headers` and `-l`
   for `llvm-readobj`. It doesn't test `--segment` and also uses
   lots of precompiled objects. It is very incomplete in compare
   with the `gnu-phdrs.test`.

2) `pt-gnu-property.test` that contains a simple test for the
   `PT_GNU_PROPERTY` segment. There is no reason to have it in
   a separate file.

This patch:
1) Merges `program-headers.test` and `pt-gnu-property.test` to `gnu-phdrs.test`.
2) Removes 2 precompiled binaries used by `program-headers.test`
   (other ones are still used by another tests).

Differential revision: https://reviews.llvm.org/D85526
2020-08-11 16:38:11 +03:00
Sjoerd Meijer
f5867de94e [ARM][MVE] Added extra tail-predication runs for auto-correlation test case. NFC 2020-08-11 14:33:41 +01:00
Pavel Labath
336dae54b1 [cmake] Make gtest macro definitions a part the library interface
These definitions are needed by any file which uses gtest. Previously we
were adding them in the add_unittest function, but over time we've
accumulated libraries (which don't go through add_unittest) building on
gtest and this has resulted in proliferation of the definitions.

Making this a part of the library interface enables them to be managed
centrally. This follows a patch for -Wno-suggest-override (D84554) which
took a similar approach.

Differential Revision: https://reviews.llvm.org/D84748
2020-08-11 15:22:44 +02:00
Simon Pilgrim
ad368223b7 [X86][SSE] Add tests for 256-bit HOP(SHUFFLE(X,Y),SHUFFLE(X,Y)) --> SHUFFLE(HOP(X,Y)) patterns
This should be addressed by combineHorizOpWithShuffle once we enable it for HADD/SUB
2020-08-11 14:02:01 +01:00
Simon Pilgrim
b9bf36c26b [X86][SSE] Add tests for HOP(LOSUBVECTOR(SHUFFLE(X)),HISUBVECTOR(SHUFFLE(X))) patterns
This should be addressed by combineHorizOpWithShuffle once we enable it for HADD/SUB
2020-08-11 14:02:01 +01:00
Florian Hahn
fc2f262900 [SCEV] ] If RHS >= Start, simplify (Start smax RHS) to RHS for trip counts.
This is the max version of D85046.

This change causes binary changes in 44 out of 237 benchmarks (out of
MultiSource/SPEC2000/SPEC2006)

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D85189
2020-08-11 13:20:24 +01:00
Kerry McLaughlin
a9073b6100 [SVE][CodeGen] Legalisation of INSERT_VECTOR_ELT for scalable vectors
When the result type of insertelement needs to be split,
SplitVecRes_INSERT_VECTOR_ELT will try to store the vector to a
stack temporary, store the element at the location of the stack
temporary plus the index, and reload the Lo/Hi parts.

This patch does the following to ensure this works for scalable vectors:
 - Sets the StackID with getStackIDForScalableVectors() in CreateStackTemporary
 - Adds an IsScalable flag to getMemBasePlusOffset() and scales the
    offset by VScale when this is true
 - Ensures the immediate is clamped correctly by clampDynamicVectorIndex
    so that we don't try to use an out of range index

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D84874
2020-08-11 12:57:28 +01:00
David Stenberg
331775f51f [DebugInfo] Allow GNU macro extension to be read
Allow the GNU .debug_macro extension to be parsed and printed by
llvm-dwarfdump. In an upcoming patch support will be added for emitting
that format also.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82974
2020-08-11 13:30:52 +02:00
David Stenberg
9fb94de7cb [DebugInfo] Introduce GNU macro extension entry encodings
This is a preparatory patch for allowing the GNU .debug_macro extension,
which is a precursor to the DWARF 5 format, to be emitted by LLVM for
earlier DWARF versions.

The entries share the same encoding and behavior as in DWARF5; there are
just more entries in the DWARF 5 format. Therefore, we could have used
those existing DWARF 5 entries, but I think that explicitly referring to
the GNU macro variants makes the code more clear.

The defines that this patch introduces can be found in GCC in the dwarf2.h header:
  https://gcc.gnu.org/git/?p=gcc.git;a=blob;
  f=include/dwarf2.h;
  h=0b6facfd4cf4c02320c7328114231b128ab42d5e;
  hb=dccbf1e2a6e544f71b4a5795f0c79015db019fc3#l425

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82972
2020-08-11 13:30:52 +02:00
David Stenberg
b7e32254c6 [DebugInfo] Refactor .debug_macro checks. NFCI
Move the Dwarf version checks that determine if the .debug_macro section
should be emitted, into a DwarfDebug member. This is a preparatory
refactoring for allowing the GNU .debug_macro extension, which is a
precursor to the DWARF 5 format, to be emitted by LLVM for earlier DWARF
versions.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82971
2020-08-11 13:30:52 +02:00
Benjamin Kramer
5279174413 [AutoUpgrade] Simplify code
No need to set the name on an instruction that's going away, just move
it from the old instruction to the new one.
2020-08-11 13:22:58 +02:00
Kerry McLaughlin
76e22108d4 [CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize
Changes the Offset arguments to both functions from int64_t to TypeSize
& updates all uses of the functions to create the offset using TypeSize::Fixed()

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85220
2020-08-11 12:17:10 +01:00
Benjamin Kramer
e8a9b5e671 [X86][FPEnv] Fix a use after free
Found by asan!
2020-08-11 13:00:47 +02:00
Kazushi (Jam) Marukawa
9a6359070d [VE] Update bit operations
Change bitreverse/bswap/ctlz/ctpop/cttz regression tests to support i128
and signext/zeroext i32 types.  This patch also change the way to support
i32 types using 64 bits VE instructions.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D85712
2020-08-11 19:42:12 +09:00
Paul Walker
24ea55d3d7 [SVE] Add ISD nodes for predicated integer extend inreg operations.
These are useful instructions when lowering fixed length vector
extends, so I've broken this patch out as kind of NFC like work.

Differential Revision: https://reviews.llvm.org/D85546
2020-08-11 11:39:26 +01:00
Simon Pilgrim
50301acce9 [X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.
The plan is to use this for (F)HADD/SUB opcodes as well as PACKs - similar to how we use combineShuffleWithHorizOp
2020-08-11 11:38:43 +01:00
Paul Walker
04aa37ecb2 [SVE] Lower fixed length vector integer subtract operations.
Differential Revision: https://reviews.llvm.org/D85665
2020-08-11 11:32:12 +01:00
David Zarzycki
6dee907db3 Add missing -o - to a recent test
Caught with a build-system that remounts the source directory read-only.
2020-08-11 06:00:11 -04:00
Kai Nacke
3dba5d6f3f [NFC] Fix typo in comment.
Twelvth -> Twelfth
2020-08-11 05:27:56 -04:00