[llvm-dev] "llc -march wasm64" always fail.

Thomas Lively via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 30 08:54:27 PDT 2019


Hi,

wasm64 is not supported in LLVM or anywhere else. It has not even been
specified yet. The clang frontend's wasm64 triple dates back to when
WebAssembly was an experimental target and hasn't been removed because we
expect that wasm64 will eventually exist. I have patch up that adds a clear
error when wasm64 is used for now. I will go back and finish that up.

On Mon, Sep 30, 2019 at 3:44 AM zh via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> I'm writing a wasm interpreter, aim to exposure native functions for wasm
> modules to call directly.
> So the interpreter must share address space with the wasm module.
>
> To produce a simple wasm module for testing, I tried these steps:
> step 1. Compile a simple c file with clang, targeting host platform.
> step 2. Use llc -march  wasm64 to generate a wasm module file.
> But actually it does not work, even for a simple hello.c.
>
> hello.c is the classical "hello world" C program:
>
> #include <stdio.h>
> int main(){
> printf("Hello world!\n");
> return 0;
> }
>
> This produces the hello.ll :
> clang -c -emit-llvm -S D:\hello.c
>
> 32-bit version works perfectly:
> llc -march=wasm32 hello.ll
>
> And this always fail:
> llc -march=wasm64 hello.ll
>
> The error message says:
>
> LLVM ERROR: Cannot select: 0x17246d26200: ch = store<(store 8 into %ir.7)>
> 0x17246cbf638, 0x17246d25f28, 0x17246d26268, undef:i64
>   0x17246d25f28: i64,ch = CopyFromReg 0x17246cbf638, Register:i64 %0
>     0x17246d25ff8: i64 = Register %0
>   0x17246d26268: i64,ch = CopyFromReg 0x17246cbf638, Register:i64 %16
>     0x17246d260c8: i64 = Register %16
>   0x17246d25e58: i64 = undef
> In function: sprintf
> Stack dump:
> 0.      Program arguments: llc -march=wasm64 hello.ll
> 1.      Running pass 'Function Pass Manager' on module 'hello.ll'.
> 2.      Running pass 'WebAssembly Instruction Selection' on function
> '@sprintf'
>
> Is it a bug in LLVM's wasm64 CodeGen?
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190930/5c405375/attachment.html>


More information about the llvm-dev mailing list