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

8305 Commits

Author SHA1 Message Date
Fangrui Song
491409978c [X86][Disassembler] Shrink X86GenDisassemblerTables.inc from 36M to 6.1M
In x86Disassembler{OneByte,TwoByte,...}Codes,
"/* EmptyTable */" is very common. Omitting it saves lots of space.
Also, there is no need to display a table entry in multiple lines.

It is also common that the whole OpcodeDecision is { MODRM_ONEENTRY, 0}.
Make use of zero-initialization.
2020-01-11 17:28:22 -08:00
Vedant Kumar
ac509eb162 [AArch64] Add isAuthenticated predicate to MCInstDesc
Add a predicate to MCInstDesc that allows tools to determine whether an
instruction authenticates a pointer. This can be used by diagnostic
tools to hint at pointer authentication failures.

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

rdar://55089604
2020-01-10 14:30:52 -08:00
LLVM GN Syncbot
9006ca778d [gn build] Port 5e7beb0a414 2020-01-10 17:10:25 +00:00
Matt Arsenault
63db126603 TableGen/GlobalISel: Fix pattern matching of immarg literals
For arguments that are not expected to be materialized with
G_CONSTANT, this was emitting predicates which could never match. It
was first adding a meaningless LLT check, which would always fail due
to the operand not being a register.

Infer the cases where a literal should check for an immediate operand,
instead of a register This avoids needing to invent a special way of
representing timm literal values.

Also handle immediate arguments in GIM_CheckLiteralInt. The comments
stated it handled isImm() and isCImm(), but that wasn't really true.

This unblocks work on the selection of all of the complicated AMDGPU
intrinsics in future commits.
2020-01-09 17:37:52 -05:00
Matt Arsenault
5dd6dcdb6a TableGen/GlobalISel: Add way for SDNodeXForm to work on timm
The current implementation assumes there is an instruction associated
with the transform, but this is not the case for
timm/TargetConstant/immarg values. These transforms should directly
operate on a specific MachineOperand in the source
instruction. TableGen would assert if you attempted to define an
equivalent GISDNodeXFormEquiv using timm when it failed to find the
instruction matcher.

Specially recognize SDNodeXForms on timm, and pass the operand index
to the render function.

Ideally this would be a separate render function type that looks like
void renderFoo(MachineInstrBuilder, const MachineOperand&), but this
proved to be somewhat mechanically painful. Add an optional operand
index which will only be passed if the transform should only look at
the one source operand.

Theoretically it would also be possible to only ever pass the
MachineOperand, and the existing renderers would check the parent. I
think that would be somewhat ugly for the standard usage which may
want to inspect other operands, and I also think MachineOperand should
eventually not carry a pointer to the parent instruction.

Use it in one sample pattern. This isn't a great example, since the
transform exists to satisfy DAG type constraints. This could also be
avoided by just changing the MachineInstr's arbitrary choice of
operand type from i16 to i32. Other patterns have nontrivial uses, but
this serves as the simplest example.

One flaw this still has is if you try to use an SDNodeXForm defined
for imm, but the source pattern uses timm, you still see the "Failed
to lookup instruction" assert. However, there is now a way to avoid
it.
2020-01-09 17:37:52 -05:00
Christian Sigg
7d07ffb8d4 Add gdb pretty printer for MutableArrayRef, remove ConstArrayRef.
Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72136
2020-01-09 22:43:45 +01:00
Matt Arsenault
227ab1989f TableGen/GlobalISel: Address fixme
Don't call computeAvailableFunctionFeatures for every instruction.
2020-01-09 16:29:44 -05:00
Eric Astor
7c852db413 [ms] [X86] Use "P" modifier on all branch-target operands in inline X86 assembly.
Summary:
Extend D71677 to apply to all branch-target operands, rather than special-casing call instructions.

Also add a regression test for llvm.org/PR44272, since this finishes fixing it.

Reviewers: thakis, rnk

