aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2020-12-18 10:51:54 -0500
committerMatt Arsenault <Matthew.Arsenault@amd.com>2020-12-18 11:02:28 -0500
commitfd0f5fb8de26230cbb0eeedaef58036ddede4c63 (patch)
treef0366c8fc61c4f4c2b97289deb8aa4cc767ab782 /llvm/lib/CodeGen/PrologEpilogInserter.cpp
parent94da2cf650dd4397e8f84982c81e70f7a1825103 (diff)
downloadllvm-fd0f5fb8de26230cbb0eeedaef58036ddede4c63.zip
llvm-fd0f5fb8de26230cbb0eeedaef58036ddede4c63.tar.gz
llvm-fd0f5fb8de26230cbb0eeedaef58036ddede4c63.tar.bz2
PEI: Only call updateLiveness once per function
This only needs to be called once for the function, and it visits all the necessary blocks in the function. It looks like 631f6b888c50276450fee8b9ef129f37f83fc5a1 accidentally moved this into the loop over all save blocks.
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 9ae155a..7c38b19 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -620,12 +620,12 @@ void PEI::spillCalleeSavedRegs(MachineFunction &MF) {
if (!MFI.hasCalls())
NumLeafFuncWithSpills++;
- for (MachineBasicBlock *SaveBlock : SaveBlocks) {
+ for (MachineBasicBlock *SaveBlock : SaveBlocks)
insertCSRSaves(*SaveBlock, CSI);
- // Update the live-in information of all the blocks up to the save
- // point.
- updateLiveness(MF);
- }
+
+ // Update the live-in information of all the blocks up to the save point.
+ updateLiveness(MF);
+
for (MachineBasicBlock *RestoreBlock : RestoreBlocks)
insertCSRRestores(*RestoreBlock, CSI);
}