OSDN Git Service

[WebAssembly] Optimize ISel for SIMD Boolean reductions
authorThomas Lively <tlively@google.com>
Wed, 19 Jun 2019 00:02:13 +0000 (00:02 +0000)
committerThomas Lively <tlively@google.com>
Wed, 19 Jun 2019 00:02:13 +0000 (00:02 +0000)
commit307315e0e9566fc96d47fcb35b42857988c48d0f
tree9e6d2604d7aa601adc5a1e03b3a2a53ce633c058
parent10df6f5ff35bc3fc9c1706a8a30621026a766416
[WebAssembly] Optimize ISel for SIMD Boolean reductions

Summary:
Converting the result *.{all,any}_true to a bool at the source level
generates LLVM IR that compares the result to 0. This check is
redundant since these instructions already return either 0 or 1 and
therefore conform to the BooleanContents setting for WebAssembly. This
CL adds patterns to detect and remove such redundant operations on the
result of Boolean reductions.

Reviewers: dschuff, aheejin

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363756 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
test/CodeGen/WebAssembly/simd-reductions.ll [new file with mode: 0644]