Commit Graph

2734 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes c2f87b7bb2 Reapply r105521, this time appending "LLU" to 64 bit
immediates to avoid breaking the build.

llvm-svn: 105652
2010-06-08 22:51:23 +00:00
Nate Begeman d80ce4f861 Fix a valgrind error.
llvm-svn: 105600
2010-06-08 07:11:17 +00:00
Nate Begeman 8615667bac Refine BuiltinsARM.def types a bit, we should do a better job of this to save some c++ code in CGBuiltins.
llvm-svn: 105598
2010-06-08 06:01:16 +00:00
Nate Begeman fe123268a9 ARM NEON:
fix vcvt naming
handle vdup, vcombine with generic vector code

llvm-svn: 105588
2010-06-08 00:14:42 +00:00
Nate Begeman 12d1f62f6c clang codegen support
llvm-svn: 105531
2010-06-07 16:00:37 +00:00
Chris Lattner fdd2614330 revert r105521, which is breaking the buildbots with stuff like this:
In file included from X86InstrInfo.cpp:16:
X86GenInstrInfo.inc:2789: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2790: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2792: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2793: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2808: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2809: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2816: error: integer constant is too large for 'long' type
X86GenInstrInfo.inc:2817: error: integer constant is too large for 'long' type

llvm-svn: 105524
2010-06-05 04:17:30 +00:00
Bruno Cardoso Lopes 594fa26317 Initial AVX support for some instructions. No patterns matched
yet, only assembly encoding support.

llvm-svn: 105521
2010-06-05 03:53:24 +00:00
Bruno Cardoso Lopes c4f614870f Teach tablegen to support 'defm' inside multiclasses.
llvm-svn: 105519
2010-06-05 02:11:52 +00:00
Nate Begeman 7090e5be2b Handle multi-vector returns and args.
llvm-svn: 105496
2010-06-04 22:53:30 +00:00
Nate Begeman 0d081df3f2 Additional fixes to BuiltinsARM.def generator, on to clang codegen.
llvm-svn: 105488
2010-06-04 21:36:00 +00:00
Nate Begeman 878bdccea6 Progress on generating BuiltinsARM.def, still some duplicates to work out.
llvm-svn: 105461
2010-06-04 07:11:25 +00:00
Nate Begeman 1ca8dba557 BuiltinsARM.def emitter, still needs a substantial bit of tweaking to lighten the load on clang.
llvm-svn: 105456
2010-06-04 01:26:15 +00:00
Nate Begeman 03d6e4961c Mangle __builtin_neon_* names appropriately.
Add skeleton of support for emitting the list of prototypes for BuiltinsARM.def

llvm-svn: 105443
2010-06-04 00:21:41 +00:00
Nate Begeman 64b76bd4f7 Add some additional capabilities to the neon emitter
llvm-svn: 105416
2010-06-03 21:35:22 +00:00
Dale Johannesen d679ff7330 Early implementation of tail call for ARM.
A temporary flag -arm-tail-calls defaults to off,
so there is no functional change by default.
Intrepid users may try this; simple cases work
but there are bugs.

llvm-svn: 105413
2010-06-03 21:09:53 +00:00
Benjamin Kramer 9f4ab44fe4 Forgot to update the most important part of the gtest modifications readme.
llvm-svn: 105396
2010-06-03 17:11:49 +00:00
Benjamin Kramer 7cd082a7a3 Disable pthread support in googletest if llvm was configured without threads.
llvm-svn: 105390
2010-06-03 15:17:04 +00:00
Benjamin Kramer 1add5f378d Turns out gtest still prefers the system <tr1/tuple> over it's own
implementation. Force the internal one to unbreak clang selfhost on linux.

llvm-svn: 105386
2010-06-03 07:51:58 +00:00
Nate Begeman 11d56c55c4 arm_neon.h now makes it through clang and generates appropriate code for those functions which can use
generic vector operators rather than __builtin_neon_*

llvm-svn: 105380
2010-06-03 04:04:09 +00:00
Benjamin Kramer 9cb0274182 Update Readme and Makefiles for the new gtest.
llvm-svn: 105355
2010-06-02 22:02:57 +00:00
Benjamin Kramer bfb492d6c8 Merge gtest-1.5.0.
llvm-svn: 105354
2010-06-02 22:02:30 +00:00
Benjamin Kramer 78b6a290cb Merge gtest-1.4.0.
llvm-svn: 105353
2010-06-02 22:02:11 +00:00
Benjamin Kramer f2f402059f Merge gtest-1.3.0.
OSX users: make sure that CrashReporter is disabled when running unit tests.
Death tests are enabled now so you'll get a ton of message boxes.

llvm-svn: 105352
2010-06-02 22:01:25 +00:00
Nate Begeman 7db953e396 arm_neon.h emitter now mostly complete for the purposes of initial testing.
llvm-svn: 105349
2010-06-02 21:53:00 +00:00
Duncan Sands 9242162bb1 Pacify recent gcc: remove a pointless const qualifier.
llvm-svn: 105318
2010-06-02 08:37:30 +00:00
Nate Begeman 68d0518b92 Checkpoint; handle 'int' and 'void' correctly
llvm-svn: 105316
2010-06-02 07:14:28 +00:00
Nate Begeman d86d60f91d Emit full function prototypes. Definitions & typedefs to come.
llvm-svn: 105315
2010-06-02 06:17:19 +00:00
Nate Begeman 469bb2be2c Checkpoint arm_neon.h generation with tablegen
llvm-svn: 105307
2010-06-02 00:34:55 +00:00
Alexis Hunt 6e1690bdd8 Fix comment
llvm-svn: 105297
2010-06-01 23:29:39 +00:00
Dan Gohman 88337a95ca Fix extra fread after EOF, non-wires-crossed version.
llvm-svn: 105270
2010-06-01 14:09:29 +00:00
Chris Lattner bf17d0f62c revert r105223 which broke all my testing.
llvm-svn: 105225
2010-05-31 17:10:45 +00:00
Dan Gohman ad2259ec4c Fix count so that it doesn't make an extra fread call after
EOF is detected.

