summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-14 20:28:32 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-14 20:28:32 +0000
commit1b2c761a9cc9a57b417c676f4bd97d11b6ba1869 (patch)
treec2d7b47cff9eb1d334040345edc7f7a58c91ff83 /lib/CodeGen/RegAllocFast.cpp
parentc3ce05c594ded5c2ad20410719bd9e586aeff180 (diff)
downloadexternal_llvm-1b2c761a9cc9a57b417c676f4bd97d11b6ba1869.zip
external_llvm-1b2c761a9cc9a57b417c676f4bd97d11b6ba1869.tar.gz
external_llvm-1b2c761a9cc9a57b417c676f4bd97d11b6ba1869.tar.bz2
When verifying two-address instructions, check the following:
- Kill is implicit when use and def registers are identical. - Only virtual registers can differ. Add a -verify-fast-regalloc to run the verifier before the fast allocator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index fde7125..db6c709 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -35,6 +35,9 @@
#include <algorithm>
using namespace llvm;
+static cl::opt<bool> VerifyFastRegalloc("verify-fast-regalloc", cl::Hidden,
+ cl::desc("Verify machine code before fast regalloc"));
+
STATISTIC(NumStores, "Number of stores added");
STATISTIC(NumLoads , "Number of loads added");
@@ -778,6 +781,8 @@ bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
DEBUG(dbgs() << "********** FAST REGISTER ALLOCATION **********\n"
<< "********** Function: "
<< ((Value*)Fn.getFunction())->getName() << '\n');
+ if (VerifyFastRegalloc)
+ Fn.verify();
MF = &Fn;
MRI = &MF->getRegInfo();
TM = &Fn.getTarget();