1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

2458 Commits

Author SHA1 Message Date
Jim Grosbach
746970d850 Remove redundant Thumb2 ADD/SUB SP instruction definitions.
Unlike Thumb1, Thumb2 does not have dedicated encodings for adjusting the
stack pointer. It can just use the normal add-register-immediate encoding
since it can use all registers as a source, not just R0-R7. The extra
instruction definitions are just duplicates of the normal instructions with
the (not well enforced) constraint that the source register was SP.

llvm-svn: 134114
2011-06-29 23:25:04 +00:00
Jim Grosbach
4ee08bd52c ARM RSCS* don't need explicit TableGen decoder checks.
They've been pseudos for a while now, so the decoder will never see
them in the first place.

llvm-svn: 134101
2011-06-29 22:01:15 +00:00
Jim Grosbach
6dd5433c5c Refactor away tSpill and tRestore pseudos in ARM backend.
The tSpill and tRestore instructions are just copies of the tSTRspi and
tLDRspi instructions, respectively. Just use those directly instead.

llvm-svn: 134092
2011-06-29 20:26:39 +00:00
Francois Pichet
f9f38d8d73 Change AsmName's type from StringRef to std::string. AsmName was pointing to a temporary string object that was destroyed. This is undefined behavior and MSVC didn't like it.
This fixes over 300+ failing tests on MSVC.
Credit for this fix goes to chapuni.

llvm-svn: 134064
2011-06-29 11:25:34 +00:00
Evan Cheng
b4dc8bdd22 Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.
llvm-svn: 134049
2011-06-29 01:14:12 +00:00
Evan Cheng
65e7766262 Move CallFrameSetupOpcode and CallFrameDestroyOpcode to TargetInstrInfo.
llvm-svn: 134030
2011-06-28 21:14:33 +00:00
Evan Cheng
b83b307ae8 Hide more details in tablegen generated MCRegisterInfo ctor function.
llvm-svn: 134027
2011-06-28 20:44:22 +00:00
Evan Cheng
61530114d5 Add MCInstrInfo registeration machinery.
llvm-svn: 134026
2011-06-28 20:29:03 +00:00
Evan Cheng
a115f77785 Merge XXXGenRegisterNames.inc into XXXGenRegisterInfo.inc
llvm-svn: 134024
2011-06-28 20:07:07 +00:00
Evan Cheng
4a169be530 - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.

llvm-svn: 134021
2011-06-28 19:10:37 +00:00
Evan Cheng
701aaa4bb0 Alternative name enum should go into the enum portion.
llvm-svn: 133979
2011-06-28 01:36:01 +00:00
Jim Grosbach
190b9d7ec0 ARM Assembly support for Thumb mov-immediate.
Correctly parse the forms of the Thumb mov-immediate instruction:
  1. 8-bit immediate 0-255.
  2. 12-bit shifted-immediate.

The 16-bit immediate "movw" form is also legal with just a "mov" mnemonic,
but is not yet supported. More parser logic necessary there due to fixups.

llvm-svn: 133966
2011-06-27 23:54:06 +00:00
Evan Cheng
b2fc68c7bc Remove RCBarriers from TargetInstrDesc.
llvm-svn: 133964
2011-06-27 23:47:21 +00:00
Owen Anderson
c1dcf312d1 Add support for alternative register names, useful for instructions whose operands are logically equivalent to existing registers, but happen to be printed specially. For example, an instruciton that prints d0[0] instead of s0.
Patch by Jim Grosbach.

llvm-svn: 133940
2011-06-27 21:06:21 +00:00
Evan Cheng
84f52143c3 More refactoring. MC doesn't need know about subreg indices.
llvm-svn: 133927
2011-06-27 19:24:13 +00:00
Evan Cheng
6fea701360 Merge XXXGenRegisterDesc.inc XXXGenRegisterNames.inc XXXGenRegisterInfo.h.inc
into XXXGenRegisterInfo.inc.

llvm-svn: 133922
2011-06-27 18:32:37 +00:00
Evan Cheng
b0d9147d96 Remove dead typedefs.
llvm-svn: 133851
2011-06-25 00:27:17 +00:00
Evan Cheng
43acb2c7a9 Rename TargetRegisterDesc to MCRegisterDesc
llvm-svn: 133845
2011-06-24 23:44:48 +00:00
Bob Wilson
72e7012795 Revert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."
Sorry, this was a bad idea.  Within clang these builtins are in a separate
"ARM" namespace, but the actual builtin names should clearly distinguish that
they are target specific.

llvm-svn: 133832
2011-06-24 22:13:17 +00:00
Bob Wilson
8d84dd17fa Shorten some ARM builtin names by removing unnecessary "neon" prefix.
llvm-svn: 133825
2011-06-24 21:32:40 +00:00
Evan Cheng
391461842d - Add MCRegisterInfo registration machinery. Also added x86 registration routines.
- Rename TargetRegisterDesc to MCRegisterDesc.

llvm-svn: 133820
2011-06-24 20:42:09 +00:00
Benjamin Kramer
57bf7818aa Make the generated InitXXXMCRegisterInfo function "static inline", so it doesn't get emitted into multiple object files.
This caused linker errors when linking both libLLVMX86Desc and libLLVMX86CodeGen
into a single binary (for example when building a monolithic libLLVM shared library).

llvm-svn: 133791
2011-06-24 11:03:31 +00:00
Evan Cheng
e0801b07e0 Starting to refactor Target to separate out code that's needed to fully describe
target machine from those that are only needed by codegen. The goal is to
sink the essential target description into MC layer so we can start building
MC based tools without needing to link in the entire codegen.

First step is to refactor TargetRegisterInfo. This patch added a base class
MCRegisterInfo which TargetRegisterInfo is derived from. Changed TableGen to
separate register description from the rest of the stuff.

llvm-svn: 133782
2011-06-24 01:44:41 +00:00
Francois Pichet
3a4cc9df06 Unbreak the CMake build
llvm-svn: 133574
2011-06-21 23:19:23 +00:00
Jim Grosbach
cfcba2d22b Consolidate some TableGen diagnostic helper functions.
TableGen had diagnostic printers sprinkled about in a few places. Pull them
together into a single location in Error.cpp.

llvm-svn: 133568
2011-06-21 22:55:50 +00:00
Jakob Stoklund Olesen
22d12568aa Skip fields that don't exist in the Register class.
llvm-svn: 133470
2011-06-20 20:56:05 +00:00
Jakob Stoklund Olesen
4d1be7a5cd Add a RegisterTuples class to Target.td and TableGen.
A RegisterTuples instance is used to synthesize super-registers by
zipping together lists of sub-registers. This is useful for generating
pseudo-registers representing register sequence constraints like 'two
consecutive GPRs', or 'an even-odd pair of floating point registers'.