llvm-svn: 105223
2010-05-31 16:13:45 +00:00
Alexis Hunt c943c52073 Allow for creation of clang DeclNodes tables.
The StmtNodes generator has been generalized to allow for the
creation of DeclNodes tables as well, and another emitter was
added for DeclContexts.

llvm-svn: 105164
2010-05-30 07:21:42 +00:00
Jakob Stoklund Olesen 417fc5e434 Emit TargetRegisterInfo::composeSubRegIndices().
Also verify that all subregister indices compose unambiguously.

llvm-svn: 105064
2010-05-28 23:48:31 +00:00
Nate Begeman 2c3a196d16 Comment out some code in prep for actual .td file checkpoint.
llvm-svn: 104927
2010-05-28 02:19:08 +00:00
Eli Friedman 48be842592 Fix build breakage.
llvm-svn: 104912
2010-05-28 01:15:28 +00:00
Nate Begeman dd5904687f Add support to tablegen for auto-generating arm_neon.h from a tablegen description
of the intrinsics.  The goal is to auto-generate both support for GCC-style (vector)
and ARM-style (struct of vector) intrinsics.

This is work in progress, but will be completed soon.

llvm-svn: 104910
2010-05-28 01:08:32 +00:00
Dan Gohman 7559394270 When handling raw_ostream errors manually, use clear_error() so that
raw_ostream doesn't try to do its own error handling.

llvm-svn: 104881
2010-05-27 20:17:28 +00:00
Dan Gohman c6e5a4c68f Simplify raw_ostream usage.
llvm-svn: 104874
2010-05-27 19:48:08 +00:00
Dan Gohman 388fa73f03 Minor code simplification.
llvm-svn: 104845
2010-05-27 16:25:05 +00:00
Daniel Dunbar 97ac3afac2 AsmMatcher: Ensure classes are totally ordered, so we can std::sort them reliably.
llvm-svn: 104806
2010-05-27 05:31:32 +00:00
Jakob Stoklund Olesen 731440b62b Check that inherited subregisters all have a direct SubRegIndex.
llvm-svn: 104755
2010-05-26 22:15:07 +00:00
Jakob Stoklund Olesen d1d7ed63ff Add StringRef::compare_numeric and use it to sort TableGen register records.
This means that our Registers are now ordered R7, R8, R9, R10, R12, ...
Not R1, R10, R11, R12, R2, R3, ...

llvm-svn: 104745
2010-05-26 21:47:28 +00:00
Jakob Stoklund Olesen 3113970675 Suppress emmission of empty subreg/superreg/alias sets.
llvm-svn: 104741
2010-05-26 21:35:55 +00:00
Jakob Stoklund Olesen 7de379467e Replace the SubRegSet tablegen class with a less error-prone mechanism.
A Register with subregisters must also provide SubRegIndices for adressing the
subregisters. TableGen automatically inherits indices for sub-subregisters to
minimize typing.

CompositeIndices may be specified for the weirder cases such as the XMM sub_sd
index that returns the same register, and ARM NEON Q registers where both D
subregs have ssub_0 and ssub_1 sub-subregs.

It is now required that all subregisters are named by an index, and a future
patch will also require inherited subregisters to be named. This is necessary to
allow composite subregister indices to be reduced to a single index.

llvm-svn: 104704
2010-05-26 17:27:12 +00:00
Jakob Stoklund Olesen 50eec620f4 Revert "Replace the SubRegSet tablegen class with a less error-prone mechanism."
This reverts commit 104654.

llvm-svn: 104660
2010-05-26 01:21:14 +00:00
Jakob Stoklund Olesen 0b0274524c Replace the SubRegSet tablegen class with a less error-prone mechanism.
A Register with subregisters must also provide SubRegIndices for adressing the
subregisters. TableGen automatically inherits indices for sub-subregisters to
minimize typing.

CompositeIndices may be specified for the weirder cases such as the XMM sub_sd
index that returns the same register, and ARM NEON Q registers where both D
subregs have ssub_0 and ssub_1 sub-subregs.

It is now required that all subregisters are named by an index, and a future
patch will also require inherited subregisters to be named. This is necessary to
allow composite subregister indices to be reduced to a single index.

llvm-svn: 104654
2010-05-26 00:28:19 +00:00
Jakob Stoklund Olesen 66c939a2ca Drop the SuperregHashTable. It is essentially the same as SubregHashTable.
llvm-svn: 104650
2010-05-25 23:43:18 +00:00
Jakob Stoklund Olesen 1ad0d5e25b Print symbolic SubRegIndex names on machine operands.
llvm-svn: 104628
2010-05-25 19:49:38 +00:00
Jakob Stoklund Olesen 3b59e0601e Ignore NumberHack and give each SubRegIndex instance a unique enum value instead.
This passes lit tests, but I'll give it a go through the buildbots to smoke out
any remaining places that depend on the old SubRegIndex numbering.

Then I'll remove NumberHack entirely.

llvm-svn: 104615
2010-05-25 17:21:04 +00:00
Jakob Stoklund Olesen fdb25de17e Switch SubRegSet to using symbolic SubRegIndices
llvm-svn: 104571
2010-05-24 23:03:18 +00:00
Chris Lattner 76b3de92f2 diaggroup categories should take precedence over diag-specific groups.
llvm-svn: 104567
2010-05-24 21:55:47 +00:00
Jakob Stoklund Olesen edab242488 Replace the tablegen RegisterClass field SubRegClassList with an alist-like data
structure that represents a mapping without any dependencies on SubRegIndex
numbering.

This brings us closer to being able to remove the explicit SubRegIndex
numbering, and it is now possible to specify any mapping without inventing
*_INVALID register classes.

