1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

2380 Commits

Author SHA1 Message Date
Chris Lattner
da756c0018 reject patterns that have dead named arguments in the input pattern
this is tidier and can find bugs.

llvm-svn: 96900
2010-02-23 06:55:24 +00:00
Chris Lattner
df30185383 reject patterns that mention a name in the destination pattern
but not in the input.  Previously, this would trigger an abort
late in the isel logic.

llvm-svn: 96898
2010-02-23 06:35:45 +00:00
Chris Lattner
1a749c367d merge some code.
llvm-svn: 96896
2010-02-23 06:16:51 +00:00
Chris Lattner
4c22c51356 more tidying up
llvm-svn: 96891
2010-02-23 05:59:10 +00:00
Chris Lattner
55115233db reduce indentation by eliminating 'else after return'
llvm-svn: 96889
2010-02-23 05:51:07 +00:00
Chris Lattner
49b1b721fc really fix an off-by-one error
llvm-svn: 96845
2010-02-23 01:07:39 +00:00
Chris Lattner
68fd68d9ff switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend. 

llvm-svn: 96843
2010-02-23 00:59:59 +00:00
Chris Lattner
49ec9f853e add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.

llvm-svn: 96833
2010-02-22 23:55:39 +00:00
Chris Lattner
fbca302fe2 Change ComplexPattern handling to push the node being matched as
well as the operands produced when the pattern is matched.  This
allows CheckSame to work correctly when matching replicated 
names involving ComplexPatterns.  This fixes a bunch of MSP430 
failures, we're down to 13 failures, two of which are
due to a sched bug.

llvm-svn: 96824
2010-02-22 23:33:44 +00:00
Chris Lattner
1613c59dbe add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex 
pattern.  This fixes 4 regtest failures.

llvm-svn: 96814
2010-02-22 22:30:37 +00:00
Chris Lattner
b77c4c6a30 When matching patterns that have a complex pattern as their root, make
sure to only run the complex pattern on nodes where the target opts in.
This patch only handles targets with one opcode specified so far, but
fixes 16 failures, only 34 left.

llvm-svn: 96813
2010-02-22 22:18:05 +00:00
Chris Lattner
85fa3173ff fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without 
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.

llvm-svn: 96767
2010-02-21 23:54:05 +00:00
Chris Lattner
691dcb90a4 Always emit register class id references as i32 like
DAGISelEmitter does.  This fixes 11 arm failures (8 
left).

llvm-svn: 96757
2010-02-21 20:53:45 +00:00
Chris Lattner
fc00a4e6b8 Sort the patterns before adding them to the FA so that we get the
least cost matches.  This gets us from 195 -> 208 passes on the ppc codegen tests.

llvm-svn: 96747
2010-02-21 19:22:06 +00:00
Chris Lattner
4a9c3615f8 emit table indexes before each row so that it is debuggable.
llvm-svn: 96730
2010-02-21 07:16:41 +00:00
Chris Lattner
594803ba50 fix a table size miscomputation, target opcodes are 2 bytes.
With this, the matcher actually works reasonably well, but
crashes on larger examples in the scheduler.

llvm-svn: 96727
2010-02-21 06:44:29 +00:00
Chris Lattner
98d6a38236 emit to the right streams, to avoid emitting the push
body before the push.

llvm-svn: 96726
2010-02-21 06:30:04 +00:00
Chris Lattner
359c75b60c oops don't turn this on for everyone yet.
llvm-svn: 96725
2010-02-21 06:03:56 +00:00
Chris Lattner
0164635dad implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!

llvm-svn: 96724
2010-02-21 06:03:07 +00:00
Chris Lattner
8983077c87 Lots of improvements to the new dagisel emitter. This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization 
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.

