JinGu Kang via llvm-dev
2019-Aug-15 15:03 UTC
[llvm-dev] Question about 'outs' and 'PredicateOperand' on TableGen
Hi All, I have a question about 'outs' and 'PredicateOperand' on TableGen. Let's see simple TableGen example. def pred : PredicateOperand<OtherVT, (ops ..)>; def test_cmp : TestInst<(outs pred:$dst0), ... >; ... Above definitions cause TableGen crash. It seems below code causes the crash. On utils/TableGen/CodeGenDAGPatterns.cpp static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) { ... // Subtract any defaulted outputs. for (unsigned i = 0; i != InstInfo.Operands.NumDefs; ++i) { Record *OperandNode = InstInfo.Operands[i].Rec; if (OperandNode->isSubClassOf("OperandWithDefaultOps") && ==> I think it checks 'PredicateOperand'. !CDP.getDefaultOperand(OperandNode).DefaultOps.empty()) --NumDefsToAdd; } ...>From above code, I guess we can not use 'PredicateOperand' on 'outs'. Is it one of TableGen's rule? I was not able to find the related rules... In my case, the output of compare instruction is in predicate register rather than status register and it is used for predication of instructions. If anyone knows about it or I missed something, please let me know.Thanks JinGu Kang Software Engineer Codeplay Software Ltd Level C Argyle House, 3 Lady Lawson Street, Edinburgh, United Kingdom, EH3 9DR<http://maps.google.co.uk/?q=EH3%209DR> Tel: +44 (0)131 466 0503 Website: http://www.codeplay.com<http://www.codeplay.com/> Twitter: https://twitter.com/codeplaysoft This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it, or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated. As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments. Company registered in England and Wales, number: 04567874 Registered office: Regent House, 316 Beulah Hill, London, United Kingdom, SE19 3HF -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190815/d8e7f642/attachment.html>