r187617 - Use function attributes to indicate if we don't want to realign the stack.

Nick Lewycky nlewycky at google.com
Fri Aug 2 12:57:26 PDT 2013


On 1 August 2013 14:41, Bill Wendling <isanbard at gmail.com> wrote:

> Author: void
> Date: Thu Aug  1 16:41:02 2013
> New Revision: 187617
>
> URL: http://llvm.org/viewvc/llvm-project?rev=187617&view=rev
> Log:
> Use function attributes to indicate if we don't want to realign the stack.
>
> Modified:
>     cfe/trunk/lib/CodeGen/BackendUtil.cpp
>     cfe/trunk/lib/CodeGen/CGCall.cpp
>
> Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=187617&r1=187616&r2=187617&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
> +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu Aug  1 16:41:02 2013
> @@ -451,7 +451,6 @@ TargetMachine *EmitAssemblyHelper::Creat
>    Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath;
>    Options.UseSoftFloat = CodeGenOpts.SoftFloat;
>    Options.StackAlignmentOverride = CodeGenOpts.StackAlignment;
> -  Options.RealignStack = CodeGenOpts.StackRealignment;
>    Options.DisableTailCalls = CodeGenOpts.DisableTailCalls;
>    Options.TrapFuncName = CodeGenOpts.TrapFuncName;
>    Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=187617&r1=187616&r2=187617&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Aug  1 16:41:02 2013
> @@ -1084,6 +1084,9 @@ void CodeGenModule::ConstructAttributeLi
>
>      FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf",
>                             llvm::toStringRef(NoFramePointerElimNonLeaf));
> +
> +    if (!CodeGenOpts.StackRealignment)
> +      FuncAttrs.addAttribute("no-realign-stack");
>    }
>

This is not what mstackrealign does. There are three stack realignment
modes, on off and forced. -mstackrealign forces a stack alignment to occur
on entry to every function. no-realign-stack (off) forbids realigning stack
even if you put a stack object on the stack which requires a higher
alignment than the stack provides.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130802/832cbc92/attachment.html>


More information about the cfe-commits mailing list