From d70e5907cdaf2dd7a7a40043278d3b9589dec9bb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 8 Dec 2015 03:30:42 +0000 Subject: [PATCH] [WebAssembly] Assert MRI.isSSA() in passes that depend on SSA form. llvm-svn: 254995 --- llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | 2 ++ llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp index ac016a7b9b0a..9fbde70634ac 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp @@ -127,6 +127,8 @@ bool WebAssemblyRegStackify::runOnMachineFunction(MachineFunction &MF) { WebAssemblyFunctionInfo &MFI = *MF.getInfo(); AliasAnalysis &AA = getAnalysis().getAAResults(); + assert(MRI.isSSA() && "RegStackify depends on SSA form"); + // Walk the instructions from the bottom up. Currently we don't look past // block boundaries, and the blocks aren't ordered so the block visitation // order isn't significant, but we may want to change this in the future. diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp index b67453bee708..21122ba2b2ea 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp @@ -72,6 +72,8 @@ bool WebAssemblyStoreResults::runOnMachineFunction(MachineFunction &MF) { const MachineRegisterInfo &MRI = MF.getRegInfo(); MachineDominatorTree &MDT = getAnalysis(); + assert(MRI.isSSA() && "StoreResults depends on SSA form"); + for (auto &MBB : MF) { DEBUG(dbgs() << "Basic Block: " << MBB.getName() << '\n'); for (auto &MI : MBB)