Commit Graph

3947 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 3f6faaec70 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 2f460ae3b4 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 67dd612cdd 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 9e827d0510 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 f3d0690bf5 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
Owen Anderson fe346cd24f Add the half type to the LLVM IR vim syntax highlighting.
llvm-svn: 156080
2012-05-03 17:24:12 +00:00
Jakob Stoklund Olesen f5bc1eb9eb 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 12c1cd33f4 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 3ec7c2aa84 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 5117ef7453 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 efada2c0b4 Remove 'XXXRegisterClass' from tablegen output. Targets should use '&XXXRegClass' instead.
llvm-svn: 155270
2012-04-21 01:49:25 +00:00
Andrew Trick 03eaaf5b12 TableGen'd RegPressure: Added getPressureSetName.
llvm-svn: 155234
2012-04-20 20:44:58 +00:00
Bill Wendling d63dcde113 Modify the sh-bang to run out-of-the-box for FreeBSDes.
llvm-svn: 155230
2012-04-20 20:31:44 +00:00
Jim Grosbach 31c2d3fa74 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
Michael J. Spencer 9125493efe Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

llvm-svn: 155147
2012-04-19 19:27:54 +00:00
Jim Grosbach a37e2295d4 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 8c2beaac8b Update some internal naming conventions to modern style.
llvm-svn: 155142
2012-04-19 17:52:32 +00:00
Daniel Dunbar 58cfaf8684 llvm-lit: Inject the lit module path at the beginning of sys.path, just in case
the user has another lit somewhere.

llvm-svn: 155131
2012-04-19 16:31:08 +00:00
Craig Topper eb63a4df26 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 925a6d08c5 Fix typo.
llvm-svn: 155075
2012-04-18 23:46:25 +00:00
Bill Wendling eb1c2bdc1f Add a flag to rebranch if we need to.
llvm-svn: 155049
2012-04-18 21:38:12 +00:00
Jim Grosbach efe653f973 Revert "Replace some uses of std:map<std::string,...> with StringMap."
StringMap iterators are not deterministic, and that's more important
here than speed or memory.

llvm-svn: 155039
2012-04-18 20:24:49 +00:00
Benjamin Kramer 11983a4f85 tblgen: remove duplicated newlines.
llvm-svn: 155038
2012-04-18 19:22:47 +00:00
Jim Grosbach 2bed0f974f Replace some uses of std:map<std::string,...> with StringMap.
llvm-svn: 155037
2012-04-18 19:13:59 +00:00
Jim Grosbach dba3f5be00 Use SmallVector for the requirements on an InstAlias.
llvm-svn: 155034
2012-04-18 19:02:43 +00:00
Jim Grosbach f4e6708c7a Tidy up. Formatting.
llvm-svn: 155032
2012-04-18 18:56:33 +00:00
Jim Grosbach 9a7f4b76e5 Move a few more warnings to use PrintWarning().
llvm-svn: 155027
2012-04-18 18:39:31 +00:00
Jim Grosbach 1752ffbfe5 Tidy up. No need for a Twine here, as it's just constants.
llvm-svn: 155026
2012-04-18 18:39:27 +00:00
Jim Grosbach 0fda36485e Formatting.
llvm-svn: 155025
2012-04-18 18:39:23 +00:00
Jim Grosbach 40e984074c Tidy up. Add a '.' at the end of the sentence.
llvm-svn: 155024
2012-04-18 18:39:19 +00:00
Jim Grosbach 7670374c06 Clean up warning text. Remove extraneous prefix.
llvm-svn: 155015
2012-04-18 18:09:50 +00:00
Jim Grosbach 3ae48a6236 TableGen use PrintWarning rather than fprintf(stderr,...) for warnings.
That way we get source line number information from the diagnostics.