The RegisterTuples def can be used in register set operations when
building register classes. That is the only way of accessing the
synthesized super-registers.

For example, the ARM QQ register class of pseudo-registers could have
been formed like this:

  // Form pairs Q0_Q1, Q2_Q3, ...
  def QQPairs : RegisterTuples<[qsub_0, qsub_1],
                               [(decimate QPR, 2),
                                (decimate (shl QPR, 1), 2)]>;

  def QQ : RegisterClass<..., (add QQPairs)>;

Similarly, pseudo-registers representing '3 consecutive D-regs with
wraparound' look like:

  // Form D0_D1_D2, D1_D2_D3, ..., D30_D31_D0, D31_D0_D1.
  def DSeqTriples : RegisterTuples<[dsub_0, dsub_1, dsub_2],
                                   [(rotl DPR, 0),
                                    (rotl DPR, 1),
                                    (rotl DPR, 2)]>;

TableGen automatically computes aliasing information for the synthesized
registers.

Register tuples are still somewhat experimental. We still need to see
how they interact with MC.

llvm-svn: 133407
2011-06-20 02:50:54 +00:00
Chris Lattner
c247005424 fix the varargs version of StructType::get to not require an LLVMContext, making usage
much cleaner.

llvm-svn: 133364
2011-06-18 22:48:56 +00:00
Jakob Stoklund Olesen
7aee390412 Use the correct comparator to avoid depending on pointer values.
This should fix the Linux buildbots.

llvm-svn: 133334
2011-06-18 05:44:55 +00:00
Jakob Stoklund Olesen
f190283688 Store CodeGenRegisters as pointers so they won't be reallocated.
Reuse the CodeGenRegBank DenseMap in a few places that would build their
own or use linear search.

llvm-svn: 133333
2011-06-18 04:26:06 +00:00
Jakob Stoklund Olesen
d446052d33 Remove MethodProtos/MethodBodies and allocation_order_begin/end.
Targets that need to change the default allocation order should use the
AltOrders mechanism instead. See the X86 and ARM targets for examples.

The allocation_order_begin() and allocation_order_end() methods have been
replaced with getRawAllocationOrder(), and there is further support
functions in RegisterClassInfo.

It is no longer possible to insert arbitrary code into generated
register classes. This is a feature.

llvm-svn: 133332
2011-06-18 03:08:20 +00:00
Jakob Stoklund Olesen
5da811d840 Provide AltOrders for specifying alternative allocation orders.
A register class can define AltOrders and AltOrderSelect instead of
defining method protos and bodies. The AltOrders lists can be defined
with set operations, and TableGen can verify that the alternative
allocation orders only contain valid registers.

This is currently an opt-in feature, and it is still possible to
override allocation_order_begin/end. That will not be true for long.

llvm-svn: 133320
2011-06-18 00:50:49 +00:00
Owen Anderson
a9bf21548f Fix formatting.
llvm-svn: 133164
2011-06-16 16:52:24 +00:00
Jakob Stoklund Olesen
ba7bfc5c85 Prempt some obnoxious compiler from complaing about signed/unsigned
compares.

2^30 is actually the limit on the number of physical registers per
TargetRegisterInfo.h.

llvm-svn: 133142
2011-06-16 03:07:40 +00:00
Jakob Stoklund Olesen
55ebec6b47 Make sure to pass an unsigned to a printf format that is always %u.
This should unbreak the native ARM testers.

llvm-svn: 133141
2011-06-16 02:55:56 +00:00
Owen Anderson
f98c2ea49d Add a new MVT::untyped. This will be used in future work for modelling ISA features like register pairs and lists with "interesting" constraints (such as ARM NEON contiguous register lists or even-odd paired registers). We need to be able to generate these instructions (often from intrinsics), but don't want to have to assign a legal type to them. Instead, we'll use an "untyped" edge to bypass the type-checking and simply ensure that the register classes match.
llvm-svn: 133106
2011-06-15 23:35:18 +00:00
John McCall
1324701c66 Update the Clang diagnostic emitter to emit IDs for diagnostic categories.
Patch by Argyrios Kyrtzidis.

llvm-svn: 133093
2011-06-15 21:43:52 +00:00
Owen Anderson
e1cebd9e2e Replace the statically generated hashtables for checking register relationships with just scanning the (typically tiny) static lists.
At the time I wrote this code (circa 2007), TargetRegisterInfo was using a std::set to perform these queries.  Switching to the static hashtables was an obvious improvement, but in reality there's no reason to do anything other than scan.
With this change, total LLC time on a whole-program 403.gcc is reduced by approximately 1.5%, almost all of which comes from a 15% reduction in LiveVariables time.  It also reduces the binary size of LLC by 86KB, thanks to eliminating a bunch of very large static tables.

llvm-svn: 133051
2011-06-15 06:53:50 +00:00
Jakob Stoklund Olesen
da55d81c8f Use a SetTheory instance to expand register lists in register classes.
This prepares tablegen to compute register lists from set theoretic dag
expressions. This doesn't really make any difference as long as
Target.td still declares RegisterClass::MemberList as [Register].

llvm-svn: 133043
2011-06-15 05:09:20 +00:00
Jakob Stoklund Olesen
4d17793443 Give CodeGenRegisterClass a real sorted member set.
Make the Elements vector private and expose an ArrayRef through
getOrder() instead. getOrder will eventually provide multiple
user-specified allocation orders.

Use the sorted member set for member and subclass tests. Clean up a lot
of ad hoc searches.

llvm-svn: 133040
2011-06-15 04:50:36 +00:00
Bill Wendling
5ae6b0c972 Improve the heuristic to emit the alias if the number of hard-coded registers
are also greater than the alias.

llvm-svn: 133038
2011-06-15 04:31:19 +00:00
Jakob Stoklund Olesen
5942b61865 Move the list of register classes into CodeGenRegBank as well.
No functional change intended.

llvm-svn: 133029
2011-06-15 00:20:40 +00:00
Jakob Stoklund Olesen
d5b029ad5b Fix a compile time regression caused by too small hash tables.
Measure the worst case number of probes for a miss instead of the less
conservative number of probes required for an insertion.

Lower the limit to < 6 probes worst case.

This doubles the size of the ARM and X86 hash tables, other targets are
unaffected. LiveVariables runs 12% faster with this change.

<rdar://problem/9598545>

llvm-svn: 132999
2011-06-14 16:58:16 +00:00
Bill Wendling
77d4d62693 Heuristic: If the number of operands in the alias are more than the number of
operands in the aliasee, don't print the alias.

