[LLVMdev] x86 Frame Pointer with AVX
Eric Christopher
echristo at gmail.com
Tue Oct 23 10:39:52 PDT 2012
> Yes, I believe that this is happening if any AVX register is used in a
> function; an AVX variable does not necessarily need to be placed on the
> stack.
>
> Maybe I am misunderstanding this piece of code though...
>
>> // Be over-conservative: scan over all vreg defs and find whether
>> vector
>> // registers are used. If yes, there is a possibility that vector
>> register
>> // will be spilled and thus require dynamic stack realignment.
>> for (unsigned i = 0, e = RI.getNumVirtRegs(); i != e; ++i) {
>> unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
>> if (RI.getRegClass(Reg)->getAlignment() > StackAlignment) {
>> FuncInfo->setForceFramePointer(true); // <= Forces Frame Pointer
>> for any AVX reg use!!!
>> return true;
>> }
>> }
>
> Just to be pedantic, at one time this did work properly for AVX without
> adding the unnecessary frame pointer. It is a proper regression.
>
Yeah, I was remembering that code too. I wasn't sure if we'd fixed it
or not. It's definitely good for a bug report.
-eric
More information about the llvm-dev
mailing list