summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenInstruction.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [AVX] Constify InitsDavid Greene2011-07-291-18/+18
| | | | | | | Make references to Inits const everywhere. This is the final step before making them unique. llvm-svn: 136485
* move tier out of an anonymous namespace, it doesn't make senseChris Lattner2011-07-211-2/+3
| | | | | | | | to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. llvm-svn: 135669
* Add a new field to MCOperandInfo that contains information about the type of ↵Benjamin Kramer2011-07-141-3/+7
| | | | | | | | | | the Operand. - The actual values are from the MCOI::OperandType enum. - Teach tblgen to read it from the instruction definition. - This is a better implementation of the hacks in edis. llvm-svn: 135197
* Revert r134921, 134917, 134908 and 134907. They're causing failuresEric Christopher2011-07-111-21/+18
| | | | | | in multiple buildbots. llvm-svn: 134936
* [AVX] Make Inits FoldableDavid Greene2011-07-111-18/+21
| | | | | | | | | | | | | | | | | | Manage Inits in a FoldingSet. This provides several benefits: - Memory for Inits is properly managed - Duplicate Inits are folded into Flyweights, saving memory - It enforces const-correctness, protecting against certain classes of bugs The above benefits allow Inits to be used in more contexts, which in turn provides more dynamism to TableGen. This enhanced capability will be used by the AVX code generator to a fold common patterns together. llvm-svn: 134907
* Add isCodeGenOnly value to the CodeGenInstruction class.Jim Grosbach2011-07-071-0/+1
| | | | | | | So users of a CGI don't have to look up the value directly from the original Record; just like the rest of the convenience values in the class. llvm-svn: 134576
* Don't require pseudo-instructions to carry encoding information.Jim Grosbach2011-07-061-0/+1
| | | | | | | | | | For now this is distinct from isCodeGenOnly, as code-gen-only instructions can (and often do) still have encoding information associated with them. Once we've migrated all of them over to true pseudo-instructions that are lowered to real instructions prior to the printer/emitter, we can remove isCodeGenOnly and just use isPseudo. llvm-svn: 134539
* Add support for alternative register names, useful for instructions whose ↵Owen Anderson2011-06-271-1/+6
| | | | | | | | operands are logically equivalent to existing registers, but happen to be printed specially. For example, an instruciton that prints d0[0] instead of s0. Patch by Jim Grosbach. llvm-svn: 133940
* Consolidate some TableGen diagnostic helper functions.Jim Grosbach2011-06-211-0/+1
| | | | | | | TableGen had diagnostic printers sprinkled about in a few places. Pull them together into a single location in Error.cpp. llvm-svn: 133568
* Give CodeGenRegisterClass a real sorted member set.Jakob Stoklund Olesen2011-06-151-1/+2
| | | | | | | | | | | Make the Elements vector private and expose an ArrayRef through getOrder() instead. getOrder will eventually provide multiple user-specified allocation orders. Use the sorted member set for member and subclass tests. Clean up a lot of ad hoc searches. llvm-svn: 133040
* - 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
OpenPOWER on IntegriCloud