<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>><span style="color: rgb(33, 33, 33); font-size: 12pt;">I just noticed a possible issue with this, when trying to understand how</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>aliases are prevented from being passed to convertToDeclaration, which</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>would hit an llvm_unreachable. dropDeadSymbols uses a range based for</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>loop over the Module, which will only iterate through the functions. The</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>positive is that we avoid invoking convertToDeclaration for aliases, which</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>would be problematic currently as noted earlier. The negative is that we will</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>never call it for global variables. Is that desired behavior? </span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>In any case, a comment in dropDeadSymbols is warranted.</span><br>
</p>
<div style="color: rgb(33, 33, 33);">
<div>
<div dir="ltr">
<div>> </div>
<div>>Teresa</div>
</div>
<div class="gmail_extra"><br>
Hi Teresa, thanks for noticing. I do not think current behavior is desired,<br>
</div>
<div class="gmail_extra">opened bug: <a href="https://bugs.llvm.org/show_bug.cgi?id=36187">https://bugs.llvm.org/show_bug.cgi?id=36187</a>.<br>
<span style="font-size: 12pt;">I'll try to fix it.</span><br>
</div>
<div class="gmail_extra"><span style="font-size: 12pt;"><br>
</span></div>
<div class="gmail_extra"><span style="font-size: 12pt;">btw, I am also trying to investigate possible issues that might be relative with aliases</span></div>
<div class="gmail_extra">currently. I noticed that in a few places of LLVM we have duplicating code that<br>
</div>
<div class="gmail_extra">removes global variables and functions. It is very similar to <span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">convertToDeclaration</span>
 sometimes</div>
<div class="gmail_extra">and probably could be refactored, but issues <span style="font-size: 12pt;">I am going to
</span><span style="font-size: 12pt;">chec</span><span style="font-size: 12pt;">k</span><span style="font-size: 12pt;"> are</span><span style="font-size: 12pt;"> a bit different and </span><span style="font-size: 12pt;">relative to</span></div>
<div class="gmail_extra"><a href="https://github.com/llvm-mirror/llvm/blob/master/tools/bugpoint/ExtractFunction.cpp#L181">https://github.com/llvm-mirror/llvm/blob/master/tools/bugpoint/ExtractFunction.cpp#L181</a><br>
</div>
<div class="gmail_extra">Which seems used to delete aliases explicitly and it's comment also </div>
<div class="gmail_extra">saying "<span style="font-size: 12pt;">there might </span><span style="font-size: 12pt;">be an alias to an alias</span><span style="font-size: 12pt;">​". </span><br>
I am going to check if we need to do the something the same to what eliminateAliases​ do</div>
<div class="gmail_extra">and particulary if <span style="font-size: 12pt;">current code that marks symbols as dead works correctly with alias to alias case,</span></div>
<div class="gmail_extra">for example.<br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">George.<br>
</div>
<div class="gmail_extra"><br>
</div>
</div>
</div>
</body>
</html>