llvm-svn: 155014
2012-04-18 17:46:41 +00:00
Silviu Baranga a2944116dc Fixed decoding for the ARM cdp2 instruction. The restriction on the coprocessor number was removed for this instruction.
llvm-svn: 155000
2012-04-18 13:02:55 +00:00
Jim Grosbach 37f6dcb3a8 Sanity check error handling for TokenAlias.
llvm-svn: 154951
2012-04-17 21:23:52 +00:00
Manuel Klimek 1f8918f69d Goodbye, JSONParser...
llvm-svn: 154930
2012-04-17 17:21:17 +00:00
Bill Wendling 6c4eea4db7 Download and build the compiler-rt project.
llvm-svn: 154905
2012-04-17 05:11:51 +00:00
Bill Wendling e30df5aa29 Don't tag libcxx and libcxxabi since we don't release them just yet.
llvm-svn: 154889
2012-04-17 01:01:55 +00:00
Jim Grosbach 56e6326033 Tidy up. 80 columns.
llvm-svn: 154881
2012-04-17 00:01:04 +00:00
Bob Wilson 3b0fda08e6 Remove old code to strip out unwanted PPC slices for Apple llvmCore.
llvm-svn: 154706
2012-04-13 22:58:53 +00:00
Craig Topper 374f19cade Fix target specific intrinsic handling to adjust intrinsic number before doing attribute table lookup. Also fix attribute table lookup to handle 'invalid' intrinsic correctly. Fixes PR12542
llvm-svn: 154658
2012-04-13 06:14:57 +00:00
Jim Grosbach b4722bba5f Remove incorrect comment.
llvm-svn: 154533
2012-04-11 21:09:54 +00:00
Jim Grosbach 3263a07d48 Tidy up. Remove hard tab characters.
llvm-svn: 154532
2012-04-11 21:02:33 +00:00
Jim Grosbach dac4a95b35 Tidy up. Whitespace.
llvm-svn: 154531
2012-04-11 21:02:30 +00:00
Andrew Trick 972541503f TableGen's regpressure: emit per-registerclass weight limits.
llvm-svn: 154518
2012-04-11 18:16:28 +00:00
Andrew Trick a5eee987e0 TableGen'd regpressure: register unit set pruning.
The pruning is more complete if it is not done incrementally. The code
is also a tad less convluted.

llvm-svn: 154510
2012-04-11 17:35:26 +00:00
Andrew Trick b1a92d3b35 Tablegen'd regpressure: emit the weighted pressure limit.
llvm-svn: 154477
2012-04-11 04:31:33 +00:00
Andrew Trick 0d94c73c26 Table-generated register pressure fixes.
Handle mixing allocatable and unallocatable register gracefully.
Simplify the pruning of register unit sets.

llvm-svn: 154474
2012-04-11 03:19:15 +00:00
Andrew Trick f8b1a66620 TableGen/reginfo potential bug: typo from previous checkin.
llvm-svn: 154452
2012-04-10 23:53:32 +00:00
Andrew Trick 7d52db9864 Fix for register pressure tables.
Recent refactoring introduced a bug. Fix: added buildRegUnitSets.

llvm-svn: 154382
2012-04-10 03:36:49 +00:00
Andrew Trick 9002c3157f Use std::includes instead of my own implementation.
Jakob's review.

llvm-svn: 154377
2012-04-10 03:12:29 +00:00
Andrew Trick 739a00386e Added register unit sets to the target description.
This is a new algorithm that finds sets of register units that can be
used to model registers pressure. This handles arbitrary, overlapping
register classes. Each register class is associated with a (small)
list of pressure sets. These are the dimensions of pressure affected
by the register class's liveness.

llvm-svn: 154374
2012-04-10 02:25:24 +00:00
Andrew Trick 1d7a2c572c Added register unit weights to the target description.
This is a new algorithm that associates registers with weighted
register units to accuretely model their effect on register
pressure. This handles registers with multiple overlapping
subregisters. It is possible, but almost inconceivable that the
algorithm fails to find an exact solution for a target description. If
an exact solution cannot be found, an inexact, but reasonable solution
will be chosen.

llvm-svn: 154373
2012-04-10 02:25:21 +00:00
Andrew Trick 3a6e88dcc9 Fix header comment
llvm-svn: 154372
2012-04-10 02:25:18 +00:00
Bob Wilson 1864146ab7 Do not include multiple -arch options in CPPFLAGS.
llvm-svn: 154070
2012-04-05 00:35:55 +00:00
Craig Topper 34487838bf Convert assert(false) followed by a return to llvm_unreachable
llvm-svn: 153997
2012-04-04 04:55:46 +00:00
Bob Wilson 3e66d73259 Fix the install location for the Embedded makefile target.
svn r145378 inadvertently changed the destination for the Embedded target
in the makefile.  Add a "/Developer" suffix to DSTROOT to compensate.

llvm-svn: 153980
2012-04-03 23:44:39 +00:00
Bob Wilson 9d12ffcd71 Remove dead code for installing libLTO when building llvmCore.
llvm-svn: 153978
2012-04-03 23:13:26 +00:00
Michael J. Spencer 22120c47a7 Add YAML parser to Support.
llvm-svn: 153977
2012-04-03 23:09:22 +00:00
Bob Wilson 8bbd98df00 When building llvmCore, pass the SDKROOT and -arch setting to configure.
So far all of configure tests have been run against the default SDK and
architecture, regardless of what is actually being built.  We've gotten
lucky until now.  <rdar://problem/11112479>

