Rail Shafigulin via llvm-dev
2015-Nov-19 23:34 UTC
[llvm-dev] Way to print all the properties of a given def
Does anybody know is there is a way to print all the property values for a
given def?
For example I have a following instruction definition in the .td file
let isReturn = 1, isTerminator = 1, hasDelaySlot=1, isBarrier = 1,
isCodeGenOnly = 1, Inst = 0x44004800 in {
def RET : InstBR<0x1, (outs), (ins),
"l.jr\tr9",
[(retflag)]>;
}
Ultimately when I track it down the def tracks down to class Instruction in
include/llvm/Target/Target.td, ie.
class Instruction {
string Namespace = "";
dag OutOperandList; // An dag containing the MI def operand list.
dag InOperandList; // An dag containing the MI use operand list.
string AsmString = ""; // The .s format to print the instruction
with.
// Pattern - Set to the DAG pattern for this instruction, if we know of
one,
// otherwise, uninitialized.
list<dag> Pattern;
// The follow state will eventually be inferred automatically from the
// instruction pattern.
list<Register> Uses = []; // Default to using no non-operand registers
list<Register> Defs = []; // Default to modifying no non-operand
registers
...
...
...
/// UseNamedOperandTable - If set, the operand indices of this instruction
/// can be queried via the getNamedOperandIdx() function which is
generated
/// by TableGen.
bit UseNamedOperandTable = 0;
}
Does anybody know if there is a way to print all those settings for my
instruction in the following format:
def RET {
string Namespace = "My Arch Namespace";
dag OutOperandList = (outs); // An dag containing the MI def
operand list.
dag InOperandList = (ins); // An dag containing the MI use
operand list.
string AsmString = ".jr\tr9"; // The
....
....
....
}
Any help is appreciated.
--
R
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20151119/6eeef625/attachment.html>
Tim Northover via llvm-dev
2015-Nov-20 02:14 UTC
[llvm-dev] Way to print all the properties of a given def
On 19 November 2015 at 15:34, Rail Shafigulin via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Does anybody know is there is a way to print all the property values for a > given def?If you run llvm-tblgen without telling it to output any particular code (no "-gen-whatever" option) this is exactly what it produces. You need to set the right include paths and so on though so it's probably best to copy/paste an existing invocation the first time. Cheers. Tim.
Rail Shafigulin via llvm-dev
2015-Nov-20 02:19 UTC
[llvm-dev] Way to print all the properties of a given def
On Thu, Nov 19, 2015 at 6:14 PM, Tim Northover <t.p.northover at gmail.com> wrote:> On 19 November 2015 at 15:34, Rail Shafigulin via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Does anybody know is there is a way to print all the property values for > a > > given def? > > If you run llvm-tblgen without telling it to output any particular > code (no "-gen-whatever" option) this is exactly what it produces. You > need to set the right include paths and so on though so it's probably > best to copy/paste an existing invocation the first time. > > Cheers. > > Tim. >Thanks. I'll try it out tomorrow. -- R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151119/a72cecb2/attachment-0001.html>