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

3689 Commits

Author SHA1 Message Date
Craig Topper
afb65fa73d [TableGen] Use range-based for loops. NFC
llvm-svn: 260502
2016-02-11 07:39:29 +00:00
Craig Topper
6f4a255e72 [TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.
llvm-svn: 260501
2016-02-11 07:39:27 +00:00
Craig Topper
5012d80ee2 [TableGen] Whitespace cleanup in output file. NFC
llvm-svn: 260500
2016-02-11 07:39:25 +00:00
Craig Topper
2857d5c70c [TableGen] Simplify code slightly. NFC
llvm-svn: 260499
2016-02-11 07:39:22 +00:00
Matt Arsenault
d5880e4c88 SelectionDAG: Make Properties a field of SDPatternOperator
Currently you can't specify node properties like commutativity on
a PatFrag. If you want to create a PatFrag on a commutative node
with a hasOneUse predicate, this enables you to specify that the
PatFrag is also commutable.

llvm-svn: 260404
2016-02-10 18:40:04 +00:00
Tom Stellard
5bd77b3a86 TableGen: Add IsOptional field to AsmOperandClass
Summary:
This makes it possible to specify some operands as optional to the AsmMatcher.
Setting this field to true will prevent the AsmMatcher from emitting
'too few operands' errors when there are missing optional operands.

Reviewers: olista01, ab

Subscribers: nhaustov, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15755

llvm-svn: 259913
2016-02-05 19:59:33 +00:00
David L Kreitzer
2e3401f7b1 Unify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
CodeGenTarget.cpp to avoid the ordering dependence. NFCI.

Differential Revision: http://reviews.llvm.org/D16826

llvm-svn: 259726
2016-02-03 23:17:32 +00:00
Reid Kleckner
0262ca1fce Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)
Summary:
This patch adds a reserve call to an expensive function
(`llvm::LoadIntrinsics`), and may fix a few other low hanging
performance fruit (I've put them in comments for now, so we can
discuss).

**Motivation:**

As I'm sure other developers do, when I build LLVM, I build the entire
project with the same config (`Debug`, `MinSizeRel`, `Release`, or
`RelWithDebInfo`). However, the `Debug` config also builds llvm-tblgen
in `Debug` mode. Later build steps that run llvm-tblgen then can
actually be the slowest steps in the entire build. Nobody likes slow
builds.

Reviewers: rnk, dblaikie

Differential Revision: http://reviews.llvm.org/D16832

Patch by Alexander G. Riccio

llvm-svn: 259683
2016-02-03 19:34:28 +00:00
Dylan McKay
f1723e8dcf [TableGen] Add 'register alternative name matching' support
Summary:
This adds a new attribute which targets can set in TableGen which causes a function to be generated which matches register alternative names. This is very similar to `ShouldEmitMatchRegisterName`, except it works on alt names.

This patch is currently used by the out of tree part of the AVR backend. It reduces code duplication greatly, and has the effect that you do not need to hardcode altname to register mappings in C++.

It will not work on targets which have registers which share the same aliases.

Reviewers: stoklund, arsenm, dsanders, hfinkel, vkalintiris

Subscribers: hfinkel, dylanmckay, llvm-commits

Differential Revision: http://reviews.llvm.org/D16312

llvm-svn: 259636
2016-02-03 10:30:16 +00:00
Eugene Zelenko
0ebce618ad Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D16793