llvm-svn: 132963
2011-06-14 03:17:20 +00:00
Jakob Stoklund Olesen
4c1c395789 Tweak hash function and compress hash tables.
Make the hash tables as small as possible while ensuring that all
lookups can be done in less than 8 probes.

Cut the aliases hash table in half by only storing a < b pairs - it
is a symmetric relation.

Use larger multipliers on the initial hash function to ensure that it
properly covers the whole table, and to resolve some clustering in the
very regular ARM register bank.

This reduces the size of most of these tables by 4x - 8x. For instance,
the ARM tables shrink from 48 KB to 8 KB.

llvm-svn: 132888
2011-06-12 07:04:32 +00:00
Jakob Stoklund Olesen
f3acb4cb4a Remove now dead code.
These computations have been moved to CodeGenRegisters.cpp.

llvm-svn: 132887
2011-06-12 07:04:28 +00:00
Jakob Stoklund Olesen
a74b94b4db Extract the generateHashTable function.
The constant hash tables for sub-registers and overlaps are generated
the same way, so extract a function to generate and print the hash
table.

Also use the information computed by CodeGenRegisters.cpp instead of the
locally data.

llvm-svn: 132886
2011-06-12 07:04:26 +00:00
Jakob Stoklund Olesen
7d0e28c893 Compute lists of sub-regs, super-regs, and overlapping regs.
Besides moving structural computations to CodeGenRegisters.cpp, this
also well-defines the order of these lists:

- Sub-register lists come from a pre-order traversal of the graph
  defined by the SubRegs lists in the .td files.

- Super-register lists are topologically ordered so no register comes
  before any of its sub-registers. When the sub-register graph is not a
  tree, independent super-registers appear in numerical order.

- Lists of overlapping registers are ordered according to register
  number.

This reverses the order of the super-regs lists, but nobody was
depending on that. The previous order of the overlaps lists was odd, and
it may have depended on the precise behavior of std::stable_sort.

The old computations are still there, but will be removed shortly.

llvm-svn: 132881
2011-06-12 03:05:52 +00:00
Jakob Stoklund Olesen
87b0b77d3f Move the list of registers into CodeGenRegBank.
Also move the sub-register index computations from RegisterInfoEmitter
into CodeGenRegBank.

llvm-svn: 132865
2011-06-11 00:28:06 +00:00
Jakob Stoklund Olesen
08f9ba1084 Move some sub-register index calculations to CodeGenRegisters.cpp
Create a new CodeGenRegBank class that will eventually hold all the code
that computes the register structure from Records.

llvm-svn: 132849
2011-06-10 18:40:00 +00:00
Jakob Stoklund Olesen
a096524531 Move TableGen's register bank classes to their own source file.
I'll be moving some more code there to gather all of the
register-specific stuff in one place. Currently it is shared between
CodeGenTarget and RegisterInfoEmitter.

The plan is that CodeGenRegisters can compute the full register bank
structure while RegisterInfoEmitter only will handle the printing part.

llvm-svn: 132788
2011-06-09 18:42:07 +00:00
Bob Wilson
c8dc6c21a7 Add special-case range checking for VCVT_N intrinsic immediate operands.
Radar 9558930.

llvm-svn: 132782
2011-06-09 16:57:29 +00:00
Chad Rosier
e69f7a381a Fixed a few illegal paths with llvm_unreachable. Patch by Cameron McInally.
llvm-svn: 132732
2011-06-07 20:41:31 +00:00
Jakob Stoklund Olesen
256a95e063 Drop a RecordKeeper reference that wasn't necessary.
llvm-svn: 132636
2011-06-04 07:49:55 +00:00
Jakob Stoklund Olesen
d202f5e0be Silence compiler warnings.
llvm-svn: 132624
2011-06-04 05:09:36 +00:00
Jakob Stoklund Olesen
9c97bf91c0 Teach TableGen to evaluate DAG expressions as set operations.
A TableGen backend can define how certain classes can be expanded into
ordered sets of defs, typically by evaluating a specific field in the
record. The SetTheory class can then evaluate DAG expressions that refer
to these named sets.

A number of standard set and list operations are predefined, and the
backend can add more specialized operators if needed. The -print-sets
backend is used by SetTheory.td to provide examples.

This is intended to simplify how register classes are defined:

  def GR32_NOSP : RegisterClass<"X86", [i32], 32, (sub GR32, ESP)>;

llvm-svn: 132621
2011-06-04 04:11:37 +00:00
Nick Lewycky
73b6cfd90c Rework the logic to not rely on undefined behaviour (1LL << 64). Also simplify.
llvm-svn: 132537
2011-06-03 08:25:39 +00:00
Jakob Stoklund Olesen
4f76a2bdc8 Make it possible to have unallocatable register classes.
Some register classes are only used for instruction operand constraints.
They should never be used for virtual registers. Previously, those
register classes were given an empty allocation order, but now you can
say 'let isAllocatable=0' in the register class definition.

TableGen calculates if a register is part of any allocatable register
class, and makes that information available in TargetRegisterDesc::inAllocatableClass.

The goal here is to eliminate use cases for overriding allocation_order_*
methods.

llvm-svn: 132508
2011-06-02 23:07:20 +00:00
Joerg Sonnenberger
ffa79cb359 Add new -d option to tblgen. It writes a make(1)-style dependency file.
llvm-svn: 132395
2011-06-01 13:10:15 +00:00
Bruno Cardoso Lopes
0bdb365634 Fix ssat and ssat16 encodings for ARM and Thumb. The bit position value
must be encoded decremented by one. Only add encoding tests for ssat16
because ssat can't be parsed yet.

llvm-svn: 132324
2011-05-31 03:33:27 +00:00
Rafael Espindola
33f7d7f9fa Use the dwarf->llvm mapping to print register names in the cfi
directives.

Fixes PR9826.

llvm-svn: 132317
2011-05-30 20:20:15 +00:00
Rafael Espindola
5917c1f6ec Introduce the DwarfRegAlias class for declaring that two registers have the
same dwarf number. This will be used for creating a dwarf number to register
mapping.

The only case that needs this so far is the XMM/YMM registers that unfortunately
do have the same numbers.

llvm-svn: 132314
2011-05-30 17:49:59 +00:00
John McCall
fd85fdee7c Change how tblgen generates attributes for intrinsics to use a single
switch.  With this newfound organization, teach tblgen how not to give
all intrinsics the 'nounwind' attribute.  Introduce a new intrinsic,
llvm.eh.resume, which does not have this attribute.  Documentation and uses
to follow.

