summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenInstruction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* - Add "Bitcast" target instruction property for instructions which performEvan Cheng2011-03-151-0/+1
| | | | | | | nothing more than a bitcast. - Teach tablegen to automatically infer "Bitcast" property. llvm-svn: 127667
* Improve the AsmMatcher's ability to handle suboperands.Bob Wilson2011-01-261-85/+98
| | | | | | | | | | | | | | | When an operand class is defined with MIOperandInfo set to a list of suboperands, the AsmMatcher has so far required that operand to also define a custom ParserMatchClass, and InstAlias patterns have not been able to set the individual suboperands separately. This patch removes both of those restrictions. If a "compound" operand does not override the default ParserMatchClass, then the AsmMatcher will now parse its suboperands separately. If an InstAlias operand has the same class as the corresponding compound operand, then it will be handled as before; but if that check fails, TableGen will now try to match up a sequence of InstAlias operands with the corresponding suboperands. llvm-svn: 124314
* TableGen: PointerLikeRegClass can be accepted to operand.NAKAMURA Takumi2011-01-261-1/+2
| | | | llvm-svn: 124271
* Fix whitespace.NAKAMURA Takumi2011-01-261-58/+58
| | | | llvm-svn: 124270
* Move InstAlias check of argument types to a separate loop.Bob Wilson2011-01-201-11/+14
| | | | llvm-svn: 123934
* Fix broken check for InstAlias argument used with different types.Bob Wilson2011-01-201-0/+1
| | | | llvm-svn: 123932
* Precompute InstAlias operand mapping to result instruction operand indices.Bob Wilson2011-01-201-18/+4
| | | | | | | There should be no functional change from this, but I think it's simpler this way. llvm-svn: 123931
* Fix some tablegen issues to allow using zero_reg for InstAlias definitions.Bob Wilson2011-01-141-0/+15
| | | | | | | | This is needed to allow an InstAlias for an instruction with an "OptionalDef" result register (like ARM's cc_out) where you want to set the optional register to reg0. llvm-svn: 123490
* Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,Evan Cheng2010-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | and xor. The 32-bit move immediates can be hoisted out of loops by machine LICM but the isel hacks were preventing them. Instead, let peephole optimization pass recognize registers that are defined by immediates and the ARM target hook will fold the immediates in. Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ instructions if there are multiple uses. This happens when the 'and' is live out, machine sink would have sinked the computation and that ends up pessimizing code. The peephole pass would recognize situations where the 'and' can be toggled to define CPSR and eliminate the comparison anyway. 2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking important optimizations. rdar://8663787, rdar://8241368 llvm-svn: 119548
* add fields to the .td files unconditionally, simplifying tblgen a bit.Chris Lattner2010-11-151-2/+1
| | | | | | Switch the ARM backend to use 'let' instead of 'set' with this change. llvm-svn: 119120
* add (and document) the ability for alias results to haveChris Lattner2010-11-061-4/+28
| | | | | | | | fixed physical registers. Start moving fp comparison aliases to the .td file (which default to using %st1 if nothing is specified). llvm-svn: 118352
* generalize alias support to allow the result of an alias toChris Lattner2010-11-061-0/+15
| | | | | | | add fixed immediate values. Move the aad and aam aliases to use this, and document it. llvm-svn: 118350
* fix a bug where we had an implicit assumption that theChris Lattner2010-11-061-0/+18
| | | | | | | | result instruction operand numbering matched the result pattern. Fixing this allows us to move the xchg/test aliases to the .td file. llvm-svn: 118334
* fix some bugs in the alias support, unblocking changing of "clr" aliasesChris Lattner2010-11-061-15/+28
| | | | | | from c++ hacks to proper .td InstAlias definitions. Change them! llvm-svn: 118330
* Reimplement BuildResultOperands to be in terms of the result instruction'sChris Lattner2010-11-061-3/+1
| | | | | | | | | | | | | | | | | | operand list instead of the operand list redundantly declared on the alias or instruction. With this change, we finally remove the ins/outs list on the alias. Before: def : InstAlias<(outs GR16:$dst), (ins GR8 :$src), "movsx $src, $dst", (MOVSX16rr8W GR16:$dst, GR8:$src)>; After: def : InstAlias<"movsx $src, $dst", (MOVSX16rr8W GR16:$dst, GR8:$src)>; This also makes the alias mechanism more general and powerful, which will be exploited in subsequent patches. llvm-svn: 118329
* implement more checking to reject things like:Chris Lattner2010-11-061-0/+14
| | | | | | | | | | (someinst GR16:$foo, GR32:$foo) Reimplement BuildAliasOperandReference to be correctly based on the names of operands in the result pattern, instead of on the instruction operand definitions. llvm-svn: 118328
* decode and validate instruction alias result definitions.Chris Lattner2010-11-061-0/+33
| | | | llvm-svn: 118327
* disolve a hack, having CodeGenInstAlias decode the alias in the .tdChris Lattner2010-11-061-1/+9
| | | | | | file instead of the asmmatcher. llvm-svn: 118324
* Implement enough of the missing instalias support to getChris Lattner2010-11-011-6/+7
| | | | | | | | | | | | | | | | | | aliases installed and working. They now work when the matched pattern and the result instruction have exactly the same operand list. This is now enough for us to define proper aliases for movzx and movsx, implementing rdar://8017633 and PR7459. Note that we do not accept instructions like: movzx 0(%rsp), %rsi GAS accepts this instruction, but it doesn't make any sense because we don't know the size of the memory operand. It could be 8/16/32 bits. llvm-svn: 117901
* define a new CodeGenInstAlias. It has an asmstring and operand list for now,Chris Lattner2010-11-011-0/+10
| | | | | | todo: the result field. llvm-svn: 117894
* factor the operand list (and related fields/operations) out of Chris Lattner2010-11-011-159/+171
| | | | | | CodeGenInstruction into its own helper class. No functionality change. llvm-svn: 117893
* avoid needless throw/catch/rethrow, stringref'ize some simple stuff.Chris Lattner2010-11-011-3/+3
| | | | llvm-svn: 117892
* eliminate the old InstFormatName which is always "AsmString",Chris Lattner2010-11-011-2/+2
| | | | | | simplify CodeGenInstruction. No functionality change. llvm-svn: 117891
* move FlattenVariants out of AsmMatcherEmitter into a sharedChris Lattner2010-11-011-0/+49
| | | | | | | | CodeGenInstruction::FlattenAsmStringVariants method. Use it to simplify the code in AsmWriterInst, which now no longer needs to worry about variants. llvm-svn: 117886
* Allow targets to optionally specify custom binary encoder functions forJim Grosbach2010-10-121-1/+5
| | | | | | | | operand values. This is useful for operands which require additional trickery to encode into the instruction. For example, the ARM shifted immediate and shifted register operands. llvm-svn: 116353
* When figuring out which operands match which encoding fields in an instruction,Jim Grosbach2010-10-111-3/+16
| | | | | | | try to match them by name first. If there is no by-name match, fall back to assuming they are in order (this was the previous behavior). llvm-svn: 116211
* Revert r114703 and r114702, removing the isConditionalMove flag from ↵Owen Anderson2010-09-231-1/+0
| | | | | | | | instructions. After further reflection, this isn't going to achieve the purpose I intended it for. Back to the drawing board! llvm-svn: 114710
* Add an TargetInstrDesc bit to indicate that a given instruction is a ↵Owen Anderson2010-09-231-0/+1
| | | | | | | | conditional move. Not intended functionality change, as nothing uses this yet. llvm-svn: 114702
* Add back in r109901, which adds a Compare flag to the target instructions. It'sBill Wendling2010-08-081-0/+1
| | | | | | useful after all. llvm-svn: 110531
* Revert r109901. The implementation of <rdar://problem/7405933> (r110423) doesn'tBill Wendling2010-08-061-1/+0
| | | | | | | | | | | | | need the Compare flag after all. --- Reverse-merging r109901 into '.': U include/llvm/Target/TargetInstrDesc.h U include/llvm/Target/Target.td U utils/TableGen/InstrInfoEmitter.cpp U utils/TableGen/CodeGenInstruction.cpp U utils/TableGen/CodeGenInstruction.h llvm-svn: 110424
* Add a "Compare" flag to the target instruction descriptor. This will be usedBill Wendling2010-07-301-0/+1
| | | | | | | later to identify and possibly remove superfluous compare instructions -- those that are testing for and setting a status flag that should already be set. llvm-svn: 109901
* Remove isTwoAddress from llvm.Eric Christopher2010-06-211-11/+0
| | | | llvm-svn: 106470
* hoist some funky logic into CodeGenInstructionChris Lattner2010-03-271-0/+20
| | | | | | | | | from two places in CodeGenDAGPatterns.cpp, and use it in DAGISelMatcherGen.cpp instead of using an incorrect predicate that happened to get lucky on our current targets. llvm-svn: 99726
* capture implicit uses and defs in CodeGenInstructionChris Lattner2010-03-181-0/+2
| | | | llvm-svn: 98879
* rewrite this to not artificially force concat the ins/outs list.Chris Lattner2010-03-181-13/+20
| | | | llvm-svn: 98870
* eliminate support for "ops" in the input/output list of anChris Lattner2010-03-181-4/+2
| | | | | | instruction. Instructions must use 'ins' and 'outs' now. llvm-svn: 98868
* remove some code that was working around old sparc v9 backend bugs.Chris Lattner2010-03-181-20/+20
| | | | | | Add checking that the input/output operand list in spelled right. llvm-svn: 98865
* The mayHaveSideEffects flag is no longer used.Dan Gohman2010-02-271-2/+1
| | | | llvm-svn: 97348
* Introduce a new CodeGenInstruction::ConstraintInfo classChris Lattner2010-02-101-16/+9
| | | | | | | | | 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
* Reimplement getToken and SplitString as "StringRef helper functions"Benjamin Kramer2010-01-111-1/+3
| | | | | | | | | - getToken is modeled after StringRef::split but it can split on multiple separator chars and skips leading seperators. - SplitString is a StringRef::split variant for more than 2 elements with the same behaviour as getToken. llvm-svn: 93161
* Add @earlyclobber TableGen constraintJim Grosbach2009-12-161-4/+24
| | | | llvm-svn: 91554
* whitespaceJim Grosbach2009-12-151-26/+26
| | | | llvm-svn: 91442
* Rename usesCustomDAGSchedInserter to usesCustomInserter, and update aDan Gohman2009-10-291-1/+1
| | | | | | | | bunch of associated comments, because it doesn't have anything to do with DAGs or scheduling. This is another step in decoupling MachineInstr emitting from scheduling. llvm-svn: 85517
* Add instruction flags: hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. WhenEvan Cheng2009-10-011-0/+2
| | | | | | | | | | set, these flags indicate the instructions source / def operands have special register allocation requirement that are not captured in their register classes. Post-allocation passes (e.g. post-alloc scheduler) should not change their allocations. e.g. ARM::LDRD require the two definitions to be allocated even / odd register pair. llvm-svn: 83196
* Fix bad length argument to substr calls. Apparently I'm the first one toBob Wilson2009-08-261-2/+2
| | | | | | attempt more than 2 constraints on an instruction. llvm-svn: 80169
* Make BinOps typed and require a type specifier for !nameconcat. ThisDavid Greene2009-04-231-1/+1
| | | | | | | allows binops to be used in typed contexts such as when passing arguments to classes. llvm-svn: 69921
* Implement !nameconcat to concatenate strings and look up the resultingDavid Greene2009-04-221-1/+1
| | | | | | name in the symbol table, returning an object. llvm-svn: 69822
* Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.Dan Gohman2008-12-031-1/+1
| | | | llvm-svn: 60487
* Remove redundant word in tblgen error message.Matthijs Kooijman2008-10-271-1/+1
| | | | llvm-svn: 58250
* Handle some 64-bit atomics on x86-32, some of the time.Dale Johannesen2008-10-021-1/+2
| | | | llvm-svn: 56963
OpenPOWER on IntegriCloud