<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">The documentation is correct, and the observation that the IR verifier is currently not verifying this property is also correct. Due to the way that dbg.declares are handled by later stages, LLVM can only keep track of one dbg.declare per variable and that is intentional. The dbg.declare intrinsic is supposed to pin a variable to a stack slot, such as in the code that clang emits at -O0. If you need something different, use dbg.value. Adding a verifier check would be appreciated, but it may be a bit of work to get all of LLVM to adhere to it.<br class=""><div><br class=""></div><div>-- adrian</div><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 4, 2020, at 10:11 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+Aprantl for debug info IR metadata verifier things<br class=""><br class="">I don't think the verifier's rigorously comprehensive - so probably somewhere between "intended/acceptable" and "a bug".<br class=""><br class="">Not sure what the consequences might be.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 4, 2020 at 10:03 PM Xun Li via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br class="">
<br class="">
In the LLVM documentation it says "there can only be one call to<br class="">
llvm.dbg.declare for a given concrete local variable."<br class="">
However we don't seem to be checking it. opt tool can process IR that<br class="">
violates this rule without complaining. Is this intended, or is it a<br class="">
bug? What would be the consequence when this constraint is broken?<br class="">
<br class="">
-- <br class="">
Xun<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>