From 409b4391527a72d8c606749386a079aa42437f57 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 4 Oct 2018 23:31:00 +0000 Subject: [WebAssembly] Ignore DBG_VALUE in WebAssemblyCFGStackify pass when looking for block start Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=39158 and regression caused by D49034. Though it is possible the problem was existed before and was exposed by additional DBG_VALUEs. Reviewers: sunfish, dschuff, aheejin Reviewed By: aheejin Subscribers: sbc100, aheejin, llvm-commits, alexcrichton, jgravelle-google Differential Revision: https://reviews.llvm.org/D52837 llvm-svn: 343827 --- llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index e62b8b60d0d..93ca670bbdb 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -309,6 +309,8 @@ void WebAssemblyCFGStackify::placeBlockMarker(MachineBasicBlock &MBB) { // Local expression tree should go after the BLOCK. for (auto I = Header->getFirstTerminator(), E = Header->begin(); I != E; --I) { + if (std::prev(I)->isDebugInstr() || std::prev(I)->isPosition()) + continue; if (WebAssembly::isChild(*std::prev(I), MFI)) AfterSet.insert(&*std::prev(I)); else @@ -531,6 +533,8 @@ void WebAssemblyCFGStackify::placeTryMarker(MachineBasicBlock &MBB) { // Local expression tree should go after the TRY. for (auto I = Header->getFirstTerminator(), E = Header->begin(); I != E; --I) { + if (std::prev(I)->isDebugInstr() || std::prev(I)->isPosition()) + continue; if (WebAssembly::isChild(*std::prev(I), MFI)) AfterSet.insert(&*std::prev(I)); else -- cgit v1.2.3