search for: eliminatecallframepseudoinstr

Displaying 13 results from an estimated 13 matches for "eliminatecallframepseudoinstr".

2013 Feb 19
2
[LLVMdev] eliminateCallFramePseudoInstr belongs in TargetRegisterInfo or TargetFrameLowering
Hi all, I ran into this while trying to figure out why the X86 getSUBriOpcode/getADDriOpcode functions are duplicated, appearing once in X86RegisterInfo.cpp and once in X86FrameLowering.cpp, The method TargetRegisterInfo::eliminateCallFramePseudoInstr doesn't appear to really belong in this interface. It adds instructions into the MachineFunction given to it, which isn't what TargetRegisterInfo is supposed to do. ISTM that eliminateCallFramePseudoInstr belongs in TargerFrameLowering, since it's being used during prolog/epilog insert...
2013 Feb 19
0
[LLVMdev] eliminateCallFramePseudoInstr belongs in TargetRegisterInfo or TargetFrameLowering
> ISTM that eliminateCallFramePseudoInstr belongs in > TargerFrameLowering, since it's being used during prolog/epilog > insertion. Moving it there would avoid the code duplication and > possibly other layering problems. > What do you think Go ahead and move. It's s historical artifact why it is inside TRI. -- With be...
2016 Mar 31
0
API Change: TargetFrameLowering::eliminateCallFramePseudoInstr
Heads up for out-of-tree targets: in r265036, TargetFrameLowering::eliminateCallFramePseudoInstr changed to return an iterator to the next instruction, instead of returning void. If your target was previously doing "MBB.erase(I); return;" your code should now be doing "return MBB.erase(I);". Thanks, Hans
2018 Jul 21
2
Finding scratch register after function call
For a Z80 backend, "eliminateCallFramePseudoInstr()" shall adjust the stack pointer in three possible ways, e.g. after a function call, depending on the amount (= adjustment size) *and some other rules*: 1. via one or more target "pop <reg>" instructions (SP increments +2 per instruction), using an unused reg (disregarding...
2007 Apr 24
0
[LLVMdev] (no subject)
.... At these point, they have a constant arguments which corresponds to the fixed frame size for argument passing. But the size of the stack frame isn't finalized until frame layout has been completed, these are not translated into stack dec / inc until very late (see X86RegisterInfo.cpp::eliminateCallFramePseudoInstr). May I ask why are you adding a command line option to control stack frame size? If you must do it, it should be separate from the general mechanism. You can add a couple of special instructions that are "flagged" to the CALLSEQ nodes that will be emitted as stack inc / dec code...
2007 Apr 24
2
[LLVMdev] (no subject)
Hello, I am trying to add an instruction before each function call to add/ subtract the stack pointer by a value specified at the command line. I wonder if I can do that during lowering. For example, in X86TargetLowering::LowerCALL. I appreciate it if you give me some hints how and where I can do that. Thank you, Babak
2007 Oct 05
0
[LLVMdev] RFC: Tail call optimization X86
...Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], Ops.size()); InFlag = Chain.getValue(1); The third operand is the number of bytes the callee pops of the stack on return (on x86). This gets lowered to a ADJCALLSTACKUP pseudo machineinstruction. Later when X86RegisterInfo::eliminateCallFramePseudoInstr is called and framepointerelimination is enabled the following code gets called: ... else if (I->getOpcode() == X86::ADJCALLSTACKUP) { // If we are performing frame pointer elimination and if the callee pops // something off the stack pointer, add it back. We do this until we...
2007 Oct 04
3
[LLVMdev] RFC: Tail call optimization X86
Comments: CheckDAGForTailCallsAndFixThem - 1. for (SelectionDAG::allnodes_iterator BE = DAG.allnodes_begin(), + BI = prior(DAG.allnodes_end()); BI != BE; BI--) { Please use pre-decrement instead of post-decrement. 2. The function is slower than it should be. You are scanning all the nodes in the DAG twice. You should just examine DAG.getRoot() to make determine whether it's a
2007 Oct 05
6
[LLVMdev] RFC: Tail call optimization X86
..._END, NodeTys, &Ops[0], Ops.size > ()); > InFlag = Chain.getValue(1); > > The third operand is the number of bytes the callee pops of the > stack on return (on x86). This gets lowered to a ADJCALLSTACKUP > pseudo machineinstruction. > > Later when X86RegisterInfo::eliminateCallFramePseudoInstr is called > and framepointerelimination is enabled the following code gets called: > ... > else if (I->getOpcode() == X86::ADJCALLSTACKUP) { > // If we are performing frame pointer elimination and if the > callee pops > // something off the stack pointer, add it ba...
2007 Oct 05
0
[LLVMdev] RFC: Tail call optimization X86
....size >> ()); >> InFlag = Chain.getValue(1); >> >> The third operand is the number of bytes the callee pops of the >> stack on return (on x86). This gets lowered to a ADJCALLSTACKUP >> pseudo machineinstruction. >> >> Later when X86RegisterInfo::eliminateCallFramePseudoInstr is called >> and framepointerelimination is enabled the following code gets >> called: >> ... >> else if (I->getOpcode() == X86::ADJCALLSTACKUP) { >> // If we are performing frame pointer elimination and if the >> callee pops >> // somethi...
2013 Sep 26
0
[LLVMdev] Register scavenger and SP/FP adjustments
...ed to track the SP adjustment for frame index elimination. if (TFI->canSimplifyCallFramePseudos(Fn)) => TFI->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I); Perhaps there is a bug in canSimplifyCallFramePseudos? Evan On Sep 26, 2013, at 12:00 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: > Consider this example: > > --- ex.ll --- > declare void @bar() > > ; Function Attrs: nounwind...
2013 Sep 26
1
[LLVMdev] Register scavenger and SP/FP adjustments
.../ the target doesn't indicate otherwise, remove the call frame pseudos > // here. The sub/add sp instruction pairs are still inserted, but we don't > // need to track the SP adjustment for frame index elimination. > if (TFI->canSimplifyCallFramePseudos(Fn)) > => TFI->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I); > > Perhaps there is a bug in canSimplifyCallFramePseudos? > > Evan > > On Sep 26, 2013, at 12:00 PM, Krzysztof Parzyszek > <kparzysz at codeaurora.org <mailto:kparzysz at codeaurora.org>> wrote: > >> Consider this example: >&...
2013 Sep 26
2
[LLVMdev] Register scavenger and SP/FP adjustments
Consider this example: --- ex.ll --- declare void @bar() ; Function Attrs: nounwind optsize define void @main() { entry: %hin = alloca [256 x i32], align 4 %xin = alloca [256 x i32], align 4 call void @bar() ret void } ------------- Freshly built llc: llc -O2 -march=x86 < ex.ll -print-before-all # *** IR Dump Before Prologue/Epilogue Insertion & Frame Finalization ***: #