[llvm-commits] [llvm] r160002 - in /llvm/trunk: include/llvm/CodeGen/MachineFrameInfo.h lib/Target/X86/X86FrameLowering.cpp lib/Target/X86/X86RegisterInfo.cpp lib/Target/X86/X86RegisterInfo.h test/CodeGen/X86/alloca-align-rounding-32.ll test/Code

Chad Rosier mcrosier at apple.com
Tue Jul 31 10:21:26 PDT 2012


On Jul 31, 2012, at 10:07 AM, Anton Korobeynikov wrote:

>> Yes, this change is definitely the problem.  I used EBX as the base pointer
>> because it appeared to work with all the calling conventions, but it can be
>> changed in X86RegisterInfo.cpp.  If there is callee-saved register that
>> isn't used by any ABI, then that would be the ideal choice.  Otherwise, I
>> think the solution would be to probe the subtarget and ask for the base
>> pointer register.  If that sounds reasonable I'll start working on a patch.
> gcc uses ecx here. However, the best solution is to ask register
> scavenger for free register.

Based on a discussion with Jakob, I don't think asking the register scavenger for a free register will work.  A scavenged register is only guaranteed live at a particular point in the code, but the base pointer needs to be live across the entire function.

> I think extreme case here is PIC + regparm(3) o x86-32.
> 
> -- 
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-commits mailing list