[LLVMdev] Fixing segmented stacks
grosbach at apple.com
Tue Oct 18 14:56:27 PDT 2011
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.
More information about the llvm-dev