<div dir="ltr">There is actually a much simpler fix you sholdl use.<div><br></div><div>return instructionClobbersQuery(MD, MU MemoryLocOrCall(MU), AA);</div><div><br></div><div>You need to move that version of instructionClobbersQuery up, but it was built to always do the right thing.</div><div><br></div><div>Also note it will properly handle a case you are not: Fences do not have memorylocations, and calling get on them will also crash.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 6:43 PM, Sebastian Pop <span dir="ltr"><<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sebpop created this revision.<br>
sebpop added a reviewer: dberlin.<br>
sebpop added a subscriber: llvm-commits.<br>
<br>
For some reason in the cleanup or in the change I did to use the MemorySSA.cpp interface, I introduced more calls to MemoryLocation::get() without checking whether the instruction was a call.<br>
I will apply this patch on top of yesterday's fix (that got reverted.)<br>
This should fix the ICE in Chromium builds.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25542" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25542</a><br>
<br>
Files:<br>
  lib/Transforms/Utils/<wbr>MemorySSA.cpp<br>
<br>
<br>
Index: lib/Transforms/Utils/<wbr>MemorySSA.cpp<br>
==============================<wbr>==============================<wbr>=======<br>
--- lib/Transforms/Utils/<wbr>MemorySSA.cpp<br>
+++ lib/Transforms/Utils/<wbr>MemorySSA.cpp<br>
@@ -257,8 +257,13 @@<br>
 // Return true when MD may alias MU, return false otherwise.<br>
 bool defClobbersUseOrDef(MemoryDef *MD, const MemoryUseOrDef *MU,<br>
                          AliasAnalysis &AA) {<br>
-  Instruction *Insn = MU->getMemoryInst();<br>
-  return instructionClobbersQuery(MD, MemoryLocation::get(Insn), Insn, AA);<br>
+  Instruction *UseInst = MU->getMemoryInst();<br>
+  MemoryLocation UseLoc;<br>
+  if (ImmutableCallSite(UseInst))<br>
+    UseLoc = MemoryLocation();<br>
+  else<br>
+    UseLoc = MemoryLocation::get(UseInst);<br>
+  return instructionClobbersQuery(MD, UseLoc, UseInst, AA);<br>
 }<br>
 }<br>
<br>
<br>
<br>
</blockquote></div><br></div>