<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>It appears that this behaviour of InstCombine is at least somewhat intended, as there are several tests that fail after the change mentioned before:
</span><span style="font-family: Consolas, Courier, monospace;">cast.ll</span><span>,
</span><span style="font-family: Consolas, Courier, monospace;">gep-addrspace.ll</span><span> and
</span><span style="font-family: Consolas, Courier, monospace;">getelementptr.ll</span><span> in
</span><span style="font-family: Consolas, Courier, monospace;">test/Transforms/InstCombine</span><span>.<br>
</span>
<div>I feel a little uncomfortable applying the patch after knowing this, and removing those tests doesn't seem like a great solution.<br>
</div>
<div>What are your thoughts?<br>
</div>
<div><br>
</div>
<div>For now, I think I can work around my original issue since the CUDA driver seems to optimise away the additional ADD in most cases.<br>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Van:</b> Matt Arsenault <whatmannerofburgeristhis@gmail.com> namens Matt Arsenault <arsenm2@gmail.com><br>
<b>Verzonden:</b> maandag 23 maart 2020 19:05<br>
<b>Aan:</b> Thomas Faingnaert <thomas.faingnaert@hotmail.com><br>
<b>CC:</b> Johannes Doerfert <johannesdoerfert@gmail.com>; llvm-dev@lists.llvm.org <llvm-dev@lists.llvm.org><br>
<b>Onderwerp:</b> Re: [llvm-dev] [InstCombine] Addrspacecast and GEP assumed commutative</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space"><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 23, 2020, at 10:52, Thomas Faingnaert via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Calibri,Helvetica,sans-serif">Would replacing this by<span class="x_Apple-converted-space"> </span></span><span class="" style="font-family:Consolas,Courier,monospace">stripPointerCastsSameRepresentation</span><span class="" style="font-family:Calibri,Helvetica,sans-serif"><span class="x_Apple-converted-space"> </span>be
 an acceptable solution, or do other parts of LLVM rely on this reordering?</span></div>
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Calibri,Helvetica,sans-serif">If not, I can send a patch in Phabricator to address this issue.</span></div>
</div>
</blockquote>
</div>
<br class="">
<div class="">This is probably the right solution. Nothing should be relying on this anyway</div>
<div class=""><br class="">
</div>
<div class="">-Matt</div>
</div>
</div>
</body>
</html>