1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

2751 Commits

Author SHA1 Message Date
Chris Lattner
073117cd52 move some code around so that Verifier.cpp can get access to the intrinsic info table.
llvm-svn: 157540
2012-05-27 18:28:35 +00:00
Chris Lattner
f5861a2e42 enhance the intrinsic info table to encode what *kind* of Any argument
it is (at the cost of 45 bytes of extra table space) so that the verifier can
start using it.

llvm-svn: 157536
2012-05-27 16:39:08 +00:00
Chris Lattner
95d61a8294 rearrange some code, no functionality change.
llvm-svn: 157523
2012-05-26 23:03:52 +00:00
Jakob Stoklund Olesen
87e444d0a5 Compress MCRegisterInfo register name tables.
Store (debugging) register names as offsets into a string table instead
of as char pointers.

llvm-svn: 157449
2012-05-25 00:21:41 +00:00
Owen Anderson
03e1ab9c5b Teach tblgen's set theory "sequence" operator to support an optional stride operand.
llvm-svn: 157416
2012-05-24 21:37:08 +00:00
Patrik Hägglund
6f837093ba Fixed typo in r156905.
llvm-svn: 157320
2012-05-23 12:34:56 +00:00
Chris Lattner
9b30a6d7da small refinement to r157218 to save a tiny amount of table size in the common
case.

llvm-svn: 157312
2012-05-23 05:19:18 +00:00
Jakob Stoklund Olesen
e4801d77e1 Also compute TopoSigs in synthetic register classes.
CodeGenRegisterClass has two constructors. Both need to compute the
TopoSigs BitVector.

llvm-svn: 157271
2012-05-22 18:20:28 +00:00
Pete Cooper
869fc085f9 Added address space qualifier to intrinsic PointerType arguments.
llvm-svn: 157218
2012-05-21 23:21:28 +00:00
Chris Lattner
3d3d2be19b enhance the intrinsic info stuff to emit encodings that don't fit in 32-bits into a
separate side table, using the handy SequenceToOffsetTable class.  This encodes all
these weird things into another 256 bytes, allowing all intrinsics to be encoded this way.

llvm-svn: 156995
2012-05-17 15:55:41 +00:00
Chris Lattner
288872000a finish encoding all of the interesting details of intrinsics. Now intrinsics
are only rejected because they can't be encoded into a 32-bit unit, not because
they contain an unencodable feature.

llvm-svn: 156978
2012-05-17 05:03:24 +00:00
Chris Lattner
8962c547fa strengthen the intrinsic descriptor stuff to be able to handle sin, cos and other
intrinsics that use passed-in arguments.

llvm-svn: 156977
2012-05-17 04:30:58 +00:00
Chris Lattner
c951b8da61 simplify code generated by tblgen that is not necessary since we dropped
compatibility with LLVM 2.x bitcode files.

llvm-svn: 156976
2012-05-17 04:07:48 +00:00
Francois Pichet
8d9b4be771 I forgot the #ifdef _MSC_VER guard in my last commit.
llvm-svn: 156975
2012-05-17 04:00:03 +00:00
Francois Pichet
e46a849da6 Fix the MSVC 2010 build: disable the optimizer for a problematic function.
llvm-svn: 156973
2012-05-17 03:38:19 +00:00
Jakob Stoklund Olesen
a912a25126 Use RegUnits to compute overlapping registers.
TableGen already computes register units as the basic unit of
interference. We can use that to compute the set of overlapping
registers.

This means that we can easily compute overlap sets for one register at a
time. There is no benefit to computing all registers at once.

llvm-svn: 156960
2012-05-16 23:03:04 +00:00
Chris Lattner
294ca0bfbc Significantly reduce the compiled size of Functions.cpp by turning a big blob of tblgen
generated code (for Intrinsic::getType) into a table.  This handles common cases right now,
but I plan to extend it to handle all cases and merge in type verification logic as well
in follow-on patches.

llvm-svn: 156905
2012-05-16 06:34:44 +00:00
Chris Lattner
346025b7c0 have tblgen emit cast<> instead of dyn_cast<> when we know it must succeed.
llvm-svn: 156902
2012-05-16 04:51:09 +00:00
Jim Grosbach
8f241263d7 TableGen'erate mapping physical registers to encoding values.
Many targets always use the same bitwise encoding value for physical
registers in all (or most) instructions. Add this mapping to the
.td files and TableGen'erate the information and expose an accessor
in MCRegisterInfo.

patch by Tom Stellard.

llvm-svn: 156829
2012-05-15 17:35:57 +00:00
Jakob Stoklund Olesen
c52390cafe Create a struct representing register units in TableGen.
Besides the weight, we also want to store up to two root registers per
unit. Most units will have a single root, the leaf register they
represent. Units created for ad hoc aliasing get two roots: The two
aliasing registers.

The root registers can be used to compute the set of overlapping
registers.

llvm-svn: 156792
2012-05-15 00:50:23 +00:00
Jakob Stoklund Olesen
6d4ef2b65f Consider ad hoc aliasing when building RegUnits.
Register units can be used to compute if two registers overlap:

  A overlaps B iff units(A) intersects units(B).