llvm-svn: 104563
2010-05-24 21:46:58 +00:00
Jakob Stoklund Olesen 1c69646e99 Add the SubRegIndex TableGen class.
This is the beginning of purely symbolic subregister indices, but we need a bit
of jiggling before the explicit numeric indices can be completely removed.

llvm-svn: 104492
2010-05-24 14:48:12 +00:00
Daniel Dunbar 346782c12c tblgen/AsmMatcher: Change AsmOperandClass to allow a list of superclasses instead of just one.
llvm-svn: 104452
2010-05-22 21:02:29 +00:00
Daniel Dunbar 5661c0c755 tblgen/Target: Add a isAsmParserOnly bit, and teach the disassembler to honor
it.

llvm-svn: 104270
2010-05-20 20:20:32 +00:00
Daniel Dunbar 04c4a399aa lit: Add another place to look for bash.
llvm-svn: 104189
2010-05-19 23:56:09 +00:00
Alexis Hunt 7dfbb1faf1 Replace FIRST_* and LAST_* macros with a generic STMT_RANGE macro
Also rename ABSTRACT to ABSTRACT_STMT

llvm-svn: 104018
2010-05-18 06:22:50 +00:00
Evan Cheng cd67c21407 Added a QQQQ register file to model 4-consecutive Q registers.
llvm-svn: 103760
2010-05-14 02:13:41 +00:00
Evan Cheng 670a4104a9 Adding a v8i64 512-bit vector type. This will be used to model ARM NEON intrinsics which translate into a pair of vld / vst instructions that can load / store 8 consecutive 64-bit (D) registers.
llvm-svn: 103746
2010-05-13 23:55:47 +00:00
Chandler Carruth 89e5635a7c Update tablegen to generate shorts instead of chars for subgroup arrays.
llvm-svn: 103704
2010-05-13 07:43:47 +00:00
Daniel Dunbar 12a78f502a lit: Fix a sh lexing bug which caused annotate-token.m to fail when run with the
internal shell parser; we weren't lexing the quotes in a command like::

  clang -DFOO='hello'

correctly.

llvm-svn: 103652
2010-05-12 21:47:58 +00:00
Daniel Dunbar cf925cb272 lit: Fix OneCommandPerFileTest format when tests are specified directly.
llvm-svn: 103626
2010-05-12 17:56:44 +00:00
Daniel Dunbar 6b3b0a405e lit: Add support for 'lit ... @foo', which reads a list of tests to run from
foo.

llvm-svn: 103625
2010-05-12 17:56:42 +00:00
Dan Gohman 1a1b51ff59 Add initial kill flag support to FastISel.
llvm-svn: 103529
2010-05-11 23:54:07 +00:00
Douglas Gregor 6739a89117 Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!
llvm-svn: 103457
2010-05-11 06:17:44 +00:00
Sean Callanan e7e1cf9fbd Eliminated the classification of control registers into %ecr_
and %rcr_, leaving just %cr_ which is what people expect.
Updated the disassembler to support this unified register set.
Added a testcase to verify that the registers continue to be
decoded correctly.

llvm-svn: 103196
2010-05-06 20:59:00 +00:00
Dan Gohman 779c69bbc5 Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.

llvm-svn: 103194
2010-05-06 20:33:48 +00:00
Evan Cheng 31cdcd46d6 Re-apply 103156 and 103157. 103156 didn't break anything. 10315 exposed a coalescer bug that's fixed by 103170.
llvm-svn: 103172
2010-05-06 06:36:08 +00:00
Alexis Hunt 41e9f77628 Fix some stylistic issues with my last commit.
llvm-svn: 103164
2010-05-06 05:24:38 +00:00
Bob Wilson 0d545607f7 Select an ARM-hosted cross build with a separate makefile target instead of
a magic project name.

llvm-svn: 103125
2010-05-05 22:22:40 +00:00
Jeffrey Yasskin 1a74a44bf9 Rearrange the suppressions files to be by-architecture instead of by-problem.
ddunbar says the gcc-4.3.3 suppressions are obsolete.

llvm-svn: 103106
2010-05-05 18:39:16 +00:00
Jeffrey Yasskin 4ad4fbd885 Add a suppressions file for an intermittent "leak" under RegisterPass.
llvm-svn: 103100
2010-05-05 18:15:26 +00:00
Daniel Dunbar d6e76fb20c lit: Allow test_format to be None.
llvm-svn: 103091
2010-05-05 17:22:35 +00:00
Shantonu Sen e8282890ec Add newline to end of file to avoid warning
when building llvm with clang

llvm-svn: 103084
2010-05-05 13:56:46 +00:00
Alexis Hunt 40dde1ac92 Include the right header for toupper
llvm-svn: 103073
2010-05-05 04:31:44 +00:00
Alexis Hunt f4cdc84160 Add an emitter to handle the list of clang statement nodes.
llvm-svn: 103071
2010-05-05 04:13:08 +00:00
Chris Lattner b3d221964b add the ability to associate 'category' names with clang diagnostics
and diagnostic groups.  This allows the compiler to group 
diagnostics together (e.g. "Logic Warning", 
"Format String Warning", etc) like the static analyzer does.  
This is not exposed through anything in the compiler yet.

llvm-svn: 103050
2010-05-04 20:44:23 +00:00
Daniel Dunbar 9989417f33 MC/Matcher: Add support for over-riding the default MatchInstruction function
name (for example, to allow targets to interpose the actual MatchInstruction
function).

llvm-svn: 102987
2010-05-04 00:33:13 +00:00
Dan Gohman 7d5d5b9065 Add a polygen rule that reflects the fact that nsw and nuw can be
used together in either order.

llvm-svn: 102983
2010-05-04 00:13:24 +00:00
Bob Wilson d57269df5e Remove special case for llvmCore_Embedded project. This is no longer needed
since llvmCore is built as part of llvmgcc42 now.

