[llvm] 1375380 - [verify-regalloc] Verify after allocation and before postOptimization

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 09:11:00 PST 2021


Author: Philip Reames
Date: 2021-02-18T09:10:50-08:00
New Revision: 13753808f4e990089bf34ff44474e85cc3e6e775

URL: https://github.com/llvm/llvm-project/commit/13753808f4e990089bf34ff44474e85cc3e6e775
DIFF: https://github.com/llvm/llvm-project/commit/13753808f4e990089bf34ff44474e85cc3e6e775.diff

LOG: [verify-regalloc] Verify after allocation and before postOptimization

I've now hit several cases where a mistake in the regalloc main loop caused corrupt live intervals that didn't get caught until either the next verify or during post-optimization.  The later case is rather confusing and tends to lead one down false trails, so let's catch corruption before that.

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegAllocGreedy.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index a8c6c20c1f5e..577e23211513 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -3256,6 +3256,9 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
 
   allocatePhysRegs();
   tryHintsRecoloring();
+
+  if (VerifyEnabled)
+    MF->verify(this, "Before post optimization");
   postOptimization();
   reportNumberOfSplillsReloads();
 


        


More information about the llvm-commits mailing list