diff options
author | JF Bastien <jfb@google.com> | 2015-07-01 23:41:25 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2015-07-01 23:41:25 +0000 |
commit | 03855df197944840745afd1180ebf423c7050c3c (patch) | |
tree | 10279e6f356ea28fbb0e58df4b3eb958e1471b7a /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 14cd13c51313e3a53a403eeb32b091d9c6a3011c (diff) | |
download | llvm-03855df197944840745afd1180ebf423c7050c3c.zip llvm-03855df197944840745afd1180ebf423c7050c3c.tar.gz llvm-03855df197944840745afd1180ebf423c7050c3c.tar.bz2 |
WebAssembly: start instructions
Summary:
* Add 64-bit address space feature.
* Rename SIMD feature to SIMD128.
* Handle single-thread model with an IR pass (same way ARM does).
* Rename generic processor to MVP, to follow design's lead.
* Add bleeding-edge processors, with all features included.
* Fix a few DEBUG_TYPE to match other backends.
Test Plan: ninja check
Reviewers: sunfish
Subscribers: jfb, llvm-commits
Differential Revision: http://reviews.llvm.org/D10880
llvm-svn: 241211
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 54ab028..6f93248 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -24,6 +24,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Transforms/Scalar.h" using namespace llvm; #define DEBUG_TYPE "wasm" @@ -139,9 +140,14 @@ void WebAssemblyPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) { //===----------------------------------------------------------------------===// void WebAssemblyPassConfig::addIRPasses() { - // Expand some atomic operations. WebAssemblyTargetLowering has hooks which - // control specifically what gets lowered. - addPass(createAtomicExpandPass(&getTM<WebAssemblyTargetMachine>())); + // FIXME: the default for this option is currently POSIX, whereas + // WebAssembly's MVP should default to Single. + if (TM->Options.ThreadModel == ThreadModel::Single) + addPass(createLowerAtomicPass()); + else + // Expand some atomic operations. WebAssemblyTargetLowering has hooks which + // control specifically what gets lowered. + addPass(createAtomicExpandPass(TM)); TargetPassConfig::addIRPasses(); } |