llvm-svn: 102962
2010-05-03 21:41:24 +00:00
Evan Cheng 66561537f5 Add a pseudo instruction REG_SEQUENCE that takes a list of registers and
sub-register indices and outputs a single super register which is formed from
a consecutive sequence of registers.

This is used as register allocation / coalescing aid and it is useful to
represent instructions that output register pairs / quads. For example,
v1024, v1025 = vload <address>
where v1024 and v1025 forms a register pair.

This really should be modelled as
v1024<3>, v1025<4> = vload <address>
but it would violate SSA property before register allocation is done.

Currently we use insert_subreg to form the super register:
v1026 = implicit_def
v1027 - insert_subreg v1026, v1024, 3
v1028 = insert_subreg v1027, v1025, 4
...
      = use v1024
      = use v1028

But this adds pseudo live interval overlap between v1024 and v1025.

We can now modeled it as
v1024, v1025 = vload <address>
v1026 = REG_SEQUENCE v1024, 3, v1025, 4
...
      = use v1024
      = use v1026

After coalescing, it will be
v1026<3>, v1025<4> = vload <address>
...
      = use v1026<3>
      = use v1026

llvm-svn: 102815
2010-05-01 00:28:44 +00:00
Bob Wilson 1905e2be86 Don't remove libLTO.dylib if it's not being installed in Developer/usr/lib;
just leave it in Developer/usr/local/lib.

llvm-svn: 102646
2010-04-29 18:04:29 +00:00
Bob Wilson c892b6dbb0 Add an option to the Apple-style build to control whether libLTO.dylib should
be installed.  Disable it by default.

llvm-svn: 102531
2010-04-28 21:08:01 +00:00
Bob Wilson 7ebb5e4cb0 Undo most of my previous whitespace fix. I think I like it better this way
after all.

llvm-svn: 102508
2010-04-28 18:18:36 +00:00
Bob Wilson a2dbebc431 Fix inconsistent use of HOSTS and TARGETS variables.
llvm-svn: 102505
2010-04-28 18:06:27 +00:00
Bob Wilson 5f1074adde Fix whitespace.
llvm-svn: 102504
2010-04-28 17:50:03 +00:00
Sean Callanan 85d70594f0 Fixes to edis that mark x86 call targets as
memory operands rather than immediate operands.

llvm-svn: 102217
2010-04-23 22:17:17 +00:00
Johnny Chen d7209d2d56 When doing Thumb disassembly, there's no need to consider t2ADDrSPi12/t2SUBrSPi12,
as their generic counterparts t2ADDri12/t2SUBri12 should suffice.

llvm-svn: 101929
2010-04-20 18:45:24 +00:00
Chris Lattner 5debc33168 stop computing InstImpInputs, it is dead
llvm-svn: 101881
2010-04-20 06:30:25 +00:00
Chris Lattner 9dc68d31fd DAGInstruction::ImpOperands is dead after my recent tblgen work, zap it.
llvm-svn: 101880
2010-04-20 06:28:43 +00:00
Anton Korobeynikov 7d62e33291 Make processor FUs unique for given itinerary. This extends the limit of 32
FU per CPU arch to 32 per intinerary allowing precise modelling of quite
complex pipelines in the future.

llvm-svn: 101754
2010-04-18 20:31:01 +00:00
Chris Lattner 3448f4e448 silence some -Wmissing-field-initializers warnings.
llvm-svn: 101690
2010-04-18 03:30:32 +00:00
Dan Gohman b29cda9b3c Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Daniel Dunbar f43481df34 Remove unnecessary uses of <iostream>.
llvm-svn: 101338
2010-04-15 03:47:24 +00:00
Benjamin Kramer a050255103 EDis: Don't include inttypes.h. We support compilers which don't provide it. It was unused anyways.
llvm-svn: 101241
2010-04-14 13:56:38 +00:00
Daniel Dunbar 780792dc86 Fix -Asserts warnings.
llvm-svn: 101191
2010-04-13 23:34:11 +00:00
Sean Callanan 814e69b171 Fixed a nasty layering violation in the edis source
code.  It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.

Also removed hacky #define-controlled initialization
of targets in edis.  If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.

llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Johnny Chen 4e8bd58001 If all the bit positions are not specified; do not decode the instructions.
We are bound to fail!  For proper disassembly, the well-known encoding bits
of the instruction must be fully specified.

This also removes pseudo instructions from considerations of disassembly,
which is a better design and less fragile than the name matchings.

llvm-svn: 100899
2010-04-09 21:01:02 +00:00
Chris Lattner c86cdc7d47 add minix support, patch by Kees van Reeuwijk! PR6797
llvm-svn: 100895
2010-04-09 20:45:04 +00:00
Bob Wilson 0106063556 Provide versions of the ARM eh_sjlj_setjmp instructions for non-VFP subtargets
such that the non-VFP versions have no implicit defs of VFP registers.
If any callee-saved VFP registers are marked as having been defined, the
prologue/epilogue code will try to save and restore them.
Radar 7770432.

llvm-svn: 100892
2010-04-09 20:41:18 +00:00
Johnny Chen 298a122fb4 ARM decoder emitter should print out useful information unconditionally when it
encounters decoding conflicts, instead of wrapping it inside the DEBUG() macro. 

llvm-svn: 100886
2010-04-09 19:31:33 +00:00
Daniel Dunbar c1ba0c96e3 lit: Add support to OneCommandPerFileTest format to take input directory from input path.
llvm-svn: 100846
2010-04-09 02:15:10 +00:00
Johnny Chen 75f82345c4 Now that Evan Cheng has fixed the coalescer bug (r100804), the workaround code
to avoid memcpy() call is no longer necessary.

llvm-svn: 100811
2010-04-08 21:23:54 +00:00
Benjamin Kramer 53dd088b58 Various MSVC warning fixes about truncated 64 bit shifts and const pointers passed to free.
llvm-svn: 100767
2010-04-08 15:25:57 +00:00
Benjamin Kramer 634d9ff7c0 Use errs instead of fprintf.
llvm-svn: 100754
2010-04-08 09:42:29 +00:00
Sean Callanan 03549ee5af Added support for ARM disassembly to edis.
I also added a rule to the ARM target's Makefile to
build the ARM-specific instruction information table
for the enhanced disassembler.

