diff options
author | Cheng Shao <terrorjack@type.dance> | 2022-12-01 12:56:23 +0000 |
---|---|---|
committer | Cheng Shao <terrorjack@type.dance> | 2022-12-16 21:16:28 +0000 |
commit | 8a81d9d933089b6ed72478342a0070d7c8f82ff8 (patch) | |
tree | 441142f702b4655515757472f72cd46b5a9e08c6 /compiler/GHC/Wasm/ControlFlow.hs | |
parent | 1c6930bf59223b6a70ca6045e2bbd4a4fb297b76 (diff) | |
download | haskell-8a81d9d933089b6ed72478342a0070d7c8f82ff8.tar.gz |
compiler: add optional tail-call support in wasm NCG
When the `-mtail-call` clang flag is passed at configure time, wasm
tail-call extension is enabled, and the wasm NCG will emit
`return_call`/`return_call_indirect` instructions to take advantage of
it and avoid the `StgRun` trampoline overhead.
Closes #22461.
Diffstat (limited to 'compiler/GHC/Wasm/ControlFlow.hs')
-rw-r--r-- | compiler/GHC/Wasm/ControlFlow.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/GHC/Wasm/ControlFlow.hs b/compiler/GHC/Wasm/ControlFlow.hs index 97c703597e..365a003323 100644 --- a/compiler/GHC/Wasm/ControlFlow.hs +++ b/compiler/GHC/Wasm/ControlFlow.hs @@ -1,10 +1,10 @@ {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE DataKinds, GADTs, RankNTypes, TypeOperators, KindSignatures #-} +{-# LANGUAGE DataKinds, GADTs, RankNTypes, KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternSynonyms #-} module GHC.Wasm.ControlFlow - ( WasmControl(..), (<>), pattern WasmIf, wasmReturn + ( WasmControl(..), (<>), pattern WasmIf , BrTableInterval(..), inclusiveInterval , WasmType, WasmTypeTag(..) @@ -47,7 +47,3 @@ pattern WasmIf :: WasmFunctionType pre post pattern WasmIf ty e t f = WasmPush TagI32 e `WasmSeq` WasmIfTop ty t f - --- More syntactic sugar. -wasmReturn :: WasmTypeTag t -> e -> WasmControl s e (t ': t1star) t2star -wasmReturn tag e = WasmPush tag e `WasmSeq` WasmReturnTop tag |