With this change, the above holds true even on targets that use ad hoc
aliasing (currently only ARM). This means that register units can be
used to implement regsOverlap() more efficiently, and the register
allocator can use the concept to model interference.

When there is no ad hoc aliasing, the register units correspond to the
maximal cliques in the register overlap graph. This is optimal, no other
register unit assignment can have fewer units.

With ad hoc aliasing, weird things are possible, and we don't try too
hard to compute the maximal cliques. The current approach is always
correct, and it works very well (probably optimally) as long as the ad
hoc aliasing doesn't have cliques larger than pairs. It seems unlikely
that any target would need more.

llvm-svn: 156763
2012-05-14 15:20:39 +00:00
Jakob Stoklund Olesen
a87c0f6c9d Record the ad hoc aliasing graph in CodeGenRegister.
The ad hoc aliasing specified in the 'Aliases' list in .td files is
currently only used by computeOverlaps(). It will soon be needed to
build accurate register units as well, so build the undirected graph in
CodeGenRegister::buildObjectGraph() instead.

Aliasing is a symmetric relationship with only one direction specified
in the .td files. Make sure both directions are represented in
getExplicitAliases().

llvm-svn: 156762
2012-05-14 15:12:37 +00:00
Jakob Stoklund Olesen
ce6916a00b Compute topological signatures of registers.
TableGen creates new register classes and sub-register indices based on
the sub-register structure present in the register bank. So far, it has
been doing that on a per-register basis, but that is not very efficient.

This patch teaches TableGen to compute topological signatures for
registers, and use that to reduce the amount of redundant computation.
Registers get the same TopoSig if they have identical sub-register
structure.

TopoSigs are not currently exposed outside TableGen.

llvm-svn: 156761
2012-05-14 15:10:07 +00:00
Jakob Stoklund Olesen
afe973fad4 Speed up computeComposites() by using the new SubReg -> SubIdx map.
TableGen doesn't need to search through the SubRegs map to find an
inverse entry.

llvm-svn: 156690
2012-05-12 02:02:26 +00:00
Bill Wendling
55c91b69ec Remove extraneous ; and the resulting warning.
llvm-svn: 156649
2012-05-11 21:56:04 +00:00
Jakob Stoklund Olesen
041239982f Defer computation of SuperRegs.
Don't compute the SuperRegs list until the sub-register graph is
completely finished. This guarantees that the list of super-registers is
properly topologically ordered, and has no duplicates.

llvm-svn: 156629
2012-05-11 19:01:01 +00:00
Jakob Stoklund Olesen
5a51c567a1 Compute secondary sub-registers.
The sub-registers explicitly listed in SubRegs in the .td files form a
tree. In a complicated register bank, it is possible to have
sub-register relationships across sub-trees. For example, the ARM NEON
double vector Q0_Q1 is a tree:

  Q0_Q1 = [Q0, Q1],  Q0 = [D0, D1], Q1 = [D2, D3]

But we also define the DPair register D1_D2 = [D1, D2] which is fully
contained in Q0_Q1.

This patch teaches TableGen to find such sub-register relationships, and
assign sub-register indices to them. In the example, TableGen will
create a dsub_1_dsub_2 sub-register index, and add D1_D2 as a
sub-register of Q0_Q1.

This will eventually enable the coalescer to handle copies of skewed
sub-registers.

llvm-svn: 156587
2012-05-10 23:27:10 +00:00
Jakob Stoklund Olesen
e762a8379f Precompute lists of explicit sub-registers and indices.
The .td files specify a tree of sub-registers. Store that tree as
ExplicitSubRegs lists in CodeGenRegister instead of extracting it from
the Record when needed.

llvm-svn: 156555
2012-05-10 17:46:18 +00:00
Andrew Trick
ac3b83d82b Fix TableGen's RegPressureSet weight normalization to handle subreg DAGS.
I initially assumed that the subreg graph was a tree. That may not be true.

llvm-svn: 156524
2012-05-10 00:32:15 +00:00
Jakob Stoklund Olesen
fbf5e9ff6f Fix warning text.
llvm-svn: 156521
2012-05-09 23:43:30 +00:00
Jakob Stoklund Olesen
b010f9d251 Compute a backwards SubReg -> SubRegIndex map for each register.
This mapping is for internal use by TableGen. It will not be exposed in
the generated files.

Unfortunately, the mapping is not completely well-defined. The X86 xmm
registers appear with multiple sub-register indices in the ymm
registers. This is because of the odd idempotent sub_sd and sub_ss
sub-register indices. I hope to be able to eliminate them entirely, so
we can require the sub-registers to form a tree.

For now, just place the canonical sub_xmm index in the mapping, and
ignore the idempotents.

llvm-svn: 156519
2012-05-09 22:15:00 +00:00
Jakob Stoklund Olesen
da59286b98 Rename getSubRegs() to computeSubRegs().
That's what it does.

llvm-svn: 156518
2012-05-09 22:09:17 +00:00
Jim Grosbach
d48551961d TableGen: AsmMatcher diagnostic when missing instruction mnemonic.
Previously, if an instruction definition was missing the mnemonic,
the next line would just assert(). Issue a real diagnostic instead.