llvm-svn: 96716
2010-02-21 03:22:59 +00:00
Chris Lattner
e6302b3565 add emitter support for integer constants and simple physreg references.
llvm-svn: 96663
2010-02-19 07:49:56 +00:00
Chris Lattner
80491f4c52 fix this to work more determinstically, patch by Thomas Veith!
llvm-svn: 96661
2010-02-19 07:02:20 +00:00
Chris Lattner
28cc2f3f44 I confused myself, temporaries will be recorded right along with other inputs.
llvm-svn: 96639
2010-02-19 00:33:13 +00:00
Chris Lattner
fc0b27563f introduce a new ResultVal and start keeping track of temporary values.
llvm-svn: 96636
2010-02-19 00:27:40 +00:00
Chris Lattner
4cfdecc52b add support for referencing registers and immediates,
building the tree to represent them but not emitting 
table entries for them yet.

llvm-svn: 96617
2010-02-18 22:03:03 +00:00
Chris Lattner
5bc53ac6f5 start sketching out the structure of code for result emission generation.
Nothing real here yet.

llvm-svn: 96575
2010-02-18 06:47:49 +00:00
Chris Lattner
76506b3749 rename the child field to 'next'. This is not a parent/child
relationship, this is a linear list relationship.

llvm-svn: 96561
2010-02-18 02:53:41 +00:00
Chris Lattner
955650be1f eliminate the MatcherNodeWithChild class, give the 'child'
field to MatcherNode.

llvm-svn: 96560
2010-02-18 02:49:24 +00:00
Chris Lattner
025ca7158a fit in 80 cols
llvm-svn: 96541
2010-02-18 00:23:27 +00:00
Chris Lattner
a1f12685c7 redisable this to save people a small amount of build time.
llvm-svn: 96497
2010-02-17 19:19:50 +00:00
Chris Lattner
2ec1f1a54a move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
and add a sparc implementation that knows about delay slots.  Patch by
Nathan Keynes!

llvm-svn: 96492
2010-02-17 18:52:56 +00:00
Chris Lattner
b8c69426ef reduce nesting.
llvm-svn: 96466
2010-02-17 06:53:36 +00:00
Chris Lattner
143e2b6181 improve comments, the matcher is now feature complete, on to codegen.
llvm-svn: 96464
2010-02-17 06:47:35 +00:00
Chris Lattner
955ce23e27 sink special case "cannotyetselect" for intrinsics out of the
tblgen splatted code into the implementation.

llvm-svn: 96460
2010-02-17 06:28:22 +00:00
Chris Lattner
8f3afbc621 Emulate the current isel's "IsChainCompatible" logic for now.
I'd like to eventually rip it out, but for now producing the
same selections as the old matcher is more important.

llvm-svn: 96458
2010-02-17 06:23:39 +00:00
Chris Lattner
15eb8504cd properly record chain inputs to complex patterns,
resolving a fixme.

llvm-svn: 96457
2010-02-17 06:08:25 +00:00
Chris Lattner
abb5e906a7 simplify IsChainCompatible codegen, add comments. no
functionality change.

llvm-svn: 96453
2010-02-17 05:35:28 +00:00
Chris Lattner
44d2031ca8 Prep work to handle input chains of matched patterns and checking for
'ischaincompatible' when a pattern has more than one input chain.  Need
to do some commenting and cleanup now that I understand how this works.

llvm-svn: 96443
2010-02-17 02:16:19 +00:00
Chris Lattner
ac9295346b record input chains.
llvm-svn: 96437
2010-02-17 01:34:15 +00:00
Chris Lattner
a6df2a60e5 prefix captured value names with $ so they look like
variables.  Use the fancy OpNo variable instead of i,
which has the right index including chains.

llvm-svn: 96436
2010-02-17 01:27:29 +00:00
Chris Lattner
ab430d225c improve comments on OPC_Record to say what we're recording a node.
llvm-svn: 96433
2010-02-17 01:03:09 +00:00
Chris Lattner
fdd452441a improve comments in generated matcher a bit.
llvm-svn: 96422
2010-02-17 00:39:26 +00:00
Chris Lattner
1f818d2e25 make the new isel generator plop out a CheckComplexPattern function
for evaluating complex patterns.  Some cleanup has to happen before
this can be used though.

