[dragonegg] r187105 - Try to update to set the no-frame-pointer-elim-non-leaf attribute as a function attribute instead of target option.
Bill Wendling
isanbard at gmail.com
Thu Jul 25 11:18:55 PDT 2013
On Jul 25, 2013, at 9:35 AM, David Blaikie <dblaikie at gmail.com> wrote:
> On Wed, Jul 24, 2013 at 11:20 PM, Bill Wendling <isanbard at gmail.com> wrote:
>> Author: void
>> Date: Thu Jul 25 01:20:06 2013
>> New Revision: 187105
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=187105&view=rev
>> Log:
>> Try to update to set the no-frame-pointer-elim-non-leaf attribute as a function attribute instead of target option.
>>
>> Modified:
>> dragonegg/trunk/src/Backend.cpp
>> dragonegg/trunk/src/Convert.cpp
>>
>> Modified: dragonegg/trunk/src/Backend.cpp
>> URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=187105&r1=187104&r2=187105&view=diff
>> ==============================================================================
>> --- dragonegg/trunk/src/Backend.cpp (original)
>> +++ dragonegg/trunk/src/Backend.cpp Thu Jul 25 01:20:06 2013
>> @@ -484,11 +484,9 @@ static void CreateTargetMachine(const st
>> if (flag_omit_frame_pointer) {
>> // Eliminate frame pointers everywhere.
>> Options.NoFramePointerElim = false;
>> - Options.NoFramePointerElimNonLeaf = false;
>> } else {
>> // Keep frame pointers everywhere.
>> Options.NoFramePointerElim = true;
>> - Options.NoFramePointerElimNonLeaf = true;
>> }
>> // If a target has an option to eliminate frame pointers in leaf functions
>> // only then it should set
>>
>> Modified: dragonegg/trunk/src/Convert.cpp
>> URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=187105&r1=187104&r2=187105&view=diff
>> ==============================================================================
>> --- dragonegg/trunk/src/Convert.cpp (original)
>> +++ dragonegg/trunk/src/Convert.cpp Thu Jul 25 01:20:06 2013
>> @@ -1034,6 +1034,14 @@ void TreeToLLVM::StartFunctionBody() {
>> if (lookup_attribute("naked", DECL_ATTRIBUTES(FnDecl)))
>> Fn->addFnAttr(Attribute::Naked);
>>
>> + if (flag_omit_frame_pointer) {
>> + // Eliminate frame pointers everywhere.
>> + Fn->addFnAttr("no-frame-pointer-elim-non-leaf", "false");
>
> Curious choice to do this with if (x) { addFnAttribute } else {
> addFnAttribute } here whereas to use the conditional operator in the
> Clang change for the same.
The clang change was a bit more involved than just a regular if-then. But it doesn't really make much difference.
> As I mentioned there, presumably we want a
> simple bool->StringRef (if we don't already) & just
> Fn->addFnAttr("no-frame-pointer-elim-non-leaf",
> ToString(!flag_omit_frame_pointer))
>
I suppose that might be useful. But it's low on my priority list right now. :-(
> Speaking of which:
>
> If the flag has to be present anyway, should we avoid the negative in
> it & just name it "frame-pointer-slim-non-leaf"?
>
It might be nice to do that. But it will involve changing how it's used throughout the code...
-bw
More information about the llvm-commits
mailing list