summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenTarget.cpp
AgeCommit message (Collapse)Author
2010-03-15Completely rewrite tblgen's type inference mechanism,Chris Lattner
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-02-09move target-independent opcodes out of TargetInstrInfoChris Lattner
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-01-15Remove DEBUG_DECLARE, looks like we don't need it.Dale Johannesen
Also, DEBUG_VALUE has side effects. llvm-svn: 93498
2010-01-09Add DEBUG_DECLARE. Not used yet.Dale Johannesen
llvm-svn: 93040
2010-01-08Add DEBUG_VALUE. Not used yet.Dale Johannesen
llvm-svn: 93030
2010-01-04Remove the CPAttrParentAsRoot code, which is unused, and inconvenientDan Gohman
for a refactoring I'm working on. llvm-svn: 92503
2009-09-28Introduce the TargetInstrInfo::KILL machine instruction and get rid of theJakob Stoklund Olesen
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-08-11Split EVT into MVT and EVT, the former representing _just_ a primitive type, ↵Owen Anderson
while the latter is capable of representing either a primitive or an extended type. llvm-svn: 78713
2009-08-11Fix a few more places in TableGen that need to handle EVT::vAny types.Bob Wilson
llvm-svn: 78643
2009-08-11Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsicBob Wilson
arguments that are vectors of any size and element type. llvm-svn: 78631
2009-08-10Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson
own struct type. llvm-svn: 78610
2009-07-29Match X86 register names to number.Daniel Dunbar
llvm-svn: 77404
2009-07-15Remove the v3i32 and v3f32 value types: they are notDuncan Sands
native for any supported targets. llvm-svn: 75785
2009-07-14Revert 75308.Bob Wilson
llvm-svn: 75565
2009-07-10Add new vector types for 192-bit, 348-bit and 512-bit sizes.Bob Wilson
These are needed to represent ARM Neon struct datatypes containing 2, 3 or 4 separate vectors. llvm-svn: 75308
2009-07-10Refactor TableGen's llvm::getName to share code with llvm::getEnumName,Bob Wilson
since names are the same for almost all the types. llvm-svn: 75302
2009-07-06Add new ValueType for metadata.Devang Patel
llvm-svn: 74882
2009-07-03Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar
- Sorry, I can't help myself. - No intended functionality change. llvm-svn: 74742
2009-06-29Add more vector ValueTypes for AVX and other extended vector instructionDavid Greene
sets. llvm-svn: 74427
2009-06-02Revert 72707 and 72709, for the moment.Dale Johannesen
llvm-svn: 72712
2009-06-01Make the implicit inputs and outputs of target-independentDale Johannesen
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-04-16Fix PR3994: LLVMMatchType arguments do not refer to absolute return valueBob Wilson
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-13Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalizeDan Gohman
it accordingly. Thanks to Jakob Stoklund Olesen for pointing out how this might be useful. llvm-svn: 68986
2009-04-13Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.Dan Gohman
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-02-05Reapply 63765. Patches for clang and llvm-gcc to follow.Dale Johannesen
llvm-svn: 63812
2009-02-04Reverting 63765. This broke the build of both clangDale Johannesen
and llvm-gcc. llvm-svn: 63786
2009-02-04New feature: add support for target intrinsics being defined in theNate Begeman
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-01-12add nocapture attribute to llvm.mem* intrinsics and have tblgenChris Lattner
parse them. tblgen doesn't yet do anything with this info though. llvm-svn: 62065
2009-01-07Improve support for type-generic vector intrinsics by teaching TableGen howBob Wilson
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
2008-12-18Added support for vector widening.Mon P Wang
llvm-svn: 61209
2008-11-13Modify the intrinsics pattern to separate out the "return" types from theBill Wendling
"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-08-20Factor the code for determining the target-specific instructionDan Gohman
namespace out of the isel emitters and into common code. llvm-svn: 55079
2008-08-20Fix the string for MVT::isVoid.Dan Gohman
llvm-svn: 55034
2008-07-30Added support for overloading intrinsics (atomics) based on pointersMon P Wang
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-01Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman
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-06-25Added MemOperands to Atomic operations since Atomics touches memory.Mon P Wang
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-16- Add "Commutative" property to intrinsics. This allows tblgen to generate ↵Evan Cheng
the commuted variants for dagisel matching code. - Mark lots of X86 intrinsics as "Commutative" to allow load folding. llvm-svn: 52353
2008-06-06Wrap MVT::ValueType in a struct to get type safetyDuncan Sands
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-04-03Move instruction flag inference out of InstrInfoEmitter and intoDan Gohman
CodeGenDAGPatterns, where it can be used in other tablegen backends. This allows the inference to be done for DAGISelEmitter so that it gets accurate mayLoad/mayStore/isSimpleLoad flags. This brings MemOperand functionality back to where it was before 48329. However, it doesn't solve the problem of anonymous patterns which expand to code that does loads or stores. llvm-svn: 49123
2008-03-16Make insert_subreg a two-address instruction, vastly simplifying ↵Christopher Lamb
LowerSubregs pass. Add a new TII, subreg_to_reg, which is like insert_subreg except that it takes an immediate implicit value to insert into rather than a register. llvm-svn: 48412
2008-03-15Replace all target specific implicit def instructions with a target ↵Evan Cheng
independent one: TargetInstrInfo::IMPLICIT_DEF. llvm-svn: 48380
2008-02-02SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng
information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc. Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. llvm-svn: 46659
2008-01-31Allow ComplexExpressions in InstrInfo.td files to be slightly more... ↵Christopher Lamb
complex! ComplexExpressions can now have attributes which affect how TableGen interprets the pattern when generating matchin code. The first (and currently, only) attribute causes the immediate parent node of the ComplexPattern operand to be passed into the matching code rather than the node at the root of the entire DAG containing the pattern. llvm-svn: 46606
2008-01-10Start inferring side effect information more aggressively, and fix many bugs ↵Chris Lattner
in the x86 backend where instructions were not marked maystore/mayload, and perf issues where instructions were not marked neverHasSideEffects. It would be really nice if we could write patterns for copy instructions. I have audited all the x86 instructions down to MOVDQAmr. The flags on others and on other targets are probably not right in all cases, but no clients currently use this info that are enabled by default. llvm-svn: 45829
2008-01-06Split the impl of CodeGenInstruction out to its own .cpp file, add a ↵Chris Lattner
getName() accessor. llvm-svn: 45645
2008-01-05change getQualifiedName to be a global function.Chris Lattner
Split the pattern parsing code out from the dag isel emitter into it's own file. No functionality change. llvm-svn: 45632
2007-12-29remove attributions from utils.Chris Lattner
llvm-svn: 45419
2007-12-14Add flags to indicate that there are "never" side effects or that there "may be"Bill Wendling
side effects for machine instructions. llvm-svn: 45022
2007-12-13Oops. Forgot these.Evan Cheng
llvm-svn: 44969
2007-11-12Add a flag for indirect branch instructions.Owen Anderson
Target maintainers: please check that the instructions for your target are correctly marked. llvm-svn: 44012