llvm-svn: 96419
2010-02-17 00:31:50 +00:00
Chris Lattner
ebf80812e3 fix inverted condition.
llvm-svn: 96416
2010-02-17 00:11:30 +00:00
Chris Lattner
3499eaaac1 complex patterns don't get 'record' nodes, they implicitly
record all their results.

llvm-svn: 96412
2010-02-16 23:16:25 +00:00
Chris Lattner
c89e98d63b clean up some code, eliminate NodeIsComplexPattern, which
does the same thing as getComplexPatternInfo.

llvm-svn: 96411
2010-02-16 23:13:59 +00:00
Chris Lattner
617c3a5c69 fix indentation
llvm-svn: 96409
2010-02-16 22:38:31 +00:00
Chris Lattner
0d35c68d5c fix rdar://7653908, a crash on a case where we would fold a load
into a roundss intrinsic, producing a cyclic dag.  The root cause
of this is badness handling ComplexPattern nodes in the old dagisel
that I noticed through inspection.  Eliminate a copy of the of the
code that handled ComplexPatterns by making EmitChildMatchCode call
into EmitMatchCode.

llvm-svn: 96408
2010-02-16 22:35:06 +00:00
Chris Lattner
cafd2c75a1 simplify this code. In the new world order there is no
need to scan the entire subtree of the pattern anymore.

llvm-svn: 96369
2010-02-16 19:19:58 +00:00
Chris Lattner
ebcd505b14 convert the new matcher to check intermediate nodes for a single
use and only call IsProfitableToFold/IsLegalToFold on the load
being folded, like the old dagiselemitter does.  This 
substantially simplifies the code and improves opportunities for
sharing.

llvm-svn: 96368
2010-02-16 19:15:55 +00:00
Chris Lattner
eba9f75b00 change dag isel emitter to only call 'IsProfitableToFold' on nodes
with chains.  On interior nodes that lead up to them, we just directly
check that there is a single use.  This generates slightly more
efficient code.

llvm-svn: 96366
2010-02-16 19:03:34 +00:00
Chris Lattner
2507e6b51f mark all the generated node predicates 'const'.
llvm-svn: 96337
2010-02-16 07:26:36 +00:00
Chris Lattner
a9550b6d27 generate code for node and pattern predicates. Note that this won't
build if enabled, it will fail with constness issues. I'll resolve 
these next.

llvm-svn: 96336
2010-02-16 07:21:10 +00:00
Chris Lattner
5a026d7367 refactor some code into a local class.
llvm-svn: 96334
2010-02-16 06:52:01 +00:00
Chris Lattner
eb72054cb3 remove now dead code and fixme.
llvm-svn: 96333
2010-02-16 06:15:00 +00:00
Chris Lattner
5901090df8 remove dead code. This is never generated for any targets in mainline.
llvm-svn: 96332
2010-02-16 06:14:22 +00:00
Chris Lattner
104828612b add support for the new isel matcher to generate
(isprofitable|islegal)tofold checks.

llvm-svn: 96331
2010-02-16 06:10:58 +00:00
Evan Cheng
b5fe25544c Split SelectionDAGISel::IsLegalAndProfitableToFold to
IsLegalToFold and IsProfitableToFold. The generic version of the later simply checks whether the folding candidate has a single use.

This allows the target isel routines more flexibility in deciding whether folding makes sense. The specific case we are interested in is folding constant pool loads with multiple uses.

llvm-svn: 96255
2010-02-15 19:41:07 +00:00
Chris Lattner
bc3bc62709 Check in the first big step of rewriting DAGISelEmitter to
produce a table based matcher instead of gobs of C++ Code.

Though it's not done yet, the shrinkage seems promising,
the table for the X86 ISel is 75K and still has a lot of 
optimization to come (compare to the ~1.5M of .o generated
the old way, much of which will go away).

