<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 28, 2017 at 8:31 AM Adrian Prantl via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:1577<br>
+  for(auto *GV : GVs)<br>
+    NewGV->addDebugInfo(GV);<br>
+<br>
----------------<br>
I'm not familiar with this transformation: Do we need to add a DIExpression to mask out all but the first bit (i.e. can multiple bools be packed into the same uint32_t such that it could confuse debuggers)?<br>
<br>
<br>
================<br>
Comment at: test/Transforms/GlobalOpt/static-global-boolean-dwarf.c:2<br>
+// RUN: clang -g -O2 -c %s -o %t<br>
+// RUN: llvm-dwarfdump %t | FileCheck %s<br>
+<br>
----------------<br>
We shouldn't require a frontend to be available when running tests. Can you use thew output of clang -S -emit-llvm instead an run it through opt?<br></blockquote><div><br>Also I imagine the test could be further minimized? Is the enum necessary, for example (oh, perhaps since it's C it is? not sure - I'd probably write it in C++ using 'bool')? Could it be simplified by having the boolean value (but not its address) leak out of the translation unit - though I guess that's what 'get_foo' does. Does init_boolean need to be that complicated? Or could it be : "void set_foo(bool b) { foo = b; }" & still trigger the right amount of optimization? (so I'd expect the test case to come down to: "static bool foo; void set_foo(bool b) { foo = b; } bool get_foo() { return foo; }")<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D35994" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35994</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>