Well, I was hinting at LLVM_DEBUG messages. You can pretty much dump all "actions" Tablegen would take to process a .td file, which should suffice, IMO. On Wed, Aug 5, 2020 at 5:59 PM Paul C. Anagnostopoulos <paul at windfall.com> wrote:> Your reply suggests that there is a way to see debug messages from > TableGen. Is that what you meant? If so, can you explain how that works? > (Sorry, I should know the answer to this question, but I'm quite the > newbie.) > > At 8/5/2020 04:15 AM, Madhur Amilkanthwar wrote: > >Hi Paul, > >If all you care about is debugging then for now we can just emit a few > more debug messages which would help to "trace" the flow. To distinguish > traces you can prefix it with some known string. I don't think you really > need a 'trace' tag in the language spec for this. > > > >Debugging Tablegen has always been a nightmare and I don't think we can > ever reach a stage where we can start a debugger and debug statements in > .td files step-by-step. This is far from reality unless we fundamentally > change the language. > >-- *Disclaimer: Views, concerns, thoughts, questions, ideas expressed in this mail are of my own and my employer has no take in it. * Thank You. Madhur D. Amilkanthwar -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200805/86d4cb3b/attachment.html>
Paul C. Anagnostopoulos via llvm-dev
2020-Aug-05 14:00 UTC
[llvm-dev] TableGen trace facility
I'm sorry, I still don't understand. I presume you are talking about the LLVM_DEBUG() macro that is enabled with the -debug option. But there are no uses of LLVM_DEBUG() in the TableGen base files. Wouldn't the base "compiler" have to display the information we're talking about? Or is it sufficient to use LLVM_DEBUG() in the target-specific files? At 8/5/2020 08:40 AM, Madhur Amilkanthwar wrote:>Well, I was hinting at LLVM_DEBUG messages. You can pretty much dump all "actions" Tablegen would take to process a .td file, which should suffice, IMO. > > >On Wed, Aug 5, 2020 at 5:59 PM Paul C. Anagnostopoulos <<mailto:paul at windfall.com>paul at windfall.com> wrote: >Your reply suggests that there is a way to see debug messages from TableGen. Is that what you meant? If so, can you explain how that works? (Sorry, I should know the answer to this question, but I'm quite the newbie.) > >At 8/5/2020 04:15 AM, Madhur Amilkanthwar wrote: >>Hi Paul, >>If all you care about is debugging then for now we can just emit a few more debug messages which would help to "trace" the flow. To distinguish traces you can prefix it with some known string. I don't think you really need a 'trace' tag in the language spec for this. >> >>Debugging Tablegen has always been a nightmare and I don't think we can ever reach a stage where we can start a debugger and debug statements in .td files step-by-step. This is far from reality unless we fundamentally change the language.
Hi Paul, On Wed, Aug 5, 2020 at 4:04 PM Paul C. Anagnostopoulos <paul at windfall.com> wrote:> I'm sorry, I still don't understand. I presume you are talking about the LLVM_DEBUG() macro that is enabled with the -debug option. But there are no uses of LLVM_DEBUG() in the TableGen base files. Wouldn't the base "compiler" have to display the information we're talking about? Or is it sufficient to use LLVM_DEBUG() in the target-specific files?Trying to interpret what Madhur is saying, maybe adding some uses of LLVM_DEBUG() to TableGen would be a good idea. Cheers, Nicolai> > At 8/5/2020 08:40 AM, Madhur Amilkanthwar wrote: > >Well, I was hinting at LLVM_DEBUG messages. You can pretty much dump all "actions" Tablegen would take to process a .td file, which should suffice, IMO. > > > > > >On Wed, Aug 5, 2020 at 5:59 PM Paul C. Anagnostopoulos <<mailto:paul at windfall.com>paul at windfall.com> wrote: > >Your reply suggests that there is a way to see debug messages from TableGen. Is that what you meant? If so, can you explain how that works? (Sorry, I should know the answer to this question, but I'm quite the newbie.) > > > >At 8/5/2020 04:15 AM, Madhur Amilkanthwar wrote: > >>Hi Paul, > >>If all you care about is debugging then for now we can just emit a few more debug messages which would help to "trace" the flow. To distinguish traces you can prefix it with some known string. I don't think you really need a 'trace' tag in the language spec for this. > >> > >>Debugging Tablegen has always been a nightmare and I don't think we can ever reach a stage where we can start a debugger and debug statements in .td files step-by-step. This is far from reality unless we fundamentally change the language. >-- Lerne, wie die Welt wirklich ist, aber vergiss niemals, wie sie sein sollte.