From bea30c62862cd617fe7fd1bf439b434c76168550 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 10 Aug 2017 16:17:32 +0000 Subject: Add "Restored" flag to CalleeSavedInfo The liveness-tracking code assumes that the registers that were saved in the function's prolog are live outside of the function. Specifically, that registers that were saved are also live-on-exit from the function. This isn't always the case as illustrated by the LR register on ARM. Differential Revision: https://reviews.llvm.org/D36160 llvm-svn: 310619 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp') diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index cbb43203b5c..1b82cd2158a 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -489,7 +489,7 @@ static void insertCSRSaves(MachineBasicBlock &SaveBlock, /// Insert restore code for the callee-saved registers used in the function. static void insertCSRRestores(MachineBasicBlock &RestoreBlock, - ArrayRef CSI) { + std::vector &CSI) { MachineFunction &Fn = *RestoreBlock.getParent(); const TargetInstrInfo &TII = *Fn.getSubtarget().getInstrInfo(); const TargetFrameLowering *TFI = Fn.getSubtarget().getFrameLowering(); @@ -534,7 +534,7 @@ static void doSpillCalleeSavedRegs(MachineFunction &Fn, RegScavenger *RS, if (!F->hasFnAttribute(Attribute::Naked)) { MFI.setCalleeSavedInfoValid(true); - ArrayRef CSI = MFI.getCalleeSavedInfo(); + std::vector &CSI = MFI.getCalleeSavedInfo(); if (!CSI.empty()) { for (MachineBasicBlock *SaveBlock : SaveBlocks) { insertCSRSaves(*SaveBlock, CSI); -- cgit v1.2.3