<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 23, 2018, at 9:53 AM, Adrian Prantl via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><span style="font-family: Menlo-Regular;" class="">[resending with a bugfix s/x/y/ in my example]</span></div><span style="font-family: Menlo-Regular;" class=""><div class=""><span style="font-family: Menlo-Regular;" class=""><br class=""></span></div>We still have to support constant dbg.values that need to be at a specific point in the instruction stream and don't refer to any SSA value.</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class="">For example, we can still have code like this:</span><br style="font-family: Menlo-Regular;" class=""><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> int x = foo();</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> int y = 42;</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> bar();</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> y = x;</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> baz();</span><br style="font-family: Menlo-Regular;" class=""><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class="">that might lower into IR like</span><br style="font-family: Menlo-Regular;" class=""><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> %x = call i32 @foo()</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> call void @llvm.dbg.value(i32 %x, DIVariable("x"), ...)</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> call void @llvm.dbg.value(i32 42, DIVariable("y"), ...)</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> call void @bar()</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> call void @llvm.dbg.value(i32 %x, DIVariable("y"), ...) ; %x is not materialized here, and we also can't hoist this.</span><br style="font-family: Menlo-Regular;" class=""><span style="font-family: Menlo-Regular;" class=""> call void @foo()</span><br style="font-family: Menlo-Regular;" class=""></div></div></blockquote><div><br class=""></div><div>Maybe I am misunderstanding the proposal, but I would imagine this to be modeled similar to this:</div><div><br class=""></div><div>%x = call i32 @foo() !debug-variable X0, !debug-variable Y1</div><div>call @bar()</div><div>call @foo()</div><div><br class=""></div><div>now we have two tables for the X and Y debug variables:</div><div><br class=""></div><div>X0 (line xxx-yyy)</div><div><br class=""></div><div>Y0 - Constant 42 (line xxx-yyy)</div><div>Y1 (line yyy-zzz)</div><div><br class=""></div><div>- Matthias</div></div></body></html>