Commit Graph

3969 Commits

Author SHA1 Message Date
Matthias Braun
0101cb0a0b TableGen: Accept itinerary data when checking for schedmodel completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:04:59 +00:00
Matthias Braun
3b1588aa81 TableGen: Display helpfull message for incomplete models.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 21:36:12 +00:00
Matthias Braun
eab2869a64 TableGen: Check scheduling models for completeness
TableGen checks at compiletime that for scheduling models with
"CompleteModel = 1" one of the following holds:

- Is marked with the hasNoSchedulingInfo flag
- The instruction is a subclass of Sched
- There are InstRW definitions in the scheduling model

Typical steps necessary to complete a model:

- Ensure all pseudo instructions that are expanded before machine
  scheduling (usually everything handled with EmitYYY() functions in
  XXXTargetLowering).
- If a CPU does not support some instructions mark the corresponding
  resource unsupported: "WriteRes<WriteXXX, []> { let Unsupported = 1; }".
- Add missing scheduling information.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 20:03:21 +00:00
Matthias Braun
279476d30d TableGen: Add hasNoSchedulingInfo to instructions
This introduces a new flag that indicates that a specific instruction
will never be present when the MachineScheduler runs and therefore needs
no scheduling information.

This is in preparation for an upcoming commit which checks completeness
of a scheduling model when tablegen runs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 20:03:11 +00:00
Nikolay Haustov
344528bfec [TableGen] AsmMatcher: Skip optional operands in the midle of instruction if it is not present
Previosy, if actual instruction have one of optional operands then other optional operands listed before this also should be presented.
For example instruction v_fract_f32 v0, v1, mul:2 have one optional operand - OMod and do not have optional operand clamp. Previously this was not allowed because clamp is listed before omod in AsmString:

string AsmString = "v_fract_f32$vdst, $src0_modifiers$clamp$omod";
Making this work required some hacks (both OMod and Clamp match classes have same PredicateMethod).

Now, if MatchInstructionImpl meets formal optional operand that is not presented in actual instruction it skips this formal operand and tries to match current actual operand with next formal.

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17568

[AMDGPU] Assembler: Check immediate types for several optional operands in predicate methods
With this change you should place optional operands in order specified by asm string:

