From 68d1052dc355480e7c8c2bf03ad1309a4a97a7f9 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 31 Jan 2019 23:22:39 +0000 Subject: [PATCH] [WebAssembly] Fix a regression selecting negative build_vector lanes Summary: The custom lowering introduced in rL352592 creates build_vector nodes with negative i32 operands, but these operands did not meet the value range constraints necessary to match build_vector nodes. This CL fixes the issue by removing the unnecessary constraints. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish Differential Revision: https://reviews.llvm.org/D57481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352813 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 2 +- test/CodeGen/WebAssembly/simd-build-vector.ll | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index b7ecd49c793..ab0f48c9a1e 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -30,7 +30,7 @@ defm "" : ARGUMENT; // Constrained immediate argument types foreach SIZE = [8, 16] in def ImmI#SIZE : ImmLeaf; foreach SIZE = [2, 4, 8, 16, 32] in def LaneIdx#SIZE : ImmLeaf; diff --git a/test/CodeGen/WebAssembly/simd-build-vector.ll b/test/CodeGen/WebAssembly/simd-build-vector.ll index ab08ef4be7d..41a320c92f7 100644 --- a/test/CodeGen/WebAssembly/simd-build-vector.ll +++ b/test/CodeGen/WebAssembly/simd-build-vector.ll @@ -23,12 +23,12 @@ define <8 x i16> @same_const_one_replaced_i8x16(i16 %x) { ; CHECK-LABEL: different_const_one_replaced_i8x16: ; CHECK-NEXT: .functype different_const_one_replaced_i8x16 (i32) -> (v128) -; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 1, 2, 3, 4, 5, 0, 7, 8 +; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 1, -2, 3, -4, 5, 0, 7, -8 ; CHECK-NEXT: i16x8.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 5, $0 ; CHECK-NEXT: return $pop[[L1]] define <8 x i16> @different_const_one_replaced_i8x16(i16 %x) { %v = insertelement - <8 x i16> , + <8 x i16> , i16 %x, i32 5 ret <8 x i16> %v -- 2.40.0