<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"Malgun Gothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I¡¯m currently writing an IR pass that¡¯s required to match a ¡®br¡¯ instruction (in IR) with a specific AST if statement. Matching itself can be done quite easily through DebugLoc, but I realized that the ¡®way¡¯ (as in where the control flow
 continues after it¡¯s been (not-)taken) of a branch can be changed in the course of IR optimizations. For example, a branch ¡®if (x == 0)¡¯ can be semantically transformed to ¡®if (x != 0)¡¯ in the resulting IR.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My question is, <i>how can I know such way-changing transformation has been done on which branches?</i> Or, is there any way I can prevent such way-changes during optimization?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal">Gwangmu Lee.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
<b><span style="font-size:11.0pt">Gwangmu Lee</span></b><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
<span style="font-size:11.0pt">Ph.D. Student<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
+82) 10 4114 7441<o:p></o:p></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
Room 615, Bldg 301, Seoul National University, <br>
Gwanak-ro 1, Gwanak-gu, Seoul, South Korea.<o:p></o:p></p>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
<a href="http://compsec.snu.ac.kr/~gwangmu">http://compsec.snu.ac.kr/~gwangmu</a><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" align="left" style="text-align:left;text-autospace:ideograph-numeric ideograph-other;word-break:keep-all">
<span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>