1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Chad Rosier
e67a19eff8 Minor fix to comment from my previous commit.
llvm-svn: 182536
2013-05-22 23:25:59 +00:00
Chad Rosier
5a81a5816e Simplify the logic described in the comment.
llvm-svn: 182534
2013-05-22 23:23:14 +00:00
Chad Rosier
d450a8f086 Add the IncludeSelf parameter to the MCSubRegIterator and MCSuperRegIterator
constructors.  No functional change.
Part of rdar://12906217

llvm-svn: 182490
2013-05-22 17:26:26 +00:00
Jakob Stoklund Olesen
15218a60cd Add a missing assertion, the null register has no register units.
llvm-svn: 170916
2012-12-21 18:38:09 +00:00
Jim Grosbach
f57dff9005 Clean up some DOxygen comments.
llvm-svn: 170628
2012-12-20 01:14:45 +00:00
Jim Grosbach
431f84fb2f MC: Add MCInstrDesc::mayAffectControlFlow() method.
MC disassembler clients (LLDB) are interested in querying if an
instruction may affect control flow other than by virtue of being
an explicit branch instruction. For example, instructions which
write directly to the PC on some architectures.

llvm-svn: 170610
2012-12-19 23:38:53 +00:00
Jim Grosbach
e30a84f8e2 Add isSubRegisterEq() and isSuperRegisterEq().
isSub and isSuper return false if RegA == RegB. Add variants which also
include the identity function.

llvm-svn: 170609
2012-12-19 23:38:49 +00:00
Jim Grosbach
af9cecb0f9 Move isSubRegister() and isSuperRegister to MCRegisterInfo.
These were defined on TargetRegisterInfo, but they don't use any information
that's not available in MCRegisterInfo, so sink them down to be available
at the MC layer.

llvm-svn: 170608
2012-12-19 23:38:46 +00:00
Jakob Stoklund Olesen
7cbcf348ea 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
Lang Hames
a2fffc78e7 MCRegisterClass should be returned by const ref, not by value.
llvm-svn: 166822
2012-10-26 22:14:10 +00:00
Jakob Stoklund Olesen
1e7f74aaa8 Add MCRI::getNumSubRegIndices() and start checking SubRegIndex ranges.
Apparently, NumSubRegIndices was completely unused before. Adjust it by
one to include the null subreg index, just like getNumRegs() includes
the null register.

llvm-svn: 163628
2012-09-11 16:34:02 +00:00
Jakob Stoklund Olesen
234fac2188 Give MCRegisterInfo an implementation file.
Move some functions from MCRegisterInfo.h that don't need to be inline.

This shrinks llc by 8K.

llvm-svn: 160865
2012-07-27 16:25:20 +00:00
Jakob Stoklund Olesen
49c17daace Eliminate the large XXXSubRegTable constant arrays.
These tables were indexed by [register][subreg index] which made them,
very large and sparse.

Replace them with lists of sub-register indexes that match the existing
lists of sub-registers. MCRI::getSubReg() becomes a very short linear
search, like getSubRegIndex() already was.

llvm-svn: 160843
2012-07-27 00:10:51 +00:00
Jakob Stoklund Olesen
95a1a7df29 Differentially encode all MC register lists.
This simplifies MCRegisterInfo and shrinks the target descriptions a bit
more.

llvm-svn: 160758
2012-07-25 21:41:37 +00:00
Jakob Stoklund Olesen
ee64ad3aba Remove the old register list functions from MCRegisterInfo.
These functions exposed the layout of the underlying data tables as
null-terminated uint16_t arrays.

Use the new MCSubRegIterator, MCSuperRegIterator, and MCRegAliasIterator
classes instead.

llvm-svn: 157855
2012-06-01 23:28:34 +00:00
Jakob Stoklund Olesen
be0b8939c0 Switch all register list clients to the new MC*Iterator interface.
No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

llvm-svn: 157854
2012-06-01 23:28:30 +00:00
Jakob Stoklund Olesen
e79316648d Emit register unit root tables.
Each register unit has one or two root registers. The full set of
registers containing a given register unit can be computed as the union
of the root registers and their super-registers.

