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

8486 Commits

Author SHA1 Message Date
Nico Weber
0858f1491b [gn build] unbreak mac build after 133a31cef61c 2020-01-31 21:25:56 -05:00
Nico Weber
fa01d382f6 [gn build] add asan runtime on linux and mac
This produces a seemingly-working dynamic (x64-only) asan dylib on macOS
and static libraries on Linux.

I've had this sitting in a branch for a long time and wanted to get
check-asan working before landing it, but smaller patches and fewer
local branches is probably better.
2020-01-31 21:23:43 -05:00
LLVM GN Syncbot
b23f6c533d [gn build] Port 16a0313ee32 2020-01-31 09:18:27 +00:00
LLVM GN Syncbot
0ef9aaaf35 [gn build] Port 601687bf731 2020-01-30 15:06:10 +00:00
Hans Wennborg
b86d89bef2 test-release.sh: Add MLIR to the projects list 2020-01-30 14:31:02 +01:00
LLVM GN Syncbot
66655979b5 [gn build] Port f00be8da62b 2020-01-30 12:56:31 +00:00
Christian Sigg
b84ab96dc9 Add GDB pretty printers for llvm::ilist, llvm::simple_ilist, and llvm::ilist_node.
Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72589
2020-01-30 09:35:49 +01:00
LLVM GN Syncbot
22bd378211 [gn build] Port f2af0607000 2020-01-30 01:35:57 +00:00
Nico Weber
94398225a4 [gn build] add a FIXME about using /Gw on win 2020-01-29 19:12:08 -05:00
LLVM GN Syncbot
f1f059b66f [gn build] Port 5ea83eef4d6 2020-01-29 21:19:26 +00:00
LLVM GN Syncbot
519cacf3d2 [gn build] Port 24962ced814 2020-01-29 21:06:15 +00:00
LLVM GN Syncbot
b357126bee [gn build] Port 9a08a3fab99 2020-01-29 15:15:45 +00:00
Benjamin Kramer
633cdf3dc1 Address implicit conversions detected by g++ 5 only. 2020-01-29 01:01:09 +01:00
Benjamin Kramer
8d50d8820b Fix a couple more implicit conversions that Clang doesn't diagnose. 2020-01-29 00:42:56 +01:00
Benjamin Kramer
87d13166c7 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Nico Weber
0a628dd70c [gn build] (manually) port 90a10f00ff8 2020-01-28 16:00:54 -05:00
LLVM GN Syncbot
7a0c456a46 [gn build] Port 2c03c899d50 2020-01-28 18:59:31 +00:00
LLVM GN Syncbot
4e41d24fc8 [gn build] Port a928d127a52 2020-01-28 18:39:09 +00:00
LLVM GN Syncbot
6ffae95289 [gn build] Port a32f894f17b 2020-01-28 15:50:50 +00:00
Matt Arsenault
e2876f478f TableGen: Try to fix expensive checks failures 2020-01-27 14:42:04 -05:00
Luke Drummond
a097bd08a1 [tablegen] Emit string literals instead of char arrays
This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
    extern const char HexagonInstrNameData[] = {
      /* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
      /* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
      /* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
      /* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
      [...]
    };

...to this:

    extern const char HexagonInstrNameData[] = {
      /* 0 */ "G_FLOG10\0"
      /* 9 */ "ENDLOOP0\0"
      /* 18 */ "V6_vdd0\0"
      /* 26 */ "PS_vdd0\0"
      [...]
    };

This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.

To avoid issues with low implementation limits, this is disabled by
default for visual studio.

