Commit Graph

776 Commits

Author SHA1 Message Date
Chris Lattner
a6dc9fb745 Fix a bug handling instructions, like blr, which just consist of a text
string.  The return value of printInstruction should be true for these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29196 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-19 01:39:06 +00:00
Evan Cheng
e6f32034db Add code size to target instruction use it as the 3rd isel sorting tie-breaker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29193 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-19 00:24:41 +00:00
Evan Cheng
6f6602ce42 Make sub- super- reg-class tables static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29190 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 22:18:31 +00:00
Chris Lattner
195bb4a7b0 Fix case where identical cases were not detected across case #0, because
instructions not handled would have a case value of #0, throwing things off.
This marginally shrinks the X86 asmprinter, but shrinks the sparc asmwriter
by 25 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29187 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 19:27:30 +00:00
Chris Lattner
0a01212857 Fix an accidentally duplicated line that caused tblgen to crash on itanium.
Add an assert that catches the real problem earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29185 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 19:06:01 +00:00
Chris Lattner
96c1ade5c3 Maximally group commands. When all instructions within a command set have a
series of identical commands, handle them all with one switch.  In the case
of the x86 at&t asm printer, only 3 switches are needed for all instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29184 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 18:28:27 +00:00
Chris Lattner
b84628679a Change generator to remove operands as it processes them. No change in
generated file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29183 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:56:07 +00:00
Chris Lattner
191dd1f186 Handle the last operand more intelligently. When emitting the \n, also
return from the asmprinter to make the generated asmprinter both more
efficient and smaller.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29182 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:50:22 +00:00
Chris Lattner
e7a589df09 Emit switches with 1/2 cases as unconditional code or an if/then/else for
tidyness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:43:54 +00:00
Chris Lattner
b51ecd4dd9 Steal bits from the asm string index to use for operand information. On both
x86 and ppc, this gets us 4 more bits to play with, since the string indices
both only use 12 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29180 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:38:46 +00:00
Chris Lattner
5561640043 Merge operand info and asmstr idx into a single 32-bit field. No other change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29179 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:32:27 +00:00
Chris Lattner
bdff5f95b9 Completely change the structure of the generated asmprinter to be more table
based and less switch-statements-with-hundreds-of-cases based.  This shrinks
the x86 asmprinters to about 1/3 their previous size.

