[PATCH] D87136: [ARM][MachineOutliner] Add calls default handling.
Sam Parker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 05:18:54 PDT 2020
samparker added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp:5694
+ FrameDefault(target.isThumb() ? 2 : 4),
+ SaveRestoreLROnStack(target.isThumb() ? 8 : 8) {}
};
----------------
yroux wrote:
> samparker wrote:
> > yroux wrote:
> > > samparker wrote:
> > > > So this is the cost of the store and load, but don't we also need to consider the frame setup too?
> > > The variable NumBytesToCreateFrame is initialized to the default cost of the frame setup and then incremented by the cost of the load/store if needed
> > So I'm sorry if I'm just being a bit blind (and/or horribly confused!) But I see:
> >
> > ```
> > unsigned NumBytesToCreateFrame = Costs.FrameDefault;
> > NumBytesToCreateFrame += Costs.SaveRestoreLROnStack;
> > ```
> > Does this really translate the the cost of inserting:
> > - a call to the outlined function.
> > - a sub to adjust the stack pointer in the outlined function.
> > - the stack store of LR.
> > - the bx lr from the outlined function.
> > - the stack restore of LR.
> >
> > Am I missing some logic that calls SetCandidateCallInfo?
> Ok, let's look at the Default case for ARM mode:
>
> * The cost of the call to the outlined function is handled by the setCallInfo method of a candidate, in which Cost.CallDefault is passed.
> * Then for the frame:
> - I used a STR_PRE_IMM which decrement SP and store LR in 4 bytes
> - then LR and stack are restored LDR_POST_IMM which is alsor 4 bytes (so the cost of save and restore is 8)
> - and we have the BX LR, is cost is handled by FrameDefault (4 bytes)
>
Ah, indexed load/store! Sorry for missing that in the tests, thanks for clearing that up.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87136/new/
https://reviews.llvm.org/D87136
More information about the llvm-commits
mailing list