[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:54:49 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG39ae5bf5c539: [CSSPGO] Fix an AV caused by a block that has only pseudo pseudo instructions. (authored by hoy).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101415/new/

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.341044.patch
Type: text/x-patch
Size: 898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210428/f16a70ab/attachment.bin>


More information about the llvm-commits mailing list