<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"David Callahan via llvm-dev" <llvm-dev@lists.llvm.org><br><b>To: </b>"LLVM Dev Mailing list" <llvm-dev@lists.llvm.org><br><b>Sent: </b>Wednesday, January 27, 2016 3:56:33 PM<br><b>Subject: </b>[llvm-dev] DCE in the presence of control flow.<br><br>






<style>
<!--
 
@font-face
        {font-family:"?? ??";
        mso-font-charset:78;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-536870145 1791491579 18 0 131231 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-536870145 1107305727 0 0 415 0;}
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-536870145 1073743103 0 0 415 0;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:-520092929 1073806591 9 0 415 0;}
 
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:Cambria;
        mso-ascii-font-family:Cambria;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:"?? ??";
        mso-fareast-theme-font:minor-fareast;
        mso-hansi-font-family:Cambria;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        font-family:Cambria;
        mso-ascii-font-family:Cambria;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:"?? ??";
        mso-fareast-theme-font:minor-fareast;
        mso-hansi-font-family:Cambria;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.WordSection1
        {page:WordSection1;}
-->
</style>

<div>
<p class="MsoNormal">I have been looking at some internal codes looking for differences between Clang (specifically 3.7.1) and gcc (typically 4.8.1 but sometimes later).</p>
<p class="MsoNormal"> </p>
<p id="DWT1743" class="MsoNormal">One area where I bumped into was dead code elimination in the presence of complex control flow. I note that the “aggressive dead code elimination” (ADCE.cpp) treats all branch operations as live (<span style="font-size: 10pt; font-family: Consolas;">isa<TerminatorInst>(I)). 
</span>Doing more requires some approximation to control dependence.</p></div></blockquote><br>Can you provide a small example where this matters?<br><br> -Hal<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><p class="MsoNormal"></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I note SimplifyCFG indirectly handles some simple cases. It will speculate the contents of a basic block into a predecessor but this is insufficient for more complex structures. This probably cherry-picks the most common cases by frequency.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Have their been prior attempts strengthen dead code elimination w.r.t. control flow? If so, any guidance on what went wrong?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks</p>
<p class="MsoNormal">David</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Consolas;"> </span></p>
</div>
<br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>