[PATCH] D101415: [CSSPGO] Fix an AV caused by a block that has only pseudo pseudo instructions.
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 27 17:21:01 PDT 2021
hoy created this revision.
Herald added subscribers: wenlei, hiraditya, qcolombet, MatzeB.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101415
Files:
llvm/lib/CodeGen/RegAllocGreedy.cpp
Index: llvm/lib/CodeGen/RegAllocGreedy.cpp
===================================================================
--- llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -1324,10 +1324,10 @@
// Abort if the spill cannot be inserted at the MBB' start
MachineBasicBlock *MBB = MF->getBlockNumbered(Number);
- if (!MBB->empty() &&
- SlotIndex::isEarlierInstr(
- LIS->getInstructionIndex(*MBB->getFirstNonDebugInstr()),
- SA->getFirstSplitPoint(Number)))
+ auto FirstNonDebugInstr = MBB->getFirstNonDebugInstr();
+ if (FirstNonDebugInstr != MBB->end() &&
+ SlotIndex::isEarlierInstr(LIS->getInstructionIndex(*FirstNonDebugInstr),
+ SA->getFirstSplitPoint(Number)))
return false;
// Interference for the live-in value.
if (Intf.first() <= Indexes->getMBBStartIdx(Number))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101415.341033.patch
Type: text/x-patch
Size: 898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210428/4e9ed847/attachment.bin>
More information about the llvm-commits
mailing list