To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`

Reviewers: mstorsjo, rnk

Subscribers: llvm-commits

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

A variation of this patch was originally committed in ce23515f5ab011 and
then reverted in e464b31c due to build failures.
2020-01-27 18:22:25 +00:00
Christian Sigg
4789f36750 Add pretty printers for llvm::PointerIntPair and llvm::PointerUnion.
Reviewers: aprantl, dblaikie, jdoerfert, nicolasvasilache

Reviewed By: dblaikie

Subscribers: jpienaar, dexonsmith, merge_guards_bot, llvm-commits

Tags: #llvm, #clang, #lldb, #openmp

Differential Revision: https://reviews.llvm.org/D72557
2020-01-27 17:23:59 +01:00
LLVM GN Syncbot
b191b5e878 [gn build] Port dd8e0a0a23b 2020-01-25 02:40:48 +00:00
Nico Weber
9a83eff740 [gn build] (manually) merge 81b700e302b1 2020-01-24 21:40:26 -05:00
LLVM GN Syncbot
1c66965881 [gn build] Port 8a81daaa8b5 2020-01-24 21:42:43 +00:00
LLVM GN Syncbot
54ede9be55 [gn build] Port 3f8b100e94b 2020-01-24 21:02:26 +00:00
Matt Arsenault
653b9c5a80 TableGen/GlobalISel: Handle non-leaf EXTRACT_SUBREG
This previously only handled EXTRACT_SUBREGs from leafs, such as
operands directly in the original output. Handle extracting from a
result instruction.
2020-01-24 12:15:10 -08:00
Matt Arsenault
a3296c73e9 TableGen: Work around assert on Mips register definitions
This would hit the "Biggest class wasn't first" assert in
getMatchingSubClassWithSubRegs in a future patch for EXTRACT_SUBREG
handling.

Mips defines 4 identical register classes (MSA128B, MSA128H, MSA128BW,
MSA128D). These have the same set of registers, and only differ by the
isel type. I believe this is an ill formed way of defining registers,
that probably is just to work around the inconvenience of mixing
different types in a single register class in DAG patterns.

Since these all have the same size, they would all sort to the
beginning, but you would not necessarily get the same super register
at the front as the assert enforces. Breaking the ambiguity by also
sorting by name doesn't work, since each of these register classes all
want to be first. Force sorting of the original register class if the
size is the same.
2020-01-24 12:15:10 -08:00
LLVM GN Syncbot
42180df7df [gn build] Port 555d8f4ef5e 2020-01-24 19:37:54 +00:00
Sergej Jaskiewicz
22b60a6c62 Revert "[tablegen] Emit string literals instead of char arrays"
This reverts commit ce23515f5ab01161c98449d833b3ae013b553aa8.

That commit broke some builds on Windows:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13870
2020-01-23 18:22:22 +03:00
Luke Drummond
93befba229 [tablegen] Emit string literals instead of char arrays
This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
    extern const char HexagonInstrNameData[] = {
      /* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
      /* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
      /* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
      /* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
      [...]
    };

...to this:

    extern const char HexagonInstrNameData[] = {
      /* 0 */ "G_FLOG10\0"
      /* 9 */ "ENDLOOP0\0"
      /* 18 */ "V6_vdd0\0"
      /* 26 */ "PS_vdd0\0"
      [...]
    };

This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.

To avoid issues with low implementation limits, this is disabled by
default for visual studio or when cross-compiling.

To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`

Reviewers: mstorsjo, rnk

Subscribers: llvm-commit

Differential Revision: https://reviews.llvm.org/D73044
2020-01-23 13:57:20 +00:00
LLVM GN Syncbot
41ea30c256 [gn build] Port 2f6987ba61c 2020-01-23 13:34:12 +00:00
LLVM GN Syncbot
0bce65f3ee [gn build] Port dcff3961c2d 2020-01-23 05:43:56 +00:00
Nico Weber
068346b51e [gn build] reformat all build files again
Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
after recent fixes to formatting of comments after single-element
lists.
2020-01-22 14:04:20 -05:00
Nico Weber
9a5d53ffb2 Revert "[gn build] [win] produce symbolized stack frames in release builds too"
This reverts commit fd98eccf984f203e39452da238a142f83f61d368.
Seems to have no effect, need to try it locally for a bit first.
2020-01-22 12:54:19 -05:00
Nico Weber
aa258c1b77 [gn build] [win] produce symbolized stack frames in release builds too 2020-01-22 12:36:38 -05:00
Nico Weber
7de08a66c5 [gn build] (manually) port a174f0da62f 2020-01-22 11:08:34 -05:00
LLVM GN Syncbot
7bf9ea1c7a [gn build] Port e53a9d96e6a 2020-01-22 04:19:38 +00:00
LLVM GN Syncbot
f3ae931f0a [gn build] Port fccd0da5ee6 2020-01-21 13:36:16 +00:00
LLVM GN Syncbot
7c3aa098d6 [gn build] Port a80291ce10b 2020-01-21 08:19:25 +00:00
LLVM GN Syncbot
c0e209358d [gn build] Port a42c3eb599c 2020-01-20 17:09:12 +00:00
LLVM GN Syncbot
71d2effead [gn build] Port 24b7b99b7d6 2020-01-20 15:32:54 +00:00
Eric Astor
dea61577e1 Fix build - removing legacy target reference. 2020-01-20 09:54:59 -05:00
Eric Astor
f5ab9140ce [ms] [llvm-ml] Add placeholder for llvm-ml, based on llvm-mc
As discussed on the mailing list, I plan to introduce an ml-compatible MASM assembler as part of providing more of the Windows build tools. This will be similar to llvm-mc, but with different command-line parameters.

