From: Philip Reames Date: Mon, 22 Apr 2019 18:28:44 +0000 (+0000) Subject: [Tests] Add a negative test for masked.gather part of D59703 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b5296b223c7f3afbd31c707125fb2760557b124;p=llvm [Tests] Add a negative test for masked.gather part of D59703 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358906 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/masked_intrinsics.ll b/test/Transforms/InstCombine/masked_intrinsics.ll index 582fd8f5c82..66f04a17682 100644 --- a/test/Transforms/InstCombine/masked_intrinsics.ll +++ b/test/Transforms/InstCombine/masked_intrinsics.ll @@ -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(