Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit a8d416d

Browse files
author
Marcin Koscielnicki
committed
Revert "[SystemZ] Implement backchain attribute."
This reverts commit rL268571. It caused failures in register scavenger. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268576 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c4002d7 commit a8d416d

File tree

3 files changed

+4
-130
lines changed

3 files changed

+4
-130
lines changed

lib/Target/SystemZ/SystemZFrameLowering.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,6 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF,
354354

355355
uint64_t StackSize = getAllocatedStackSize(MF);
356356
if (StackSize) {
357-
// Determine if we want to store a backchain.
358-
bool StoreBackchain = MF.getFunction()->hasFnAttribute("backchain");
359-
360-
// If we need backchain, save current stack pointer. R1 is free at this
361-
// point.
362-
if (StoreBackchain)
363-
BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::LGR))
364-
.addReg(SystemZ::R1D).addReg(SystemZ::R15D);
365-
366357
// Allocate StackSize bytes.
367358
int64_t Delta = -int64_t(StackSize);
368359
emitIncrement(MBB, MBBI, DL, SystemZ::R15D, Delta, ZII);
@@ -373,10 +364,6 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF,
373364
BuildMI(MBB, MBBI, DL, ZII->get(TargetOpcode::CFI_INSTRUCTION))
374365
.addCFIIndex(CFIIndex);
375366
SPOffsetFromCFA += Delta;
376-
377-
if (StoreBackchain)
378-
BuildMI(MBB, MBBI, DL, ZII->get(SystemZ::STG))
379-
.addReg(SystemZ::R1D).addReg(SystemZ::R15D).addImm(0).addReg(0);
380367
}
381368

382369
if (HasFP) {

lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,9 +2836,8 @@ SDValue SystemZTargetLowering::lowerVACOPY(SDValue Op,
28362836
SDValue SystemZTargetLowering::
28372837
lowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const {
28382838
const TargetFrameLowering *TFI = Subtarget.getFrameLowering();
2839-
MachineFunction &MF = DAG.getMachineFunction();
2840-
bool RealignOpt = !MF.getFunction()-> hasFnAttribute("no-realign-stack");
2841-
bool StoreBackchain = MF.getFunction()->hasFnAttribute("backchain");
2839+
bool RealignOpt = !DAG.getMachineFunction().getFunction()->
2840+
hasFnAttribute("no-realign-stack");
28422841

28432842
SDValue Chain = Op.getOperand(0);
28442843
SDValue Size = Op.getOperand(1);
@@ -2860,12 +2859,6 @@ lowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const {
28602859
// Get a reference to the stack pointer.
28612860
SDValue OldSP = DAG.getCopyFromReg(Chain, DL, SPReg, MVT::i64);
28622861

2863-
// If we need a backchain, save it now.
2864-
SDValue Backchain;
2865-
if (StoreBackchain)
2866-
Backchain = DAG.getLoad(MVT::i64, DL, Chain, OldSP, MachinePointerInfo(),
2867-
false, false, false, 0);
2868-
28692862
// Add extra space for alignment if needed.
28702863
if (ExtraAlignSpace)
28712864
NeededSpace = DAG.getNode(ISD::ADD, DL, MVT::i64, NeededSpace,
@@ -2893,10 +2886,6 @@ lowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const {
28932886
DAG.getConstant(~(RequiredAlign - 1), DL, MVT::i64));
28942887
}
28952888

2896-
if (StoreBackchain)
2897-
Chain = DAG.getStore(Chain, DL, Backchain, NewSP, MachinePointerInfo(),
2898-
false, false, 0);
2899-
29002889
SDValue Ops[2] = { Result, Chain };
29012890
return DAG.getMergeValues(Ops, DL);
29022891
}
@@ -3355,26 +3344,8 @@ SDValue SystemZTargetLowering::lowerSTACKRESTORE(SDValue Op,
33553344
SelectionDAG &DAG) const {
33563345
MachineFunction &MF = DAG.getMachineFunction();
33573346
MF.getInfo<SystemZMachineFunctionInfo>()->setManipulatesSP(true);
3358-
bool StoreBackchain = MF.getFunction()->hasFnAttribute("backchain");
3359-
3360-
SDValue Chain = Op.getOperand(0);
3361-
SDValue NewSP = Op.getOperand(1);
3362-
SDValue Backchain;
3363-
SDLoc DL(Op);
3364-
3365-
if (StoreBackchain) {
3366-
SDValue OldSP = DAG.getCopyFromReg(Chain, DL, SystemZ::R15D, MVT::i64);
3367-
Backchain = DAG.getLoad(MVT::i64, DL, Chain, OldSP, MachinePointerInfo(),
3368-
false, false, false, 0);
3369-
}
3370-
3371-
Chain = DAG.getCopyToReg(Chain, DL, SystemZ::R15D, NewSP);
3372-
3373-
if (StoreBackchain)
3374-
Chain = DAG.getStore(Chain, DL, Backchain, NewSP, MachinePointerInfo(),
3375-
false, false, 0);
3376-
3377-
return Chain;
3347+
return DAG.getCopyToReg(Op.getOperand(0), SDLoc(Op),
3348+
SystemZ::R15D, Op.getOperand(1));
33783349
}
33793350

33803351
SDValue SystemZTargetLowering::lowerPREFETCH(SDValue Op,

test/CodeGen/SystemZ/backchain.ll

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)