diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-02-18 06:32:53 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-02-18 06:32:53 +0000 |
commit | d85ab7fc103b163494046317120ad57055a2b7db (patch) | |
tree | 08061988eeb96938752d45b07c019e7cc7c8c452 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | ac697c5d8ecf96d4af15c29f72bbb8f898e3b8f5 (diff) | |
download | llvm-d85ab7fc103b163494046317120ad57055a2b7db.zip llvm-d85ab7fc103b163494046317120ad57055a2b7db.tar.gz llvm-d85ab7fc103b163494046317120ad57055a2b7db.tar.bz2 |
[WebAssembly] Don't use setRequiresStructuredCFG(true).
While we still do want reducible control flow, the RequiresStructuredCFG
flag imposes more strict structure constraints than WebAssembly wants.
Unsetting this flag enables critical edge splitting and tail merging.
Also, disable TailDuplication explicitly, as it doesn't support virtual
registers, and was previously only disabled by the RequiresStructuredCFG
flag.
llvm-svn: 261190
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 2e2a119..ac18589 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -58,9 +58,9 @@ WebAssemblyTargetMachine::WebAssemblyTargetMachine( initAsmInfo(); - // We need a reducible CFG, so disable some optimizations which tend to - // introduce irreducibility. - setRequiresStructuredCFG(true); + // Note that we don't use setRequiresStructuredCFG(true). It disables + // optimizations than we're ok with, and want, such as critical edge + // splitting and tail merging. } WebAssemblyTargetMachine::~WebAssemblyTargetMachine() {} @@ -184,6 +184,7 @@ void WebAssemblyPassConfig::addPostRegAlloc() { disablePass(&PrologEpilogCodeInserterID); // Fails with: should be run after register allocation. disablePass(&MachineCopyPropagationID); + disablePass(&TailDuplicateID); if (getOptLevel() != CodeGenOpt::None) { // Mark registers as representing wasm's expression stack. |