aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2020-06-03 14:04:59 -0700
committerThomas Lively <tlively@google.com>2020-06-03 14:04:59 -0700
commit7f50c15be5c020b2789f83dc3c87d28f8294664f (patch)
tree4d30960311ac91c8558394cff79aeb8410e0577c /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parentd496437a0bfd6d135343026cdb7b6a69cb6af536 (diff)
downloadllvm-7f50c15be5c020b2789f83dc3c87d28f8294664f.zip
llvm-7f50c15be5c020b2789f83dc3c87d28f8294664f.tar.gz
llvm-7f50c15be5c020b2789f83dc3c87d28f8294664f.tar.bz2
Reland "[WebAssembly] Eliminate range checks on br_tables"
This reverts commit 755a89591528b692315ad0325347e2fd4637271b. Although I was not able to reproduce any test failures locally, aheejin was able to reproduce them and found a fix, applied here.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index ca098427..7bf655c9 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -406,6 +406,10 @@ bool WebAssemblyPassConfig::addInstSelector() {
// it's inconvenient to collect. Collect it now, and update the immediate
// operands.
addPass(createWebAssemblySetP2AlignOperands());
+
+ // Eliminate range checks and add default targets to br_table instructions.
+ addPass(createWebAssemblyFixBrTableDefaults());
+
return false;
}