This placeholder is purely a stripped-down version of llvm-mc; we'll eventually add support for the Microsoft-style command-line flags, and back it with a MASM parser.

Relanding this revision after fixing ARM-compatibility issues.

Reviewers: rnk, thakis, RKSimon

Reviewed By: thakis, RKSimon

Differential Revision: https://reviews.llvm.org/D72679
2020-01-20 09:19:10 -05:00
LLVM GN Syncbot
554716c6ed [gn build] Port a0f50d73163 2020-01-19 14:54:02 +00:00
Eric Astor
538f1d9b3f Revert "[ms] [llvm-ml] Add placeholder for llvm-ml, based on llvm-mc"
This reverts commit 22af2cbefc86dbef6e11ddaa96a08956e0baf22b, due to breakages on ARM platforms.
2020-01-18 09:51:40 -05:00
LLVM GN Syncbot
2be916404f [gn build] Port d3db13af7e5 2020-01-17 23:26:29 +00:00
Nico Weber
b68ba95e0b [gn build] fix build after 22af2cbefc 2020-01-17 18:26:02 -05:00
Eric Astor
ed7261e778 [ms] [llvm-ml] Add placeholder for llvm-ml, based on llvm-mc
Summary:
As discussed on the mailing list, I plan to introduce an ml-compatible MASM assembler as part of providing more of the Windows build tools. This will be similar to llvm-mc, but with different command-line parameters.

This placeholder is purely a stripped-down version of llvm-mc; we'll eventually add support for the Microsoft-style command-line flags, and back it with a MASM parser.

Reviewers: rnk, thakis

Reviewed By: thakis

Subscribers: merge_guards_bot, mgorny, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72679
2020-01-17 16:14:08 -05:00
LLVM GN Syncbot
75dedac3a0 [gn build] Port 42a0355816d 2020-01-17 13:44:44 +00:00
Dmitri Gribenko
bac0121a4b Revert "Avoid creating an immutable map in the Automaton class."
This reverts commit 051d330314cb1f175025ca37da8e5e1d851e1790. It broke
buildbots, for example,
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/21908.
2020-01-17 10:20:36 +01:00
Hans Wennborg
269a6bd0b2 Remove old Suversion release scripts 2020-01-17 09:35:34 +01:00
Marcello Maggioni
8c76dbff6b Avoid creating an immutable map in the Automaton class.
Summary:
In the DFAPacketizer we copy the Transitions array
into a map in order to later access the transitions
based on a "Current State/Action" pair as a key.
This map lives in the Automaton object used by the DFAPacketizer.
It is never changed during the life of the object after
having been created during the creation of the Automaton
itself.

This map creation can make the creation of a DFAPacketizer
quite expensive if the target contains a considerable
amount of transition states.

Considering that TableGen already generates a
sorted list of transitions by State/Action pairs
we could just use that directly in our Automaton
and search entries with std::lower_bound instead of copying
it in a map and paying the execution time and memory cost.

Reviewers: jmolloy, ThomasRaoux

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72682
2020-01-16 18:44:20 -08:00
Nico Weber
02bc480b15 [gn build] replace llvm_allow_tardy_revision with llvm_append_vc_rev
Previously, the gn build would create VCSRevision.h / VCSVersion.h
files with some LLD_REVISION / LLVM_REVISION / CLANG_REVISION but
by default wouldn't add a dependency on .git/logs/HEAD so that
the step doesn't rerun after every branch switch or every pull.

That's bad for deterministic builds, and having --version print
some arbitrarily old revision isn't great either.

Instead, move to the model that the cmake build (now) uses fairly
consistently: If llvm_append_vc_rev is set, include the revision,
else don't.

Since the GN build is focused on developers, set llvm_append_vc_rev
to false instead of true by default (different from the cmake build),
so that things don't rebuild after every branch switch and every
pull.

While here, also remove some pre-monorepo code.