llvm-svn: 156263
2012-05-06 17:33:14 +00:00
Jakob Stoklund Olesen
fb40ced513 Order register classes by spill size first, members last.
This is still a topological ordering such that every register class gets
a smaller enum value than its sub-classes.

Placing the smaller spill sizes first makes a difference for the
super-register class bit masks. When looking for a super-register class,
we usually want the smallest possible kind of super-register. That is
now available as the first bit set in the bit mask.

llvm-svn: 156222
2012-05-04 23:12:22 +00:00
Jakob Stoklund Olesen
2c4618568d Remove TargetRegisterClass::SuperRegClasses.
This manually enumerated list of super-register classes has been
superceeded by the automatically computed super-register class masks
available through SuperRegClassIterator.

llvm-svn: 156151
2012-05-04 03:30:28 +00:00
Jakob Stoklund Olesen
d75f11c7fc Use a shared implementation of getMatchingSuperRegClass().
TargetRegisterClass now gives access to the necessary tables.

llvm-svn: 156122
2012-05-03 22:49:04 +00:00
Jakob Stoklund Olesen
0b38e611c1 Add TargetRegisterClass::getSuperRegIndices().
This is a pointer into one of the tables used by
getMatchingSuperRegClass(). It makes it possible to use a shared
implementation of that function.

llvm-svn: 156121
2012-05-03 22:49:00 +00:00
Jakob Stoklund Olesen
b1f429ef36 Emit SuperRegMasks as part of the existing SubClassMask arrays.
The RC->getSubClassMask() pointer now points to a sequence of register
class bit masks. The first bit mask is the normal sub-class mask. The
following masks are super-reg class masks used by
getMatchingSuperRegClass().

llvm-svn: 156120
2012-05-03 22:48:56 +00:00
Jakob Stoklund Olesen
7f140ab879 Compress tables for getMatchingSuperRegClass().
Many register classes only have a few super-registers, so it is not
necessary to keep individual bit masks for all possible sub-register
indices.

llvm-svn: 156083
2012-05-03 18:14:20 +00:00
Jakob Stoklund Olesen
9fc9ae5ef4 Don't override subreg functions in targets without subregisters.
Some targets have no sub-registers at all. Use the TargetRegisterInfo
versions of composeSubRegIndices(), getSubClassWithSubReg(), and
getMatchingSuperRegClass() for those targets.

llvm-svn: 156075
2012-05-03 16:26:20 +00:00
Douglas Gregor
0507cabcbd Move llvm-tblgen's StringMatcher into the TableGen library so it can
be used by clang-tblgen.

llvm-svn: 156000
2012-05-02 17:32:48 +00:00
Craig Topper
5828c654b9 Add ifdef around getSubtargetFeatureName in tablegen output file so that only targets that want the function get it. This prevents other targets from getting an unused function warning.
llvm-svn: 155538
2012-04-25 06:56:34 +00:00
Jim Grosbach
7ac2ac85a8 ARM: improved assembler diagnostics for missing CPU features.
When an instruction match is found, but the subtarget features it
requires are not available (missing floating point unit, or thumb vs arm
mode, for example), issue a diagnostic that identifies what the feature
mismatch is.

rdar://11257547

llvm-svn: 155499
2012-04-24 22:40:08 +00:00
Craig Topper
56cbdd4cd7 Remove 'XXXRegisterClass' from tablegen output. Targets should use '&XXXRegClass' instead.
llvm-svn: 155270
2012-04-21 01:49:25 +00:00
Andrew Trick
155245effc TableGen'd RegPressure: Added getPressureSetName.
llvm-svn: 155234
2012-04-20 20:44:58 +00:00
Jim Grosbach
0cd0534390 TableGen support for auto-generating assembly two-operand aliases.
Assembly matchers for instructions with a two-operand form. ARM is full
of these, for example:
  add {Rd}, Rn, Rm  // Rd is optional and is the same as Rn if omitted.

The property TwoOperandAliasConstraint on the instruction definition controls
when, and if, an alias will be formed. No explicit InstAlias definitions
are required.

rdar://11255754

llvm-svn: 155172
2012-04-19 23:59:23 +00:00
Jim Grosbach
e8c60733b9 Use a SmallVector instead of std::vector for ResOperands.
There's almost always a small number of instruction operands, so
use a SmallVector and save on heap allocations.

llvm-svn: 155143
2012-04-19 17:52:34 +00:00
Jim Grosbach
d335490731 Update some internal naming conventions to modern style.
llvm-svn: 155142
2012-04-19 17:52:32 +00:00
Craig Topper
626573d98d Make fast isel use &XXXRegClass instead of XXXRegisterClass. Not a functional change since XXXRegisterClass is just a constant alias of &XXXRegClass, but should probably go away.
llvm-svn: 155104
2012-04-19 06:52:06 +00:00
Jim Grosbach
013a59646b Fix typo.
llvm-svn: 155075
2012-04-18 23:46:25 +00:00