llvm-svn: 132252
2011-05-28 06:31:34 +00:00
Rafael Espindola
386c4259db Fix the root cause of the bootstrap failure:
There was no way to check if a given register/mode pair was valid. We now return
an error code (-2) instead of asserting. If anyone thinks that an assert
at this point  is really needed, we can autogen a hasValidDwarfRegNum instead.

llvm-svn: 132236
2011-05-28 00:13:01 +00:00
Argyrios Kyrtzidis
f5fe5499f9 [tablegen] A couple of changes to ClangDiagnosticEmmitter.
-Emit an empty warning option as string ("") instead of 0.
-For diagnostic names also emit the size of the string.

llvm-svn: 132046
2011-05-25 05:04:22 +00:00
Bill Wendling
6f30676150 Use a more efficient data structure for the "operand map". The number of
operands to an instruction aren't great, so an iterative search is fairly quick
and doesn't have the overhead of std::map.

llvm-svn: 131886
2011-05-23 00:18:33 +00:00
Cameron Zwarich
e876d96b4e Fix PR9947 by placing OPFL_MemRefs on the node using memory operands rather than
the root if there is only one such node. This leaves only 2 verifier failures in
the entire test suite when running "make check".

llvm-svn: 131677
2011-05-19 21:13:30 +00:00
Jakob Stoklund Olesen
509b4ecd92 Downgrade a tablegen warning to an error.
Ambiguous sub-register index compositions are OK as long as the backend writer
knows what he is doing.

llvm-svn: 131134
2011-05-10 17:52:59 +00:00
Mon P Wang
08d3b69861 Fixed MC encoding for index_align for VLD1/VST1 (single element from one lane) for size 32
llvm-svn: 131085
2011-05-09 17:47:27 +00:00
Jakob Stoklund Olesen
3bc1816380 Teach TableGen to automatically generate missing SubRegIndex instances.
The RegisterInfo.td file should only specify the indexes that sources need to
refer to. The rest is inferred.

llvm-svn: 131058
2011-05-07 21:22:39 +00:00
Jim Grosbach
780c27bb61 Improve diagnostics for some parse errors. Not asserting when a user input
error is detected is a good thing.

llvm-svn: 131005
2011-05-06 18:47:45 +00:00
Jim Grosbach
f1f78457f3 ParseFile() may throw, so extend the try/catch to handle that.
llvm-svn: 131004
2011-05-06 18:39:28 +00:00
Mikhail Glushenkov
14e7792820 llvmc: Make it possible to provide an argument to (join).
llvm-svn: 130914
2011-05-05 04:24:58 +00:00
Jim Grosbach
833ffeb2cd Tidy up. Add missing newline to generated file.
llvm-svn: 130779
2011-05-03 19:09:56 +00:00
Eli Friedman
0667319d62 Filter out pattterns from the FastISel emitter which it doesn't actually know how to handle. No significant functionality change at the moment, but it's necessary for some changes I'm planning.
llvm-svn: 130547
2011-04-29 21:58:31 +00:00
Owen Anderson
5ea854079d Fix a bug in tblgen that caused incorrect encodings on instructions that specified operands with "bit" instead of "bits<1>".
Unfortunately, my only testcase for this is fragile, and the ARM AsmParser can't round trip the instruction in question.
<rdar://problem/9345702>

llvm-svn: 130410
2011-04-28 17:51:45 +00:00
Mikhail Glushenkov
e2c4cc8224 Add a TODO.
llvm-svn: 130092
2011-04-24 14:17:41 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Johnny Chen
dfac31bc1b Disassembly of A8.6.59 LDR (literal) Encoding T1 (16-bit thumb instruction) should
print out ldr, not ldr.n.

rdar://problem/9267772

llvm-svn: 130008
2011-04-22 19:12:43 +00:00
Bob Wilson
dbe2447934 Define Neon load/store intrinsics for Clang as macros instead of functions.
This is needed so the front-end can see "aligned" attributes on the type
for the pointer arguments.  Radar 9311427.

llvm-svn: 129964
2011-04-22 00:37:01 +00:00
Jakob Stoklund Olesen
5168088bcf Don't allow per-register spill size and alignment.
These values were not used for anything. Spill size and alignment is a property
of the register class, not the register.

llvm-svn: 129906
2011-04-21 03:43:21 +00:00
Jakob Stoklund Olesen
6501ea2557 Prefer cheap registers for busy live ranges.
On the x86-64 and thumb2 targets, some registers are more expensive to encode
than others in the same register class.

Add a CostPerUse field to the TableGen register description, and make it
available from TRI->getCostPerUse. This represents the cost of a REX prefix or a
32-bit instruction encoding required by choosing a high register.

Teach the greedy register allocator to prefer cheap registers for busy live
ranges (as indicated by spill weight).

llvm-svn: 129864
2011-04-20 18:19:48 +00:00
Eric Christopher
bd8bbe5934 Invert the meaning of printAliasInstr's return value. It now returns
true on success and false on failure. Update callers.

llvm-svn: 129722
2011-04-18 21:28:11 +00:00
Owen Anderson
d98b684f30 Enhance the fixed-length disassembler to support the callbacks necessary for symbolic disassembly.
llvm-svn: 129708
2011-04-18 18:42:26 +00:00
Chris Lattner
a473329704 Add a new bit that ImmLeaf's can opt into, which allows them to duck out of
the generated FastISel.  X86 doesn't need to generate code to match ADD16ri8 
since ADD16ri will do just fine.  This is a small codesize win in the generated
instruction selector.