The code is currently disabled by default (the #if 0 in
DAGISelEmitter.cpp).  When enabled it generates a dead
SelectCode2 function in the DAGISel Header which will
eventually replace SelectCode.

There is still a lot of stuff left to do, which are
documented with a trail of FIXMEs.

llvm-svn: 96215
2010-02-15 08:04:42 +00:00
Mikhail Glushenkov
47bcd93456 Revert r96130 ("Forward parameter options as '-option=param'").
This behaviour must be configurable.

llvm-svn: 96210
2010-02-15 03:17:06 +00:00
Chris Lattner
3d4086208b constize
llvm-svn: 96199
2010-02-14 22:33:49 +00:00
Chris Lattner
4a7b56d74e clean up a bunch of code, move some random predicates
on TreePatternNode to be methods on TreePatternNode.

llvm-svn: 96197
2010-02-14 22:22:58 +00:00
Chris Lattner
8d7e9178d4 remove the DisablePatternForFastISel predicate, which is a check
that predated -fast-isel which attempted to speed up the dag pattern
matchers at -O0.  Since fast-isel is around, this is basically 
obsolete and removing it shrinks the generated dag isels.

llvm-svn: 96188
2010-02-14 21:11:53 +00:00
Chris Lattner
1a9a2e116d add an insertion operator.
llvm-svn: 96187
2010-02-14 21:10:33 +00:00
Chris Lattner
216edab8dd tidy up
llvm-svn: 96186
2010-02-14 21:10:15 +00:00
Mikhail Glushenkov
09bf7f44e8 Forward parameter options as '-option=parameter'.
Some tools do not like the '-option parameter' form. Should this be
configurable?

llvm-svn: 96130
2010-02-13 22:37:28 +00:00
Chris Lattner
d971210bd9 pull a bunch of huge inline methods in the PatternCodeEmitter
class out of line.

llvm-svn: 96113
2010-02-13 20:06:50 +00:00
Sean Callanan
0bc10793b0 Added the rdtscp instruction to the x86 instruction
tables.

llvm-svn: 96073
2010-02-13 02:06:11 +00:00
Sean Callanan
9806eade6e Fixed encodings for invlpg, invept, and invvpid.
llvm-svn: 96065
2010-02-13 01:48:34 +00:00
Chris Lattner
5b01ab848c remove special cases for vmlaunch, vmresume, vmxoff, and swapgs
fix swapgs to be spelled right.

llvm-svn: 96058
2010-02-13 00:41:14 +00:00
Chris Lattner
1d25e3978d Remove special cases for [LM]FENCE, MONITOR and MWAIT from
encoder and decoder by using new MRM_ forms.

llvm-svn: 96048
2010-02-12 23:54:57 +00:00
Sean Callanan
21a160f4bf Reworked the Intel disassembler to support instructions
whose opcodes extend into the ModR/M field using the
Form field of the instruction rather than by special
casing each instruction.  Commented out the special
casing of VMCALL, which is the first instruction to use
this special form.  While I was in the neighborhood,
added a few comments for people modifying the Intel
disassembler. 

llvm-svn: 96043
2010-02-12 23:39:46 +00:00
Chris Lattner
c3dbd2e2fc add a bunch of mod/rm encoding types for fixed mod/rm bytes.
This will work better for the disassembler for modeling things
like lfence/monitor/vmcall etc.

llvm-svn: 95960
2010-02-12 02:06:33 +00:00
Daniel Dunbar
08f1b2f670 MC: Fix bug where trailing tied operands were forgotten; the X86 assembler
matcher is now free of implicit operands!
 - Still need to clean up the code now that we don't to worry about implicit
   operands, and to make it a hard error if an instruction fails to specify all
   of its operands for some reason.

llvm-svn: 95956
2010-02-12 01:46:54 +00:00
Chris Lattner
fcce3c5ee4 enhance llvm-mc -show-inst to print the enum of an instruction, like so:
testb	%al, %al                ## <MCInst #2412 TEST8rr
                                        ##   <MCOperand Reg:2>
                                        ##   <MCOperand Reg:2>>
	jne	LBB1_7                  ## <MCInst #938 JNE_1
                                        ##   <MCOperand Expr:(LBB1_7)>>

