Amara Emerson via llvm-dev
2021-Oct-05 22:29 UTC
[llvm-dev] Can DBG_VALUE instructions use undefined vregs?
One GlobalISel compile time optimization patch (https://reviews.llvm.org/D109750 <https://reviews.llvm.org/D109750>) has generated some debate over whether it’s semantically allowed/not-an-error for a DBG_VALUE machine instruction to have a use of a vreg that doesn’t have a corresponding definition. We talked internally with Adrian and Vedant and didn’t come to a strong conclusion either way. Does anyone have thoughts here? Thanks, Amara -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211005/6b037184/attachment.html>
Matthias Braun via llvm-dev
2021-Oct-05 22:37 UTC
[llvm-dev] Can DBG_VALUE instructions use undefined vregs?
I can't really be speak about debug instructions in particular. For machine instructions in general you just mark the use operand with "undef" and you are good... - Matthias> On Oct 5, 2021, at 3:29 PM, Amara Emerson via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > One GlobalISel compile time optimization patch (https://reviews.llvm.org/D109750) has generated some debate over whether it’s semantically allowed/not-an-error for a DBG_VALUE machine instruction to have a use of a vreg that doesn’t have a corresponding definition. > > We talked internally with Adrian and Vedant and didn’t come to a strong conclusion either way. Does anyone have thoughts here? > > Thanks, > Amara > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Jeremy Morse via llvm-dev
2021-Oct-06 10:46 UTC
[llvm-dev] Can DBG_VALUE instructions use undefined vregs?
Hi, On Tue, Oct 5, 2021 at 11:29 PM Amara Emerson via llvm-dev <llvm-dev at lists.llvm.org> wrote:> One GlobalISel compile time optimization patch (https://reviews.llvm.org/D109750) has generated some debate over whether it’s semantically allowed/not-an-error for a DBG_VALUE machine instruction to have a use of a vreg that doesn’t have a corresponding definition.I don't think there's a semantic reason why DBG_VALUEs of undefined vregs should be disallowed -- they can be interpreted the same as a DBG_VALUE $noreg, just in a non-canonical form. They would correctly become DBG_VALUE $noreg's when LiveDebugVariables runs, as the vreg wouldn't be live. In practical terms, it could slightly mislead people reading MIR, and there might be code out there that expects to find a vreg definition for anything that DBG_VALUEs refer to, which I imagine would be fairly easy to work around. -- Thanks, Jeremy