<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 22, 2016 at 10:50 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Jun 22, 2016 at 7:07 PM, Gerolf Hoflehner <span dir="ltr"><<a href="mailto:ghoflehner@apple.com" target="_blank">ghoflehner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Gerolf added a subscriber: Gerolf.<br>
<br>
================<br>
Comment at: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp:297<br>
@@ -231,3 +296,3 @@<br>
<br>
MemoryLocation Loc0 = MemoryLocation::get(Load0);<br>
MemoryLocation Loc1 = MemoryLocation::get(Load1);<br>
----------------<br>
Loc0,1 should be moved below the conditional. Then they are definitely needed.<br>
<br>
================<br>
Comment at: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp:346<br>
@@ -271,1 +345,3 @@<br>
HoistedInst->insertBefore(HoistPt);<br>
+ if (UseMemorySSA) {<br>
+ // We also hoist operands of loads using this function, so check to see if<br>
----------------<br>
This is a MSSA update problem. How about<br>
if (MSSA && MSSA->update(HoistCan, HoistedInst))<br>
MSSA->removeMemoryAccess(ElseInst);<br>
<br></blockquote><div></div></span></div></div></div></blockquote><div>Sorry, i cut this answer off too early.</div><div><br></div><div>I also meant to say: we deliberately assert in removeMemoryAccess if you try to remove something that has no memoryssa instruction, as it is a good way to find updating bugs in clients, etc.</div><div><br></div><div>In any case, i've moved the check to be dependent on MSSA and not UseMemorySSA, but i otherwise can't think of how to simplify it.</div><div><br></div></div></div></div>