Reviewed By: thakis

Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72417
2020-01-09 14:55:03 -05:00
Matt Arsenault
34322b1974 TableGen: Remove unused code 2020-01-09 10:32:57 -05:00
Matt Arsenault
e24094cacc TableGen/GlobalISel: Fix slightly wrong generated comment 2020-01-09 10:29:31 -05:00
LLVM GN Syncbot
4861c0838e [gn build] Port 346f6b54bd1 2020-01-08 13:43:29 +00:00
Nico Weber
4710b1b396 [gn build] (manually) merge 1cf11a4c67a15 2020-01-08 07:44:33 -05:00
Daniel Sanders
518303cb4e Fix warnings as errors that occur on sanitizer-x86_64-linux 2020-01-07 16:02:31 -08:00
Bill Wendling
c185d37c5e Remove extraneous semicolon. 2020-01-07 12:49:09 -08:00
LLVM GN Syncbot
f330417d5f [gn build] Port 1d94fb21118 2020-01-07 19:13:41 +00:00
Daniel Sanders
728c2ac3b1 [gicombiner] Add GIMatchTree and use it for the code generation
Summary:
GIMatchTree's job is to build a decision tree by zipping all the
GIMatchDag's together.

Each DAG is added to the tree builder as a leaf and partitioners are used
to subdivide each node until there are no more partitioners to apply. At
this point, the code generator is responsible for testing any untested
predicates and following any unvisited traversals (there shouldn't be any
of the latter as the getVRegDef partitioner handles them all).

Note that the leaves don't always fit into partitions cleanly and the
partitions may overlap as a result. This is resolved by cloning the leaf
into every partition it belongs to. One example of this is a rule that can
match one of N opcodes. The leaf for this rule would end up in N partitions
when processed by the opcode partitioner. A similar example is the
getVRegDef partitioner where having rules (add $a, $b), and (add ($a, $b), $c)
will result in the former being in the partition for successfully
following the vreg-def and failing to do so as it doesn't care which
happens.

Depends on D69151

Fixed the issues with the windows bots which were caused by stdout/stderr
interleaving.

Reviewers: bogner, volkan

Reviewed By: volkan

Subscribers: lkail, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69152
2020-01-07 11:12:53 -08:00
LLVM GN Syncbot
6bd74663bc [gn build] Port c69ae835d0e 2020-01-07 11:41:46 +00:00
Fangrui Song
0523ceb321 [MC] Add parameter Address to MCInstrPrinter::printInstruction
Follow-up of D72172.

Reviewed By: jhenderson, rnk

Differential Revision: https://reviews.llvm.org/D72180
2020-01-06 20:44:14 -08:00
Matt Arsenault
8defb1c20e TableGen/GlobalISel: Handle default operands that are used
Copy the logic from the existing handling in the DAG matcher emittter.

This will enable some AMDGPU pattern cleanups without breaking
GlobalISel tests, and eventually handle importing more patterns.

The test is a bit annoying since the sections seem to randomly sort
themselves if anything else is added in the future.
2020-01-06 18:26:42 -05:00
Nico Weber
8b63012d97 Make check-llvm run 50% faster on macOS, 18% faster on Windows.
While looking at cycle time graphs of some of my bots, I noticed
that 327894859cc made check-llvm noticeably slower on macOS and
Windows.

As it turns out, the 5 substitutions added in that change were
enough to cause lit to thrash the build-in cache in re.compile()
(re.sub() is implemented as re.compile().sub()), and apparently
applySubstitutions() is on the cricital path and slow when all
regexes need to compile all the time.

(See `_MAXCACHE = 512` in cpython/Lib/re.py)

Supporting full regexes for lit substitutions seems a bit like
overkill, but for now add a simple unbounded cache to recover
the lost performance.

No intended behavior change.
2020-01-06 12:57:42 -05:00
LLVM GN Syncbot
bc9205ef6b [gn build] Port 350da402ef6 2020-01-06 17:22:13 +00:00
James Henderson
91705af363 [NFC] Fix trivial typos in comments
Reviewed By: jhenderson

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