llvm-svn: 95935
2010-02-11 22:57:32 +00:00
Chris Lattner
1bc8cf5d29 work around a gcc bug with -Wuninitialized.
llvm-svn: 95808
2010-02-10 21:22:51 +00:00
Daniel Dunbar
0e4c6eb0d7 lit: Ignore dot files when scanning for tests (e.g., editor temprary files,
etc.)

llvm-svn: 95803
2010-02-10 21:00:55 +00:00
Daniel Dunbar
4254b19c9a MC/AsmMatcher: Tweak conversion function name.
llvm-svn: 95802
2010-02-10 21:00:47 +00:00
Daniel Dunbar
59cb3a1ca4 MC/AsmMatcher: Add support for creating tied operands when constructing MCInsts.
- Pretty messy, but we need to rework how we handle tied operands in MCInst
   anyway.

llvm-svn: 95774
2010-02-10 08:15:48 +00:00
Daniel Dunbar
54d6a41882 Remove stray DOS newline.
llvm-svn: 95765
2010-02-10 04:10:10 +00:00
Sean Callanan
c022448a07 Updated the enhanced disassembly library's TableGen
backend to not use exceptions at all except in cases
of actual error.

llvm-svn: 95762
2010-02-10 03:23:23 +00:00
Sean Callanan
65a17e3ac6 Updated the TableGen emitter for the Enhanced
Disassembler to take advantage of the refactored
AsmWriterInst.h.  Note removed parser code.

llvm-svn: 95760
2010-02-10 02:47:08 +00:00
Sean Callanan
d21eecd9a2 Changed AsmWriterOperand to also include the index of the
operand into the CodeGenInstruction's list of operands,
which is useful for EDEmitter.  (Still working on PR6219)

llvm-svn: 95759
2010-02-10 02:27:43 +00:00
Chris Lattner
bd21fff65c Introduce a new CodeGenInstruction::ConstraintInfo class
for representing constraint info semantically instead of
as a c expression that will be blatted out to the .inc
file.  Fix X86RecognizableInstr to use this instead of
parsing C code :).

llvm-svn: 95753
2010-02-10 01:45:28 +00:00
Sean Callanan
c1249e600e Fixed some indentation in the AsmWriterInst
implementation.  Also changed the constructor
so that it does not require a Record, making it
usable by the EDEmitter.

llvm-svn: 95715
2010-02-09 23:06:35 +00:00
Sean Callanan
1e496fad4f Added AsmWriterInst.cpp to the CMakeList so that
it builds OK on Visual Studio.

llvm-svn: 95702
2010-02-09 22:29:16 +00:00
Sean Callanan
1248c51819 Per PR 6219, factored AsmWriterInst and AsmWriterOperand
out of the AsmWriterEmitter.  This patch does the physical
code movement, but leaves the implementation unchanged. I'll
make any changes necessary to generalize the code in a
separate patch.

llvm-svn: 95697
2010-02-09 21:50:41 +00:00
Chris Lattner
7acf9be6c4 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Chris Lattner
804c2270c7 pass stringref by value instead of by const&
llvm-svn: 95627
2010-02-09 00:34:28 +00:00
Jakob Stoklund Olesen
83ebc265b3 Reintroduce the InlineHint function attribute.
This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

llvm-svn: 95466
2010-02-06 01:16:28 +00:00
Jeffrey Yasskin
d0d363d1a9 Make lit's gtest support honor config.environment.
llvm-svn: 95398
2010-02-05 18:09:19 +00:00
Torok Edwin
37e451649c New flag for GenLibDeps, and llvm-config-perobjincl.
This allows to show the explicit files that need to be built/linked to get an
LLVM component.

