From 13753808f4e990089bf34ff44474e85cc3e6e775 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 18 Feb 2021 09:08:56 -0800 Subject: [PATCH] [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. --- llvm/lib/CodeGen/RegAllocGreedy.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index a8c6c20..577e232 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(); -- 2.7.4