I will add the test harness for all this stuff in
a separate commit.

llvm-svn: 100735
2010-04-08 00:48:21 +00:00
Chris Lattner 2104b8d36e rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner 5109d3e55d add newlines at end of files.
llvm-svn: 100706
2010-04-07 22:54:55 +00:00
Sean Callanan 1efe661b46 Fixed a bug where the disassembler would allow an immediate
argument that had to be between 0 and 7 to have any value,
firing an assert later in the AsmPrinter.  Now, the
disassembler rejects instructions with out-of-range values
for that immediate.

llvm-svn: 100694
2010-04-07 21:42:19 +00:00
Eric Christopher 978d33a937 Fix typo and correct comment somewhat.
llvm-svn: 100691
2010-04-07 20:58:16 +00:00
Johnny Chen 4e2f8722c4 Re-enable ARM/Thumb disassembler and add a workaround for a memcpy() call in
ARMDecoderEmitter.cpp, with FIXME comment.

llvm-svn: 100690
2010-04-07 20:53:12 +00:00
Anton Korobeynikov 0bdc6345e8 Initial support for different kinds of FU reservation.
llvm-svn: 100645
2010-04-07 18:19:32 +00:00
Chris Lattner 0e45d24a4e stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.

llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Jakob Stoklund Olesen b93331f3be Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.
When a target instruction wants to set target-specific flags, it should simply
set bits in the TSFlags bit vector defined in the Instruction TableGen class.

This works well because TableGen resolves member references late:

class I : Instruction {
  AddrMode AM = AddrModeNone;
  let TSFlags{3-0} = AM.Value;
}

let AM = AddrMode4 in
def ADD : I;

TSFlags gets the expected bits from AddrMode4 in this example.

llvm-svn: 100384
2010-04-05 03:10:20 +00:00
Chris Lattner 76c564b1bb change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.

llvm-svn: 100306
2010-04-04 04:47:45 +00:00
Chandler Carruth 77074b1378 Fix a warning in GCC about a pointless typedef.
llvm-svn: 100268
2010-04-03 04:45:24 +00:00
Chandler Carruth 89c787b906 Add the new ARMDecodeEmitter to CMake build.
llvm-svn: 100267
2010-04-03 04:36:43 +00:00
Johnny Chen dbdd3f8b09 Move variable "Bits" declaration/definition into the DEBUG block where its usage
is expected.

llvm-svn: 100247
2010-04-02 23:13:52 +00:00
Johnny Chen 7d363b63fd Fixed build warning.
llvm-svn: 100244
2010-04-02 22:51:04 +00:00
Johnny Chen 88a7b5a724 Change from .../Support/DataTypes.h to .../System/DataTypes.h.
(Fix build failure)

llvm-svn: 100243
2010-04-02 22:41:06 +00:00
Johnny Chen 7b999ea7b7 Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Reviewed by Chris Latter and Bob Wilson.

llvm-svn: 100233
2010-04-02 22:27:38 +00:00
Daniel Dunbar 3f183ae5cb Add a FIXME.
llvm-svn: 100034
2010-03-31 19:14:05 +00:00
Daniel Dunbar 6e0dbca6c4 lit: Make sure to close any files we open as part of redirection.
PR6753.

llvm-svn: 100032
2010-03-31 18:48:43 +00:00
Chris Lattner f91869b619 Switch pattern sorting predicate from stable sort -> sort, it
doesn't need to be stable because the patterns are fully ordered.

Add a first level sort predicate that orders patterns in this
order:  1) scalar integer operations 2) scalar floating point 
3) vector int 4) vector float.  This is a trivial sort on their
top level pattern type so it is nice and transitive.  The
benefit of doing this is that simple integer operations are
much more common than insane vector things and isel was trying
to match the big complex vector patterns before the simple
ones because the complexity of the vector operations was much
higher.  Since they can't both match, it is best (for compile
time) to try the simple integer ones first.

This cuts down the # failed match attempts on real code by
quite a bit, for example, this reduces backtracks on crafty
(as a random example) from 228285 -> 188369.

llvm-svn: 99797
2010-03-29 02:02:45 +00:00
Chris Lattner 41a15141c9 revert 99795, as mentioned, it is disabled anyway.
llvm-svn: 99796
2010-03-29 01:58:15 +00:00
Chris Lattner a79260151f Check in a (disabled) failed attempt to improve the ordering of
patterns within the generated matcher.  This works great except
that the sort fails because the relation defined isn't 
transitive.  I have a much simpler solution coming next, but want
to archive the code.

llvm-svn: 99795
2010-03-29 01:56:19 +00:00
Chris Lattner 05925fe1fe print the complexity of the pattern being matched in the
comment in the generated table.

llvm-svn: 99794
2010-03-29 01:40:38 +00:00
Chris Lattner 135091bd9d improve type checking of SDNode operand count. This rejects all cases
where an incorrect number of operands is provided to an sdnode instead
of just a few cases.

llvm-svn: 99761
2010-03-28 08:48:47 +00:00
Chris Lattner 6642118e83 finally remove the immAllOnesV_bc/immAllZerosV_bc patterns
and those derived from them.  These are obnoxious because
they were written as: PatLeaf<(bitconvert).  Not having an
argument was foiling adding better type checking for operand
count matching up with what was required (in this case,
bitconvert always requires an operand!)

llvm-svn: 99759
2010-03-28 08:43:23 +00:00
Chris Lattner a787c9e23a teach tblgen to allow patterns like (add (i32 (bitconvert (i32 GPR))), 4),
transforming it into (add (i32 GPR), 4).  This allows us to write type
generic multi patterns and have tblgen automatically drop the bitconvert
in the case when the types align.  This allows us to fold an extra load
in the changed testcase.

