Commit Graph

3011 Commits

Author SHA1 Message Date
Bill Wendling e94d843e43 s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
llvm-svn: 169651
2012-12-07 23:16:57 +00:00
Andrew Trick 7f7cee39ab RegisterPresssureTracker: Track live physical register by unit.
This is much simpler to reason about, more efficient, and
fixes some corner cases involving implicit super-register defs.
Fixed rdar://12797931.

llvm-svn: 169425
2012-12-05 21:37:42 +00:00
Andrew Trick 510e606e19 RegisterPressure API. Add support for physical register units.
At build-time register pressure was always computed in terms of
register units. But the compile-time API was expressed in terms of
register classes because it was intended for virtual registers (and
physical register units weren't yet used anywhere in codegen).

Now that the codegen uses physreg units consistently, prepare for
tracking register pressure also in terms of live units, not live
registers.

llvm-svn: 169360
2012-12-05 06:47:12 +00:00
Michael J. Spencer 41ee041d4f Copy clang/Driver/<Option parsing stuff> to llvm.
llvm-svn: 169344
2012-12-05 00:29:32 +00:00
Chandler Carruth 91d19d8e93 Sort the #include lines for utils/...
I've tried to find main moudle headers where possible, but the TableGen
stuff may warrant someone else looking at it.

llvm-svn: 169251
2012-12-04 10:37:14 +00:00
Jakob Stoklund Olesen 7afe1663e9 Add an MCPhysReg typedef to replace naked uint16_t.
Use this type for arrays of physical registers.

llvm-svn: 168850
2012-11-29 02:39:28 +00:00
Jakob Stoklund Olesen 9de596e650 Remove all references to TargetInstrInfoImpl.
This class has been merged into its super-class TargetInstrInfo.

llvm-svn: 168760
2012-11-28 02:35:17 +00:00
Bill Wendling f86efb9b98 Make the AttrListPtr object a part of the LLVMContext.
When code deletes the context, the AttributeImpls that the AttrListPtr points to
are now invalid. Therefore, instead of keeping a separate managed static for the
AttrListPtrs that's reference counted, move it into the LLVMContext and delete
it when deleting the AttributeImpls.

llvm-svn: 168354
2012-11-20 05:09:20 +00:00
Weiming Zhao 8f56f88661 Remove hard coded registers in ARM ldrexd and strexd instructions
This patch replaces the hard coded GPR pair [R0, R1] of
Intrinsic:arm_ldrexd and [R2, R3] of Intrinsic:arm_strexd with
even/odd GPRPair reg class.
Similar to the lowering of atomic_64 operation.

llvm-svn: 168207
2012-11-16 21:55:34 +00:00
Evandro Menezes 03789a9ec7 Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

PS: this fixes issue with revision #167634.
llvm-svn: 167635
2012-11-09 21:27:03 +00:00
Evandro Menezes 567698a6ca Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

llvm-svn: 167634
2012-11-09 20:29:37 +00:00
Michael Liao 73cffddb95 Add support of RTM from TSX extension
- Add RTM code generation support throught 3 X86 intrinsics:
  xbegin()/xend() to start/end a transaction region, and xabort() to abort a
  tranaction region

llvm-svn: 167573
2012-11-08 07:28:54 +00:00
Rafael Espindola 7296139d5e Fix a build problem with xlc. The error message was
"../llvm-git/utils/TableGen/CodeGenSchedule.cpp", line 1594.12: 1540-0218 (S) The call does not match any parameter list for "operator+".
"../llvm-git/include/llvm/ADT/STLExtras.h", line 130.1: 1540-1283 (I) "template <class _Iterator, class Func> llvm::operator+(mapped_iterator<_Iterator,Func>::difference_type, const mapped_iterator<_Iterator,Func> &)" is not a viable candidate.

Patch by Kai.

llvm-svn: 167311
2012-11-02 20:57:36 +00:00
Jakob Stoklund Olesen 366bd86335 Generate a table-driven version of TRI::composeSubRegIndices().
Explicitly allow composition of null sub-register indices, and handle
that common case in an inlinable stub.

Use a compressed table implementation instead of the previous nested
switches which generated pretty bad code.

llvm-svn: 167190
2012-11-01 00:32:10 +00:00
Kaelyn Uhrain 41a73b7678 Don't return false when the function's return type is a pointer.
llvm-svn: 166719
2012-10-25 21:25:08 +00:00
Joerg Sonnenberger 635debe85b Remove exception handling usage from tblgen.
Most places can use PrintFatalError as the unwinding mechanism was not
used for anything other than printing the error. The single exception
was CodeGenDAGPatterns.cpp, where intermediate errors during type
resolution were ignored to simplify incremental platform development.
This use is replaced by an error flag in TreePattern and bailout earlier
in various places if it is set. 

llvm-svn: 166712
2012-10-25 20:33:17 +00:00
David Blaikie dcbd160804 Remove unused member & unnecessary semicolon.
llvm-svn: 166694
2012-10-25 17:04:55 +00:00
NAKAMURA Takumi 88e1b351d4 llvm/utils/TableGen/CMakeLists.txt: Update corresponding to r166685.
llvm-svn: 166686
2012-10-25 15:57:56 +00:00
Sebastian Pop 5c87daf2c8 add TableGen support to create relationship maps between instructions
Relationship maps are represented as InstrMapping records which are parsed by
TableGen and the information is used to construct mapping tables to represent
appropriate relations between instructions. These tables are emitted into
XXXGenInstrInfo.inc file along with the functions to query them.

Patch by Jyotsna Verma <jverma@codeaurora.org>.

llvm-svn: 166685
2012-10-25 15:54:06 +00:00
Joerg Sonnenberger 7090937330 Don't use stack unwinding to provide the location information for
SetTheory, but pass down the location explicitly.

llvm-svn: 166629
2012-10-24 22:03:59 +00:00
Lang Hames cdd40bdc05 Allow the commuted form of tied-operand constraints in tablegen ("$dst = $src",
rather than "$src = $dst").

llvm-svn: 166382
2012-10-20 22:44:13 +00:00
Bill Wendling fbd38fe2e3 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling d079a446d7 Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.

llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Chad Rosier 2f480a8a50 [ms-inline asm] Use the new API introduced in r165830 in lieu of the
MapAndConstraints vector.  Also remove the unused Kind argument.

llvm-svn: 165833
2012-10-12 22:53:36 +00:00
Richard Trieu 2448969d7f Change (!list.size() == 0) to (!list.empty()). No functional change.
llvm-svn: 165812
2012-10-12 17:57:35 +00:00
Sean Silva 506a1c5a58 Remove unnecessary classof()'s
isa<> et al. automatically infer when the cast is an upcast (including a
self-cast), so these are no longer necessary.

llvm-svn: 165767
2012-10-11 23:30:49 +00:00
Chad Rosier 2b189a5b40 Remove extra semicolons.
llvm-svn: 165757
2012-10-11 22:25:56 +00:00
Sean Silva bd7d243107 tblgen: Compile TableGen without RTTI.
TableGen no longer needs RTTI!

llvm-svn: 165651
2012-10-10 20:27:18 +00:00
Sean Silva c0a9e39d0a tblgen: Move mini Type hierarchy to LLVM-style RTTI.
llvm-svn: 165648
2012-10-10 20:24:49 +00:00
Sean Silva 88eb8dd4ed tblgen: Use semantically correct RTTI functions.
Also, some minor cleanup.

llvm-svn: 165647
2012-10-10 20:24:47 +00:00
Sean Silva fb509ed156 tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.
Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.

There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.

llvm-svn: 165646
2012-10-10 20:24:43 +00:00
Bill Wendling ed42e799dc Pass into the AttributeWithIndex::get method an ArrayRef of attribute
enums. These are then created via the correct Attributes creation method.

llvm-svn: 165607
2012-10-10 06:13:42 +00:00
Andrew Trick d0b9c44583 TableGen subtarget emitter cleanup.
Consistently evaluate Aliases and Sequences recursively.

llvm-svn: 165604
2012-10-10 05:43:13 +00:00
Andrew Trick 8e9c1d8998 misched: Generate IsBuffered flag for machine resources.
llvm-svn: 165602
2012-10-10 05:43:04 +00:00
Micah Villmow 9cfc13d46c Move TargetData to DataLayout.
llvm-svn: 165403
2012-10-08 16:39:34 +00:00
Chad Rosier 8f06e7dea4 [ms-inline asm] Add a few typedefs to simplify future changes.
llvm-svn: 165324
2012-10-05 18:41:14 +00:00
Sean Silva 98c61711c6 tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

llvm-svn: 165291
2012-10-05 03:31:58 +00:00
Andrew Trick 9e1deb69b9 Added instregex support to TableGen subtarget emitter.
This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.

llvm-svn: 165180
2012-10-03 23:06:32 +00:00
Andrew Trick da984b1aa9 TableGen subtarget emitter, nearly first class support for SchedAlias.
A processor can now arbitrarily alias one SchedWrite onto
another. Only the SchedAlias definition need be within the processor
model. The aliased SchedWrite may be a SchedVariant, WriteSequence, or
transitively refer to another alias.

llvm-svn: 165179
2012-10-03 23:06:28 +00:00
Andrew Trick 7aba6beae5 Cleanup TableGen subtarget emitter.
llvm-svn: 165178
2012-10-03 23:06:25 +00:00
Chad Rosier bd5974e7ae [ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
MSVC compiler.

llvm-svn: 165174
2012-10-03 22:18:38 +00:00
Sean Silva a3bf561384 tblgen: Migrate llvm-tblgen to new TableGenMain API.
llvm-svn: 165166
2012-10-03 21:29:19 +00:00
Chad Rosier 380a74a339 Fix 80-column violations. Cleanup whitespace in generated code.
llvm-svn: 164983
2012-10-02 00:25:57 +00:00
Chad Rosier f4e35dc672 [ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands.  This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.

llvm-svn: 164979
2012-10-01 23:45:51 +00:00
Sylvestre Ledru 91ce36c986 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru 721cffd53a Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Chad Rosier c4734c8950 Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

llvm-svn: 164567
2012-09-24 22:57:55 +00:00
Chad Rosier 3cb355d11f Rather then have a wrapper function, have tblgen instantiate the implementation.
llvm-svn: 164548
2012-09-24 19:32:29 +00:00
Andrew Trick 9257b8f8bb Machine Model (-schedmodel only). Added SchedAliases.
Allow subtargets to tie SchedReadWrite types to processor specific
sequences or variants.

llvm-svn: 164451
2012-09-22 02:24:21 +00:00
Chad Rosier 17ede627f0 [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
llvm-svn: 164420
2012-09-21 22:21:26 +00:00
Chad Rosier 2ac9fd0a82 Whitespace.
llvm-svn: 164406
2012-09-21 19:25:59 +00:00
Micah Villmow 75e29c4b78 Add in new data types that are used by AMDIL/ANL among others.
llvm-svn: 164261
2012-09-19 22:47:07 +00:00
Owen Anderson dee6583dfd Soften the pattern-can-never-match error in TableGen into a warning. This pattern can be very useful in cases where you want to define a multiclass that covers both commutative and non-commutative operators (say, add and sub).
llvm-svn: 164256
2012-09-19 22:15:06 +00:00
Craig Topper 3f23c1a8b9 Remove code for setting the VEX L-bit as a function of operand size from the code emitters and the disassembler table builder. Fix a couple instructions that were still missing VEX_L.
llvm-svn: 164204
2012-09-19 06:37:45 +00:00
Andrew Trick cfe222c2a9 SchedMachineModel: compress the CPU's WriteLatencyTable.
llvm-svn: 164199
2012-09-19 04:43:19 +00:00
Sean Silva 835139bfe4 Iterate deterministicaly over ClassInfo*'s
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164191
2012-09-19 01:47:03 +00:00
Sean Silva c8f5657f91 Iterate deterministically over register classes
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164190
2012-09-19 01:47:01 +00:00
Sean Silva a4e2c5fc86 Refactor Record* by-ID comparator to Record.h
This is a generally useful utility; there's no reason to have it hidden
in CodeGenDAGPatterns.cpp.

Also, rename it to fit the other comparators in Record.h

Review by Jakob.

llvm-svn: 164189
2012-09-19 01:47:00 +00:00
Craig Topper 7ecfa6d960 Make custom operand parsing mnemonic indices use the same mnemonic table as the match table. Reorder fields in OperandMatchEntry to provide the least amount of padding for in tree targets.
llvm-svn: 164109
2012-09-18 07:02:21 +00:00
Craig Topper e2cfeb30a1 Use variable type for index into mnemonic table. Shrinks size of index field on in tree targets. Saving static data space.
llvm-svn: 164108
2012-09-18 06:10:45 +00:00
Andrew Trick ba7b921fcb Replaced ReInitMCSubtargetInfo with InitMCProcessor.
Now where we used to call ReInitMCSubtargetInfo, we actually recompute
the same information as InitMCSubtargetInfo instead of only setting
the feature bits.

llvm-svn: 164105
2012-09-18 05:33:15 +00:00
Andrew Trick ea28dbdf93 comment typo
llvm-svn: 164097
2012-09-18 04:03:30 +00:00
Andrew Trick a88f1bddc6 TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164096
2012-09-18 03:55:55 +00:00
Andrew Trick c6c88151bb TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164095
2012-09-18 03:41:43 +00:00
Andrew Trick 1188e439b2 TableGen subtarget emitter. Remove unnecessary header dependence.
llvm-svn: 164094
2012-09-18 03:32:57 +00:00
Andrew Trick ab722bdd50 TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164092
2012-09-18 03:18:56 +00:00
Craig Topper 9150610db7 Mark asm matcher conversion table as const.
llvm-svn: 164088
2012-09-18 01:41:49 +00:00
Craig Topper aae8fb801e Fix typo in comment. No functional change.
llvm-svn: 164086
2012-09-18 01:13:36 +00:00
Andrew Trick 8038ceb731 Backout the wrong subtarget emitter fix
llvm-svn: 164078
2012-09-17 23:14:15 +00:00
Andrew Trick 3e5546add7 Fix release build after reverting
llvm-svn: 164075
2012-09-17 23:05:04 +00:00
Andrew Trick 8e7f202e32 Revert r164061-r164067. Most of the new subtarget emitter.
I have to work out the Target/CodeGen header dependencies
before putting this back.

llvm-svn: 164072
2012-09-17 23:00:42 +00:00
Andrew Trick 692b87c18f InitMCProcessor
llvm-svn: 164066
2012-09-17 22:19:12 +00:00
Andrew Trick c00f4314ce comment typo
llvm-svn: 164064
2012-09-17 22:19:04 +00:00
Andrew Trick 36e07eb83e TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164063
2012-09-17 22:19:01 +00:00
Andrew Trick 7a1faa2c8a TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164062
2012-09-17 22:18:58 +00:00
Andrew Trick 0923f8183b TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164061
2012-09-17 22:18:55 +00:00
Andrew Trick a72fca6bec TableGen subtarget emitter. Format and emit data tables for the new machine model.
llvm-svn: 164060
2012-09-17 22:18:50 +00:00
Andrew Trick 9ef0882b72 TableGen subtarget emitter. Generate data tables for the new machine model.
Map the CodeGenSchedule object model onto data tables. The structure
of the data tables is defined in MC, so for convenience we include
MCSchedule.h. The alternative is maintaining a redundant copy of the
table structure definitions. Mapping the object model onto data tables
is sufficiently complicated that it should not be interleaved with
emitting source code. This avoids major problem with the backend for
itinerary generation.

llvm-svn: 164059
2012-09-17 22:18:48 +00:00
Andrew Trick 23f3c65e4b TableGen subtarget emitter. Emit processor resources for the new machine model.
llvm-svn: 164058
2012-09-17 22:18:45 +00:00
Andrew Trick 8fa00f5069 TableGen subtarget parser: Add getProcResourcesIdx().
llvm-svn: 164057
2012-09-17 22:18:43 +00:00
Jim Grosbach 4c36349de9 TableGen: Add initializer.
Keep GCC's warnings happy. It can't reason out that the state machine won't
ever hit the potentially uninitialized use in OPC_FilterValue.

llvm-svn: 164041
2012-09-17 18:00:53 +00:00
Michael Liao ebeedd0ed6 Fix typo
llvm-svn: 164012
2012-09-17 04:43:39 +00:00
Craig Topper a583df034a Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 164002
2012-09-16 18:25:36 +00:00
Craig Topper 8dcaf4998c Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 163999
2012-09-16 16:35:22 +00:00
Dmitri Gribenko 8d30240939 Fix Doxygen issues: wrap code examples in \code and use \p to refer to
parameters.

llvm-svn: 163984
2012-09-15 20:22:05 +00:00
Craig Topper f8f0a23ce7 Revert r163878 as it breaks on targets with alternate register names. Such targets do not exist in the main tree so this was not noticed.
llvm-svn: 163959
2012-09-15 01:22:42 +00:00
Andrew Trick 1e46d48814 TableGen subtarget parser. Handle new machine model.
Collect processor resources from the subtarget defs.

llvm-svn: 163953
2012-09-15 00:20:02 +00:00
Andrew Trick 33401e8469 TableGen subtarget parser. Handle new machine model.
Infer SchedClasses from variants defined by the target or subtarget.

llvm-svn: 163952
2012-09-15 00:19:59 +00:00
Andrew Trick 766864963b TableGen subtarget parser. Handle new machine model.
Collect SchedClasses and SchedRW types from the subtarget defs.

llvm-svn: 163951
2012-09-15 00:19:57 +00:00
Craig Topper 06cec4ceac Allow the second opcode info table to be 8, 16, or 32-bits as needed to represent additional fragments. This recovers some space on ATT X86 syntax and PowerPC which only need 40-bits instead of 48-bits. This also increases ARM to 64-bits to fully encode all of its operands.
llvm-svn: 163880
2012-09-14 08:33:11 +00:00
Craig Topper 805e39beab Reduce size of register name index tables by using uint16_t for all in tree targets. If more than 16-bits are needed for any out of tree targets, code will detect and use uint32_t instead.
llvm-svn: 163878
2012-09-14 06:37:49 +00:00
Manman Ren 4d9ae56a45 AsmWriterEmitter: OpInfo2 should be unsigned 16-bit.
Fix an issue in r163814.

llvm-svn: 163837
2012-09-13 20:47:48 +00:00
Manman Ren 68cf9fc45d AsmWriterEmitter: increase the number of bits for OpcodeInfo from 32-bit to
48-bit if necessary, in order to reduce the generated code size.

We have 900 cases not covered by OpcodeInfo in ATT AsmWriter and more in Intel
AsmWriter and ARM AsmWriter.

This patch reduced the clang Release build size by 50k, running on a Mac Pro.

llvm-svn: 163814
2012-09-13 17:43:46 +00:00
Dmitri Gribenko 2bc1d483fe Fix Doxygen issues:
* wrap code blocks in \code ... \endcode;
* refer to parameter names in paragraphs correctly (\arg is not what most
  people want -- it starts a new paragraph).

llvm-svn: 163790
2012-09-13 12:34:29 +00:00
Craig Topper 963305b450 Add a new compression type to ModRM table that detects when the memory modRM byte represent 8 instructions and the reg modRM byte represents up to 64 instructions. Reduces modRM table from 43k entreis to 25k entries. Based on a patch from Manman Ren.
llvm-svn: 163774
2012-09-13 05:45:42 +00:00
Jim Grosbach f6cb1ee75a TableGen: Convert an assert() to a proper diagnostic.
llvm-svn: 163726
2012-09-12 17:40:25 +00:00
Dmitri Gribenko 881929c1b6 Fix a couple of Doxygen comment issues pointed out by -Wdocumentation.
llvm-svn: 163721
2012-09-12 16:59:47 +00:00
Owen Anderson 16ba4b2d83 Improve tblgen code cleanliness: create an unknown_class, from which the unknown def inherits. Make tblgen check for that class, rather than checking for the def itself.
llvm-svn: 163664
2012-09-11 23:47:08 +00:00
Owen Anderson ccd682c695 Compute a map from register names to registers, rather than scanning the list of registers every time we want to look up a register by name.
llvm-svn: 163659
2012-09-11 23:32:17 +00:00
Jakob Stoklund Olesen d346d4871a Add TRI::getSubRegIndexLaneMask().
Sub-register lane masks are bitmasks that can be used to determine if
two sub-registers of a virtual register will overlap. For example, ARM's
ssub0 and ssub1 sub-register indices don't overlap each other, but both
overlap dsub0 and qsub0.

The lane masks will be accurate on most targets, but on targets that use
sub-register indexes in an irregular way, the masks may conservatively
report that two sub-register indices overlap when the eventually
allocated physregs don't.

Irregular register banks also mean that the bits in a lane mask can't be
mapped onto register units, but the concept is similar.

llvm-svn: 163630
2012-09-11 16:34:08 +00:00