Commit Graph

8283 Commits

Author SHA1 Message Date
LLVM GN Syncbot 0f1e7993e9 [gn build] Port 5d304d68dd 2020-01-04 02:17:36 +00:00
Daniel Sanders 5d304d68dd 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 64f1bb5cd2 and 77d4b5f5fe
2020-01-03 18:17:00 -08:00
LLVM GN Syncbot a61a6323dd [gn build] Port 64f1bb5cd2 2020-01-04 00:24:04 +00:00
Daniel Sanders 64f1bb5cd2 [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 1dbc486457 [globalisel] Fix another mismatch between %d and the RuleID type 2020-01-03 13:36:24 -08:00
LLVM GN Syncbot a308cc6b82 [gn build] Port 9861a8538c 2020-01-03 20:30:09 +00:00
LLVM GN Syncbot 264637f0b8 [gn build] Port cf48101200 2020-01-03 19:41:47 +00:00
Nico Weber 94d4ca9004 Reland "[gn build] (manually) merge 68a235d07f9e70"
This reverts commit 70342641b3.

68a235d relanded in abb0075306, so this relands the gn port of it.
2020-01-02 14:39:17 -05:00
Nico Weber 9d49e5c087 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 31210d1a32 [gn build] (manually) merge 24ab9b537e yet more, to fix redef warnings 2020-01-02 12:22:04 -05:00
James Y Knight b747607bec update_test_checks: match CHECK-EMPTY lines for replacement.
In a8a89c77ea, 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 437f9ec140 [gn build] (manually) merge 24ab9b537e more 2020-01-02 11:44:34 -05:00
Nico Weber 70342641b3 Revert "[gn build] (manually) merge 68a235d07f9e70"
This reverts commit 6ff6d32ebf,
because 68a235d07f was reverted in e406cca5f9.
2020-01-02 11:07:31 -05:00
Nico Weber 3f7ead3369 [gn build] (manually) merge 24ab9b537e 2020-01-02 11:06:32 -05:00
serge_sans_paille 24ab9b537e 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 6ff6d32ebf [gn build] (manually) merge 68a235d07f 2020-01-01 22:06:48 -05:00
Johannes Doerfert a6c59e0792 [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 be26bd5513 [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 70771d8b9e [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 94d08feaef 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 f7910496c8 [Intrinsic] Delete tablegen rules of llvm.{sig,}{setjmp,longjmp} 2019-12-27 18:04:39 -08:00
LLVM GN Syncbot d105ea26e8 [gn build] Port eca40066eb 2019-12-23 13:55:08 +00:00
Kristof Beyls 5bd9eee53d [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 e8d448ec25 [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 0fe131aebb [gn build] Port 7376d9eb38 2019-12-22 02:15:02 +00:00
Nico Weber 541a342742 [gn build] fixup after c3d13d9c56 2019-12-21 21:14:26 -05:00
Nico Weber c3d13d9c56 [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 71b26f1d19 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
LLVM GN Syncbot 226a014044 [gn build] Port 82923c71ef 2019-12-20 20:35:49 +00:00
David Spickett 0ca9d2fd39 Re-land "[cmake] Add dependency on llvm-dwarfdump to llvm-locstats"
This reverts commit f8e2ab3cd3.
2019-12-20 09:11:07 +00:00
Jessica Paquette dcaaede1e5 [lit] Add "from .main import main" back into lit/__init__.py
A refactoring commit (cf252240) removed this line. Removing it broke installing
lit with pip and setup.py.

This adds the line back in so that we can install lit again.

For an example of how this appeared, see:

http://green.lab.llvm.org/green/job/LNT_Tests/5853/

File "/Users/buildslave/jenkins/...s/__init__.py", line 2453, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'main'
2019-12-19 16:09:27 -08:00
LLVM GN Syncbot 50c3bd9e71 [gn build] Port 3075cd5c9f 2019-12-19 21:33:15 +00:00
David Spickett f8e2ab3cd3 Revert "[cmake] Add dependency on llvm-dwarfdump to llvm-locstats"
This reverts commit ba430f5032.
Which appears to have caused a failure on the lld-x86_64-ubuntu-fast
buildbot.
2019-12-19 17:15:33 +00:00
David Spickett ba430f5032 [cmake] Add dependency on llvm-dwarfdump to llvm-locstats
Though llvm-locstat is a "util" it requires llvm-dwarfdump
to be useful. So what happens now is that unless LLVM_BUILD_TOOLS
is ON llvm-locstats won't be part of the "all" target.

However given that it requires llvm-dwarfdump, this is less
confusing/build time consuming than suddenly having llvm-dwarfdump
build when all other tools are disabled.

Differential Revision: https://reviews.llvm.org/D71705
2019-12-19 16:36:14 +00:00
LLVM GN Syncbot b94aeabfae [gn build] Port abc7f6800d 2019-12-19 12:43:20 +00:00
David Spickett 119cd70322 [cmake] Include the llvm-locstats target when
utils and tools are not being built.

This was uncovered by: https://reviews.llvm.org/D71611
Which added llvm-locstats to the test dependencies.

Previously the build target was only added if you
were building tools. This meant that you couldn't
configure at all if you had LLVM_BUILD_TOOLS=OFF.

Differential revision: https://reviews.llvm.org/D71695
2019-12-19 10:44:34 +00:00
Mehdi Amini 400083f21e [gn build] Update console print to match the commit message (NFC) 2019-12-18 16:12:19 -05:00
Mehdi Amini 6fd972624c Tweak commit message for auto update of gn build script
Use `[tag]` as a prefix and "port" instead of "merge" to
avoid confusing with "git merge".
2019-12-18 15:57:24 -05:00
LLVM GN Syncbot 4765dc726b gn build: Merge 9883d7edc6 2019-12-18 16:00:24 +00:00
Daniel Sanders 3a779b7dfd [globalisel] Small correction to the fixup in 0a0813962d. The two ID's are not the same size
The rule ID is a uint64_t as it has global scope but the UID is scoped to
the rule and expected to be much smaller so it's only unsigned.
2019-12-18 14:56:23 +00:00
Daniel Sanders c3cb089a87 [gicombiner] Import tryCombineIndexedLoadStore()
Summary:
Now that arbitrary data is supported, import tryCombineIndexedLoadStore()

Depends on D69147

Reviewers: bogner, volkan

Reviewed By: volkan

Subscribers: hiraditya, arphaman, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69151
2019-12-18 14:41:38 +00:00
Daniel Sanders 0a0813962d [globalisel] Attempt to fix ARM bots that emit the correct number in the wrong place 2019-12-18 14:15:11 +00:00
Daniel Sanders 55c57408b0 [gicombiner] Add support for arbitrary match data being passed from match to apply
Summary:
This is used by the extending_loads combine to tell the apply step which
use is the preferred one to fold and the other uses should be re-written
to consume.

Depends on D69117

Reviewers: volkan, bogner

Reviewed By: volkan

Subscribers: hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69147
2019-12-18 12:27:29 +00:00
LLVM GN Syncbot bad6a76041 gn build: Merge 7ea2e5195a 2019-12-18 11:37:45 +00:00
Daniel Sanders 7ea2e5195a Revert "Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input""
This reverts commit e62e760f29.

The issue @uweigand raised should have been fixed by iterating over the
vector that owns the operand list data instead of the FoldingSet.

The MSVC issue raised by @thakis should have been fixed by relaxing the
regexes a little. I don't have a Windows machine available to test that so
I tested it by using `perl -p -e 's/0x([0-9a-f]+)/\U\1\E/g' to convert the
output of %p to the windows style.

I've guessed at the issue @phosek raised as there wasn't enough information
to investigate it. What I think is happening on that bot is the -debug
option isn't available because the second stage build is a release build.
I'm not sure why other release-mode bots didn't report it though.
2019-12-18 11:37:12 +00:00
LLVM GN Syncbot 2f45693030 gn build: Merge 1ad15046dc 2019-12-18 11:25:51 +00:00
LLVM GN Syncbot 758825c5b8 gn build: Merge e62e760f29 2019-12-18 00:29:06 +00:00
Eric Christopher e62e760f29 Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input"
and follow-on patches.

This is breaking a few build bots and local builds with follow-up already
on the patch thread.

This reverts commits 390c8baa54 and
520e3d66e7.
2019-12-17 16:23:29 -08:00
Nemanja Ivanovic ba5a00167b Fix buildbot failures after removing REQUIRES-ANY
It would appear that the removal of this lit feature was incomplete
and there is a test case that still tests for this. This patch removes
the remaining tests to bring the bots back to green. I would encourage the
author to do a post-commit review on this in case there is a more desirable fix.
2019-12-17 15:27:45 -06:00
Daniel Sanders 520e3d66e7 [gicombiner] Process the MatchDag such that every node is reachable from the roots
Summary:
When we build the walk across these DAG's we need to be able to reach every node
from the roots. Flip and traversal edges (so that use->def becomes def->uses)
that make nodes unreachable. Note that early on we'll just error out on these
flipped edges as def->uses edges are more complicated to match due to their
one->many nature.

Depends on D69077

Reviewers: volkan, bogner

Subscribers: llvm-commits
2019-12-17 17:03:24 +00:00