[WebAssemly] Invalidate liveness in CFG stackifier
authorDerek Schuff <dschuff@google.com>
Wed, 13 Jan 2016 17:10:28 +0000 (17:10 +0000)
committerDerek Schuff <dschuff@google.com>
Wed, 13 Jan 2016 17:10:28 +0000 (17:10 +0000)
WebAssemblyCFGStackify does not track liveness for EXPR_STACK, causing
verifier failure if liveness has not already been invalidated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257620 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp

index 7876a1e18325c734647423a264f7e5df398ba852..a39349c562fdd8f32721d3a493e1bc65d73f1b74 100644 (file)
@@ -34,6 +34,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
@@ -475,7 +476,9 @@ bool WebAssemblyCFGStackify::runOnMachineFunction(MachineFunction &MF) {
 
   const auto &MLI = getAnalysis<MachineLoopInfo>();
   auto &MDT = getAnalysis<MachineDominatorTree>();
+  // Liveness is not tracked for EXPR_STACK physreg.
   const auto &TII = *MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
+  MF.getRegInfo().invalidateLiveness();
 
   // RPO sorting needs all loops to be single-entry.
   EliminateMultipleEntryLoops(MF, MLI);