From 0b647e6cca16a55cce3d7e4dcc86b75273a5598b Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 20 Feb 2015 01:00:19 +0000 Subject: EH: Prune unreachable resume instructions during Dwarf EH preparation Today a simple function that only catches exceptions and doesn't run destructor cleanups ends up containing a dead call to _Unwind_Resume (PR20300). We can't remove these dead resume instructions during normal optimization because inlining might introduce additional landingpads that do have cleanups to run. Instead we can do this during EH preparation, which is guaranteed to run after inlining. Fixes PR20300. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D7744 llvm-svn: 229944 --- llvm/test/CodeGen/XCore/exception.ll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/test/CodeGen/XCore') diff --git a/llvm/test/CodeGen/XCore/exception.ll b/llvm/test/CodeGen/XCore/exception.ll index fec83eb15ea..cd9771d6401 100644 --- a/llvm/test/CodeGen/XCore/exception.ll +++ b/llvm/test/CodeGen/XCore/exception.ll @@ -78,6 +78,7 @@ cont: ; CHECK: bl __cxa_end_catch lpad: %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup catch i8* bitcast (i8** @_ZTIi to i8*) catch i8* bitcast (i8** @_ZTId to i8*) %1 = extractvalue { i8*, i32 } %0, 0 @@ -110,13 +111,14 @@ Exit: ; CHECK: .long [[PRE_G]]-[[START]] ; CHECK: .long [[POST_G]]-[[PRE_G]] ; CHECK: .long [[LANDING]]-[[START]] -; CHECK: .byte 3 +; CHECK: .byte 5 ; CHECK: .long [[POST_G]]-[[START]] ; CHECK: .long [[END]]-[[POST_G]] ; CHECK: .long 0 ; CHECK: .byte 0 -; CHECK: .byte 1 ; CHECK: .byte 0 +; CHECK: .byte 1 +; CHECK: .byte 125 ; CHECK: .byte 2 ; CHECK: .byte 125 ; CHECK: .long _ZTIi -- cgit v1.2.3