This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Strip threadlocal attribute from globals in single thread mode
ClosedPublic

Authored by dschuff on Mar 20 2018, 2:27 PM.

Details

Summary

The default thread model for wasm is single, and in this mode thread-local
global variables can be lowered identically to non-thread-local variables.

Fixes PR36807

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff created this revision.Mar 20 2018, 2:27 PM
dschuff edited the summary of this revision. (Show Details)Mar 20 2018, 2:28 PM
sbc100 accepted this revision.Mar 20 2018, 2:41 PM

Thanks for fixing this!

lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
189 ↗(On Diff #139198)

Does LLVM style allow for this kind of bracketing where one side of a conditions uses braces and the other doesn't?

This revision is now accepted and ready to land.Mar 20 2018, 2:41 PM
sbc100 added inline comments.Mar 20 2018, 2:42 PM
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
188 ↗(On Diff #139198)

What do the other passes all have create functions but this one use just using new?

dschuff added inline comments.Mar 20 2018, 2:59 PM
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
188 ↗(On Diff #139198)

I assume it's so that you can forward-declare FunctionPass *createFooPass() without including the full class definition (e.g. in include/llvm/Analysis/Passes.h). It's not necessary when you define the pass in the same file in an anonymous namespace. The implementations of createFooPass() are all just return new FooPass().

189 ↗(On Diff #139198)

I don't know but I don't like it, and it wasn't my intention :) I'll fix.

dschuff updated this revision to Diff 139207.Mar 20 2018, 2:59 PM
  • add braces in else
This revision was automatically updated to reflect the committed changes.