diff options
author | Thomas Lively <tlively@google.com> | 2018-08-23 19:23:13 +0000 |
---|---|---|
committer | Thomas Lively <tlively@google.com> | 2018-08-23 19:23:13 +0000 |
commit | da26b84bd0cf996badc6c1c876f5a363158ca8d4 (patch) | |
tree | d34f528de5e06915def812a9061a4eccbf2c78d1 /llvm/lib | |
parent | 1542b0aef5230d0748e8791c16db66debf95d46d (diff) | |
download | bcm5719-llvm-da26b84bd0cf996badc6c1c876f5a363158ca8d4.tar.gz bcm5719-llvm-da26b84bd0cf996badc6c1c876f5a363158ca8d4.zip |
[WebAssembly] Prioritize splats over v128.consts
Summary:
Splats are fewer bytes than v128.consts, so use them when either could
apply.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D51179
llvm-svn: 340569
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index 07d3dbc8abb..2ea5c8d97a0 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -85,6 +85,8 @@ def splat16 : PatFrag<(ops node:$x), (build_vector node:$x, node:$x, node:$x, node:$x)>; multiclass Splat<ValueType vec_t, string vec, WebAssemblyRegClass reg_t, PatFrag splat_pat, bits<32> simdop> { + // Prefer splats over v128.const for const splats (65 is lowest that works) + let AddedComplexity = 65 in defm SPLAT_#vec_t : SIMD_I<(outs V128:$dst), (ins reg_t:$x), (outs), (ins), [(set (vec_t V128:$dst), (splat_pat reg_t:$x))], vec#".splat\t$dst, $x", vec#".splat", simdop>; |