Other improvements coming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29177 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 17:18:03 +00:00
Evan Cheng
fb878a37ba Use __attribute__((noinline)) only if compiled by gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-16 06:14:37 +00:00
Evan Cheng
f872940dfc Parameterize target node ValueType to allow more sharing of emit functions.
Also reduce the number of arguments passed to emit functions and removed a
hack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29160 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-16 06:12:52 +00:00
Evan Cheng
fceb57a917 Reduce instruction selection code size and stack frame size by factoring
code that emit target specific nodes into emit functions that are uniquified
and shared among selection routines.
e.g. This reduces X86ISelDAGToDAG.o (release) from ~2M to ~1.5M. Stack frame
size of Select_store from ~13k down to ~8k.
This is the first step. Further work to enable more sharing will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29158 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-15 08:45:20 +00:00
Chris Lattner
fb5115e84c The generated index array should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29155 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 23:14:02 +00:00
Chris Lattner
6af022f255 Emit the string information for the asm writer as a single large string
and index into it, instead of emitting it like this:

  static const char * const OpStrs[] = {
    "PHINODE\n",        // PHI
    0,  // INLINEASM
    "adc ",     // ADC32mi
    "adc ",     // ADC32mi8
   ...

The old way required thousands of relocations that slows down link time and
dynamic load times.

This also cuts about 10K off each of the X86 asmprinters, and should shrink
the others as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29152 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 22:59:11 +00:00
Jim Laskey
cb12903147 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29137 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-13 22:17:08 +00:00
Jim Laskey
f1b05bf755 1. Simplfy bit operations.
2. Coalesce instruction cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29135 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-13 21:02:53 +00:00
Jim Laskey
ed393433d2 Move base value of instruction to lookup table to prepare for case reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29122 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 19:15:43 +00:00
Jim Laskey
16d42c6ac6 It was pointed out that DEBUG() is only available with -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29106 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-11 18:25:13 +00:00
Jim Laskey
e37fe9b3a1 Ensure that dump calls that are associated with asserts are removed from
non-debug build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29105 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-11 17:58:07 +00:00
Jim Laskey
1406bdab85 Reduce bloat in target libraries by removing per machine instruction assertion
from code emitter generation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29097 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-11 01:25:59 +00:00
Chris Lattner
a539c03271 tblgen uses EH
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29034 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 00:21:17 +00:00
Evan Cheng
322812e603 Ugly hack! Add helper functions InsertInFlightSetEntry and
RemoveInFlightSetEntry. They are used in place of direct set operators to
reduce instruction selection function stack size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28987 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-29 23:57:05 +00:00
Chris Lattner
02cdb377ec Fix an error message regression. Print:
LI8:    (LI8:i64 (imm:i64):$imm)
instead of:
  LI8:    (LI8:MVT::i64 (imm:MVT::i64):$imm)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28868 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-20 00:56:37 +00:00
Chris Lattner
186fb7d131 Don't require src/dst patterns to be able to fully resolve their types,
because information about one can help refine the other.  This allows us to
write:

def : Pat<(i32 (extload xaddr:$src, i8)),
          (LBZX xaddr:$src)>;

as:

def : Pat<(extload xaddr:$src, i8),
          (LBZX xaddr:$src)>;

because tblgen knows LBZX returns i32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28865 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-20 00:31:27 +00:00
Chris Lattner
a354849c27 Make sure to use the result of the pattern to infer the result type of the
instruction, and the result type of the instruction to refine the pattern.
This allows us to write things like this:

def : Pat<(v2i64 (bitconvert (v16i8 VR128:$src))), (v2i64 VR128:$src)>;

as:
def : Pat<(v2i64 (bitconvert (v16i8 VR128:$src))), (VR128:$src)>

and fixes a ppc64 issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28863 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-20 00:18:02 +00:00
Chris Lattner
8f60d54fb1 Improve a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28833 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 18:25:06 +00:00
Evan Cheng
8d3af5e7d0 Instructions with variable operands (variable_ops) can have a number required
operands. e.g.
def CALL32r : I<0xFF, MRM2r, (ops GR32:$dst, variable_ops),
                "call {*}$dst", [(X86call GR32:$dst)]>;
TableGen should emit operand informations for the "required" operands.

Added a target instruction info flag M_VARIABLE_OPS to indicate the target
instruction may have more operands in addition to the minimum required
operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28791 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-15 07:22:16 +00:00
Evan Cheng
d7c2c86239 Allow more use of iPTR in patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28790 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-15 00:16:37 +00:00
Evan Cheng
e945f4d3d4 Added support for variable_ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28788 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 22:22:20 +00:00
Evan Cheng
bc6b86a89e Fix support for optional input flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28784 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 19:27:50 +00:00
Evan Cheng
50c997e26a getOperandNum(): error if specified operand number is out of range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28775 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 21:47:27 +00:00
Chris Lattner
11bcd28dff Wrap to 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28743 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 23:59:44 +00:00
Reid Spencer
d386e55e33 Don't build tblgen with -pedantic or -Wno-long-long
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28638 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 18:20:23 +00:00
Evan Cheng
553ef1be94 Can't trust NodeDepth when checking for possibility of load folding creating
a cycle. This increase the search space and will increase compile time (in
practice it appears to be small, e.g. 176.gcc goes from 62 sec to 65 sec)
that will be addressed later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28476 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 20:16:55 +00:00
Evan Cheng
b0793f9741 Fixed a really ugly bug. The TableGen'd isel is not freeing the "inflight set"
correctly. That is causing non-deterministic behavior (and possibly preventing
some load folding from happening).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28458 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:21:44 +00:00
Chris Lattner
243be2c80d Don't make zero-sized static arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28448 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:31:02 +00:00
Chris Lattner
d74ea2bbd8 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:04:05 +00:00
Evan Cheng
d15531b430 Now that iPTR is a fully resolved type. We end up losing the type check for
patterns that look like this:

def : Pat<(i32 (X86Wrapper tconstpool  :$dst)), (MOV32ri tconstpool  :$dst)>;

InsertOneTypeCheck should copy the type from the resolved pattern to the
unresolved one as long as there types are different.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28389 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 07:24:32 +00:00
Evan Cheng
21d03f2de0 lib/Target/Target.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28386 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 20:42:07 +00:00
Evan Cheng
764811f145 Don't generate getCalleeSaveReg and getCalleeSaveRegClasses anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28376 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 00:08:46 +00:00
Evan Cheng
6b12516f1a Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 20:55:51 +00:00
Evan Cheng
2618d07765 Remove PointerType from target definition. Use abstract type MVT::iPTR to
represent pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28363 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 20:37:59 +00:00
Evan Cheng
44a65fa552 Allow patterns to refer to physical registers that belong to multiple
register classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28323 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 07:05:30 +00:00
Evan Cheng
9812f1ca97 Noop instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28241 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 07:47:00 +00:00
Evan Cheng
d9d4518a86 Unused instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28240 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 07:42:01 +00:00
Evan Cheng
2ca0efd71a Also add super- register classes info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28221 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:30:26 +00:00
Evan Cheng
3eff89bf89 Watch out for the following case:
1. Use expects a chain output.
2. Node is expanded into multiple target ops.
3. One of the inner node produces a chain, the outer most one doesn't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28209 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 02:47:57 +00:00
Evan Cheng
045953c37a Fix a load folding bug. It is exposed by a multi- resulting instructions
def : Pat<> pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28208 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 00:05:46 +00:00
Evan Cheng
8d58e6a9be Add sub-register class information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28195 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:34:26 +00:00
Evan Cheng
108714c14f Set isStore of instructions with ISD::TRUNCSTORE root node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28075 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 02:08:34 +00:00
Chris Lattner
eff5c36238 Put instruction names into the first non TargetInstrInfo namespace found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28043 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-01 23:46:16 +00:00
Chris Lattner
a1e8a80b96 instructions can be in different namespaces. Make sure to use the right
one for each instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28038 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-01 17:01:17 +00:00
Evan Cheng
afba446d99 Formating
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28036 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-01 09:30:17 +00:00
Evan Cheng
6f6360d9ab Mark instructions whose pattern is (store ...) isStore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28032 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-01 09:04:20 +00:00
Evan Cheng
55d0fa1bfa Remove the temporary option: -no-isel-fold-inflight
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28012 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 18:54:11 +00:00
Evan Cheng
61a0209a8a When isel'ing a node, mark its operands "InFlight" before selecting them. These
nodes should not be folded into other nodes.
This fixes the miscompilation of PR 749.
Temporarily under flag control.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28002 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 02:08:10 +00:00
Nate Begeman
37efe67645 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27947 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-22 18:53:45 +00:00
Chris Lattner
719c2fc97f Don't fill in fields that no longer exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27898 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20 18:32:22 +00:00
Evan Cheng
c81d2a041d Rename AddedCost to AddedComplexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27841 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 20:36:09 +00:00
Evan Cheng
5941320c0d Allow "let AddedCost = n in" to increase pattern complexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27834 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 18:07:24 +00:00
Reid Spencer
28421d0a80 Add missing things to the distribution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27650 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-13 06:27:20 +00:00
Chris Lattner
4b2362e247 Fix a typo: Instr* -> Intr*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27568 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-10 22:02:59 +00:00
Chris Lattner
91ded08224 Infer element types for shuffle masks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27456 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-06 20:36:51 +00:00
Chris Lattner
52793e2c41 rename a method, to avoid confusion with llvm intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27455 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-06 20:19:52 +00:00
Chris Lattner
5348e393df Adjust the Intrinsics.gen interface a little bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27345 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02 03:35:30 +00:00
Chris Lattner
b83169195c regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27313 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 21:54:11 +00:00
Chris Lattner
711e5d96aa Generalize the previous binary operator support and add a string concatenation
operation.  This implements Regression/TableGen/strconcat.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27312 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 21:53:49 +00:00
Chris Lattner
ffa4fdcd17 Allow bits init values to be used in patterns, turn them into ints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27286 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 05:25:56 +00:00
Chris Lattner
f124b46b4f Final bugfix for PR724. GCC won't inline varargs functions, so use one to
validate the prototype of intrinsic functions.  This prevents GCC from going
crazy and inlining too much stuff, eventually running out of memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27283 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 04:48:26 +00:00
Chris Lattner
c4d9b240b1 When emitting code for the verifier, instead of emitting each case statement
independently, batch up checks so that identically typed intrinsics share
verifier code.  This dramatically reduces the size of the verifier function,
which should help avoid GCC running out of memory compiling Verifier.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-31 04:24:58 +00:00
Chris Lattner
8177969be0 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27264 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-30 22:51:12 +00:00
Chris Lattner
8c06318821 Implement Regression/TableGen/DagDefSubst.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27263 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-30 22:50:40 +00:00
Evan Cheng
f065a6f711 Don't sort the names before outputing the intrinsic name table. It causes a
mismatch against the enum table.
This is a part of Sabre's master plan to drive me nuts with subtle bugs that
happens to only affect x86 be. :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27237 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-28 22:25:56 +00:00
Chris Lattner
b026e70462 Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value. Split them into separate enums.
Also, don't emit dynamic checks when we can compute them statically


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27202 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-28 00:41:33 +00:00
Chris Lattner
6a160fba22 Only compute intrinsic valuetypes when in a target .td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27197 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-28 00:15:00 +00:00
Chris Lattner
76f8c7c4cc revert this, it breaks things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27196 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-28 00:03:08 +00:00
Chris Lattner
8850a1bcef Add support for decoding iPTR to the right pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27188 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-27 22:48:18 +00:00
Chris Lattner
2c4e65d460 Print error messages like this:
tblgen: In STVEBX: Intrinsic 'llvm.ppc.altivec.stvebx' expects 3 operands, not 2 operands!

instead of like this:
tblgen: In STVEBX: Intrinsic 'intrinsic_void expects 3 operands, not 2 operands!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27185 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-27 22:21:18 +00:00
Chris Lattner
5c4c774c75 Add a missing check which cause an invalid .td file to crash tblgen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-25 22:12:44 +00:00
Chris Lattner
9bf2d3e6d6 When failing selection for an intrinsic, print this:
Cannot yet select: intrinsic %llvm.ppc.altivec.lvx

instead of this:

Cannot yet select: 0x9b047e0: v4i32,ch = INTRINSIC 0x9b04540:1, 0x9b04710, 0x9b04790, 0x9b04540


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27110 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-25 06:47:53 +00:00
Chris Lattner
5a1df389a6 Change approach so that we get codegen for free for intrinsics. With this,
intrinsics that don't take pointer arguments now work.  For example, we can
compile this:

int test3( __m128d *A) {
  return _mm_movemask_pd(*A);
}
int test4( __m128 *A) {
  return _mm_movemask_ps(*A);
}

to this:

_test3:
        movl 4(%esp), %eax
        movapd (%eax), %xmm0
        movmskpd %xmm0, %eax
        ret
_test4:
        movl 4(%esp), %eax
        movaps (%eax), %xmm0
        movmskps %xmm0, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27090 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 23:10:39 +00:00
Chris Lattner
947604b0e2 fix 80 column violations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27084 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 21:52:20 +00:00
Chris Lattner
550525e3cf Parse intrinsics correctly and perform type propagation. This doesn't currently
emit the code to select intrinsics, but that is next :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27082 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 21:48:51 +00:00
Jim Laskey
47622e3721 Add dwarf register numbering to register data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27081 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 21:15:58 +00:00
Chris Lattner
2ca956f8de Make sure to initialize the TheDef field!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27078 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 20:25:01 +00:00
Chris Lattner
43fbbc36dc Move CodeGenIntrinsic implementation to CodeGenTarget.cpp with the rest of
the CodeGen* implementations.

Parse the MVT::ValueType for each operand of the intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27075 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 19:49:31 +00:00
Chris Lattner
7056de375d extract some more information from the intrinsic table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27022 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 01:13:55 +00:00
Reid Spencer
4d9f05cdcb Add new generated files to be ignored.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27011 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 23:45:32 +00:00
Evan Cheng
83e1a6ab95 Allow result node to be a simple leaf node. This enable bitconvert patterns
like this:
def : Pat<(v4i32 (bitconvert (v4f32 VR128:$src))), (v4i32 VR128:$src)>;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 02:35:32 +00:00
Evan Cheng
3a7a14b0ae Don't forget to promote xform function to an explicit node for def : Pat<>
patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26929 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-21 20:44:17 +00:00
Chris Lattner
4e2f54d99e minor code simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26918 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-21 06:42:58 +00:00
Evan Cheng
863bf5afb0 The node wrapped in PatLeaf<> should be treated as a leaf even if it isn't
one, i.e. don't select it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26909 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-20 22:53:06 +00:00
Evan Cheng
f26ba69725 It should be ok for a xform output type to be different from input type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26899 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-20 08:09:17 +00:00
Evan Cheng
420132e1eb Copy matching pattern's output type info to instruction result pattern.
The instruction patterns do not contain enough information to resolve the
exact type of the destination if it of a generic vector type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26892 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-20 06:04:09 +00:00
Chris Lattner
697f88456c Add a new SDTCisIntVectorOfSameSize type constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26890 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-20 05:39:48 +00:00
Evan Cheng
dcfccac13b getEnumName() missed v8i8, v4i16, and v2i32 types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26869 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-19 07:57:34 +00:00
Chris Lattner
485c00f7e8 Fix miscodegen of V_SET0 in PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26836 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-18 00:40:36 +00:00
Chris Lattner
0da3130a98 allow the GCCBuiltinName field to be optional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26784 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 19:15:26 +00:00
Jeff Cohen
71c3bc3d96 Fix VC++ build error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26773 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 02:51:05 +00:00
Chris Lattner
ad45b00d6a remove typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26772 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 02:05:38 +00:00
Chris Lattner
fda6affb95 Autogenerate a table of intrinsic names, so we can map from intrinsic ID to
LLVM intrinsic function name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 01:55:21 +00:00
Chris Lattner
3f8b8913bc Autogenerate code to map from GCC builtin to LLVM intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-15 01:33:26 +00:00
Reid Spencer
767a25b878 Add a newline at the end to avoid gcc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26749 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-14 05:59:52 +00:00
Chris Lattner
022f64fbbc emit a mapping from LLVM intrinsic -> GCC builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 23:08:44 +00:00
Chris Lattner
18faf5d9f7 Verify that packed type operands have the right size and base type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 22:38:57 +00:00
Chris Lattner
78167faa18 fix pasto in generate assertion msg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26706 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-11 00:20:47 +00:00
Chris Lattner
4e5f35973c generate side-effect info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:37:52 +00:00
Chris Lattner
6448ee44c6 Parse mod/ref properties, autogen mod/ref information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26669 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:30:49 +00:00
Chris Lattner
f97a00e681 parse intrinsic types
autogenerate an intrinsic verifier


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:05:04 +00:00
Chris Lattner
9b843b2494 autogenerate the function name recognizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26663 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 20:34:19 +00:00
Evan Cheng
ed66e855ec Temporary hack to enable more (store (op (load ...))) folding. This makes
it possible when a TokenFactor is between the load and store. But is still
missing some cases due to ordering issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26638 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 08:19:11 +00:00
Evan Cheng
6f8aaf2cb0 Don't generate silly matching code like this:
if (N1.getOpcode() == ISD::ADD &&
     ...)
   if (... &&
       (N1.getNumOperands() == 1 || !isNonImmUse(N1.Val, N10.Val))) &&
       ...)

