Commit Graph

2430 Commits

Author SHA1 Message Date
Chris Lattner
d9c1a344a0 simplify IsChainCompatible codegen, add comments. no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 05:35:28 +00:00
Chris Lattner
785d16fe75 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:16:19 +00:00
Chris Lattner
2f7ecdeb1d record input chains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:34:15 +00:00
Chris Lattner
c642b84fb8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:27:29 +00:00
Chris Lattner
c96087b343 improve comments on OPC_Record to say what we're recording a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 01:03:09 +00:00
Chris Lattner
5be6e5990b improve comments in generated matcher a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:39:26 +00:00
Chris Lattner
e609a513f3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:31:50 +00:00
Chris Lattner
c2676b2909 fix inverted condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:11:30 +00:00
Chris Lattner
53a2f60062 complex patterns don't get 'record' nodes, they implicitly
record all their results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 23:16:25 +00:00
Chris Lattner
05446e7d47 clean up some code, eliminate NodeIsComplexPattern, which
does the same thing as getComplexPatternInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 23:13:59 +00:00
Chris Lattner
5b08f77096 fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:38:31 +00:00
Chris Lattner
92d3ada814 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:35:06 +00:00
Chris Lattner
6bc1b51377 simplify this code. In the new world order there is no
need to scan the entire subtree of the pattern anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:19:58 +00:00
Chris Lattner
21390d7984 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:15:55 +00:00
Chris Lattner
29c6270328 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 19:03:34 +00:00
Chris Lattner
ccba15f914 mark all the generated node predicates 'const'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 07:26:36 +00:00
Chris Lattner
050a03d0f3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 07:21:10 +00:00
Chris Lattner
e02ea54cfd refactor some code into a local class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:52:01 +00:00
Chris Lattner
e2de49d9a1 remove now dead code and fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:15:00 +00:00
Chris Lattner
6e6975d419 remove dead code. This is never generated for any targets in mainline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:14:22 +00:00
Chris Lattner
e39650a805 add support for the new isel matcher to generate
(isprofitable|islegal)tofold checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 06:10:58 +00:00
Evan Cheng
014bf215c3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 19:41:07 +00:00
Chris Lattner
da272d1a70 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 08:04:42 +00:00
Mikhail Glushenkov
0b1a39577b Revert r96130 ("Forward parameter options as '-option=param'").
This behaviour must be configurable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 03:17:06 +00:00
Chris Lattner
751d5aa1ea constize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 22:33:49 +00:00
Chris Lattner
4766132036 clean up a bunch of code, move some random predicates
on TreePatternNode to be methods on TreePatternNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 22:22:58 +00:00
Chris Lattner
c87bf389dc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96188 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:11:53 +00:00
Chris Lattner
383fed9c7a add an insertion operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:10:33 +00:00
Chris Lattner
523f6a5848 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 21:10:15 +00:00
Mikhail Glushenkov
18c67b994c Forward parameter options as '-option=parameter'.
Some tools do not like the '-option parameter' form. Should this be
configurable?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 22:37:28 +00:00
Chris Lattner
a0cdf17f37 pull a bunch of huge inline methods in the PatternCodeEmitter
class out of line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 20:06:50 +00:00
Sean Callanan
cebe955779 Added the rdtscp instruction to the x86 instruction
tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 02:06:11 +00:00
Sean Callanan
95a5a7d570 Fixed encodings for invlpg, invept, and invvpid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 01:48:34 +00:00
Chris Lattner
a599de2410 remove special cases for vmlaunch, vmresume, vmxoff, and swapgs
fix swapgs to be spelled right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 00:41:14 +00:00
Chris Lattner
eaca5fa8e6 Remove special cases for [LM]FENCE, MONITOR and MWAIT from
encoder and decoder by using new MRM_ forms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:54:57 +00:00
Sean Callanan
9492be8d10 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. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:39:46 +00:00
Chris Lattner
0d8db8e0a8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 02:06:33 +00:00
Daniel Dunbar
3b6910dcd4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 01:46:54 +00:00
Chris Lattner
0d7b0aa760 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)>>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 22:57:32 +00:00
Chris Lattner
e555c9f4a5 work around a gcc bug with -Wuninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:22:51 +00:00
Daniel Dunbar
cacaa5bff2 lit: Ignore dot files when scanning for tests (e.g., editor temprary files,
etc.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:00:55 +00:00
Daniel Dunbar
bef529182f MC/AsmMatcher: Tweak conversion function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 21:00:47 +00:00
Daniel Dunbar
af61681ced 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 08:15:48 +00:00
Daniel Dunbar
3f451cafb5 Remove stray DOS newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 04:10:10 +00:00
Sean Callanan
cf57c7084a Updated the enhanced disassembly library's TableGen
backend to not use exceptions at all except in cases
of actual error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 03:23:23 +00:00
Sean Callanan
2db6ff2285 Updated the TableGen emitter for the Enhanced
Disassembler to take advantage of the refactored
AsmWriterInst.h.  Note removed parser code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 02:47:08 +00:00
Sean Callanan
397170b0ab 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 02:27:43 +00:00
Chris Lattner
a7d479c7bd 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 :).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:45:28 +00:00
Sean Callanan
d0bc7f060e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 23:06:35 +00:00
Sean Callanan
3ac97b386b Added AsmWriterInst.cpp to the CMakeList so that
it builds OK on Visual Studio.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 22:29:16 +00:00