Provide an MCRegUnitRootIterator class to enumerate the roots.

llvm-svn: 157753
2012-05-31 17:18:26 +00:00
Jakob Stoklund Olesen
67b7a47013 Add MCRegisterInfo::RegListIterator.
Also add subclasses MCSubRegIterator, MCSuperRegIterator, and
MCRegAliasIterator.

These iterators provide an abstract interface to the MCRegisterInfo
register lists so the internal representation can be changed without
changing all clients.

llvm-svn: 157695
2012-05-30 16:36:28 +00:00
Jakob Stoklund Olesen
73535ebd9d Make DiffListIterator public to unbreak the gcc buildbots.
Apparently, a friend can't derive from a private class according to gcc.

llvm-svn: 157654
2012-05-30 00:05:03 +00:00
Jakob Stoklund Olesen
16603c4371 Emit register unit lists for each register.
Register units are already used internally in TableGen to compute
register pressure sets and overlapping registers. This patch makes them
available to the code generators.

The register unit lists are differentially encoded so they can be reused
for many related registers. This keeps the total size of the lists below
200 bytes for most targets. ARM has the largest table at 560 bytes.

Add an MCRegUnitIterator for traversing the register unit lists. It
provides an abstract interface so the representation can be changed in
the future without changing all clients.

llvm-svn: 157650
2012-05-29 23:40:00 +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
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
Benjamin Kramer
3532e8b899 Implement DwarfLLVMRegPair::operator< without violating asymmetry.
MSVC8 verifies this.

llvm-svn: 154002
2012-04-04 08:24:08 +00:00
Benjamin Kramer
84a17ab494 Emit the LLVM<->DWARF register mapping as a sorted table and use binary search to do the lookup.
This also avoids emitting the information twice, which led to code bloat. On i386-linux-Release+Asserts
with all targets built this change shaves a whopping 1.3 MB off clang. The number is probably exaggerated
by recent inliner changes but the methods were already enormous with the old inline cost computation.

The DWARF reg -> LLVM reg mapping doesn't seem to have holes in it, so it could be a simple lookup table.
I didn't implement that optimization yet to avoid potentially changing functionality.

There is still some duplication both in tablegen and the generated code that should be cleaned up eventually.

llvm-svn: 153837
2012-04-01 14:23:58 +00:00
Jakob Stoklund Olesen
0255173d11 Reapply 153764 and 153761 with a fix.
Use an explicit comparator instead of the default.

The sets are sorted, but not using the default comparator. Hopefully,
this will unbreak the Linux builders.

llvm-svn: 153772
2012-03-30 20:24:14 +00:00
Rafael Espindola
34915bd5fa Revert 153764 and 153761. They broke a --enable-optimized --enable-assertions
--enable-expensive-checks build.

llvm-svn: 153771
2012-03-30 20:09:06 +00:00
Jakob Stoklund Olesen
cf79a76c01 Compress register lists by sharing suffixes.
TableGen emits lists of sub-registers, super-registers, and overlaps. Put
them all in a single table and use a SequenceToOffsetTable to share
suffixes.

llvm-svn: 153761
2012-03-30 17:25:43 +00:00
Craig Topper
723f98cc58 Increase number of allowed registers in register classes to 64k instead of 256. Widen register class ID to 16-bits. Widen register size and alignment to be up to 64k bytes instead of 256 bytes. This partially reverts r152019 to be less restrictive.
llvm-svn: 152100
2012-03-06 03:44:22 +00:00
Craig Topper
ab4842ceda Revert r152016 and allow overlap, sub, super register tables to be more than 64k entries.
llvm-svn: 152099
2012-03-06 03:28:45 +00:00
Jim Grosbach
fdfaed95ae ARM refactor away a bunch of VLD/VST pseudo instructions.
With the new composite physical registers to represent arbitrary pairs
of DPR registers, we don't need the pseudo-registers anymore. Get rid of
a bunch of them that use DPR register pairs and just use the real
instructions directly instead.

