Commit Graph

161 Commits

Author SHA1 Message Date
Chris Lattner b424faa09c reject void in intrinsic type lists.
llvm-svn: 99347
2010-03-23 23:46:27 +00:00
Chris Lattner 2109cb461c Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy.  Now with a fix
for the verifier.

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

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

llvm-svn: 98934
2010-03-19 05:07:09 +00:00
Chris Lattner 1802b17b65 Finally change the instruction looking map to be a densemap from
record* -> instrinfo instead of std::string -> instrinfo.

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

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

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

llvm-svn: 98910
2010-03-19 00:34:35 +00:00
Chris Lattner c9ae94c793 factor copy and paste code.
llvm-svn: 98908
2010-03-19 00:23:20 +00:00
Chris Lattner 9aec14b560 look up instructions by record, not by name.
llvm-svn: 98904
2010-03-19 00:07:20 +00:00
Chris Lattner cabe037b2d Completely rewrite tblgen's type inference mechanism,
changing the primary datastructure from being a 
"std::vector<unsigned char>" to being a new TypeSet class
that actually has (gasp) invariants!

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

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

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

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

llvm-svn: 98534
2010-03-15 06:00:16 +00:00
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
Dale Johannesen 881ba0bb92 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
Dale Johannesen 237254dcab Add DEBUG_DECLARE. Not used yet.
llvm-svn: 93040
2010-01-09 01:24:25 +00:00
Dale Johannesen 8f04740650 Add DEBUG_VALUE. Not used yet.
llvm-svn: 93030
2010-01-08 23:51:25 +00:00
Dan Gohman b91411c9b9 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
Jakob Stoklund Olesen dc9efe8078 Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

llvm-svn: 83006
2009-09-28 20:32:26 +00:00
Owen Anderson 9f94459d24 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Bob Wilson 781797f586 Fix a few more places in TableGen that need to handle EVT::vAny types.
llvm-svn: 78643
2009-08-11 05:03:38 +00:00
Bob Wilson 2cd5da8300 Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.

llvm-svn: 78631
2009-08-11 01:14:02 +00:00
Owen Anderson 53aa7a960c Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Daniel Dunbar 0033199c50 Match X86 register names to number.
llvm-svn: 77404
2009-07-29 00:02:19 +00:00
Duncan Sands 9ad1594fe0 Remove the v3i32 and v3f32 value types: they are not
native for any supported targets.

llvm-svn: 75785
2009-07-15 15:28:52 +00:00
Bob Wilson c6026b5198 Revert 75308.
llvm-svn: 75565
2009-07-14 00:16:03 +00:00
Bob Wilson 73fd66c06b Add new vector types for 192-bit, 348-bit and 512-bit sizes.
These are needed to represent ARM Neon struct datatypes containing 2, 3 or 4
separate vectors.

llvm-svn: 75308
2009-07-10 23:05:09 +00:00
Bob Wilson bf8e4c1128 Refactor TableGen's llvm::getName to share code with llvm::getEnumName,
since names are the same for almost all the types.

llvm-svn: 75302
2009-07-10 22:25:24 +00:00
Devang Patel 5832e7fd23 Add new ValueType for metadata.
llvm-svn: 74882
2009-07-06 23:44:32 +00:00
Daniel Dunbar 38a22bffdc Replace std::iostreams with raw_ostream in TableGen.
- Sorry, I can't help myself.

 - No intended functionality change.

llvm-svn: 74742
2009-07-03 00:10:29 +00:00
David Greene f92ba97cda Add more vector ValueTypes for AVX and other extended vector instruction
sets.

llvm-svn: 74427
2009-06-29 16:47:10 +00:00
Dale Johannesen 5234d3795f Revert 72707 and 72709, for the moment.
llvm-svn: 72712
2009-06-02 03:12:52 +00:00
Dale Johannesen 0b8ca79253 Make the implicit inputs and outputs of target-independent
ADDC/ADDE use MVT::i1 (later, whatever it gets legalized to)
instead of MVT::Flag.  Remove CARRY_FALSE in favor of 0; adjust
all target-independent code to use this format.