llvm-svn: 95300
2010-02-04 09:31:35 +00:00
Chris Lattner
cd07a3a0b7 sink handling of target-independent machine instrs (other
than DEBUG_VALUE :(  ) into the target indep AsmPrinter.cpp
file.   This allows elimination of the 
NO_ASM_WRITER_BOILERPLATE hack among other things.

llvm-svn: 95177
2010-02-03 01:00:52 +00:00
Daniel Dunbar
9b2879bd70 AsmMatcherEmitter: Use stable_sort when reordering instructions, so that order
is still deterministic even amongst ambiguous instructions (eventually ambiguous
match orders will be a hard error, but we aren't there yet).

llvm-svn: 95157
2010-02-02 23:46:36 +00:00
Daniel Dunbar
0016281dc2 AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

llvm-svn: 94868
2010-01-30 01:02:37 +00:00
Daniel Dunbar
08265d2e9b FileCheck: When looking for "possible matches", only compare against the prefix
line. Turns out edit_distance can be slow if the string we are scanning for
happens to be quite large.

llvm-svn: 94860
2010-01-30 00:24:06 +00:00
Dan Gohman
4ce1281b20 Minor code cleanup.
llvm-svn: 94848
2010-01-29 21:57:46 +00:00
Dan Gohman
b550d3a78e Skip whitespace when looking for a potential intended match.
Before:

<stdin>:94:1: note: possible intended match here
 movsd 4096(%rsi), %xmm0
^

After:
<stdin>:94:2: note: possible intended match here
 movsd 4096(%rsi), %xmm0
 ^

llvm-svn: 94847
2010-01-29 21:55:16 +00:00
Dan Gohman
ef102f1ed3 Fix the position of the caret in the FileCheck error message.
Before:

test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
                                 ^

After:

test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
         ^

llvm-svn: 94846
2010-01-29 21:53:18 +00:00
Daniel Dunbar
f65b05e7e1 FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
- Thanks Doug, who is obviously less lazy than me!

llvm-svn: 94795
2010-01-29 03:22:19 +00:00
Sean Callanan
2112298100 Quick fix to make the header file for the enhanced
disassembly information have a better comment (and
better guard macros).

llvm-svn: 94781
2010-01-29 01:34:29 +00:00
Ted Kremenek
1eca6e4925 Recognize 'add_executable' when analyzing CMake files.
llvm-svn: 94777
2010-01-29 01:10:55 +00:00
Ted Kremenek
cce1825bc9 Update CMake build.
llvm-svn: 94776
2010-01-29 01:10:25 +00:00
Sean Callanan
59ba2433b0 Added a custom TableGen backend to support the
enhanced disassembler, and the necessary makefile
rules to build the table for X86.

llvm-svn: 94764
2010-01-29 00:21:04 +00:00
Mikhail Glushenkov
ee410352c8 Escape double quotes in 'help'.
llvm-svn: 94543
2010-01-26 14:55:04 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Sean Callanan
1942b96584 Modified the register matcher function in AsmMatcher to
be static.  Also made it possible for clients to get it
and no other functions from ...GenAsmMatcher.inc by
defining REGISTERS_ONLY before including GenAsmMatcher.inc.
This sets the stage for target-specific lexers that can
identify registers and return AsmToken::Register as
appropriate.

llvm-svn: 94266
2010-01-23 00:40:33 +00:00
Daniel Dunbar
a0ef4e4068 AsmMatcher: Add a comment.
llvm-svn: 94261
2010-01-23 00:26:16 +00:00
Daniel Dunbar
856d040f58 Make GetSourceVersion more portable, thanks Pawel!
llvm-svn: 94186
2010-01-22 18:14:21 +00:00
Daniel Dunbar
ca283162fa lit: Separate test suite from test name with spaces, to make it easier to cut and paste.
llvm-svn: 94134
2010-01-22 02:04:28 +00:00
Daniel Dunbar
55d6538336 Add a simple script for getting a version tag from a svn/git-svn/git
repository. Feel free to add support for your favorite VCS.

llvm-svn: 94077
2010-01-21 16:09:59 +00:00
Bob Wilson
c82f536a5c The change in r90189 adds a link in a directory outside the iPhone platform
directory when building the llvmCore_Embedded project.  Fix this by putting
the iPhone platform directory into DEST_DIR instead of DEST_ROOT.  I also
noticed what appears to be an unintentional use of DEVELOPER_BIN instead of
DEVELOPER_DIR, so I fixed that and changed to use DEVELOPER_DIR in some places
that were hardcoded to "Developer".  Finally, the other changes here allowed
some refactoring and simplification, which I have done.

llvm-svn: 93878
2010-01-19 16:42:10 +00:00
Chris Lattner
b9ad4c901e update mkpatch, patch by Garrison Venn!
llvm-svn: 93771
2010-01-18 21:09:05 +00:00
Eric Christopher
3c5d9dc0e3 Remove the InlineHint attribute. There are no current or planned
users.

llvm-svn: 93558
2010-01-15 21:36:30 +00:00
Dale Johannesen
c396179c7e Remove DEBUG_DECLARE, looks like we don't need it.
Also, DEBUG_VALUE has side effects.

llvm-svn: 93498
2010-01-15 01:50:44 +00:00
Chris Lattner
882cb240a6 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 

llvm-svn: 93469
2010-01-14 22:21:20 +00:00
Bill Wendling
56464738cc Use ENABLE_ASSERTIONS throughout.
llvm-svn: 93423
2010-01-14 10:19:55 +00:00
Stuart Hastings
a27112f01a Erm, previous patch was wrong; Thanks Bill\!
llvm-svn: 93381
2010-01-14 00:34:53 +00:00
Stuart Hastings
47cfd4abc0 Enable assertions by default for Apple-style builds.
llvm-svn: 93380
2010-01-14 00:22:05 +00:00
Benjamin Kramer
cdbc36f961 Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.

llvm-svn: 93161
2010-01-11 18:03:24 +00:00
Dan Gohman
123aee69c0 Tighten up the vim LLVM IR syntax highlighting regex for labels, and add a
highlighting rule for identifiers.

llvm-svn: 93056
2010-01-09 17:22:48 +00:00
Dan Gohman
03fedbe06b Set the vim auto-indent setting for open braces after case statements to
follow LLVM source convention.

Before:
  case X: {
            stuff;
          }

After:
  case X: {
    stuff;
  }

llvm-svn: 93055
2010-01-09 17:15:21 +00:00
Dale Johannesen
0e21161e32 Add DEBUG_DECLARE. Not used yet.
llvm-svn: 93040
2010-01-09 01:24:25 +00:00
Dale Johannesen
610f0ce9aa Add DEBUG_VALUE. Not used yet.
llvm-svn: 93030
2010-01-08 23:51:25 +00:00
Duncan Sands
4ef1119d94 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.

llvm-svn: 92829
2010-01-06 08:45:52 +00:00
Dan Gohman
9ef9e2c758 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.

llvm-svn: 92794
2010-01-05 22:26:32 +00:00
David Greene
19324a5b81 Add an !eq() operator to TableGen. It operates on strings only.
Use !cast<string>() to compare other types of objects.

llvm-svn: 92754
2010-01-05 19:11:42 +00:00
David Greene
eef5772b46 Have TableGen emit code that uses dbgs() rather than errs().
llvm-svn: 92738
2010-01-05 17:47:41 +00:00
Dan Gohman
9bcfdf98f1 Change SelectCode's argument from SDValue to SDNode *, to make it more
clear what information these functions are actually using.

This is also a micro-optimization, as passing a SDNode * around is
simpler than passing a { SDNode *, int } by value or reference.

llvm-svn: 92564
2010-01-05 01:24:18 +00:00
Daniel Dunbar
3e856e5f8f tblgen/OptParser: Use EmitSourceFileHeader.
llvm-svn: 92521
2010-01-04 22:03:51 +00:00
Dan Gohman
a89531ec4f Replace some special-case code which probably was buggy with an assertion
verifying that the special case does not occur.

llvm-svn: 92504
2010-01-04 20:36:57 +00:00
Dan Gohman
f47c2a2335 Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.

llvm-svn: 92503
2010-01-04 20:31:55 +00:00
Mikhail Glushenkov
3a5fc21b12 Typo.
llvm-svn: 92392
2010-01-01 04:40:54 +00:00
Mikhail Glushenkov
226e1c7f11 Make CheckForSuperfluousOptions handle list form of 'switch_on' correctly.
llvm-svn: 92391
2010-01-01 03:51:02 +00:00
Mikhail Glushenkov
f697106fb7 Minor simplifications.
llvm-svn: 92390
2010-01-01 03:50:51 +00:00
Mikhail Glushenkov
72ce967c39 Better error message.
llvm-svn: 92389
2010-01-01 03:50:34 +00:00
Daniel Dunbar
e7b673bbc4 lit: Add setuptools support.
llvm-svn: 92169
2009-12-26 22:58:39 +00:00
Daniel Dunbar
8dae6490fd lit: Sink code into a 'lit' package.
llvm-svn: 92168
2009-12-26 22:58:23 +00:00
Bill Wendling
318224b8f1 Use the 'MadeChange' variable instead of returning 'false' all of the time.
llvm-svn: 92155
2009-12-25 13:35:40 +00:00
Daniel Dunbar
cb80704195 Don't emit trailing semicolon.
llvm-svn: 92133
2009-12-24 17:49:28 +00:00
Mikhail Glushenkov
1de24c23ea Cosmetic issue: more consistent naming.
llvm-svn: 91998
2009-12-23 12:49:41 +00:00
Mikhail Glushenkov
7db8203dd2 Allow (set_option SwitchOption, true).
llvm-svn: 91997
2009-12-23 12:49:30 +00:00
Daniel Dunbar
0c5f079749 Suppress compiler warning.
llvm-svn: 91959
2009-12-23 00:45:10 +00:00
Sean Callanan
983f906451 Fixes to the X86 disassembler:
Made LEA memory operands emit only 4 MCInst operands.
Made the scale operand equal 1 for instructions that have no
SIB byte.

llvm-svn: 91919
2009-12-22 21:12:55 +00:00
David Greene
3bfe36b5d9 Fix a bug in !subst where TableGen would go and resubstitute text it had
just substituted.  This could cause infinite looping in certain
pathological cases.

llvm-svn: 91843
2009-12-21 21:21:34 +00:00
Chris Lattner
2c532518c0 .llx is no more.
llvm-svn: 91784
2009-12-19 20:56:53 +00:00
Nuno Lopes
d0b1ef8875 fix build and while at it remove a redudant include
llvm-svn: 91774
2009-12-19 11:52:18 +00:00
Daniel Dunbar
bc03a42df1 More bzero -> memset that I missed.
llvm-svn: 91757
2009-12-19 04:16:57 +00:00
Daniel Dunbar
a1563328bb Add missing newlines at EOF (for clang++).
llvm-svn: 91756
2009-12-19 04:16:48 +00:00
Sean Callanan
18fa59f381 Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
incarnations), integrated into the MC framework.  

The disassembler is table-driven, using a custom TableGen backend to 
generate hierarchical tables optimized for fast decode.  The disassembler 
consumes MemoryObjects and produces arrays of MCInsts, adhering to the 
abstract base class MCDisassembler (llvm/MC/MCDisassembler.h).

The disassembler is documented in detail in

- lib/Target/X86/Disassembler/X86Disassembler.cpp (disassembler runtime)
- utils/TableGen/DisassemblerEmitter.cpp (table emitter)

You can test the disassembler by running llvm-mc -disassemble for i386
or x86_64 targets.  Please let me know if you encounter any problems
with it.

llvm-svn: 91749
2009-12-19 02:59:52 +00:00