llvm-svn: 99756
2010-03-28 08:38:32 +00:00
Chris Lattner 2e9eae1fa2 validate that input sdnodes don't exist in an output pattern.
llvm-svn: 99747
2010-03-28 06:57:56 +00:00
Chris Lattner adf7ecf9d3 eliminate a bunch of code duplication in ParseTreePattern
by rotating it.

llvm-svn: 99746
2010-03-28 06:50:34 +00:00
Chris Lattner ffdac7b76a SDTCisVT<0, isVoid> is not valid, reject it.
llvm-svn: 99744
2010-03-28 06:04:39 +00:00
Chris Lattner 49e2773dd8 add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and
1, 1 cases which are by-far the most frequent.  This shrinks the X86
isel table from 77014 -> 74657 bytes.

llvm-svn: 99740
2010-03-28 05:50:16 +00:00
Chris Lattner 725d3f6219 fix a long standing fixme, which required fixing a bunch of other
issues to get here.  We now trim the result type list of the
CompleteMatch or MorphNodeTo operation to be the same size as the
thing we're matching.  this means that if you match (add GPR, GPR)
with an instruction that produces a normal result and a flag that
we now trim the result in tblgen instead of having to do it 
dynamically.  This exposed a bunch of inconsistencies in result
counting that happened to be getting lucky since the days of the
old isel.

llvm-svn: 99728
2010-03-27 20:45:15 +00:00
Chris Lattner 4a5f7be077 fix CodeGenTarget::getRegisterVTs to not return the
same vt multiple times for a register.  For example,
ECX is in 5 different i32 reg classes, just return 
1 i32 instead of 5.

llvm-svn: 99727
2010-03-27 20:32:26 +00:00
Chris Lattner 7bc5d9b576 hoist some funky logic into CodeGenInstruction
from two places in CodeGenDAGPatterns.cpp, and
use it in DAGISelMatcherGen.cpp instead of using
an incorrect predicate that happened to get lucky
on our current targets.

llvm-svn: 99726
2010-03-27 20:09:24 +00:00
Chris Lattner d44966f26d continue pushing tblgen's support for nodes with multiple
results forward.  We can now handle an instruction that 
produces one implicit def and one result instead of one or
the other when not at the root of the pattern.

llvm-svn: 99725
2010-03-27 19:15:02 +00:00
Chris Lattner e7e9f06d3b fix a bug in my recent patch that increased opcode size to 2 bytes:
the index comments nested under OPC_SwitchOpcode were off by one.
This fixes the comments.

llvm-svn: 99722
2010-03-27 18:49:33 +00:00
Dan Gohman dcc8cd96f2 Remove an unnecessary #include.
llvm-svn: 99714
2010-03-27 16:33:36 +00:00
Chris Lattner 5c2182ef77 remove parallel support.
llvm-svn: 99703
2010-03-27 02:53:27 +00:00
Jakob Stoklund Olesen f8d7eda663 Teach TableGen to understand X.Y notation in the TSFlagsFields strings.
Remove much horribleness from X86InstrFormats as a result. Similar
simplifications are probably possible for other targets.

llvm-svn: 99539
2010-03-25 18:52:01 +00:00
Daniel Dunbar e810155805 lit: Add LitTestCase and lit.load_test_suite, for adapting lit based suites for
use with Python's unittest.

llvm-svn: 99498
2010-03-25 07:10:01 +00:00
Chris Lattner 552dddc51c Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte.  This is important because
we're running up to too many opcodes to fit in a byte
and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE
making the numbering sparse.  This just bites the
bullet and bloats out the table.  In practice, this
increases the size of the x86 isel table from 74.5K
to 76K.  I think we'll cope :)

This fixes rdar://7791648

llvm-svn: 99494
2010-03-25 06:33:05 +00:00
Jakob Stoklund Olesen 0e45762250 Fix evil TableGen bug in template parameters with defaults.
If a TableGen class has an initializer expression containing an X.Y subexpression,
AND X depends on template parameters,
AND those template parameters have defaults,
AND some parameters with defaults are beyond position 1,
THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted.

llvm-svn: 99492
2010-03-25 06:23:34 +00:00
Chris Lattner 6c2d178957 add plumbing for handling multiple result nodes
in some more places.

llvm-svn: 99366
2010-03-24 00:41:19 +00:00
Chris Lattner 38c99662ff implement SDTCisVTSmallerThanOp with EnforceSmallerThan
instead of reimplementing it wrong and poorly.

llvm-svn: 99357
2010-03-24 00:06:46 +00:00
Chris Lattner 57ebf63da7 bring sanity to EnforceVectorEltType
llvm-svn: 99354
2010-03-24 00:01:16 +00:00
Chris Lattner 6070ee2a58 Cleanup getImplicitType
llvm-svn: 99353
2010-03-23 23:50:31 +00:00
Chris Lattner b424faa09c reject void in intrinsic type lists.
llvm-svn: 99347
2010-03-23 23:46:27 +00:00
Bill Wendling c941619a73 Use "DISABLE_EDIS" to disable building "edis" explicitly. Don't build it for
Apple-style builds.

llvm-svn: 99336
2010-03-23 22:15:33 +00:00
Chris Lattner 2109cb461c Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.  Now with a fix
for the verifier.

llvm-svn: 99206
2010-03-22 20:56:36 +00:00
Jeffrey Yasskin 544cfd76e7 When we don't pass --vg-leak to lit, pass --leak-check=no to valgrind.
llvm-svn: 99112
2010-03-21 01:47:33 +00:00
Daniel Dunbar d177edf361 Fix suggested parentheses warning.
llvm-svn: 99111
2010-03-21 01:38:21 +00:00
Jeffrey Yasskin 2f87b54f1a Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking.  We add -vg to the triple for non-checked runs,
or -vg_leak for checked runs.  Also use this to XFAIL the TableGen tests, since
tablegen leaks like a sieve.  This includes some valgrindArgs refactoring.

