1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=early-cse < %s | FileCheck %s
4 define <128 x i8> @f0(ptr %a0, <128 x i8> %a1, <128 x i8> %a2) {
6 ; CHECK-NEXT: [[V0:%.*]] = icmp eq <128 x i8> [[A1:%.*]], [[A2:%.*]]
7 ; CHECK-NEXT: call void @llvm.masked.store.v128i8.p0(<128 x i8> [[A1]], ptr [[A0:%.*]], i32 4, <128 x i1> [[V0]])
8 ; CHECK-NEXT: ret <128 x i8> [[A1]]
10 %v0 = icmp eq <128 x i8> %a1, %a2
11 call void @llvm.masked.store.v128i8.p0(<128 x i8> %a1, ptr %a0, i32 4, <128 x i1> %v0)
12 %v1 = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr %a0, i32 4, <128 x i1> %v0, <128 x i8> undef)
16 define <128 x i8> @f1(ptr %a0, <128 x i8> %a1, <128 x i8> %a2) {
18 ; CHECK-NEXT: [[V0:%.*]] = icmp eq <128 x i8> [[A1:%.*]], [[A2:%.*]]
19 ; CHECK-NEXT: [[V1:%.*]] = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr [[A0:%.*]], i32 4, <128 x i1> [[V0]], <128 x i8> undef)
20 ; CHECK-NEXT: ret <128 x i8> [[V1]]
22 %v0 = icmp eq <128 x i8> %a1, %a2
23 %v1 = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr %a0, i32 4, <128 x i1> %v0, <128 x i8> undef)
24 call void @llvm.masked.store.v128i8.p0(<128 x i8> %v1, ptr %a0, i32 4, <128 x i1> %v0)
28 define <128 x i8> @f2(ptr %a0, <128 x i8> %a1, <128 x i8> %a2) {
30 ; CHECK-NEXT: [[V0:%.*]] = icmp eq <128 x i8> [[A1:%.*]], [[A2:%.*]]
31 ; CHECK-NEXT: [[V1:%.*]] = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr [[A0:%.*]], i32 4, <128 x i1> [[V0]], <128 x i8> undef)
32 ; CHECK-NEXT: [[V3:%.*]] = add <128 x i8> [[V1]], [[V1]]
33 ; CHECK-NEXT: ret <128 x i8> [[V3]]
35 %v0 = icmp eq <128 x i8> %a1, %a2
36 %v1 = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr %a0, i32 4, <128 x i1> %v0, <128 x i8> undef)
37 %v2 = call <128 x i8> @llvm.masked.load.v128i8.p0(ptr %a0, i32 4, <128 x i1> %v0, <128 x i8> undef)
38 %v3 = add <128 x i8> %v1, %v2
42 declare <128 x i8> @llvm.masked.load.v128i8.p0(ptr, i32, <128 x i1>, <128 x i8>)
43 declare void @llvm.masked.store.v128i8.p0(<128 x i8>, ptr, i32, <128 x i1>)