Commit Graph

1443 Commits

Author SHA1 Message Date
Chris Lattner e2347aac52 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 e83e2483bd 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 314e34b5b8 fix indentation
llvm-svn: 96409
2010-02-16 22:38:31 +00:00
Chris Lattner afac7dad21 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 6c132331ee 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 f8695c1ee9 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 300048631b 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 52bfe24e2c mark all the generated node predicates 'const'.
llvm-svn: 96337
2010-02-16 07:26:36 +00:00
Chris Lattner 5ce8303950 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 1d689a09a9 refactor some code into a local class.
llvm-svn: 96334
2010-02-16 06:52:01 +00:00
Chris Lattner 812586ad2a remove now dead code and fixme.
llvm-svn: 96333
2010-02-16 06:15:00 +00:00
Chris Lattner f400fd6aec 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 aa7d3e096b 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 5e73ff2e3a 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 b02cdaaa9c 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 5352f07f2c 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 450d50467c constize
llvm-svn: 96199
2010-02-14 22:33:49 +00:00
Chris Lattner 53c39ba3c1 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 b3d9942c51 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 dd2ec58276 add an insertion operator.
llvm-svn: 96187
2010-02-14 21:10:33 +00:00
Chris Lattner 78291e3be8 tidy up
llvm-svn: 96186
2010-02-14 21:10:15 +00:00
Mikhail Glushenkov 32fa169648 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 3dc137d8ed 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 4d804d794f Added the rdtscp instruction to the x86 instruction
tables.

llvm-svn: 96073
2010-02-13 02:06:11 +00:00
Sean Callanan 44232af55a Fixed encodings for invlpg, invept, and invvpid.
llvm-svn: 96065
2010-02-13 01:48:34 +00:00
Chris Lattner 140caa7240 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 064e926362 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 dde9c12307 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 f7477e599f 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 692d06fb77 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 b1913c4df9 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 0d7b5e5d33 work around a gcc bug with -Wuninitialized.
llvm-svn: 95808
2010-02-10 21:22:51 +00:00
Daniel Dunbar 5b785ac0a3 MC/AsmMatcher: Tweak conversion function name.
llvm-svn: 95802
2010-02-10 21:00:47 +00:00
Daniel Dunbar f22553a1c7 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
Sean Callanan 7b0c339510 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 e9959a5f1a 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 515937d2ea 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 a9dfb1bc07 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 d4b19e12ed 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 a36341366b 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 b7e8f4a30e 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 b06015aa69 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 60db0a6ba5 pass stringref by value instead of by const&
llvm-svn: 95627
2010-02-09 00:34:28 +00:00
Chris Lattner 41ad1905c9 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 3b8a4663b9 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 cf18153de2 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
Sean Callanan e8f5e8c9f8 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 ffe9c20eaa Update CMake build.
llvm-svn: 94776
2010-01-29 01:10:25 +00:00
Sean Callanan 82436d1666 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 81068d0a3d Escape double quotes in 'help'.
llvm-svn: 94543
2010-01-26 14:55:04 +00:00