llvm-svn: 99103
2010-03-20 23:08:45 +00:00
Eric Christopher 3e2bb702db Revert r99009 temporarily it seems to be breaking the bots.
llvm-svn: 99011
2010-03-19 23:04:23 +00:00
Chris Lattner 933b2cf9a8 Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.

llvm-svn: 99009
2010-03-19 22:40:56 +00:00
Chris Lattner 2db7abaa44 make getOperandNum a static function (since it's just used by
ApplyTypeConstraint) and make it handle multiple result nodes.

llvm-svn: 99003
2010-03-19 21:56:21 +00:00
Chris Lattner f144725ebc major surgery on tblgen: generalize TreePatternNode
to maintain a list of types (one for each result of
the node) instead of a single type.  There are liberal
hacks added to emulate the old behavior in various
situations, but they can start disolving now.

llvm-svn: 98999
2010-03-19 21:37:09 +00:00
Ben Holt b7d3d99181 Test commit (removed extra blank line)
llvm-svn: 98988
2010-03-19 21:12:29 +00:00
Daniel Dunbar c069cc8eaa FileCheck: Don't print "possibly intended match" line if it would match the
"scanning from here" one.

llvm-svn: 98971
2010-03-19 18:07:43 +00:00
Torok Edwin bc8eed000f Set numThreads to 1 by default when Python is older than 2.5.2.
Python 2.4 always hits this bug: http://bugs.python.org/issue1731717
when running check-lit on multi-core systems.
Setting numThreads to 1 makes it slower, but at least the results reported are
correct.

llvm-svn: 98969
2010-03-19 17:54:21 +00:00
Chris Lattner 6d765ebc0d make FillWithPossibleTypes take a predicate to filter types so that
we don't blow the smallvector as often.  No functionality change.

llvm-svn: 98968
2010-03-19 17:41:26 +00:00
Chris Lattner bb34b4e10f resolve fixme: we now infer the instruction-level 'isvariadic' bit
from the pattern if present, and we use it instead of the bit.

llvm-svn: 98938
2010-03-19 05:34:15 +00:00
Chris Lattner 83aeaab462 add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.

llvm-svn: 98934
2010-03-19 05:07:09 +00:00
Chris Lattner be6b17f927 rewrite EnforceSmallerThan to be less bone headed.
llvm-svn: 98933
2010-03-19 04:54:36 +00:00
Daniel Dunbar ec71ba25e5 Fix -Asserts warning.
llvm-svn: 98927
2010-03-19 03:18:20 +00:00
Chris Lattner da5b4ad03e eliminate the last use of EEVT::isUnknown
llvm-svn: 98918
2010-03-19 01:14:27 +00:00
Chris Lattner 1802b17b65 Finally change the instruction looking map to be a densemap from
record* -> instrinfo instead of std::string -> instrinfo.

This speeds up tblgen on cellcpu from 7.28 -> 5.98s with a debug
build (20%).

llvm-svn: 98916
2010-03-19 01:07:44 +00:00
Chris Lattner 4763dbeaf6 make inst_begin/inst_end iterate over InstructionsByEnumValue.
Use CodeGenTarget::getInstNamespace in one place and fix it.

llvm-svn: 98915
2010-03-19 01:00:55 +00:00
Chris Lattner 2d822ab185 revert 98912
llvm-svn: 98914
2010-03-19 00:50:47 +00:00
Chris Lattner 45e2fc5ac1 make inst_begin/inst_end iterate over InstructionsByEnumValue.
llvm-svn: 98912
2010-03-19 00:40:22 +00:00
Chris Lattner 918be520dc change Target.getInstructionsByEnumValue to return a reference
to a vector that CGT stores instead of synthesizing it on every 
call.

llvm-svn: 98910
2010-03-19 00:34:35 +00:00
Chris Lattner c9ae94c793 factor copy and paste code.
llvm-svn: 98908
2010-03-19 00:23:20 +00:00
Chris Lattner 70eb897d7c don't go through getInstructions().
llvm-svn: 98906
2010-03-19 00:18:23 +00:00
Chris Lattner 9aec14b560 look up instructions by record, not by name.
llvm-svn: 98904
2010-03-19 00:07:20 +00:00
Chris Lattner 63a627cd88 expand tblgen's support for instructions with implicit defs.
llvm-svn: 98900
2010-03-18 23:57:40 +00:00
Chris Lattner fdc20711e8 infer results of a pattern from implicit defs. This allows you to do something
like this:

 def : Pat<(add ...),
           (FOOINST)>;

When fooinst only has a single implicit def (e.g. to R1).  This will be handled
as if written as (set R1, (FOOINST ...))

llvm-svn: 98897
2010-03-18 23:15:10 +00:00
Chris Lattner 2130a3e0af capture implicit uses and defs in CodeGenInstruction
llvm-svn: 98879
2010-03-18 21:42:03 +00:00
Chris Lattner 13590892e7 simplify this code, the # of sets in the pattern for an instruction
shouldn't change this.

llvm-svn: 98872
2010-03-18 21:15:05 +00:00
Chris Lattner 81fd1f20ba disallow concatenation of two dags with different operators.
llvm-svn: 98871
2010-03-18 21:07:51 +00:00
Chris Lattner 1f22d278f3 rewrite this to not artificially force concat the ins/outs list.
llvm-svn: 98870
2010-03-18 21:07:39 +00:00
Chris Lattner 0f03747577 eliminate support for "ops" in the input/output list of an
instruction.  Instructions must use 'ins' and 'outs' now.

llvm-svn: 98868
2010-03-18 20:56:35 +00:00
Chris Lattner 5f418eafdc remove some code that was working around old sparc v9 backend bugs.
Add checking that the input/output operand list in spelled right.

