[PATCH] D28381: [WebAssembly] Always inline atomics

Jacob Gravelle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 15:35:45 PST 2017


jgravelle-google added a comment.

In https://reviews.llvm.org/D28381#637915, @sunfish wrote:

> Would it be difficult to enable atomic.c in Emscripten's compiler-rt build, to define these libcalls (assuming that the problem is just that they're not currently defined)?


Tried it and it seems to work. I needed to add `-mthread-model single` to the compiler_rt build flags to get it to build. Which makes me think we'll have issues when we actually support "posix".

> Alternatively, could we make the change in the patch guarded by `if (CodeGenOpts.ThreadModel == "single")` or so, so that it doesn't affect the "posix" case?

We don't have access to `GodeGenOpts` in the constructor as far as I know, and the only `TargetInfo` method that does is `adjustTargetOptions`, which is `const` for the target.

My ideal patch here is to make the smallest change that doesn't need to be totally undone later, that also avoids making assumptions about how we'll implement wasm atomics down the line.
Talked with @dschuff, and we're probably going to go the compiler-rt route. Need to first explore whether it'd be saner to just drop in the real atomic.c or to stub one out for now.


https://reviews.llvm.org/D28381





More information about the cfe-commits mailing list