diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-29 00:27:32 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-29 00:27:32 +0000 |
commit | e69438fb87623dd6fdeeb99b647a46e877eb6183 (patch) | |
tree | 207b42e178b5c2be142c55173866929fb8286b6e | |
parent | ef715972423a57febb7aa9b056d9bf6320e74817 (diff) | |
download | external_llvm-e69438fb87623dd6fdeeb99b647a46e877eb6183.zip external_llvm-e69438fb87623dd6fdeeb99b647a46e877eb6183.tar.gz external_llvm-e69438fb87623dd6fdeeb99b647a46e877eb6183.tar.bz2 |
Add -verify-arm-pseudo-expand.
This hidden llc option runs the machine code verifier after expanding
ARM pseudo-instructions, but before if-conversion.
The machine code verifier is much better at pointing out liveness errors
that can trip up the register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136439 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMExpandPseudoInsts.cpp | 7 | ||||
-rw-r--r-- | test/CodeGen/ARM/crash.ll | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/lib/Target/ARM/ARMExpandPseudoInsts.cpp index d400ceb..a4fcfd5 100644 --- a/lib/Target/ARM/ARMExpandPseudoInsts.cpp +++ b/lib/Target/ARM/ARMExpandPseudoInsts.cpp @@ -26,9 +26,14 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" // FIXME: for debug only. remove! using namespace llvm; +cl::opt<bool> +VerifyARMPseudo("verify-arm-pseudo-expand", cl::Hidden, + cl::desc("Verify machine code after expanding ARM pseudos")); + namespace { class ARMExpandPseudo : public MachineFunctionPass { public: @@ -1328,6 +1333,8 @@ bool ARMExpandPseudo::runOnMachineFunction(MachineFunction &MF) { for (MachineFunction::iterator MFI = MF.begin(), E = MF.end(); MFI != E; ++MFI) Modified |= ExpandMBB(*MFI); + if (VerifyARMPseudo) + MF.verify(this, "After expanding ARM pseudo instructions."); return Modified; } diff --git a/test/CodeGen/ARM/crash.ll b/test/CodeGen/ARM/crash.ll index 5ecfe15..979442a 100644 --- a/test/CodeGen/ARM/crash.ll +++ b/test/CodeGen/ARM/crash.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 +; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 -verify-arm-pseudo-expand ; <rdar://problem/8529919> %struct.foo = type { i32, i32 } |