Patch by Kazuaki Ishizaki.
2020-01-06 10:50:26 +00:00
LLVM GN Syncbot
cd053d774f [gn build] Port 5d304d68dd5 2020-01-04 02:17:36 +00:00
Daniel Sanders
c661517808 Revert "[gicombiner] Add GIMatchTree and use it for the code generation"
All the windows bots are failing match-tree.td and there's no obvious cause that
I can see. It's not just the %p formatting problem. My best guess is that
there's an ordering issue too but I'll need further information to figure that
out. Revert while I'm investigating.

This reverts commit 64f1bb5cd2c6d69af7c74ec68840029603560238 and 77d4b5f5feff663e70b347516cc4c77fa5cd2a20
2020-01-03 18:17:00 -08:00
LLVM GN Syncbot
7a55410502 [gn build] Port 64f1bb5cd2c 2020-01-04 00:24:04 +00:00
Daniel Sanders
6d286aba49 [gicombiner] Add GIMatchTree and use it for the code generation
Summary:
GIMatchTree's job is to build a decision tree by zipping all the
GIMatchDag's together.

Each DAG is added to the tree builder as a leaf and partitioners are used
to subdivide each node until there are no more partitioners to apply. At
this point, the code generator is responsible for testing any untested
predicates and following any unvisited traversals (there shouldn't be any
of the latter as the getVRegDef partitioner handles them all).

Note that the leaves don't always fit into partitions cleanly and the
partitions may overlap as a result. This is resolved by cloning the leaf
into every partition it belongs to. One example of this is a rule that can
match one of N opcodes. The leaf for this rule would end up in N partitions
when processed by the opcode partitioner. A similar example is the
getVRegDef partitioner where having rules (add $a, $b), and (add ($a, $b), $c)
will result in the former being in the partition for successfully
following the vreg-def and failing to do so as it doesn't care which
happens.

Depends on D69151

Reviewers: bogner, volkan

Reviewed By: volkan

Subscribers: lkail, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69152
2020-01-03 16:23:23 -08:00
Daniel Sanders
441ea1d372 [globalisel] Fix another mismatch between %d and the RuleID type 2020-01-03 13:36:24 -08:00
LLVM GN Syncbot
fbe666414f [gn build] Port 9861a8538c0 2020-01-03 20:30:09 +00:00
LLVM GN Syncbot
bcb65cb41c [gn build] Port cf48101200e 2020-01-03 19:41:47 +00:00
Nico Weber
07a1a25723 Reland "[gn build] (manually) merge 68a235d07f9e70"
This reverts commit 70342641b3c064b1cdf90d16902b937e7a21ecf2.

68a235d relanded in abb00753069, so this relands the gn port of it.
2020-01-02 14:39:17 -05:00
Nico Weber
2e2f2e4aa5 Make mangled_names.test and update_cc_test_checks.py work with Python 2.
Differential Revision: https://reviews.llvm.org/D71565
2020-01-02 13:45:39 -05:00
Nico Weber
f496752901 [gn build] (manually) merge 24ab9b537e61b3 yet more, to fix redef warnings 2020-01-02 12:22:04 -05:00
James Y Knight
c5ea5f2943 update_test_checks: match CHECK-EMPTY lines for replacement.
In a8a89c77ea3c16b45763fca6940bbfd3bef7884f, the script started adding
CHECK-EMPTY lines, but the regex for which lines to replace was not
updated.
2020-01-02 12:17:37 -05:00
Nico Weber
613f70cda6 [gn build] (manually) merge 24ab9b537e61b3 more 2020-01-02 11:44:34 -05:00
Nico Weber
9e84066c71 Revert "[gn build] (manually) merge 68a235d07f9e70"
This reverts commit 6ff6d32ebfec3150aa462cd31042b5719edb84da,
because 68a235d07f9e70 was reverted in e406cca5f9.
2020-01-02 11:07:31 -05:00
Nico Weber
f48681862d [gn build] (manually) merge 24ab9b537e61b3 2020-01-02 11:06:32 -05:00
serge_sans_paille
d4f51b5c4f Generalize the pass registration mechanism used by Polly to any third-party tool
There's quite a lot of references to Polly in the LLVM CMake codebase. However
the registration pattern used by Polly could be useful to other external
projects: thanks to that mechanism it would be possible to develop LLVM
extension without touching the LLVM code base.