llvm-svn: 129692
2011-04-18 06:36:55 +00:00
Chris Lattner
eb78c66d3a Implement major new fastisel functionality: the matcher can now handle immediates with
value constraints on them (when defined as ImmLeaf's).  This is particularly important
for X86-64, where almost all reg/imm instructions take a i64immSExt32 immediate operand,
which has a value constraint.  Before this patch we ended up iseling the examples into
such amazing code as:

	movabsq	$7, %rax
	imulq	%rax, %rdi
	movq	%rdi, %rax
	ret

now we produce:

	imulq	$7, %rdi, %rax
	ret

This dramatically shrinks the generated code at -O0 on x86-64.

llvm-svn: 129691
2011-04-18 06:22:33 +00:00
Chris Lattner
ffa308d572 introduce a new OpKind abstraction which wraps up operand flavors in a tidy little wrapper.
No functionality change.

llvm-svn: 129680
2011-04-17 23:29:05 +00:00
Chris Lattner
6bf4d85361 change OperandsSignature to use SmallVector<char> instead of std::vector<string>
since the strings are always exactly one character, and there are usually only 2-3 operands.

llvm-svn: 129678
2011-04-17 22:24:13 +00:00
Chris Lattner
7ca810dd13 since the VT is fixed for a ImmLeaf, there is no reason to expose it to the matching code.
llvm-svn: 129677
2011-04-17 22:17:27 +00:00
Chris Lattner
2d89feb795 now that predicates have a decent abstraction layer on them, introduce a new
kind of predicate: one that is specific to imm nodes.  The predicate function
specified here just checks an int64_t directly instead of messing around with
SDNode's.  The virtue of this is that it means that fastisel and other things
can reason about these predicates.

llvm-svn: 129675
2011-04-17 22:05:17 +00:00
Chris Lattner
d776e76c44 Rework our internal representation of node predicates to expose more
structure and fix some fixmes.  We now have a TreePredicateFn class
that handles all of the decoding of these things.  This is an internal
cleanup that has no impact on the code generated by tblgen.

llvm-svn: 129670
2011-04-17 21:38:24 +00:00
Chris Lattner
835ef2b8f4 remove some debugging code I added.
llvm-svn: 129668
2011-04-17 21:36:19 +00:00
Chris Lattner
28eaf6be7f 1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.ll
2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts
3. teach tblgen to handle shift immediates that are different sizes than the 
   shifted operands, eliminating some code from the X86 fast isel backend.
4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function
   instead of FastEmit_ri to simplify code.

llvm-svn: 129666
2011-04-17 20:23:29 +00:00
Douglas Gregor
2bebd9880d Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
llvm-svn: 129613
2011-04-15 22:04:07 +00:00
Evan Cheng
e33e4028a6 Increase SubtargetFeatureKV Value and Implies fields to 64 bits since some targets are getting very close to 32 subtarget features. Also teach tablegen to error when there are more than 64 features to guard against undefined behavior. rdar://9282332
llvm-svn: 129590
2011-04-15 19:35:46 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Bill Wendling
500b41a7a5 Add an option to not print the alias of an instruction. It defaults to "print
the alias".

llvm-svn: 129485
2011-04-13 23:36:21 +00:00
Johnny Chen
443a6902bf Thumb disassembler was erroneously rejecting "blx sp" instruction.
rdar://problem/9267838

llvm-svn: 129320
2011-04-11 23:33:30 +00:00
NAKAMURA Takumi
0e00d1971e TableGen: Keep the order of DECL_CONTEXT() for DeclNodes.td. RecordVector may be used instead of RecordSet.
The result of DeclNodes.inc was unstable on msys, Windows 7 x64.

llvm-svn: 129317
2011-04-11 23:20:28 +00:00
Bill Wendling
fafa0c2509 Only emit the AvailableFeatures variable if it's used.
llvm-svn: 129124
2011-04-08 04:08:57 +00:00
Bill Wendling
342ba5c4b6 Replace the old algorithm that emitted the "print the alias for an instruction"
with the newer, cleaner model. It uses the IAPrinter class to hold the
information that is needed to match an instruction with its alias. This also
takes into account the available features of the platform.

There is one bit of ugliness. The way the logic determines if a pattern is
unique is O(N**2), which is gross. But in reality, the number of items it's
checking against isn't large. So while it's N**2, it shouldn't be a massive time
sink.

llvm-svn: 129110
2011-04-07 21:20:06 +00:00
Joerg Sonnenberger
1cbd300346 Add support for the VIA PadLock instructions.
llvm-svn: 128826
2011-04-04 16:58:13 +00:00
Joerg Sonnenberger
aedfaff262 Use array_lengthof
llvm-svn: 128823
2011-04-04 16:25:38 +00:00
Joerg Sonnenberger
4acf601864 Change loops to derive the number of tables automatically
llvm-svn: 128818
2011-04-04 14:42:22 +00:00
Daniel Dunbar
7e8cb9fc5e tlbgen/MC: StringRef's to temporary objects considered harmful.
llvm-svn: 128735
2011-04-01 20:23:52 +00:00
Andrew Trick
5d212b6374 Add annotations to tablegen-generated processor itineraries, or replace them with something meaningful. I want to be able to read and debug the generated tables.
llvm-svn: 128703
2011-04-01 02:22:47 +00:00
Andrew Trick
ee4b7e695a whitespace
llvm-svn: 128701
2011-04-01 01:56:55 +00:00
Bob Wilson
5e30c4c931 Use intrinsics for Neon vmull operations. Radar 9208957.
llvm-svn: 128591
2011-03-31 00:09:35 +00:00
Argyrios Kyrtzidis
bea6ccf737 ClangSAEmClangSACheckersEmitter, emit info about groups.
llvm-svn: 128515
2011-03-30 00:22:00 +00:00
Matt Beaumont-Gay
bf215beedb Quiet a gcc warning about changed name lookup rules
llvm-svn: 128497
2011-03-29 22:25:36 +00:00
Argyrios Kyrtzidis
e923f22a2e In ClangSACheckersEmitter:
- Also emit a list of packages and groups sorted by name
  - Avoid iterating over DenseSet so that the output of the arrays is deterministic.

llvm-svn: 128489
2011-03-29 21:16:19 +00:00
Argyrios Kyrtzidis
71261edb9b For ClangSACheckersEmitter, allow a package to belong to checker group, in which all its checkers will go into the group.
llvm-svn: 128474
2011-03-29 18:53:00 +00:00
Douglas Gregor
88d8c14766 Extend Clang's TableGen emitter for attributes to support bool arguments.
llvm-svn: 128330
2011-03-26 03:40:01 +00:00
Johnny Chen
a4f73530a5 delegate the disassembly of t2ADR to the more generic t2ADDri12/t2SUBri12 instructions, and add a test case for that.
llvm-svn: 128249
2011-03-25 00:17:42 +00:00
Johnny Chen
4a55a733b8 The opcode names ("tLDM", "tLDM_UPD") used for conflict resolution have been stale since
the change to ("tLDMIA", "tLDMIA_UPD").  Update the conflict resolution code and add
test cases for that.

llvm-svn: 128247
2011-03-24 23:42:31 +00:00
Johnny Chen
6345e6a882 The ARM disassembler was confused with the 16-bit tSTMIA instruction.
According to A8.6.189 STM/STMIA/STMEA (Encoding T1), there's only tSTMIA_UPD available.
Ignore tSTMIA for the decoder emitter and add a test case for that.

llvm-svn: 128246
2011-03-24 23:21:14 +00:00
Bruno Cardoso Lopes
a5de5df6d8 Add asm parsing support w/ testcases for strex/ldrex family of instructions
llvm-svn: 128236
2011-03-24 21:04:58 +00:00
Johnny Chen
ae5d27987a ADR was added with the wrong encoding for inst{24-21}, and the ARM decoder was fooled.
Set the encoding bits to {0,?,?,0}, not 0.  Plus delegate the disassembly of ADR to
the more generic ADDri/SUBri instructions, and add a test case for that.

llvm-svn: 128234
2011-03-24 20:42:48 +00:00
Douglas Gregor
d11c0d2ab8 Update the Clang attribute emitter to handle attributes of 'version'
kind, and fix serialization/deserialization of IdentifierInfo
attributes. These are requires for the new 'availability' attribute.

llvm-svn: 128130
2011-03-23 01:05:46 +00:00
Bill Wendling
52c4596a0f Call static functions so that they aren't left unused.
llvm-svn: 128020
2011-03-21 21:08:27 +00:00
Bill Wendling
9adf1c9edd A WIP commit of the InstAlias printing cleanup. This code will soon replace the
code below it. Even though it looks very similar, it will match more precisely
and geneate better functions in the long run.

llvm-svn: 127991
2011-03-21 08:59:17 +00:00
Bill Wendling
4cdb29548b Add the IAPrinter class.
This is a helper class that will make it easier to say which InstAliases can be
printed and which cannot (because of ambiguity).

llvm-svn: 127990
2011-03-21 08:40:31 +00:00
Bill Wendling
e3b0820ad4 * Add classes that support the "feature" information.
* Move the code that emits the reg in reg class matching into its own function.

llvm-svn: 127988
2011-03-21 08:31:53 +00:00
Owen Anderson
c23c6e0c1a Thumb2 PC-relative loads require a fixup rather than just an immediate.
llvm-svn: 127888
2011-03-18 17:42:55 +00:00
Evan Cheng
14eff5d627 - Add "Bitcast" target instruction property for instructions which perform
nothing more than a bitcast.
- Teach tablegen to automatically infer "Bitcast" property.

llvm-svn: 127667
2011-03-15 05:09:26 +00:00
Sean Callanan
5a51ccdc0f X86 table-generator and disassembler support for the AVX
instruction set.  This code adds support for the VEX prefix
and for the YMM registers accessible on AVX-enabled
architectures.  Instruction table support that enables AVX
instructions for the disassembler is in an upcoming patch.

llvm-svn: 127644
2011-03-15 01:23:15 +00:00
Owen Anderson
49965661d5 Ignore isCodeGenOnly instructions when generating diassembly tables.
llvm-svn: 127619
2011-03-14 20:58:49 +00:00
Jim Grosbach
973ab94013 Trailing whitespace.
llvm-svn: 127592
2011-03-14 17:32:49 +00:00
Francois Pichet
0e434150f9 Correct small comment order typo.
llvm-svn: 127575
2011-03-14 02:30:32 +00:00
Jim Grosbach
a87f223848 Remove no-longer-correct special case for disasm of ARM BL instructions.
llvm-svn: 127517
2011-03-12 01:05:29 +00:00
Jim Grosbach
daffeb06fb Pseudo-ize the ARM 'B' instruction.
llvm-svn: 127510
2011-03-11 23:24:15 +00:00
Jim Grosbach
2226dfbea2 Remove dead code. These ARM instruction definitions no longer exist.
llvm-svn: 127509
2011-03-11 23:15:02 +00:00
Jim Grosbach
01a937ac07 Remove dead code. These ARM instruction definitions no longer exist.
llvm-svn: 127508
2011-03-11 23:11:41 +00:00
Jim Grosbach
009af69d6d Pseudo-ize VMOVDcc and VMOVScc.
llvm-svn: 127506
2011-03-11 23:09:50 +00:00
Jim Grosbach
b480da2317 Remove dead code. These ARM instruction definitions don't exist.
llvm-svn: 127491
2011-03-11 20:51:07 +00:00
Jim Grosbach
ee6075cda5 ARM VDUPfd and VDUPfq can just be patterns. The instruction is the same
as for VDUP32d and VDUP32q, respectively.

llvm-svn: 127489
2011-03-11 20:44:08 +00:00
Jim Grosbach
cb57d3b1d9 Remove dead code. These ARM instruction definitions don't exist.
llvm-svn: 127488
2011-03-11 20:38:18 +00:00
Jim Grosbach
3329263352 ARM VDUPLNfq and VDUPLNfd definitions can just be Pat<>s for VDUPLN32q
and VDUPLN32d, respectively.

llvm-svn: 127486
2011-03-11 20:31:17 +00:00
Jim Grosbach
431682981d ARM VREV64df and VREV64qf can just be patterns. The instruction is the same
as for VREV64d32 and VREV64q32, respectively.

llvm-svn: 127485
2011-03-11 20:18:05 +00:00
Jim Grosbach
9e8cf109dc Add missing 'return on failure'. Previously we'd crash after emitting
the diagnostic.

llvm-svn: 127480
2011-03-11 19:52:52 +00:00
Jim Grosbach
c7548fce48 Teach TableGen to pre-calculate register enum values when creating the
CodeGenRegister entries. Use this information to more intelligently build
the literal register entires in the DAGISel matcher table. Specifically,
use a single-byte OPC_EmitRegister entry for registers with a value of
less than 256 and OPC_EmitRegister2 entry for registers with a larger value.

rdar://9066491

llvm-svn: 127456
2011-03-11 02:19:02 +00:00
Jim Grosbach
6e41ec016b Make the register enum value part of the CodeGenRegister struct.
llvm-svn: 127448
2011-03-11 01:33:54 +00:00
Jim Grosbach
2c9ce71360 Trailing whitespace.
llvm-svn: 127447
2011-03-11 01:27:24 +00:00
Jim Grosbach
9834ed0ef4 Trailing whitespace.
llvm-svn: 127446
2011-03-11 01:19:05 +00:00
Jim Grosbach
9cddc3746d Tidy up since ARM MOVCCi and MOVCCi16 are now pseudos.
llvm-svn: 127445
2011-03-11 01:16:49 +00:00
Jim Grosbach
1986d9ac8f Properly pseudo-ize MOVCCr and MOVCCs.
llvm-svn: 127434
2011-03-10 23:56:09 +00:00
Jim Grosbach
41694b91ad Memory barrier instructions don't need special handling in tblgen anymore.
llvm-svn: 127419
2011-03-10 19:05:48 +00:00
Bill Wendling
958e854f40 Rename the narrow shift right immediate operands to "shr_imm*" operands. Also
expand the testing of the narrowing shift right instructions.

No functionality change.

llvm-svn: 127193
2011-03-07 23:38:41 +00:00
Bob Wilson
e24bee9ce8 TableGen should not ignore BX instructions for the ARM disassembler. pr9368.
llvm-svn: 126931
2011-03-03 07:19:52 +00:00
Bob Wilson
42f80596ca pr9367: Add missing predicated BLX instructions.
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.

llvm-svn: 126915
2011-03-03 01:41:01 +00:00
John McCall
8346b49836 Teach the clang attribute emitter about InheritableParamAttr.
Intended to be atomic with clang r126828.

llvm-svn: 126827
2011-03-02 04:00:52 +00:00
Jim Grosbach
3b72823981 trailing whitespace.
llvm-svn: 126733
2011-03-01 01:39:05 +00:00
Jim Grosbach
fbdcd70f4b Generalize the register matching code in DAGISel a bit.
llvm-svn: 126731
2011-03-01 01:37:19 +00:00
Bill Wendling
304dda7810 Narrow right shifts need to encode their immediates differently from a normal
shift.

   16-bit: imm6<5:3> = '001', 8 - <imm> is encded in imm6<2:0>
   32-bit: imm6<5:4> = '01',16 - <imm> is encded in imm6<3:0>
   64-bit: imm6<5> = '1', 32 - <imm> is encded in imm6<4:0>

llvm-svn: 126723
2011-03-01 01:00:59 +00:00
Bill Wendling
91cce6cc1d A new TableGen feature! (Not turned on just yet.)
InstAlias<{alias}, {aliasee}>;

The InstAlias instruction should be able to go from the MCInst to the
{alias}. All of the information is there to match the MCInst with the
{aliasee}. From there, it's a simple matter to emit the {alias}, with the
correct operands from the {aliasee}.

The code this patch generates can be used by the InstPrinter to automatically
print out the alias without having to write special C++ code to handle the
situation.

This is a WIP, and therefore are several limitations. For instance, it cannot
handle AsmOperands at the moment. It also doesn't know what to do when two
{alias}es match the same {aliasee}. (Currently, it just ignores those two cases
and allows the printInstruction method to handle them.)

llvm-svn: 126538
2011-02-26 03:09:12 +00:00
Argyrios Kyrtzidis
1b1e152fc0 In utils/TableGen/ClangSACheckersEmitter.cpp, set the 'Hidden' bit for checkers.
llvm-svn: 126436
2011-02-24 21:33:49 +00:00
Rafael Espindola
e4a04cce2b Implement xgetbv and xsetbv.
Patch by Jai Menon.

llvm-svn: 126165
2011-02-22 00:35:18 +00:00
Oscar Fuentes
22247bd624 Put targets on folders, if the IDE supports the feature.
Requires CMake 2.8.3 or newer.

llvm-svn: 126092
2011-02-20 22:06:10 +00:00
Oscar Fuentes
704198a74e CMake: updated list of tblgen source files.
llvm-svn: 125969
2011-02-18 22:06:23 +00:00
Owen Anderson
a2d2de33c5 Add FixedLenDecoderEmitter, the skeleton of a new disassembler emitter for fixed-length instruction encodings.
A major part of its (eventual) goal is to support a much cleaner separation between disassembly callbacks
provided by the target and the disassembler emitter itself, i.e. not requiring hardcoding of knowledge in tblgen
like the existing disassembly emitters do.

The hope is that some day this will allow us to replace the existing non-Thumb ARM disassembler and remove
some of the hacks the old one introduced to tblgen.

llvm-svn: 125966
2011-02-18 21:51:29 +00:00
Joerg Sonnenberger
adef15e109 Check that MnemonicAlias doesn't map back to the same string.
llvm-svn: 125792
2011-02-17 23:22:19 +00:00
Alexis Hunt
be0782975d Add serialization for Expr* arguments for attributes to clang tablegen files.
Patch thanks to Zach Anderson.

llvm-svn: 125721
2011-02-17 03:30:09 +00:00
Argyrios Kyrtzidis
f19978df28 When tablegen'ing the clang analyzer checkers:
-Use the tablegen class name for the checker class name.
-Mark checker packages as hidden/not hidden.

llvm-svn: 125558
2011-02-15 07:42:16 +00:00
Argyrios Kyrtzidis
c5c3ca71c0 Add the ClangSACheckersEmitter tablegen backend which will be used for the clang static analyzer.
llvm-svn: 125493
2011-02-14 17:58:52 +00:00
Bruno Cardoso Lopes
e65a98b127 Fix encoding and add parsing support for the arm/thumb CPS instruction:
- Add custom operand matching for imod and iflags.
- Rename SplitMnemonicAndCC to SplitMnemonic since it splits more than CC
  from mnemonic.
- While adding ".w" as an operand, don't change "Head" to avoid passing the
  wrong mnemonic to ParseOperand.
- Add asm parser tests.
- Add disassembler tests just to make sure it can catch all cps versions.

llvm-svn: 125489
2011-02-14 13:09:44 +00:00
Argyrios Kyrtzidis
aded28619c Wrap the struct in an anonymous namespace.
llvm-svn: 125452
2011-02-13 07:51:19 +00:00
Jim Grosbach
c359122d78 AsmMatcher custom operand parser failure enhancements.
Teach the AsmMatcher handling to distinguish between an error custom-parsing
an operand and a failure to match. The former should propogate the error
upwards, while the latter should continue attempting to parse with
alternative matchers.

Update the ARM asm parser accordingly.

llvm-svn: 125426
2011-02-12 01:34:40 +00:00
Jim Grosbach
1ba77f9624 Tidy out asm matcher .inc output.
llvm-svn: 125408
2011-02-11 21:31:55 +00:00
Bill Wendling
bbb31e6663 Don't return before calling the post-processing function(s).
llvm-svn: 125256
2011-02-10 01:28:26 +00:00
Jim Grosbach
48e8554772 Do AsmMatcher operand classification per-opcode.
When matching operands for a candidate opcode match in the auto-generated
AsmMatcher, check each operand against the expected operand match class.
Previously, operands were classified independently of the opcode being
handled, which led to difficulties when operand match classes were
more complicated than simple subclass relationships.

llvm-svn: 125245
2011-02-10 00:08:28 +00:00
Bruno Cardoso Lopes
6ad8313c84 Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
 /* Mnemonic, Operand List Mask, Operand Class, Features */
 { "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
 { "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

 case MCK_Coproc:
   return TryParseCoprocessorOperandName(Operands);

llvm-svn: 125030
2011-02-07 19:38:32 +00:00
Daniel Dunbar
5fb9f9c756 MC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
implicitly allows custom conversions to be member functions.

llvm-svn: 124908
2011-02-04 23:17:40 +00:00
Jason W Kim
10c1a81736 Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.
(yes, this is different from R_ARM_CALL)

- Adds a new method getARMBranchTargetOpValue() which handles the
  necessary distinction between the conditional and unconditional br/bl
  needed for ARM/ELF

At least for ARM mode, the needed fixup for conditional versus unconditional
br/bl is identical, but the ARM docs and existing ARM tools expect this
reloc type...

Added a few FIXME's for future naming fixups in ARMInstrInfo.td

llvm-svn: 124895
2011-02-04 19:47:15 +00:00
Daniel Dunbar
622bb34af8 MC/AsmParser: Add support for allowing the conversion process to fail (via
custom conversion functions).

llvm-svn: 124872
2011-02-04 17:12:23 +00:00
Daniel Dunbar
c89a150d94 MC/AsmMatcher: Add support for custom conversion functions.
llvm-svn: 124870
2011-02-04 17:12:15 +00:00
David Greene
21bfdb7527 Silence uninitialized value warnings.
llvm-svn: 124869
2011-02-04 17:01:53 +00:00
Jim Grosbach
431e5539ed Tidy up a bit.
llvm-svn: 124832
2011-02-03 23:26:36 +00:00
Oscar Fuentes
51a072b7d8 Changes for building Clang and others using LLVM as an external
library.

Installs tblgen (required by Clang).

Translates handling of user settings and platform-dependant options to
its own file, where it can included by another project.

Installs the .cmake files required by projects like Clang.

llvm-svn: 124816
2011-02-03 20:57:36 +00:00
Kevin Enderby
6c73ff04e4 Changed the TableGen created MatchInstructionImpl() setting of ErrorInfo.
The algorithm for identifying which operand is invalid will now always point to
some operand and not the mnemonic sometimes.  The change is now that ErrorInfo
is the index of the highest operand that does not match for any of the matching
mnemonics records.  And no longer the ~0U value when the mnemonic matches and
not every record with a matching mnemonic has the same mismatching operand
index.

llvm-svn: 124734
2011-02-02 18:20:55 +00:00
David Greene
e563b14e41 [AVX] Implement EnforceSmallerThan for mixed int/fp type lists. This
makes type checking for extract_subvector and insert_subvector more
robust and will allow stricter typechecking of more patterns in the
future.

This change handles int and fp as disjoint sets so that it will
enforce integer types to be smaller than the largest integer type and
fp types to be smaller than the largest fp type.  There is no attempt
to check type sizes across the int/fp sets.

llvm-svn: 124672
2011-02-01 19:12:32 +00:00
Bob Wilson
0b0692bd8d Fix a comment typo.
llvm-svn: 124450
2011-01-27 23:08:52 +00:00
Douglas Gregor
8d44712818 Clang: separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior.
llvm-svn: 124440
2011-01-27 21:06:17 +00:00
Bob Wilson
e93c1add9e Add a MnemonicIsValid method to the asm matcher.
Patch by Bill Wendling.

llvm-svn: 124328
2011-01-26 21:43:46 +00:00
Bob Wilson
6675dea05d Fix spelling of CouldMatchAmbiguouslyWith method name.
llvm-svn: 124324
2011-01-26 21:26:21 +00:00
Bob Wilson
397316f33a Whitespace and 80-column fixes.
llvm-svn: 124323
2011-01-26 21:26:19 +00:00
Bob Wilson
6850ea9790 Improve the AsmMatcher's ability to handle suboperands.
When an operand class is defined with MIOperandInfo set to a list of
suboperands, the AsmMatcher has so far required that operand to also define
a custom ParserMatchClass, and InstAlias patterns have not been able to
set the individual suboperands separately.  This patch removes both of those
restrictions.  If a "compound" operand does not override the default
ParserMatchClass, then the AsmMatcher will now parse its suboperands
separately.  If an InstAlias operand has the same class as the corresponding
compound operand, then it will be handled as before; but if that check fails,
TableGen will now try to match up a sequence of InstAlias operands with the
corresponding suboperands.

llvm-svn: 124314
2011-01-26 19:44:55 +00:00
NAKAMURA Takumi
a2cf7854a1 TableGen: PointerLikeRegClass can be accepted to operand.
llvm-svn: 124271
2011-01-26 02:03:48 +00:00
NAKAMURA Takumi
066378440a Fix whitespace.
llvm-svn: 124270
2011-01-26 02:03:37 +00:00
Daniel Dunbar
c07888ef8d tblgen/AsmMatcherEmitter: Fix alias handling to honor -match-prefix.
llvm-svn: 124154
2011-01-24 23:26:31 +00:00
David Greene
1c4fa5e643 [AVX] Add type checking support for vector/subvector type constraints.
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode.  INSERT_SUBVECTOR in turn is very useful for
matching to VINSERTF128 instructions and complements the already
existing EXTRACT_SUBVECTOR SDNode.

llvm-svn: 124145
2011-01-24 20:53:18 +00:00
Bill Wendling
85fb50d56c ARM uses '.' in their tokens. Give it a name instead of a numeric value.
llvm-svn: 124026
2011-01-22 09:44:32 +00:00
Peter Collingbourne
0f816f75d0 tblgen: Add support for non-inheritable attributes
This patch makes the necessary changes to TableGen to support
non-inheritable attributes.

llvm-svn: 123958
2011-01-21 02:08:26 +00:00
Bob Wilson
959aad8197 Move InstAlias check of argument types to a separate loop.
llvm-svn: 123934
2011-01-20 18:38:10 +00:00
Bob Wilson
7c1ca31c1d Tidy comment.
llvm-svn: 123933
2011-01-20 18:38:07 +00:00
Bob Wilson
d178f6d009 Fix broken check for InstAlias argument used with different types.
llvm-svn: 123932
2011-01-20 18:38:05 +00:00
Bob Wilson
a234847b58 Precompute InstAlias operand mapping to result instruction operand indices.
There should be no functional change from this, but I think it's simpler this
way.

llvm-svn: 123931
2011-01-20 18:38:02 +00:00
Douglas Gregor
8a1c4fd8ce Fix comment for gen-clang-decl-nodes tblgen backend, from Michael Han
llvm-svn: 123833
2011-01-19 15:57:47 +00:00
Owen Anderson
ed4acd59cb When matching asm operands, always try to match the most restricted type first.
Unfortunately, while this is the "right" thing to do, it breaks some ARM
asm parsing tests because MemMode5 and ThumbMemModeReg are ambiguous.  This
is tricky to resolve since neither is a subset of the other.

XFAIL the test for now.  The old way was broken in other ways, just ways
we didn't happen to be testing, and our ARM asm parsing is going to require
significant revisiting at a later point anyways.

llvm-svn: 123786
2011-01-18 23:01:21 +00:00
Bruno Cardoso Lopes
94247155c4 Add support for parsing and encoding ARM's official syntax for the BFI instruction
llvm-svn: 123770
2011-01-18 20:45:56 +00:00
Daniel Dunbar
b8debfe450 Formatting tweak.
llvm-svn: 123718
2011-01-18 01:59:30 +00:00