Commit Graph

3820 Commits

Author SHA1 Message Date
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