<div dir="ltr"><span style="font-size:13px;line-height:19.5px">Hi all,</span><div style="font-size:13px;line-height:19.5px">Virtual ISAs such as WebAssembly and NVPTX use infinite virtual register sets instead of traditional phsyical registers. PrologEpilogInserter is run after register allocation and asserts that all virtuals have been allocated but doesn't otherwise depend on this if scavenging is not needed. We'd like to use the target-independent PEI code for WebAssembly, so we're proposing a TargetRegisterInfo hook for targets to indicate that they use virtual registers in this way (currently called usesVirtualRegstersAfterRegAlloc(), other suggestions welcome). The code is at<a href="http://reviews.llvm.org/D15394" target="_blank" class="cremed">http://reviews.llvm.org/D15394</a> and an example of the intended use for WebAssembly is at <a href="http://reviews.llvm.org/D15344" target="_blank" class="cremed">http://reviews.llvm.org/D15344</a> .</div><div style="font-size:13px;line-height:19.5px"><br></div><div style="font-size:13px;line-height:19.5px">The actual change to PrologEpilogInserter itself is quite minimal, but we thought we'd ask a wider audience for feedback since it's a target-independent change. For WebAssembly we would implement prolog/epilog insertion and FrameIndex elimination but most of the rest of the PEI code (dealing with callee-saved registers, scavenging) does nothing.<br></div><div style="font-size:13px;line-height:19.5px"><br></div><div style="font-size:13px;line-height:19.5px">For other reference the NVPTX backend currently disables the PrologEpilogInserter pass but has its own pass which is just a copy (inevitably slightly out-of-date) of PEI with the irrelevant bits just deleted; it could probably be updated to use this mechanism too.</div><div style="font-size:13px;line-height:19.5px"><br></div><div style="font-size:13px;line-height:19.5px">Any comments?</div><div style="font-size:13px;line-height:19.5px">Thanks,</div><div style="font-size:13px;line-height:19.5px">-Derek</div></div>