llvm-svn: 259539
2016-02-02 18:20:45 +00:00
Craig Topper
2f7fb265dd [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.
llvm-svn: 259336
2016-02-01 01:33:42 +00:00
Craig Topper
755daee3dd No need to use utostr/utohexstr when writing into a raw_ostream. NFC
llvm-svn: 259314
2016-01-31 01:55:15 +00:00
Reid Kleckner
822ed5c846 [llvm-tblgen] Avoid StringMatcher for GCC and MS builtin names
This brings the compile time of Function.cpp from ~40s down to ~4s for
me locally. It also shaves off about 400KB of object file size in a
release+asserts build.

I also realized that the AMDGPU backend does not have any GCC builtin
names to match, so the extra lookup was a no-op. I removed it to silence
a zero-length string table array warning. There should be no functional
change here.

This change really ends the story of PR11951.

llvm-svn: 258897
2016-01-27 01:43:12 +00:00
Reid Kleckner
50e0e30317 [llvm-tblgen] Stop emitting the intrinsic name matching code
The AMDGPU backend was the last user of the old StringMatcher
recognition code. Move it over to the new lookupLLVMIntrinsicName
funciton, which is now improved to handle all of the interesting edge
cases exposed by AMDGPU intrinsic names.

llvm-svn: 258875
2016-01-26 23:01:21 +00:00
Chris Bieneman
1b8d4f74aa Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D16471

llvm-svn: 258861
2016-01-26 21:29:08 +00:00
Eugene Zelenko
966902f532 Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568

llvm-svn: 258831
2016-01-26 18:48:36 +00:00
Reid Kleckner
b834dd994c Sort intrinsics by LLVM intrinsic name, rather than tablegen def name
Step one towards using a simple binary search to lookup intrinsic IDs
instead of our crazy table generated switch+memcmp+startswith code that
makes Function.cpp take about a minute to compile.  See PR24785 and
PR11951 for why we should do this.

The X86 backend contains tables that need to be sorted on intrinsic ID,
so reorder those.

llvm-svn: 258757
2016-01-26 00:55:00 +00:00
Oliver Stannard
4ff6a9f924 [TableGen] Fix sort order of asm operand classes
This is a fix for https://llvm.org/bugs/show_bug.cgi?id=22796.

The previous implementation of ClassInfo::operator< allowed cycles of classes
such that x < y < z < x, meaning that a list of them cannot be correctly
sorted, and the sort order could differ with different standard libraries.

The original implementation sorted classes by ValueName if they were otherwise
equal. This isn't strictly necessary, but some backends seem to accidentally
rely on it. If I reverse this comparison I get 8 test failures spread across
the AArch64, Mips and X86 backends, so I have left it in until those backends
can be fixed.

There was one case in the X86 backend where the observable behaviour of the
assembler is changed by this patch. This was because some of the memory asm
operands were not marked as children of X86MemAsmOperand.

Differential Revision: http://reviews.llvm.org/D16141

llvm-svn: 258677
2016-01-25 10:20:19 +00:00
Craig Topper
eb67a46511 [TableGen] In AsmWriterEmitter unique command search, rather than storing a mapping from instruction to unique command, instead store a list of which instructions each unique command corresponds to.
This simplifies the complexity of the code that tries to find further operands to merge into the unique command.

llvm-svn: 258656
2016-01-24 07:13:28 +00:00
Craig Topper
33bd74d06d [TableGen] Make a class member local to the function that populates it and consumes it later. NFC
llvm-svn: 258490
2016-01-22 05:59:43 +00:00
Craig Topper
22c150cc79 [TableGen] Reorder fields in AsmWriterOperand to remove padding and reduce size. NFC
llvm-svn: 258489
2016-01-22 05:59:40 +00:00
Craig Topper
fc34e453b1 [TableGen] Remove the CGIOpNo from AsmWriterOperand as its not used for anything. NFC
llvm-svn: 258488
2016-01-22 05:59:37 +00:00
Quentin Colombet
acf8746c63 [GlobalISel] Add a generic machine opcode for ADD.
The selection process being split into separate passes, we need generic opcodes
to translate the LLVM IR to target independent code.

This patch adds an opcode for addition: G_ADD.

Differential Revision: http://reviews.llvm.org/D15472

llvm-svn: 258333
2016-01-20 19:14:55 +00:00
Craig Topper
a5ac333af9 [TableGen] Merge the SuperClass Record and SMRange vector into a single vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC
llvm-svn: 258065
2016-01-18 19:52:37 +00:00
Craig Topper
677a8c0da1 [TableGen] Keep a returned const reference instead of making a copy. NFC
llvm-svn: 258020
2016-01-17 20:38:21 +00:00
Craig Topper
6dbe9b8c99 [TableGen] Replace instructions() with getInstructionsByEnumValue(). No need to make an iterator_range when we already have a function that returns an ArrayRef. NFC
llvm-svn: 258019
2016-01-17 20:38:18 +00:00
Craig Topper
a7f2a9aef5 [TableGen] Return ArrayRef instead of a std::vector reference from getInstructionsByEnumValue(). NFC
llvm-svn: 258018
2016-01-17 20:38:14 +00:00
Craig Topper
f11bd508b4 [TableGen] Use std::find instead of a manual loop. NFC
llvm-svn: 258017
2016-01-17 19:51:14 +00:00
Craig Topper
dd4cad9576 [TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
llvm-svn: 258007
2016-01-17 08:47:02 +00:00
Craig Topper
b87a77e698 [TableGen] Changes to AsmWriterEmitter to remove the CodeGenInstruction to AsmWriterInst map. NFC
Adds the corresponding CodeGenInstruction number to each AsmWriterInst. Then write all the operand uniqueing loops using the AsmWriterInst array and indices. Then use the CodeGenInstruction index to fill out the OpCodeInfo array.

llvm-svn: 258005
2016-01-17 08:05:33 +00:00
Craig Topper
280927f594 [TableGen] Use std::find instead of a manual loop. NFC
llvm-svn: 258004
2016-01-17 08:05:30 +00:00
Craig Topper
6fce6b2142 [TableGen] Pass PassSubtarget flag into getCode instead of storing a copy of the flag in every AsmWriterOperand. NFC
llvm-svn: 257743
2016-01-14 06:15:07 +00:00
Craig Topper
72d3a28a1d [TableGen] Cleanup output formatting and add llvm_unreachables to the output the AsmMatcher uses when it overflows the 64-bit tables. No in tree targets use this code, but I tested it with an temporarily reduced table width.
llvm-svn: 257583
2016-01-13 07:20:13 +00:00
Craig Topper
c0e6293345 [TableGen] Replace some hardcoded assumptions that the OpcodeInfo table is 64-bits for cleanliness. NFC
llvm-svn: 257582
2016-01-13 07:20:12 +00:00
Craig Topper
119171b36d [TableGen] Use std::remove_if instead of an n^2 loop. NFC
llvm-svn: 257581
2016-01-13 07:20:10 +00:00
Craig Topper
b458db6a4a [TableGen] Fix up some stale comments in the AsmMatcher. NFC
llvm-svn: 257580
2016-01-13 07:20:07 +00:00
Craig Topper
68c1fda7f5 [TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functions. NFC
llvm-svn: 257579
2016-01-13 07:20:05 +00:00
Craig Topper
8bf4b9d67a [TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows x86 to use 56 total bits made up of a 32-bit, 16-bit, and 8-bit table. Previously we were using 64 total bits.
This saves 14K from the x86 table size. And saves space on other targets as well.

llvm-svn: 257315
2016-01-11 05:13:41 +00:00
Craig Topper
ca1a569d9e [TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent ending an array with a comma. But that's perfectly legal and not something we need to prevent. NFC
llvm-svn: 257314
2016-01-11 05:13:38 +00:00
Craig Topper
e9d3c73857 [TableGen] Remove a few spaces from AsmMatcher output. NFC
llvm-svn: 257308
2016-01-11 02:11:36 +00:00
Craig Topper
7f328191b4 [TableGen] Use range-based for loops. Also fix one loop to not use some index name as an outer loop. NFC
llvm-svn: 257156
2016-01-08 07:06:32 +00:00
Craig Topper
baeeeaf501 [TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC
llvm-svn: 257155
2016-01-08 07:06:29 +00:00
Craig Topper
f9081a5564 [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects in the support library will be deleted.
llvm-svn: 256732
2016-01-04 04:51:51 +00:00
Craig Topper
3edc30259c [TableGen] Simplify some code slightly. No need to check if the arrays are empty before printing. The loop can be made to print the same thing if the loop is empty. NFC
llvm-svn: 256703
2016-01-03 08:57:41 +00:00
Craig Topper
3e1b28d6ad [TableGen] Replace a logically negated xor of bools with just an equality comparison for readability. NFC
llvm-svn: 256699
2016-01-03 07:33:39 +00:00
Craig Topper
67e81b4a5c [TableGen] Use std::find_if and a lambda instead of manual loops.
llvm-svn: 256698
2016-01-03 07:33:36 +00:00
Craig Topper
e018b0667f [TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.
llvm-svn: 256697
2016-01-03 07:33:34 +00:00
Craig Topper
e0da2d5327 [TableGen] Use range-based for loops. NFC
llvm-svn: 256696
2016-01-03 07:33:30 +00:00
Craig Topper
efc9b3c5bb [TableGen] Modify the AsmMatcherEmitter to only apply the table growth from r252440 to the Hexagon target.
This restores the previous behavior of not including the mnemonic in the classes table for every target that starts instruction lines with the mnemonic. Not only did the table size increase by 1 entry, but the class enum increased in size which caused every class in the array to increase in size. It also grew the size of the function that parsers tokens into classes by a substantial amount.

This adds a new HasMnemonicFirst flag to all AsmParsers. It's set to 1 by default and Hexagon target overrides it to 0.

For the X86 target alone this recovers 324KB of size on the llvm-mc executable.

I believe the current state is still a bad design choice for the Hexagon target as it causes most of the parsing to do a linear search through the entire match table to comparing operands against every instruction until it finds one that works. At least for the other targets we do a binary search based on mnemonic over which to do the linear scan.

llvm-svn: 256669
2015-12-31 08:18:23 +00:00
Craig Topper
38bce76cbc [TableGen] Use range-based for loops. NFC
llvm-svn: 256668
2015-12-31 08:18:20 +00:00