[llvm] r337425 - [WebAssembly] Add missing -mattr=+exception-handling guards

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 14:42:23 PDT 2018


Author: aheejin
Date: Wed Jul 18 14:42:22 2018
New Revision: 337425

URL: http://llvm.org/viewvc/llvm-project?rev=337425&view=rev
Log:
[WebAssembly] Add missing -mattr=+exception-handling guards

Summary:
The use of exception handling instructions should only be enabled with
`-mattr=+exception-handling` option.

Reviewers: jgravelle-google

Subscribers: dschuff, sbc100, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D49391

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
    llvm/trunk/test/CodeGen/WebAssembly/exception.ll

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td?rev=337425&r1=337424&r2=337425&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td Wed Jul 18 14:42:22 2018
@@ -140,6 +140,8 @@ defm UNREACHABLE : NRI<(outs), (ins), [(
 // Exception handling instructions
 //===----------------------------------------------------------------------===//
 
+let Predicates = [HasExceptionHandling] in {
+
 // Throwing an exception: throw / rethrow
 let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in {
 defm THROW_I32 : I<(outs), (ins i32imm:$tag, I32:$val),
@@ -187,5 +189,6 @@ let isTerminator = 1, hasSideEffects = 1
   defm CATCHRET : NRI<(outs), (ins bb_op:$dst, bb_op:$from),
                    [(catchret bb:$dst, bb:$from)], "", 0>;
 }
+}
 
 } // Defs = [ARGUMENTS]

Modified: llvm/trunk/test/CodeGen/WebAssembly/exception.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/exception.ll?rev=337425&r1=337424&r2=337425&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/exception.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/exception.ll Wed Jul 18 14:42:22 2018
@@ -1,4 +1,5 @@
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -exception-model=wasm | FileCheck -allow-deprecated-dag-overlap %s
+; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -exception-model=wasm
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -exception-model=wasm -mattr=+exception-handling | FileCheck -allow-deprecated-dag-overlap %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"




More information about the llvm-commits mailing list