<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 19, 2015 at 2:38 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+ // FIXME: If scheduling has moved an ARGUMENT virtual register, move it back,<br>
+ // and recompute liveness. This is a temporary hack.<br>
+ bool SawNonArg = false;<br>
+ bool MovedArg = false;<br>
+ MachineBasicBlock &EntryMBB = MF.front();<br>
+ for (auto MII = EntryMBB.begin(); MII != EntryMBB.end(); ) {<br>
+ MachineInstr *MI = &*MII++;<br>
+ if (MI->getOpcode() == WebAssembly::ARGUMENT_I32 ||<br>
+ MI->getOpcode() == WebAssembly::ARGUMENT_I64 ||<br>
+ MI->getOpcode() == WebAssembly::ARGUMENT_F32 ||<br>
+ MI->getOpcode() == WebAssembly::ARGUMENT_F64) {<br>
+ EntryMBB.insert(EntryMBB.begin(), MI->removeFromParent());<br>
+ if (SawNonArg)<br>
+ MovedArg = true;<br>
+ } else {<br>
+ SawNonArg = true;<br>
+ }<br>
+ }<br>
+ if (MovedArg) {<br>
+ SlotIndexes &Slots = getAnalysis<SlotIndexes>();<br>
+ Liveness->releaseMemory();<br>
+ Slots.releaseMemory();<br>
+ Slots.runOnMachineFunction(MF);<br>
+ Liveness->runOnMachineFunction(MF);<br>
+ }<br><br></blockquote><div><br></div></div></div><div>How temporary is this and do you plan on making the arguments non-schedulable? (Which is arguably what should be happening right? They should be the equivalent to an alloca yes?)</div></div></div></blockquote><div><br></div><div>I already wrote code to replace it: <a href="http://reviews.llvm.org/D14750">http://reviews.llvm.org/D14750</a> . If that patch isn't accepted, I'll go back to the drawing board to find some other way to pin the instructions to the top of the block. I don't yet have an idea for doing this, but it would be a high priority to find one.<br><br></div><div>Dan<br><br></div></div></div></div>