On Oct 18, 2011, at 2:46 PM, Jakob Stoklund Olesen wrote:> > On Oct 18, 2011, at 2:33 PM, Sanjoy Das wrote: > >>> it should be expanded late: In lib/Target/X86/X86MCInstLower.cpp. >> >> This is exactly what I was missing. Thanks a ton! :) > > We have three pseudo expansion passes: > > 1. ExpandISelPseudos.cpp - For instructions that may need to create basic blocks, like CMOV and atomics. > > 2. ExpandPostRAPseudos.cpp - For instructions used to trick the register allocator into doing the right thing, and COPY instructions created by live range splitting. > > 3. *MCInstLower.cpp - For instructions that need to trick all of codegen. > > Pseudos should be expanded as early as possible. Many of the instructions currently expanded in X86MCInstLower could be moved to the PostRA expansion pass. That would also allow them to be converted into pure isPseudo=1 instructions instead of just isCodeGenOnly=1.FWIW, even those expanded at MCLowering time can be pure pseudos. There is no need to use isCodeGenOnly definitions for any new code. Those that exist are pure legacy. -Jim
Hi! The first patch fixes the problem of a MOV after a RET by emitting a fake instruction (as suggested by Duncan), which is lowered in MCInstLower. The second patch fixes a bug reported by -verify-machineinstrs. Thanks! -- Sanjoy Das http://playingwithpointers.com -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Use-a-fake-instruction-for-the-stack-expansion-seque.patch Type: text/x-diff Size: 5276 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111023/c14374eb/attachment.patch> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Fixes-an-issue-reported-by-verify-machineinstrs.patch Type: text/x-diff Size: 4297 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111023/c14374eb/attachment-0001.patch>
On 10/23/2011 03:24 AM, Sanjoy Das wrote:> Hi! > > The first patch fixes the problem of a MOV after a RET by emitting a > fake instruction (as suggested by Duncan), which is lowered in > MCInstLower. > > The second patch fixes a bug reported by -verify-machineinstrs.Do you want to add -verify-machineinstrs to the test? Your patch looks good to me. I will commit it tomorrow if no one objects.> Thanks!Thanks, Rafael