[PATCH] D49391: [WebAssembly] Add missing -mattr=+exception-handling guards

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 11:33:33 PDT 2018


aheejin created this revision.
aheejin added a reviewer: jgravelle-google.
Herald added subscribers: llvm-commits, sunfish, sbc100, dschuff.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D49391

Files:
  lib/Target/WebAssembly/WebAssemblyInstrControl.td
  test/CodeGen/WebAssembly/exception.ll


Index: test/CodeGen/WebAssembly/exception.ll
===================================================================
--- test/CodeGen/WebAssembly/exception.ll
+++ test/CodeGen/WebAssembly/exception.ll
@@ -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"
Index: lib/Target/WebAssembly/WebAssemblyInstrControl.td
===================================================================
--- lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -140,6 +140,8 @@
 // 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 @@
   defm CATCHRET : NRI<(outs), (ins bb_op:$dst, bb_op:$from),
                    [(catchret bb:$dst, bb:$from)], "", 0>;
 }
+}
 
 } // Defs = [ARGUMENTS]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49391.155725.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180716/27aca1b2/attachment.bin>


More information about the llvm-commits mailing list