[llvm] r259083 - add masked intrinsic tests to show missed opportunities
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 11:54:20 PST 2016
Author: spatel
Date: Thu Jan 28 13:54:20 2016
New Revision: 259083
URL: http://llvm.org/viewvc/llvm-project?rev=259083&view=rev
Log:
add masked intrinsic tests to show missed opportunities
Added:
llvm/trunk/test/Transforms/InstCombine/masked_intrinsics.ll
Added: llvm/trunk/test/Transforms/InstCombine/masked_intrinsics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/masked_intrinsics.ll?rev=259083&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/masked_intrinsics.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/masked_intrinsics.ll Thu Jan 28 13:54:20 2016
@@ -0,0 +1,41 @@
+; RUN: opt -instcombine -S < %s | FileCheck %s
+
+declare <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
+
+; FIXME: All of these could be simplified.
+
+define <2 x double> @load_zeromask(<2 x double>* %ptr, <2 x double> %passthru) {
+ %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 1, <2 x i1> zeroinitializer, <2 x double> %passthru)
+ ret <2 x double> %res
+
+; CHECK-LABEL: @load_zeromask(
+; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 1, <2 x i1> zeroinitializer, <2 x double> %passthru)
+; CHECK-NEXT ret <2 x double> %res
+}
+
+define <2 x double> @load_onemask(<2 x double>* %ptr, <2 x double> %passthru) {
+ %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 2, <2 x i1> <i1 1, i1 1>, <2 x double> %passthru)
+ ret <2 x double> %res
+
+; CHECK-LABEL: @load_onemask(
+; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 2, <2 x i1> <i1 true, i1 true>, <2 x double> %passthru)
+; CHECK-NEXT ret <2 x double> %res
+}
+
+define <2 x double> @load_onesetbitmask1(<2 x double>* %ptr, <2 x double> %passthru) {
+ %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 3, <2 x i1> <i1 0, i1 1>, <2 x double> %passthru)
+ ret <2 x double> %res
+
+; CHECK-LABEL: @load_onesetbitmask1(
+; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 3, <2 x i1> <i1 false, i1 true>, <2 x double> %passthru)
+; CHECK-NEXT ret <2 x double> %res
+}
+
+define <2 x double> @load_onesetbitmask2(<2 x double>* %ptr, <2 x double> %passthru) {
+ %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 4, <2 x i1> <i1 1, i1 0>, <2 x double> %passthru)
+ ret <2 x double> %res
+
+; CHECK-LABEL: @load_onesetbitmask2(
+; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 4, <2 x i1> <i1 true, i1 false>, <2 x double> %passthru)
+; CHECK-NEXT ret <2 x double> %res
+}
More information about the llvm-commits
mailing list