clamp -> omod
offset -> glc -> slc -> tfe
Fixes for several tests.
Depends on D17568

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 08:34:43 +00:00
Igor Breger
7f2251533a AVX512F: Add GATHER/SCATTER assembler Intel syntax tests for knl/skx/avx . Change memory operand parser handling.
Differential Revision: http://reviews.llvm.org/D17564

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 13:30:17 +00:00
Xinliang David Li
2c17b9c60c Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 19:18:21 +00:00
Craig Topper
f150810c18 [X86] Remove some unused encoding checks from the disassembler table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 06:20:21 +00:00
Craig Topper
2082d39556 [TableGen,X86] Add NDEBUG check to a variable initialization that's only used by asserts. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 04:54:32 +00:00
Craig Topper
a5754d7efa [TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates is handled by RawFrmImm8/RawFrmImm16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 04:54:29 +00:00
Craig Topper
35e38d845b [TableGen] Fix inconsistent spacing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:58 +00:00
Craig Topper
69dced0d4c [TableGen] Stop passing by reference an integer that doesn't get modified. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:56 +00:00
Craig Topper
6ff0feee63 [TableGen] Remove unused member variable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:54 +00:00
Craig Topper
33543a37a7 [TableGen] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 02:48:30 +00:00
Craig Topper
487820cc86 [TableGen] Remove constant string argument from a method that's only called once. We can just hardcode the string inside. There already other things that make the method not reusable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 05:22:01 +00:00
Craig Topper
9a4d26a079 [TableGen] Fix comment about 64-bit type I missed when I removed the underlying type in r260808.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 17:58:14 +00:00
Craig Topper
dcbac18d6e [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 06:03:32 +00:00
Craig Topper
c46e309ffa No need to make the subtarget feature bit enum a uint64_t. This was a leftover from when the feature bit enum contained masks instead of bit indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 06:03:29 +00:00
Craig Topper
7f53bedefc [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:29 +00:00
Craig Topper
a78623e3e8 [TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:27 +00:00
Craig Topper
083ca64734 [TableGen] Whitespace cleanup in output file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:25 +00:00
Craig Topper
269f2734b8 [TableGen] Simplify code slightly. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:22 +00:00
Matt Arsenault
b9f1dbe18d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:40:04 +00:00
Tom Stellard
25257d8bf4 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 19:59:33 +00:00
David L Kreitzer
af50aacb9a 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 23:17:32 +00:00
Reid Kleckner
6ebd4e68e8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 19:34:28 +00:00
Dylan McKay
f4afd08249 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 10:30:16 +00:00
Eugene Zelenko
380d47d651 Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D16793


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 18:20:45 +00:00
Craig Topper
3f0462d7e0 [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 01:33:42 +00:00
Craig Topper
ac8a991748 No need to use utostr/utohexstr when writing into a raw_ostream. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 01:55:15 +00:00
Reid Kleckner
fa21741f38 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:43:12 +00:00
Reid Kleckner
80814c51f4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 23:01:21 +00:00
Chris Bieneman
caeade4234 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 21:29:08 +00:00
Eugene Zelenko
51ecde1f0a Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:36 +00:00
Reid Kleckner
fa883c2abc 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:55:00 +00:00
Oliver Stannard
09f29b2ea4 [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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 10:20:19 +00:00
Craig Topper
aed38efd95 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 07:13:28 +00:00
Craig Topper
a4f2978e0c [TableGen] Make a class member local to the function that populates it and consumes it later. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:43 +00:00
Craig Topper
43b79903fe [TableGen] Reorder fields in AsmWriterOperand to remove padding and reduce size. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:40 +00:00
Craig Topper
1c09f96ebe [TableGen] Remove the CGIOpNo from AsmWriterOperand as its not used for anything. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:37 +00:00
Quentin Colombet
8a7d012332 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 19:14:55 +00:00
Craig Topper
401ee722ee [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 19:52:37 +00:00
Craig Topper
8ce1d779bc [TableGen] Keep a returned const reference instead of making a copy. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:21 +00:00
Craig Topper
e4b8552199 [TableGen] Replace instructions() with getInstructionsByEnumValue(). No need to make an iterator_range when we already have a function that returns an ArrayRef. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:18 +00:00
Craig Topper
3356fb6f86 [TableGen] Return ArrayRef instead of a std::vector reference from getInstructionsByEnumValue(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:14 +00:00
Craig Topper
671078454d [TableGen] Use std::find instead of a manual loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 19:51:14 +00:00
Craig Topper
e0b4b2fd22 [TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:47:02 +00:00
Craig Topper
73251b7217 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:05:33 +00:00
Craig Topper
9990e7de74 [TableGen] Use std::find instead of a manual loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:05:30 +00:00
Craig Topper
efefcdd53d [TableGen] Pass PassSubtarget flag into getCode instead of storing a copy of the flag in every AsmWriterOperand. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 06:15:07 +00:00
Craig Topper
cd0aefe26f [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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 07:20:13 +00:00
Craig Topper
05bdb7c886 [TableGen] Replace some hardcoded assumptions that the OpcodeInfo table is 64-bits for cleanliness. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 07:20:12 +00:00
Craig Topper
abfd63051d [TableGen] Use std::remove_if instead of an n^2 loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 07:20:10 +00:00
Craig Topper
cdef20c37c [TableGen] Fix up some stale comments in the AsmMatcher. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 07:20:07 +00:00
Craig Topper
ced4b139cd [TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 07:20:05 +00:00
Craig Topper
d05b60850b [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 05:13:41 +00:00
Craig Topper
db6f0c6ae0 [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 05:13:38 +00:00
Craig Topper
b2e58d7b03 [TableGen] Remove a few spaces from AsmMatcher output. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 02:11:36 +00:00
Craig Topper
616141238d [TableGen] Use range-based for loops. Also fix one loop to not use some index name as an outer loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 07:06:32 +00:00
Craig Topper
d028f0c94b [TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 07:06:29 +00:00
Craig Topper
d149f59b51 [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects in the support library will be deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-04 04:51:51 +00:00
Craig Topper
07466510a7 [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 08:57:41 +00:00
Craig Topper
4d34e548af [TableGen] Replace a logically negated xor of bools with just an equality comparison for readability. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:39 +00:00
Craig Topper
9bb66bd6f5 [TableGen] Use std::find_if and a lambda instead of manual loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:36 +00:00
Craig Topper
8dd99ee81d [TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:34 +00:00
Craig Topper
4d0e40564f [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 07:33:30 +00:00
Craig Topper
5ef134945b [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 08:18:23 +00:00
Craig Topper
1159059a91 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256668 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 08:18:20 +00:00
Craig Topper
ee721e9867 [TableGen] Move determination of IsIsolatedToken into the tokenizer instead of trying to search characters around the token. No functional change intended. Verified for in-tree targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256660 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-31 05:01:45 +00:00
Craig Topper
db4180cc21 [TableGen] Remove unnecessary conversion from StringRef to std::string when outputting to a raw_ostream. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256628 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:24 +00:00
Craig Topper
e18e2bb916 [TableGen] Remove raw_string_ostream by just emitting the header for the switch the first time we emit a case. If the header was never emitted just print the default at the end. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:22 +00:00
Craig Topper
65438a7a79 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:20 +00:00
Craig Topper
e6b50232bc [TableGen] Move more things that come from variant into the AsmVariantInfo class so we can reduce some parameters. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:18 +00:00
Craig Topper
a1a9b68880 [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. Simplify some code by using StringRef::find instead of std::find. These were previously done in r247527 and r247528, but another commit seems to have erased them. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30 06:00:15 +00:00
Craig Topper
cf09bdf62e De-virtualize mnemonicIsValid and remove from the base class. It's not called by any common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256544 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:43:03 +00:00
Craig Topper
98a6307b5a [TableGen] Add missing space to output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256540 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:25 +00:00
Craig Topper
300c966c18 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 07:03:23 +00:00
Asaf Badouh
5c7343b3a6 [X86][PKU] Add {RD,WR}PKRU encoding
Differential Revision: http://reviews.llvm.org/D15711

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-24 08:25:00 +00:00
Akira Hatanaka
37de9d09f1 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r256277 with two changes:

- In emitFnAttrCompatCheck, change FuncName's type to std::string to fix
  a use-after-free bug.
- Remove an unnecessary install-local target in lib/IR/Makefile. 

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 23:57:37 +00:00
Dan Gohman
ee0835002c Add an OperandNamespace field to Target.td's Operand.
For targets to add their own operand types as needed, as advertised in
Operand's comment, they need to be able to specify an alternate namespace
for OperandType names too. This matches the RegisterOperand class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 23:37:37 +00:00
Akira Hatanaka
4a8b38c05b Revert r256277 and r256279.
Some of the bots failed again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 20:29:09 +00:00
Akira Hatanaka
a4912f5755 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r252990 and r252949. I've added member function getKind
to the Attr classes which returns the enum or string of the attribute.

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 20:00:05 +00:00
Chih-Hung Hsieh
3a1999a311 [X86] Part 2 to fix x86-64 fp128 calling convention.
Part 1 was submitted in http://reviews.llvm.org/D15134.
Changes in this part:
* X86RegisterInfo.td, X86RecognizableInstr.cpp: Add FR128 register class.
* X86CallingConv.td: Pass f128 values in XMM registers or on stack.
* X86InstrCompiler.td, X86InstrInfo.td, X86InstrSSE.td:
  Add instruction selection patterns for f128.
* X86ISelLowering.cpp:
  When target has MMX registers, configure MVT::f128 in FR128RegClass,
  with TypeSoftenFloat action, and custom actions for some opcodes.
  Add missed cases of MVT::f128 in places that handle f32, f64, or vector types.
  Add TODO comment to support f128 type in inline assembly code.
* SelectionDAGBuilder.cpp:
  Fix infinite loop when f128 type can have
  VT == TLI.getTypeToTransformTo(Ctx, VT).
* Add unit tests for x86-64 fp128 type.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255558 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 22:08:36 +00:00
Hal Finkel
f7649afaba [TableGen] Correct Namespace lookup with AltNames in AsmWriterEmitter
AsmWriterEmitter will generate a getRegisterName function with an alternate
register name index as its second argument if the target makes use of them. The
enum of these values is generated in RegisterInfoEmitter. The getRegisterName
generator would assume the namespace could always be found by reading index 1
of the list of AltNameIndices, but this will fail if this list is sorted such
that the NoRegAltName is at index 1. Because this list is sorted by record name
(in CodeGenTarget::ReadRegAltNameIndices), you only run in to problems if your
MyTargetRegisterInfo.td defines a single RegAltNameIndex that sorts lexically
before NoRegAltName.

For example, if a target has something like

  def AnAltNameIndex : RegAltNameIndex

and defines RegAltNameIndices for some registers then, prior to this change,
AsmWriterEmitter would generate references to

  ::AnAltNameIndex and ::NoRegAltName

Patch by Alex Bradbury!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 17:31:27 +00:00
Craig Topper
e6bc7d1f0d Use make_range to reduce mentions of iterator type. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254872 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-06 05:08:07 +00:00
Craig Topper
79402ee6f9 Replace uint16_t with the MCPhysReg typedef in many places. A lot of physical register arrays already use this typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 07:13:35 +00:00
Craig Topper
15766ec566 [TableGen] Remove an assumption about the order of encodings in the MVT::SimpleValueType enum. Instead of assuming the types are sorted by size, scan the typeset arrays to find the smallest/largest type. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 05:57:37 +00:00
Oliver Stannard
ce8e2a0d91 [AArch64] Add ARMv8.2-A Statistical Profiling Extension
The Statistical Profiling Extension is an optional extension to
ARMv8.2-A. Since it is an optional extension, I have added the
FeatureSPE subtarget feature to control it. The assembler-visible parts
of this extension are the new "psb csync" instruction, which is
equivalent to "hint #17", and a number of system registers.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254401 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 10:48:51 +00:00
Craig Topper
b51ae5ef11 [TableGen] Use SmallString instead of std::string to build up a string to avoid heap allocations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 08:23:02 +00:00
Craig Topper
5476e4426e [TableGen] Sort pattern predicates before concatenating into a string so that different orders of the same set will produce the same string. This can reduce the number of unique predicates in the isel tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 05:44:04 +00:00
Craig Topper
ce6f743e65 [SelectionDAG] Add a SDTCisSameSizeAs type constraint that can be used to ensure vector widths match even if the element size and count don't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254138 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 07:02:18 +00:00
Craig Topper
a86f909650 [TableGen] Flip reversed comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 06:30:40 +00:00
Krzysztof Parzyszek
05ee0ece0b Add vector types for intrinsics
Author: Ron Lieberman <ronl@codeaurora.org>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253992 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 16:28:14 +00:00
Krzysztof Parzyszek
d233ea2165 Add names for the new vector types in CodeGenTarget.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 15:50:22 +00:00
Craig Topper
20faa148c7 [TableGen] Use std::remove_if instead of manually coded loops that call erase multiple times. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:47 +00:00
Craig Topper
b5302cfc21 [TableGen] Use the other version of EnforceVectorEltTypeIs inside the TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253963 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:45 +00:00
Craig Topper
3e9844b111 [TableGen] Fix formatting and use logical OR. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:44 +00:00
Craig Topper
194e5aef9c [TableGen] Use std::set_intersection to merge TypeSets. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:42 +00:00
Craig Topper
370a2fa0fc [TableGen] Use SmallVector::assign instead of a resize and replace element.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253960 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:41 +00:00
Craig Topper
5fb978c885 Revert change that accidentally snuck into r253955.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:24:06 +00:00
Craig Topper
60338334fc [TableGen] Use array_pod_sort. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:22:43 +00:00
Craig Topper
4c91939703 [TableGen] Use std::remove_if instead of manually coded loops that called erase inside them. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253857 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 07:19:10 +00:00
Craig Topper
e3376e6361 [TableGen] Use empty() instead of checking if size of vector is greater than or equal to 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 07:19:08 +00:00
Craig Topper
020e24091c Revert a portion of r253836 that seems to have broke a couple bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253838 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 22:43:40 +00:00
Craig Topper
1664232ab1 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 20:46:24 +00:00
Craig Topper
5f57903187 [TableGen] Use std::fill instead of a manually coded loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 20:46:22 +00:00
David Blaikie
7ceb9c769f Further simplify from r253832 with some unique_ptr and coalescing conditions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253834 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 20:11:21 +00:00
David Blaikie
bcd624a451 Further simplify from r253832, removing unnecessary intermediate lambdas
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253833 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 20:02:58 +00:00
Craig Topper
6ca468743c [TableGen] Use std::any_of and std::find instead of manual loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253832 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 19:27:02 +00:00
Krzysztof Parzyszek
d8d11cb07e Avoid dependency between TableGen and CodeGen
Duplicate a few common definitions between DFAPacketizer.cpp and
DFAPacketizerEmitter.cpp to avoid including files from CodeGen
in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 15:20:19 +00:00
Krzysztof Parzyszek
b08711cc55 Now fix errors in NDEBUG build.
Hope this won't break any hardware next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 22:46:52 +00:00
Krzysztof Parzyszek
b61ef9d5f3 Fix warnings in NDEBUG build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 22:19:50 +00:00
Krzysztof Parzyszek
bf390b05bc Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.

Reapply the previous patch, this time without circular dependencies.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 20:00:45 +00:00
Krzysztof Parzyszek
a00b4f6e5d Revert r253790: it breaks all builds for some reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 17:38:33 +00:00
Krzysztof Parzyszek
c7fdae2400 Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253790 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 17:23:52 +00:00
Rafael Espindola
d33bb62823 Default SetVector to use a DenseSet.
We use to have an odd difference among MapVector and SetVector. The map
used a DenseMop, but the set used a SmallSet, which in turn uses a
std::set.

I have changed SetVector to use a DenseSet. If you were depending on the
old behaviour you can pass an explicit set type or use SmallSetVector.
The common cases for needing to do it are:

* Optimizing for small sets.
* Sets for types not supported by DenseSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253439 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 06:52:18 +00:00
Matthias Braun
0b897129c1 Assume lane masks are always precise
Allowing imprecise lane masks in case of more than 32 sub register lanes
lead to some tricky corner cases, and I need another bugfix for another
one. Instead I rather declare lane masks as precise and let tablegen
abort if we do not have enough bits.

This does not affect any in-tree target, even AMDGPU only needs 16 lanes
at the moment. If the 32 lanes turn out to be a problem in the future,
then we can easily change the LaneBitmask typedef to uint64_t.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 00:50:55 +00:00
Akira Hatanaka
ff528b6f03 [MCTargetAsmParser] Move the member varialbes that reference
MCSubtargetInfo in the subclasses into MCTargetAsmParser and define a
member function getSTI.

This is done in preparation for making changes to shrink the size of
MCRelaxableFragment. (see http://reviews.llvm.org/D14346).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-14 05:20:05 +00:00
Matthias Braun
ca7d645a60 tablegen: Add a simple heuristic to get better names for pressure sets
Differential Revision: http://reviews.llvm.org/D14597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 22:30:27 +00:00
Akira Hatanaka
7edcc75a6b Revert r252990.
Some of the buildbots are still failing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:44:32 +00:00
Akira Hatanaka
2069c3c898 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r252949. I've changed the type of FuncName to be
std::string instead of StringRef in emitFnAttrCompatCheck.

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:23:11 +00:00
Akira Hatanaka
85b811eedd Revert r252949.
It broke some of the bots including clang-x64-ninja-win7.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252951 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 21:19:18 +00:00
Akira Hatanaka
d68ad56b3f Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 20:59:43 +00:00
Akira Hatanaka
f805775e09 Move the enum attributes defined in Attributes.h to a table-gen file.
This is a step towards consolidating some of the information regarding
attributes in a single place.

This patch moves the enum attributes in Attributes.h to the table-gen
file. Additionally, it adds definitions of target independent string
attributes that will be used in follow-up commits by the inliner to
check attribute compatibility.

rdar://problem/19836465


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11 20:35:42 +00:00
Matthias Braun
ae1a6e1e16 TableGen: Emit LaneMask for register classes without subregisters as ~0u
This makes it slightly easier to handle classes with and without
subregister uniformly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 23:23:05 +00:00
Colin LeMahieu
503438e3f6 [AsmParser] Generalize matching for grammars without mnemonic-lead statements
Differential Revision: http://reviews.llvm.org/D14257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252440 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 00:46:46 +00:00
Colin LeMahieu
1539acf27c [AsmParser] Backends can parameterize ASM tokenization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252439 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 00:31:07 +00:00
Eugene Zelenko
4e036ff575 Fix some Clang-tidy modernize warnings, other minor fixes.
Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg.

Differential revision: http://reviews.llvm.org/D14312


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 22:32:32 +00:00
Benjamin Kramer
109f9e6f71 [TblGen] ArrayRefize CodeGenSchedule. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 12:46:49 +00:00
Igor Laevsky
a4e4343a26 [IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table
There is no need to generate separate table for intrinsics mod ref behaviour.
It can now be determined purely from function attributes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:35:34 +00:00
Craig Topper
e80e558370 [TableGen] Add a space between type and '*' in front of a variable name in output file. While there replace type with 'auto' since there's a cast on the right side of the assignment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249980 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11 16:59:29 +00:00
Hans Wennborg
4d651e440b Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Patch by Eugene Zelenko!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06 23:24:35 +00:00
David Majnemer
68754da26d [WinEH] Make FuncletLayout more robust against catchret
Catchret transfers control from a catch funclet to an earlier funclet.
However, it is not completely clear which funclet the catchret target is
part of.  Make this clear by stapling the catchret target's funclet
membership onto the CATCHRET SDAG node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 18:44:59 +00:00
Matt Arsenault
a7a00148d5 TableGen: Add LLVM_READONLY to generated InstrMapping functions
These just read from a generated table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-24 07:51:20 +00:00
Craig Topper
6522ad6909 Remove extra 'nullptr' entry from an array in tablegen register info file. It should never have been accessed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248246 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:16 +00:00
Craig Topper
156aeff2f7 Fix formatting of a tablegen register info file by putting a line break in a better place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:14 +00:00
Craig Topper
e32e1f4c62 Use makeArrayRef and None to simplify some code in a tablegen register info file. Additionally const correct a couple static array.
Previously the code added an extra nullptr entry to a static array and then created an ArrayRef with a size one less than the static array. If there were no other entries the array would just contain the nullptr and the ArrayRef would be crated with size 0.

Instead, put the right number of entries in the array and explicitly emit 'None' if the size would be 0. This allows the static array constructor of makeArrayRef to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:12 +00:00
Daniel Sanders
47b167dd84 Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Eric has replied and has demanded the patch be reverted.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247702 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15 16:17:27 +00:00
Daniel Sanders
9781f90c7e Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change. Thanks go to Pavel Labath for fixing LLDB for me.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15 14:08:28 +00:00
Daniel Sanders
a6aa0c3bcc Revert r247684 - Replace Triple with a new TargetTuple ...
LLDB needs to be updated in the same commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15 13:46:21 +00:00
Daniel Sanders
7b82808e13 Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.
Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15 13:17:40 +00:00
Craig Topper
6fa20dc3db [TableGen] Use range-based for loops and make a helper function static. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247529 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 18:01:25 +00:00
Craig Topper
25e88befb6 [TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247528 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 18:01:20 +00:00
Craig Topper
9bd78892b0 [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 18:01:09 +00:00
Bruce Mitchener
767c34a919 Fix typos.
Summary: This fixes a variety of typos in docs, code and headers.

Subscribers: jholewinski, sanjoy, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247495 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 01:17:08 +00:00
Hans Wennborg
07a3b97f20 Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
Except the changes that defined virtual destructors as =default, because that
ran into problems with GCC 4.7 and overriding methods that weren't noexcept.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 16:49:58 +00:00
Hans Wennborg
2515069180 Revert r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
This caused build breakges, e.g.
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/24926

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 00:57:26 +00:00
Hans Wennborg
bfd007fd70 Fix Clang-tidy misc-use-override warnings, other minor fixes
Patch by Eugene Zelenko!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247216 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 00:12:56 +00:00
Craig Topper
cb52ea5f9d [TableGen] Use make_unique. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-06 03:44:50 +00:00
Joseph Tremoulet
16c6479624 [TableGen] Allow TokenTy in intrinsic signatures
Summary:
Add the necessary plumbing so that llvm_token_ty can be used as an
argument/return type in intrinsic definitions and correspondingly require
TokenTy in function types.  TokenTy is an opaque type that has no target
lowering, but can be used in machine-independent intrinsics.  It is
required for the upcoming llvm.eh.padparam intrinsic.

Reviewers: majnemer, rnk

Subscribers: stoklund, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246651 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 13:36:25 +00:00