[all-commits] [llvm/llvm-project] f99d5f: [WebAssembly] Eliminate range checks on br_tables

Thomas Lively via All-commits all-commits at lists.llvm.org
Tue Jun 2 13:14:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f99d5f8c32a822580a732d15a34e8197da55d22b
      https://github.com/llvm/llvm-project/commit/f99d5f8c32a822580a732d15a34e8197da55d22b
  Author: Thomas Lively <tlively at google.com>
  Date:   2020-06-02 (Tue, 02 Jun 2020)

  Changed paths:
    M llvm/lib/Target/WebAssembly/CMakeLists.txt
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
    M llvm/lib/Target/WebAssembly/WebAssembly.h
    A llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
    M llvm/test/CodeGen/WebAssembly/cfg-stackify.ll
    M llvm/test/CodeGen/WebAssembly/indirectbr.ll
    M llvm/test/CodeGen/WebAssembly/stack-insts.ll
    A llvm/test/CodeGen/WebAssembly/switch-unreachable-default.ll
    M llvm/test/CodeGen/WebAssembly/switch.ll

  Log Message:
  -----------
  [WebAssembly] Eliminate range checks on br_tables

Summary:
Jump tables for most targets cannot handle out of range indices by
themselves, so LLVM emits range checks to guard the jump
tables. WebAssembly, on the other hand, implements jump tables using
the br_table instruction, which takes a default branch target as an
operand, making the range checks redundant. This patch introduces a
new MachineFunction pass in the WebAssembly backend to find and
eliminate the redundant range checks.

Reviewers: aheejin, dschuff

Subscribers: mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80863




More information about the All-commits mailing list