TableGen knows N1 must have more than one operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26592 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-07 08:31:27 +00:00
Chris Lattner
56879b2d96 Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 19:34:28 +00:00
Chris Lattner
b672d981a8 Fix pasteo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:13:41 +00:00
Chris Lattner
3b2397211b remove a bunch of long-dead testing code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:34:28 +00:00
Chris Lattner
9e493cfcc3 initial implementation of intrinsic parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:32:46 +00:00
Chris Lattner
3d87811ce0 remove out of date comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:04:07 +00:00
Chris Lattner
ed5424196d Add support for "-Ifoo" in addition to "-I foo"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26487 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:53:40 +00:00
Chris Lattner
c1d6e4eba7 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26486 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:47:37 +00:00
Chris Lattner
d9f5d90af1 add support for multiple include directories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26485 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:47:14 +00:00
Evan Cheng
9073dea7c0 New vector type v2f32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26437 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 01:10:52 +00:00
Chris Lattner
fd105d464a Select inline asm memory operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26349 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-24 02:13:31 +00:00
Evan Cheng
aea20f50e5 Added x86 integer vector types: 64-bit packed byte integer (v16i8), 64-bit
packed word integer (v8i16), and 64-bit packed doubleword integer (v2i32).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26294 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-20 22:34:53 +00:00
Jeff Cohen
bce4805d6f Fix bugs identified by VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26287 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 03:20:33 +00:00
Evan Cheng
fbad70808c Bump up pattern cost if the resulting instruction is marked
usesCustomDAGSchedInserter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 02:33:09 +00:00
Chris Lattner
bdd3c1604e Check the new form for bison output into CVS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26208 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 07:24:01 +00:00
Chris Lattner
e8242b168c Adjust to new form of handling lexer dependencies, this way shouldn't have
the problems the old way did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 05:13:13 +00:00
Evan Cheng
67212a05e6 Call InsertISelMapEntry rather than map insertion operator to prevent overly
aggrssive inlining. This reduces Select_store frame size from 24k to 10k.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26095 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 22:12:27 +00:00
Evan Cheng
d7805a741d Match getTargetNode() changes (now returns SDNode* instead of SDOperand).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26084 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 07:16:09 +00:00
Evan Cheng
34167215a8 Change Select() from
SDOperand Select(SDOperand N);
to
void Select(SDOperand &Result, SDOperand N);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26067 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-09 00:37:58 +00:00
Evan Cheng
21ad392ee6 Hoist all SDOperand declarations within a Select_{opcode}() to the top level
to reduce stack memory usage. This is intended to work around the gcc bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-07 00:37:41 +00:00
Chris Lattner
04cadb3684 Add support for modifier strings in machine instr descriptions. This allows
us to avoid creating lots of "Operand" types with different printers, instead
we can fold several together and use modifiers.  For example, we can now use:

${target:call} to say that the operand should be printed like a 'call' operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26024 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 23:40:48 +00:00
Chris Lattner
b03b080a82 Simplify the variant handling code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26023 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 22:43:28 +00:00
Evan Cheng
7cd19d038f At the end of isel, select a replacement node for each handle that does not
have one. This can happen if a load's real uses are dead (i.e. they do not
have uses themselves).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26014 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 08:12:55 +00:00
Evan Cheng
024524fe9b Name change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26013 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-06 06:03:35 +00:00
Evan Cheng
0a83ed506c Handle HANDLENODE: just return itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26011 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 08:46:14 +00:00
Evan Cheng
e41bf82107 Allow more loads to be folded which were previously prevented from happening
due to ordering issue. i.e. they were selected for chain use first.
Now at load select time, check if it is being selected for a chain use and if
it has only a single real use. If so, return a HANDLENODE (with the load as
its operand) in its place and record it.
When it is folded or the load is selected for a real use, the isel records it
as the replacement for the HANDLENODE. The replacement is done when all nodes
are selected.
This scheme exposed a couple of problems where cycles can happen. (See comments
in EmitMatchCode() for descriptions of the problems and their workaround /
solutions.) These problems have been resolved with a small compile time
penality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25995 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 06:43:12 +00:00
Evan Cheng
2216d8ad2f Re-committing the last bit of change. It shouldn't break PPC this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25982 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-05 05:22:18 +00:00
Chris Lattner
9ed44818c5 Temporarily revert the last change, which breaks PPC and other targets that
DO select things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25970 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-04 09:23:06 +00:00
Evan Cheng
9c4815a036 Complex pattern's custom matcher should not call Select() on any operands.
Select them afterwards if it returns true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-04 08:50:49 +00:00
Chris Lattner
3e1798086b node predicates add to the complexity of a pattern. This ensures that the
X86 backend attempts to match small-immediate versions of instructions before
the full size immediate versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25937 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-03 18:06:02 +00:00
Evan Cheng
e4a8a6e645 (store (op (load ...))) folding problem. In the generated matching code,
Chain is initially set to the chain operand of store node, when it reaches
load, if it matches the load then Chain is set to the chain operand of the
load.

However, if the matching code that follows this fails, isel moves on to the
next pattern but it does not restore Chain to the chain operand of the store.
So when it tries to match the next store / op / load pattern it would fail on
the Chain == load.getOperand(0) test.

The solution is for each chain operand to get a unique name. e.g. Chain10.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-03 06:22:41 +00:00
Chris Lattner
1cf9d961b2 add a note, ya knoe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25880 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 19:12:23 +00:00
Evan Cheng
657416cfba If a pattern's root node is a constant, its size should be 3 rather than 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25870 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-01 06:06:31 +00:00
Chris Lattner
273d463bef implement test/Regression/TableGen/DagIntSubst.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25836 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 06:02:35 +00:00
Chris Lattner
7859313bae simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25791 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 20:01:35 +00:00
Andrew Lenharth
8e51773bb7 it is nice not to chop off bits for those blessed with lots of bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25766 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 05:22:37 +00:00