Most targets will still produce a Flag-setting target-dependent
version when selection is done.  X86 is converted to use i32
instead, which means TableGen needs to produce different code
in xxxGenDAGISel.inc.  This keys off the new supportsHasI1 bit
in xxxInstrInfo, currently set only for X86; in principle this
is temporary and should go away when all other targets have
been converted.  All relevant X86 instruction patterns are
modified to represent setting and using EFLAGS explicitly.  The
same can be done on other targets.

The immediate behavior change is that an ADC/ADD pair are no
longer tightly coupled in the X86 scheduler; they can be
separated by instructions that don't clobber the flags (MOV).
I will soon add some peephole optimizations based on using
other instructions that set the flags to feed into ADC.

llvm-svn: 72707
2009-06-01 23:27:20 +00:00
Bob Wilson b8c370a8b5 Fix PR3994: LLVMMatchType arguments do not refer to absolute return value
and argument positions but only to the overloaded intrinsic parameters.
Keep a separate list of these overloaded parameters in CodeGenTarget.cpp
so they can be resolved easily.  Remove assertions from IntrinsicEmitter.cpp:
they were harmless but confusing, and the assertions elsewhere in TableGen
will catch any incorrect values.

llvm-svn: 69316
2009-04-16 21:51:05 +00:00
Dan Gohman 6c1426308c Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.

llvm-svn: 68986
2009-04-13 21:06:25 +00:00
Dan Gohman 60a446ab02 Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
This will be used to replace things like X86's MOV32to32_.

Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.

Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.

llvm-svn: 68961
2009-04-13 15:38:05 +00:00
Dale Johannesen b842d529a3 Reapply 63765. Patches for clang and llvm-gcc to follow.
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen ae616c2c61 Reverting 63765. This broke the build of both clang
and llvm-gcc.

llvm-svn: 63786
2009-02-04 22:47:25 +00:00
Nate Begeman 6ae3aa83d0 New feature: add support for target intrinsics being defined in the
target directories themselves.  This also means that VMCore no longer
needs to know about every target's list of intrinsics.  Future work
will include converting the PowerPC target to this interface as an
example implementation.

llvm-svn: 63765
2009-02-04 19:47:21 +00:00
Chris Lattner 9a3113aeb8 add nocapture attribute to llvm.mem* intrinsics and have tblgen
parse them.  tblgen doesn't yet do anything with this info though.

llvm-svn: 62065
2009-01-12 01:12:03 +00:00
Bob Wilson f76486ac8a Improve support for type-generic vector intrinsics by teaching TableGen how
to handle LLVMMatchType intrinsic parameters, and by adding new subclasses
of LLVMMatchType to match vector types with integral elements that are 
either twice as wide or half as wide as the elements of the matched type.

llvm-svn: 61834
2009-01-07 00:09:01 +00:00
Mon P Wang a501640ffa Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Bill Wendling 9182147f17 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;

llvm-svn: 59237
2008-11-13 09:08:33 +00:00
Dan Gohman 3e2225dfd6 Factor the code for determining the target-specific instruction
namespace out of the isel emitters and into common code.

llvm-svn: 55079
2008-08-20 21:45:57 +00:00
Dan Gohman b93b489c54 Fix the string for MVT::isVoid.
llvm-svn: 55034
2008-08-20 01:44:30 +00:00
Mon P Wang 2c839d4b1e Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Dan Gohman fb19f9402b Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminating
the need for a flavor operand, and add a new SDNode subclass,
LabelSDNode, for use with them to eliminate the need for a label id
operand.

Change instruction selection to let these label nodes through
unmodified instead of creating copies of them. Teach the MachineInstr
emitter how to emit a MachineInstr directly from an ISD label node.

This avoids the need for allocating SDNodes for the label id and
flavor value, as well as SDNodes for each of the post-isel label,
label id, and label flavor.

llvm-svn: 52943
2008-07-01 00:05:16 +00:00
Mon P Wang 6a490371c9 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Evan Cheng 49bad4c9e1 - Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding.

llvm-svn: 52353
2008-06-16 20:29:38 +00:00
Duncan Sands 13237ac3b9 Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).

llvm-svn: 52044
2008-06-06 12:08:01 +00:00