llvm-svn: 152045
2012-03-05 19:33:30 +00:00
Jim Grosbach
a64613af7a MCRegisterInfo-ize getMatchingSuperReg.
llvm-svn: 152044
2012-03-05 19:33:24 +00:00
Craig Topper
3362e91b1d Shrink and reorder fields in MCRegisterClass to reduce size of static data.
llvm-svn: 152019
2012-03-05 08:33:33 +00:00
Craig Topper
a95d527c6a Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce static data size.
llvm-svn: 152016
2012-03-05 05:37:41 +00:00
Craig Topper
8cc9d75c6a Use uint16_t to store register overlaps to reduce static data.
llvm-svn: 152001
2012-03-04 10:43:23 +00:00
Craig Topper
4ca8c48cc1 Use uint16_t instead of unsigned to store registers in reg classes. Reduces static data size.
llvm-svn: 151998
2012-03-04 10:16:38 +00:00
Benjamin Kramer
111608aae1 Move getSubRegIndex out of generated code into MCRegisterInfo, devirtualize it.
llvm-svn: 151821
2012-03-01 18:16:35 +00:00
Jim Grosbach
9b3f9f1d37 Move TargetRegisterInfo::getSubReg() to MCRegisterInfo.
Allows us to de-virtualize the function and provides access to it in
the instruction printer, which is useful for handling composite
physical registers (e.g., ARM register lists).

llvm-svn: 151815
2012-03-01 17:30:39 +00:00
Craig Topper
b1b20ead88 Remove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added in r151038.
llvm-svn: 151246
2012-02-23 08:42:06 +00:00
Craig Topper
f1056941f6 Reorder some members in MCRegisterClass to remove padding on 64-bit builds.
llvm-svn: 151043
2012-02-21 07:36:39 +00:00
Craig Topper
24cc28c7b8 In generated RegisterInfo files, replace a pointer to the end of an array with just the size of the array to avoid relocations.
llvm-svn: 151041
2012-02-21 06:54:41 +00:00
Craig Topper
593e720da6 Merge some tables in generated RegisterInfo file. Store indices into larger table instead of pointers to reduce relocations and shrink table size on 64-bit builds. Shaves ~24K off X86MCTargetDesc.o
llvm-svn: 151038
2012-02-21 06:22:36 +00:00
Benjamin Kramer
b42d2a7238 Value initialize MCRegisterClasses. Not sure how could miss this during the MCTargetDesc refactor.
llvm-svn: 150076
2012-02-08 14:43:53 +00:00
Craig Topper
e18a06be4d Convert assert(0) to llvm_unreachable
llvm-svn: 149849
2012-02-05 22:14:15 +00:00
Jim Grosbach
ee31b72246 Trailing whitespace.
llvm-svn: 143113
2011-10-27 17:44:01 +00:00
Benjamin Kramer
40ed4c3e06 Fix a silly off by one.
llvm-svn: 135842
2011-07-23 03:04:46 +00:00
Benjamin Kramer
35d7f76497 Add more constness.
llvm-svn: 135838
2011-07-23 01:40:15 +00:00
Benjamin Kramer
a1e84a1998 Turn the DenseSet in MCRegisterClass into a tblgenerated bit field. This should be faster and smaller.
Goodbye static ctors and dtors!

llvm-svn: 135836
2011-07-23 00:47:49 +00:00
Benjamin Kramer
eca22965a3 Teach tblgen to emit MCRegisterClasses.
- This currently introduces more instances of the static DenseSet dtor, but that should be fixable.

llvm-svn: 135735
2011-07-22 00:44:39 +00:00
Benjamin Kramer
727a49e530 Sink parts of TargetRegisterClass into MCRegisterClass.
llvm-svn: 135683
2011-07-21 17:26:50 +00:00
Evan Cheng
561d71ce7b Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo down
to MCRegisterInfo. Also initialize the mapping at construction time.

This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step
towards fixing the layering violation.

llvm-svn: 135424
2011-07-18 20:57:22 +00:00