This patch has two effects:

1. Remove all code specific to Polly in the llvm/clang codebase, replaicing it
   with a generic mechanism

2. Provide a generic mechanism to register compiler extensions.

A compiler extension is similar to a pass plugin, with the notable difference
that the compiler extension can be configured to be built dynamically (like
plugins) or statically (like regular passes).

As a result, people willing to add extra passes to clang/opt can do it using a
separate code repo, but still have their pass be linked in clang/opt as built-in
passes.

Differential Revision: https://reviews.llvm.org/D61446
2020-01-02 16:45:31 +01:00
Nico Weber
c6c87c4c69 [gn build] (manually) merge 68a235d07f9e70 2020-01-01 22:06:48 -05:00
Johannes Doerfert
d2f438d283 [Utils] Deal with occasionally deleted functions
When functions exist for some but not all run lines we need to be
careful when selecting the prefix. So far, a common prefix was
potentially chosen as there was never a "conflict" that would have
caused otherwise. With this patch we avoid common prefixes if they
are used by run lines that do not emit the function.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D68850
2019-12-31 02:35:18 -06:00
Johannes Doerfert
5396197fa0 [Utils] Reuse argument variable names in the body
If we have `int foo(int a) { return a; }` and we run with --function-signature
enabled, we want a single variable declaration for `a` which is reused
later.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D69722
2019-12-31 01:58:36 -06:00
Johannes Doerfert
ab978d2cdd [Utils] Allow update_test_checks to scrub attribute annotations
Attribute annotations on calls, e.g., #0, are not useful on their own.
This patch adds a flag to update_test_checks.py to scrub them.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D68851
2019-12-31 01:51:22 -06:00
Matt Arsenault
295d2fea14 TableGen: Fix assert on PatFrags with predicate code
This assumed a single pattern if there was a predicate. Relax this a
bit, and allow multiple patterns as long as they have the same class.

This was only broken for the DAG path. GlobalISel seems to have
handled this correctly already.
2019-12-30 14:24:25 -05:00
Fangrui Song
095a185e70 [Intrinsic] Delete tablegen rules of llvm.{sig,}{setjmp,longjmp} 2019-12-27 18:04:39 -08:00
LLVM GN Syncbot
acbeb21b76 [gn build] Port eca40066ebb 2019-12-23 13:55:08 +00:00
Kristof Beyls
32e21be127 [find_interesting_reviews.py] Add git blame output cache
The majority of the running time of this script tends to be spent in
running git blame on source files touched by patches under review.

By introducing a git blame output cache, some of the git blame commands
don't have to re-run, and the blame information can be retrieved from a
cache.

I've observed that in a typical run matching patches available for
review with potential reviewers, this speeds up the script's running
time by a factor of about 2.5x.
2019-12-23 12:08:16 +00:00
Mark de Wever
fe7ca9d333 [TableGen] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D71807
2019-12-22 18:58:32 +01:00
LLVM GN Syncbot
4e17d93dee [gn build] Port 7376d9eb389 2019-12-22 02:15:02 +00:00
Nico Weber
587ab43da0 [gn build] fixup after c3d13d9c56 2019-12-21 21:14:26 -05:00
Nico Weber
1361644edc [gn build] fold Basic:version into Basic
This now defines HAVE_VCS_VERSION_INC for all files in Basic,
but now the BUILD.gn file has only a single "sources" field again,
and the automerger requires that. Having the automerger work for
clang/lib/Basic is a very nice to have, and the downside seems tiny.
2019-12-21 21:10:02 -05:00
Peter Collingbourne
bb2d372edc gn build: Silence mismatched-new-delete warning in scudo C++ wrapper tests.
These tests are deliberately mismatching new and delete, so the warnings
are just noise.

Differential Revision: https://reviews.llvm.org/D71783
2019-12-20 16:53:13 -08:00