<div dir="ltr"><div>Hi Duncan,<br><br></div>No, it hasn't been reviewed yet.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 13, 2013 at 8:50 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Akira, did anything happen with this patch?<br>
<br>
Ciao, Duncan.<div><div class="h5"><br>
<br>
On 09/05/13 04:04, Akira Hatanaka wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
The following code snippet taken from StackColoring::<u></u>remapInstructions clears a<br>
mem operand if it can't guarantee whether the memoperand's underlying value<br>
aliases with the merged allocas:<br>
<br>
// Update the MachineMemOperand to use the new alloca.<br>
  522       for (MachineInstr::mmo_iterator MM = I->memoperands_begin(),<br>
....<br>
          // Climb up and find the original alloca.<br>
  532         V = GetUnderlyingObject(V);<br>
  533         // If we did not find one, or if the one that we found is not in our<br>
  534         // map, then move on.<br>
  535         if (!V || !isa<AllocaInst>(V)) {<br>
  536           // Clear mem operand since we don't know for sure that it doesn't<br>
  537           // alias a merged alloca.<br>
  538           MMO->setValue(0);<br>
  539           continue;<br>
  540         }<br>
<br>
The attached patch makes the code above less conservative. It avoids clearing a<br>
mem operand if its underlying value is a PseudoSourceValue and<br>
PseudoSourceValue::isConstant returns true. This enables MachineLICM to hoist<br>
loads from GOT out of a loop (see test case in stackcoloring-test.patch).<br>
<br>
Please review.<br>
<br>
Question: Why does it need to clear a mem operand if the underlying object is<br>
not an AllocaInst? I am not sure if I understand the reason for this.<br>
<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>