llvm-svn: 153972
2012-04-03 21:50:26 +00:00
Bob Wilson 5512ec8bae Remove a reference to the C backend.
llvm-svn: 153971
2012-04-03 21:50:24 +00:00
Craig Topper 9c252ebe4c Tidy up spacing in some tablegen outputs.
llvm-svn: 153937
2012-04-03 06:52:47 +00:00
Craig Topper 7629d63bc4 Add support for AVX enhanced comparison predicates. Patch from Kay Tiong Khoo.
llvm-svn: 153935
2012-04-03 05:20:24 +00:00
Bill Wendling 7d350efddc As Eric pointed out, even a Debug build should be equal. Leave the flag that can turn off comparisons though.
llvm-svn: 153927
2012-04-03 03:27:43 +00:00
Andrew Trick a890e3c69a Cleanup set_union usage. The same thing but a bit cleaner now.
llvm-svn: 153922
2012-04-03 01:35:52 +00:00
Andrew Trick c544e7c0a7 Use std::set_union instead of nasty custom code.
I just noticed Jakob's examples of the proper application of
std::set... routines.

llvm-svn: 153918
2012-04-03 00:47:23 +00:00
Bill Wendling d70cde134b Compare the .o files only for release builds. Add an option to bypass the comparison altogether.
llvm-svn: 153909
2012-04-02 23:27:43 +00:00
Silviu Baranga 98144e9e1a Second part for the 153874 one
llvm-svn: 153875
2012-04-02 15:46:46 +00:00
Benjamin Kramer 22d093e4f1 Emit the asm writer's mnemonic table with SequenceToOffsetTable.
This way we can get AVX v-prefixed instructions tail merged with the normal insns.

llvm-svn: 153869
2012-04-02 09:13:46 +00:00
Craig Topper 4de7373862 Reorder fields in MatchEntry and OperandMatchEntry to reduce padding. A bit tricky due to the target specific sizes for some of the fields so the ordering is only optimal for the targets in the tree.
llvm-svn: 153865
2012-04-02 07:48:39 +00:00
Craig Topper dab9e35ad0 Remove getInstructionName from MCInstPrinter implementations in favor of using the instruction name table from MCInstrInfo. Reduces static data in the InstPrinter implementations.
llvm-svn: 153863
2012-04-02 07:01:04 +00:00
Craig Topper 7a2cea1814 Use SequenceToOffsetTable to generate instruction name table for AsmWriter.
llvm-svn: 153857
2012-04-02 00:47:39 +00:00
Craig Topper 91773ab2ca Use SequenceToOffsetTable to create instruction name table. Saves space particularly on X86 where AVX instructions just add a 'v' to the front of other instructions.
llvm-svn: 153841
2012-04-01 18:14:14 +00:00
Benjamin Kramer 12af4285d1 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
Andrew Trick cdefdf1f5b comment typo
llvm-svn: 153796
2012-03-31 02:39:17 +00:00
Andrew Trick 1a004ca084 Introduce Register Units: Give each leaf register a number.
First small step toward modeling multi-register multi-pressure. In the
future, register units can also be used to model liveness and
aliasing.

llvm-svn: 153794
2012-03-31 01:35:59 +00:00
Benjamin Kramer 682de39f2d Rip out emission of the regIsInRegClass function for the asm printer.
It's slow, bloated and completely redundant with MCRegisterClass::contains.

llvm-svn: 153782
2012-03-30 23:13:40 +00:00
Jakob Stoklund Olesen 892f48058b Use SequenceToOffsetTable in emitRegisterNameString.
This allows suffix sharing in register names. (AX is a suffix of EAX).

llvm-svn: 153777
2012-03-30 21:12:52 +00:00
Jakob Stoklund Olesen 066aba5fe9 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 fc06055173 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 e214c3df40 Compress SimpleValueType lists by sharing.
Many register classes have the same value types. Share the table space.

llvm-svn: 153764
2012-03-30 17:42:04 +00:00
Jakob Stoklund Olesen 569e116d35 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
Jakob Stoklund Olesen a234f2efbd Add a SequenceToOffsetTable to TableGen.
This is similar to the StringToOffsetTable we use to produce string
tables, but it can be used for other sequences than strings, and it
eliminates entries for suffixes.

