]> granicus.if.org Git - llvm/commitdiff
[Tests] Add a negative test for masked.gather part of D59703
authorPhilip Reames <listmail@philipreames.com>
Mon, 22 Apr 2019 18:28:44 +0000 (18:28 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 22 Apr 2019 18:28:44 +0000 (18:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358906 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/masked_intrinsics.ll

index 582fd8f5c82e94c9d672d719c510206736162f8b..66f04a176825cd4bfbc4049711ab179fe5f23f20 100644 (file)
@@ -97,6 +97,20 @@ define <2 x double> @load_speculative(<2 x double>* dereferenceable(16) %ptr,
   ret <2 x double> %res
 }
 
+define <2 x double> @neg_load_spec_width(<2 x double>* dereferenceable(8) %ptr,
+; CHECK-LABEL: @neg_load_spec_width(
+; CHECK-NEXT:    [[PTV1:%.*]] = insertelement <2 x double> undef, double [[PT:%.*]], i64 0
+; CHECK-NEXT:    [[PTV2:%.*]] = shufflevector <2 x double> [[PTV1]], <2 x double> undef, <2 x i32> zeroinitializer
+; CHECK-NEXT:    [[RES:%.*]] = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* nonnull [[PTR:%.*]], i32 4, <2 x i1> [[MASK:%.*]], <2 x double> [[PTV2]])
+; CHECK-NEXT:    ret <2 x double> [[RES]]
+;
+  double %pt, <2 x i1> %mask)  {
+  %ptv1 = insertelement <2 x double> undef, double %pt, i64 0
+  %ptv2 = insertelement <2 x double> %ptv1, double %pt, i64 1
+  %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %ptr, i32 4, <2 x i1> %mask, <2 x double> %ptv2)
+  ret <2 x double> %res
+}
+
 ; Can't speculate since only half of required size is known deref
 define <2 x double> @load_spec_neg_size(<2 x double>* dereferenceable(8) %ptr,
 ; CHECK-LABEL: @load_spec_neg_size(