transform: wasm-abi: create temporary allocas in the entry block

This avoids problems with goroutines in WebAssembly, and is generally a
good thing. It fixes some cases of the following problem:

    LLVM ERROR: Coroutines cannot handle non static allocas yet
This commit is contained in:
Ayke van Laethem
2019-12-07 23:09:55 +01:00
committed by Ron Evans
parent 4d79d473c4
commit 519adf3aef
2 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -14,11 +14,11 @@ define internal i64 @testCall(i8* %ptr, i32 %len, i64 %foo) {
define internal i64 @testCallNonEntry(i8* %ptr, i32 %len) {
entry:
%i64asptr = alloca i64
%i64asptr1 = alloca i64
br label %bb1
bb1: ; preds = %entry
%i64asptr = alloca i64
%i64asptr1 = alloca i64
store i64 3, i64* %i64asptr1
call void @externalCall(i64* %i64asptr, i8* %ptr, i32 %len, i64* %i64asptr1)
%retval = load i64, i64* %i64asptr