Differential Revision: https://reviews.llvm.org/D72859
2020-01-16 19:05:07 -05:00
LLVM GN Syncbot
3c615417b5 [gn build] Port d5c6b8407c1 2020-01-16 21:35:08 +00:00
Matt Arsenault
0e42d09951 TableGen/GlobalISel: Fix srcvalue inputs
Allow using srcvalue for discarding pattern inputs.
2020-01-16 13:49:43 -05:00
Nico Weber
851ce920c9 [gn build] (manually) port bed7626f04f7 2020-01-16 13:19:39 -05:00
Nico Weber
9a71e6cdaf [gn build] include revision information in lld --version output 2020-01-16 13:10:41 -05:00
LLVM GN Syncbot
bbf89c711e [gn build] Port 6b357866496 2020-01-16 16:56:26 +00:00
Nico Weber
6bab3f4983 Make lld cmake not compute commit revision twice
r354605 moved LLD to the unified revision handling introduced in
rL353268 / r352729 and removed uses of LLD_REPOSITORY_STRING and
LLD_REVISION_STRING.

After this change, we no longer compute the (now-unused) values
of these two variables.

Since this removes the only use of llvm/utils/GetRepositoryPath,
remove that too (it's redundant with the system added in r354605).

While here, also remove LLD_VERSION_MAJOR and LLD_VERSION_MINOR.
Their uses were removed in r285163.

Also remove LLD_VERSION from Version.inc which as far as I can
tell has been unused since the file was added in r219277.

No behavior change.

Differential Revision: https://reviews.llvm.org/D72803
2020-01-16 09:55:36 -05:00
LLVM GN Syncbot
24c5598549 [gn build] Port ed181efa175 2020-01-16 09:55:55 +00:00
LLVM GN Syncbot
e4adbf252b [gn build] Port 8fdafb7dced 2020-01-16 04:13:31 +00:00
Nico Weber
31a3e4d169 [gn build] re-run "gn format" with trunk gn 2020-01-15 13:37:38 -05:00
Nico Weber
d9e1114f21 [gn build] add multi-line forcing comments in more places 2020-01-15 13:36:42 -05:00
Nico Weber
800e88dfdc [gn build] make "gn format" comment slightly more concise 2020-01-15 13:36:42 -05:00
Nico Weber
fbe5badf52 [gn build] Reformat all build files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
The motivation is to reformat them with trunk gn again right after.
Trunk gn changed formatting of some single-element lists.
2020-01-15 12:59:45 -05:00
Nico Weber
8b477b93ee [gn build] find mistakes like the one fixed in 72b5989e0d1 at build time 2020-01-15 10:05:41 -05:00
Nico Weber
cfae8b7809 [gn build] (manually) port b4a99a061f51 better 2020-01-15 09:49:56 -05:00
Matt Arsenault
222988e058 TableGen: Delete some copy constuctors
Some register related machinery relies on uniqued, static pointers for
register classes and subregisters, so try to make sure these are never
copied.
2020-01-15 08:58:57 -05:00
Matt Arsenault
6f8d4d409e TableGen/GlobalISel: Don't take reference to temporary values
These return temporary Optional<> values which are immediately
destroyed. I'm not sure why no sanitizers seem to have caught this,
but I encountered crashes on these in a future patch.
2020-01-15 08:58:57 -05:00
Matt Arsenault
79b7d20721 TableGen/GlobalISel: Don't reconstruct CodeGenRegBank
The maps for dealing with the relationships between different register
classes and subregister indexes rely on unique pointers for every
class/index. By constructing a second copy of CodeGenRegBank, two
different pointer values existed for a given subregister depending on
where you were querying.

Use the existing CodeGenRegBank owned by the CodeGenTarget instead of
constructing a second copy. This avoids incorrectly failing map
lookups in a future change.
2020-01-15 08:58:57 -05:00
Djordje Todorovic
82df06c202 [llvm-locstats] Add the --compare option
Draw a plot showing the difference in debug loc coverage on two
files provided.

Differential Revision: https://reviews.llvm.org/D71870
2020-01-15 14:35:29 +01:00
Hans Wennborg
54ef354524 Bump the trunk major version to 11
and clear the release notes.
2020-01-15 13:38:01 +01:00
Djordje Todorovic
260af8e320 [llvm-locstats] Add the --draw-plot option
When using the option, draw the histogram representing the debug
location buckets. The resulting histogram will be saved in a png
file.

Differential Revision: https://reviews.llvm.org/D71869
2020-01-15 12:00:43 +01:00
Djordje Todorovic
ada36eafbb [llvm-locstats][NFC] Support OOP concept
Making these changes, the code becomes more robust and easier for
adding the new features.

  -Introduce the LocationStats class representing the statistics
  -Add the pretty_print() method in the LocationStats class
  -Add additional '-' for the program options
  -Add the verify_program_inputs() function
  -Add the parse_locstats() function
  -Rename 'results' => 'opts'
  -Add more comments

Differential Revision: https://reviews.llvm.org/D71868
2020-01-15 11:41:09 +01:00
LLVM GN Syncbot
19664201dc [gn build] Port 0dc6c249bff 2020-01-15 09:58:27 +00:00
Tom Stellard
fb33bc86b6 CMake: Make most target symbols hidden by default
Summary:
For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
this change makes all symbols in the target specific libraries hidden
by default.

A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
libraries public, which is mainly needed for the definitions of the
LLVMInitialize* functions.

This patch reduces the number of public symbols in libLLVM.so by about
25%.  This should improve load times for the dynamic library and also
make abi checker tools, like abidiff require less memory when analyzing
libLLVM.so

One side-effect of this change is that for builds with
LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
access symbols that are no longer public will need to be statically linked.

Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
36221
nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
26278

Reviewers: chandlerc, beanz, mgorny, rnk, hans

Reviewed By: rnk, hans

Subscribers: merge_guards_bot, luismarques, smeenai, ldionne, lenary, s.egerton, pzheng, sameer.abuasal, MaskRay, wuzish, echristo, Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D54439
2020-01-14 19:46:52 -08:00
LLVM GN Syncbot
ae62b71111 [gn build] Port 36fcbb838c8 2020-01-14 19:06:58 +00:00
Simon Tatham
87e348953e [TableGen] Update editor modes for new keywords.
Summary:
D71407 and D71474 added new keywords to the Tablegen language:
`defvar`, `if`, `then` and `else`. This commit updates the various
editor modes to highlight them appropriately.

Some of the modes also didn't include `defset`, so I've added that too
while I was there.

Reviewers: MaskRay, lebedev.ri, plotfi

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72693
2020-01-14 13:39:00 +00:00
Nico Weber
52ac79df7d [gn build] (manually) port b4a99a061f51 2020-01-13 14:13:35 -05:00
Fangrui Song
f9acff790a [X86][Disassembler] Merge X86DisassemblerDecoder.cpp into X86Disassembler.cpp and refactor 2020-01-12 00:53:36 -08:00
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
LLVM GN Syncbot
113b26aae4 [gn build] Port 82923c71efa 2019-12-20 20:35:49 +00:00
David Spickett
033afbf4d8 Re-land "[cmake] Add dependency on llvm-dwarfdump to llvm-locstats"
This reverts commit f8e2ab3cd347cb7fb959ea0ece795f4eb347094c.
2019-12-20 09:11:07 +00:00
Jessica Paquette
d0d7cd1383 [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
9541184165 [gn build] Port 3075cd5c9fc 2019-12-19 21:33:15 +00:00
David Spickett
fb46f5e201 Revert "[cmake] Add dependency on llvm-dwarfdump to llvm-locstats"
This reverts commit ba430f503244d1498529d47f31090cdf79b5c231.
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
b2e4a674f5 [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
03421c172a [gn build] Port abc7f6800df 2019-12-19 12:43:20 +00:00
David Spickett
fe872487f0 [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
d1486e2ba5 [gn build] Update console print to match the commit message (NFC) 2019-12-18 16:12:19 -05:00
Mehdi Amini
038bd1ef33 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
1818a82d8d gn build: Merge 9883d7edc65 2019-12-18 16:00:24 +00:00
Daniel Sanders
62f5c5bff1 [globalisel] Small correction to the fixup in 0a0813962d6. 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
365070365b [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
1e69efeb0a [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
1ee93efcd0 [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
8152a84c90 gn build: Merge 7ea2e5195a8 2019-12-18 11:37:45 +00:00
Daniel Sanders
c57301aa25 Revert "Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input""
This reverts commit e62e760f29567fe0841af870c65a4f8ef685d217.

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
b852062701 gn build: Merge 1ad15046dcf 2019-12-18 11:25:51 +00:00
LLVM GN Syncbot
f7ddeeeea4 gn build: Merge e62e760f295 2019-12-18 00:29:06 +00:00