Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit ffbd906

Browse files
committed
[PowerPC] Remove unnecessary load of r12 in indirect call
When looking at the 64-bit SVR4 indirect call sequence, I noticed an unnecessary load of r12. And indeed the code says: // R12 must contain the address of an indirect callee. But this is not correct; in the 64-bit SVR4 (ELFv1) ABI, there is no need to load r12 at this point. It seems this code and comment is a remnant of code originally shared with the Darwin ABI ... This patch simply removes the unnecessary load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211203 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 75b56dc commit ffbd906

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,10 +4399,6 @@ PPCTargetLowering::LowerCall_64SVR4(SDValue Chain, SDValue Callee,
43994399
SDValue AddPtr = DAG.getNode(ISD::ADD, dl, PtrVT, StackPtr, PtrOff);
44004400
Chain = DAG.getStore(Val.getValue(1), dl, Val, AddPtr, MachinePointerInfo(),
44014401
false, false, 0);
4402-
// R12 must contain the address of an indirect callee. This does not
4403-
// mean the MTCTR instruction must use R12; it's easier to model this
4404-
// as an extra parameter, so do that.
4405-
RegsToPass.push_back(std::make_pair((unsigned)PPC::X12, Callee));
44064402
}
44074403

44084404
// Build a sequence of copy-to-reg nodes chained together with token chain

0 commit comments

Comments
 (0)