[llvm-commits] [llvm] r136439 - in /llvm/trunk: lib/Target/ARM/ARMExpandPseudoInsts.cpp test/CodeGen/ARM/crash.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Jul 28 17:27:32 PDT 2011


Author: stoklund
Date: Thu Jul 28 19:27:32 2011
New Revision: 136439

URL: http://llvm.org/viewvc/llvm-project?rev=136439&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp
    llvm/trunk/test/CodeGen/ARM/crash.ll

Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=136439&r1=136438&r2=136439&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Thu Jul 28 19:27:32 2011
@@ -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 @@
   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;
 }
 

Modified: llvm/trunk/test/CodeGen/ARM/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/crash.ll?rev=136439&r1=136438&r2=136439&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/crash.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/crash.ll Thu Jul 28 19:27:32 2011
@@ -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 }





More information about the llvm-commits mailing list