llvm-svn: 153760
2012-03-30 17:25:40 +00:00
Jakob Stoklund Olesen 00296815c5 Add more constness to CodeGenRegisters.
llvm-svn: 153667
2012-03-29 18:03:59 +00:00
Jakob Stoklund Olesen 9e512120b7 Spill DPair registers, not just QPR.
The arm_neon intrinsics can create virtual registers from the DPair
register class which allows both even-odd and odd-even D-register pairs.

This fixes PR12389.

llvm-svn: 153603
2012-03-28 21:20:32 +00:00
Chris Lattner 9e4e335281 fix a failure path to print the right thing, part of PR12357
llvm-svn: 153457
2012-03-26 19:11:51 +00:00
Benjamin Kramer c16e09bb80 TableGen: Don't emit the llvm intrinsic -> gcc builtin table, its only user was the c backend.
llvm-svn: 153432
2012-03-26 11:08:03 +00:00
Eli Bendersky 6330877a3e Fix lit failure on cmake-clang-x64_64-linux bot, apparently due to its having
a very (*very*) old version of Python (2.4?)

llvm-svn: 153409
2012-03-25 09:42:28 +00:00
Eli Bendersky f33086052d Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnu
* Removed test/lib/llvm.exp - it is no longer needed 
* Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files
  left in the test suite so this code is no longer required. test/lit.cfg is
  now much shorter and clearer 
* Removed a lot of duplicate code in lit.local.cfg files that need access to
  the root configuration, by adding a "root" attribute to the TestingConfig
  object. This attribute is dynamically computed to provide the same
  information as was previously provided by the custom getRoot functions. 
* Documented the config.root attribute in docs/CommandGuide/lit.pod

llvm-svn: 153408
2012-03-25 09:02:19 +00:00
Benjamin Kramer b0640db80e Include cstdio in a few place that depended on getting it transitively through StringExtras.h
llvm-svn: 153328
2012-03-23 11:35:30 +00:00
Eric Christopher 64a232343a Remove the C backend.
llvm-svn: 153307
2012-03-23 05:50:46 +00:00
Nico Weber d998e8450e Add a ${pathsep} variable to lit that expands to : (or ; on win32).
This is in braces so that it doesn't conflict with the existing %p.
It uses braces instead of parens because parens would have to be
regex-escaped.

llvm-svn: 153213
2012-03-21 19:56:42 +00:00
NAKAMURA Takumi 98b18777a4 lit/TestRunner.py: [Win32] Rework WinWaitReleased() again! "win32file" from Python Win32 Extensions.
We can simply confirm the handle released to open it with EXCLUSIVE. Attempting renaming was bad.

Disable win32file at ImportError. Thanks to Francois to let me know.

FIXME: Could we report warning or notification if win32file were not found?
llvm-svn: 153172
2012-03-21 07:49:44 +00:00
Evan Cheng 630a7f3064 Reserve number of MI operands to accom,odate complex patterns.
llvm-svn: 153125
2012-03-20 21:07:51 +00:00
Francois Pichet b7ae23fb66 Revert r152915. Chapuni's WinWaitReleased refactoring: It doesn't work for me
llvm-svn: 152958
2012-03-16 22:50:01 +00:00
NAKAMURA Takumi 16d5af118c lit/TestRunner.py: [Win32] Check all opened_files[] released, rather than (obsoleted) written_files[].
In previous case,
RUN: foo -o %t
RUN: FileCheck < %t
RUN: bar -o %t

2nd read handle might prevent manipulation of 3rd %t in bar, to remove and rename.

llvm-svn: 152916
2012-03-16 10:48:10 +00:00
NAKAMURA Takumi ee4d317725 lit/TestRunner.py: [Win32] Rework WinWaitReleased().
We can simply confirm the handle released to open it with EXCLUSIVE. Attempting renaming was bad.

llvm-svn: 152915
2012-03-16 10:48:03 +00:00
Craig Topper 501d95c176 More const-correcting of FixedLenDecoderEmitter.
llvm-svn: 152906
2012-03-16 06:52:56 +00:00
Craig Topper 48c112babe Const-correct the FixedLenDecoderEmitter. Pass a few things by const reference instead of value to avoid some copying.
llvm-svn: 152899
2012-03-16 05:58:09 +00:00
Craig Topper 82d0d5fc6b Spacing fixes. Mostly aligning arguments that spilled onto next line with the opening parenthese instead of 2 spaces in.
llvm-svn: 152889
2012-03-16 01:19:24 +00:00
Craig Topper 93e6434ca9 Remove unused field NumVariable from Filter class. Even it was needed the same result could be found with VariableInstructions.size(). Also fix some typos in comments.
llvm-svn: 152885
2012-03-16 00:56:01 +00:00