llvm-svn: 98865
2010-03-18 20:50:52 +00:00
Daniel Dunbar 9e6437ee7d lit: Tweak example tests config.
llvm-svn: 98859
2010-03-18 20:06:05 +00:00
Daniel Dunbar 451a435473 MC/AsmMatcher: Add support for target specific "instruction cleanup" functions,
to allow custom post-processing of matched instructions.

llvm-svn: 98857
2010-03-18 20:05:56 +00:00
Kovarththanan Rajaratnam dae75defc8 Add an extra newline to separate PP directives from the contents
llvm-svn: 98820
2010-03-18 13:16:38 +00:00
Jeffrey Yasskin fa22878d9d Avoid a problem in libc_freeres() seen on a linux-i686 buildbot when running
under valgrind:

==19577== Invalid free() / delete / delete[]
==19577==    at 0x4C9C866: free (vg_replace_malloc.c:325)
==19577==    by 0x5121104: ??? (in /lib/libc-2.10.2.so)
==19577==    by 0x4C97412: _vgnU_freeres (vg_preloaded.c:62)
==19577==    by 0x5041486: __run_exit_handlers (exit.c:93)
==19577==    by 0x50414FE: exit (exit.c:100)
==19577==    by 0x5028B5C: (below main) (libc-start.c:254)
==19577==  Address 0xffffffff is not stack'd, malloc'd or (recently) free'd
==19577== 

Apparently this happens under certain versions of glibc, so valgrind provides
the --run-libc-freeres=no option to avoid calling freeres().  This may increase
the number of "still reachable" blocks valgrind reports, but we don't care
about those, while this error breaks the buildbots.

There are upstream bugs about this at
http://sourceware.org/bugzilla/show_bug.cgi?id=10610 and
http://bugs.kde.org/show_bug.cgi?id=167483, but they don't look likely to be
fixed.

llvm-svn: 98813
2010-03-18 07:00:12 +00:00
Jim Grosbach 86bcdccb65 Use llvm-gcc to build ARM when it's available
llvm-svn: 98770
2010-03-17 21:25:13 +00:00
Jeffrey Yasskin 11122eafe7 Make lit pay attention to --vg for tcl tests too, which makes it work on LLVM's
non-unit tests.

llvm-svn: 98741
2010-03-17 17:04:56 +00:00
Bob Wilson 1b4e8cc69c --- Reverse-merging r98637 into '.':
U    test/CodeGen/ARM/tls2.ll
U    test/CodeGen/ARM/arm-negative-stride.ll
U    test/CodeGen/ARM/2009-10-30.ll
U    test/CodeGen/ARM/globals.ll
U    test/CodeGen/ARM/str_pre-2.ll
U    test/CodeGen/ARM/ldrd.ll
U    test/CodeGen/ARM/2009-10-27-double-align.ll
U    test/CodeGen/Thumb2/thumb2-strb.ll
U    test/CodeGen/Thumb2/ldr-str-imm12.ll
U    test/CodeGen/Thumb2/thumb2-strh.ll
U    test/CodeGen/Thumb2/thumb2-ldr.ll
U    test/CodeGen/Thumb2/thumb2-str_pre.ll
U    test/CodeGen/Thumb2/thumb2-str.ll
U    test/CodeGen/Thumb2/thumb2-ldrh.ll
U    utils/TableGen/TableGen.cpp
U    utils/TableGen/DisassemblerEmitter.cpp
D    utils/TableGen/RISCDisassemblerEmitter.h
D    utils/TableGen/RISCDisassemblerEmitter.cpp
U    Makefile.rules
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/Makefile
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
D    lib/Target/ARM/Disassembler
U    lib/Target/ARM/ARMInstrFormats.td
U    lib/Target/ARM/ARMAddressingModes.h
U    lib/Target/ARM/Thumb2ITBlockPass.cpp

llvm-svn: 98640
2010-03-16 16:59:47 +00:00
Johnny Chen 3d9327bd06 Initial ARM/Thumb disassembler check-in. It consists of a tablgen backend
(RISCDisassemblerEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]

llvm-svn: 98637
2010-03-16 16:36:54 +00:00
Daniel Dunbar 0b5310b9f2 NNT: Add -nouname option, so machine uniquing can occur across physical machines.
llvm-svn: 98633
2010-03-16 15:53:02 +00:00
Chris Lattner f57437abb1 don't form a RecordChild or CheckChildType for child #'s over 7, we don't
have enums for them.

llvm-svn: 98597
2010-03-16 00:35:11 +00:00
Chris Lattner 0db1d6500a eliminate some #if 0 code I added in r96905, type inference
now enforces that input/output named values have hte same type.

llvm-svn: 98535
2010-03-15 06:03:22 +00:00
Chris Lattner cabe037b2d Completely rewrite tblgen's type inference mechanism,
changing the primary datastructure from being a 
"std::vector<unsigned char>" to being a new TypeSet class
that actually has (gasp) invariants!

This changes more things than I remember, but one major
innovation here is that it enforces that named input 
values agree in type with their output values.

This also eliminates code that transparently assumes (in 
some cases) that SDNodeXForm input/output types are the
same, because this is wrong in many case.

This also eliminates a bug which caused a lot of ambiguous
patterns to go undetected, where a register class would
sometimes pick the first possible type, causing an
ambiguous pattern to get arbitrary results.

With all the recent target changes, this causes no 
functionality change!

llvm-svn: 98534
2010-03-15 06:00:16 +00:00
Evan Cheng 44be5362d6 Check in tablegen changes to fix disassembler related failures caused by r98465.
llvm-svn: 98468
2010-03-14 05:15:39 +00:00
Jeffrey Yasskin 754d2dc041 Make lit pay attention to --vg for unittests too.
llvm-svn: 98449
2010-03-13 20:45:41 +00:00
Chris Lattner 399f1f4fd3 update mkpatch for MC, patch by Aaron Gray
llvm-svn: 98334
2010-03-12 06:32:12 +00:00