[PATCH] D64776: [WebAssembly] Compile all TLS on Emscripten as local-exec

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 13:56:52 PDT 2019


aheejin added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp:191
       report_fatal_error("only -ftls-model=local-exec is supported for now",
                          false);
     }
----------------
So does this mean:
1. If this is emscripten, convert all non-local-exec to local-exec
2. If this is not emscripten, error on non-local exec

Is this right?

Anyhow, it might be better to tell what global variable is causing the problem to users in the error message, something like
```
report_fatal_error("only -ftls-model=local-exec is supported for now in non-Emscripten OSes: " + GA->getGlobal()->getName());
```



================
Comment at: llvm/test/CodeGen/WebAssembly/tls-general-dynamic.ll:1
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -mattr=+atomics,+bulk-memory | FileCheck %s --check-prefixes=CHECK,TLS
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -mattr=+atomics,+bulk-memory -fast-isel | FileCheck %s --check-prefixes=CHECK,TLS
+; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -mattr=+atomics,+bulk-memory 2>&1 | FileCheck %s --check-prefix=ERROR
+; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -mattr=+atomics,+bulk-memory -fast-isel 2>&1 | FileCheck %s --check-prefix=ERROR
----------------
Do we need a separate copy of `tls.ll` for this test? The file contents look the same. Can't we add a new test line or something to the existing file?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64776/new/

https://reviews.llvm.org/D64776





More information about the llvm-commits mailing list