Adrian Prantl via llvm-dev
2019-Jan-14 16:26 UTC
[llvm-dev] Metadata/DebugInfo in *.ll file
Generally, a good strategy is to look at what Clang generates for similar code and mimic that in your IR generator. -- adrian
Norbert Dajka via llvm-dev
2019-Jan-15 13:11 UTC
[llvm-dev] Metadata/DebugInfo in *.ll file
Yes, this is for a front-end-ish project. I generate LLVM IR from assembly. The result is optimized through several builtin passes, like simplify cfg, value propagation, simple const propagation, etc. I tried setDebugLoc, but it gets dropped. Aside from simplify CFG, I can't see where this happens, and it is already dropped before simplify cfg. It looks like I would be better off adding instruction metadata after generating IR, outside LLVM, instead of forcing it to process things backwards. Adrian Prantl <aprantl at apple.com> ezt írta (időpont: 2019. jan. 14., H, 17:26):> Generally, a good strategy is to look at what Clang generates for similar > code and mimic that in your IR generator. > > -- adrian >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190115/ed3d8013/attachment.html>
Roman Lebedev via llvm-dev
2019-Jan-15 13:19 UTC
[llvm-dev] Metadata/DebugInfo in *.ll file
On Tue, Jan 15, 2019 at 4:11 PM Norbert Dajka via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Yes, this is for a front-end-ish project. I generate LLVM IR from assembly. > The result is optimized through several builtin passes, like simplify cfg, value propagation, > simple const propagation, etc. I tried setDebugLoc, but it gets dropped.Pretty sure this is just a bug in LLVM. Some pointers: https://reviews.llvm.org/D40512 https://llvm.org/devmtg/2018-04/slides/Bedwell-Measuring_the_User_Debugging_Experience.pdf https://lists.llvm.org/pipermail/llvm-dev/2018-August/125780.html https://bugs.llvm.org/show_bug.cgi?id=38768 Would be a good idea for you to verify that it still happens with trunk, come up with a minimal test case, and file a bug.> Aside from simplify CFG, > I can't see where this happens, and it is already dropped before simplify cfg. > It looks like I would be better off adding instruction metadata after generating IR, outside LLVM, > instead of forcing it to process things backwards. > > Adrian Prantl <aprantl at apple.com> ezt írta (időpont: 2019. jan. 14., H, 17:26): >> >> Generally, a good strategy is to look at what Clang generates for similar code and mimic that in your IR generator. >> >> -- adrianRoman.> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev