1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -inline < %s | FileCheck %s
4 ; Test interaction of simplification during cloning with insertion of scoped
7 define <2 x i8> @callee1(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1> %mask, <2 x i8> %passthru) {
8 ; CHECK-LABEL: @callee1(
9 ; CHECK-NEXT: [[RET:%.*]] = call <2 x i8> @llvm.masked.load.v2i8.p0v2i8(<2 x i8>* [[PTR1:%.*]], i32 1, <2 x i1> [[MASK:%.*]], <2 x i8> [[PASSTHRU:%.*]])
10 ; CHECK-NEXT: store <2 x i8> zeroinitializer, <2 x i8>* [[PTR2:%.*]], align 2
11 ; CHECK-NEXT: ret <2 x i8> [[RET]]
13 %ret = call <2 x i8> @llvm.masked.load.v2i8(<2 x i8>* %ptr1, i32 1, <2 x i1> %mask, <2 x i8> %passthru)
14 store <2 x i8> zeroinitializer, <2 x i8>* %ptr2
18 ; The load should not have !noalias.
19 define void @caller1(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
20 ; CHECK-LABEL: @caller1(
21 ; CHECK-NEXT: [[PASSTHRU:%.*]] = load <2 x i8>, <2 x i8>* [[PTR2:%.*]], align 2{{$}}
22 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META0:![0-9]+]])
23 ; CHECK-NEXT: store <2 x i8> zeroinitializer, <2 x i8>* [[PTR2]], align 2, !alias.scope !0
24 ; CHECK-NEXT: ret void
26 %passthru = load <2 x i8>, <2 x i8>* %ptr2
27 call <2 x i8> @callee1(<2 x i8>* %ptr1, <2 x i8>* %ptr2, <2 x i1> zeroinitializer, <2 x i8> %passthru)
31 define <2 x i8> @callee2(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1> %mask) {
32 ; CHECK-LABEL: @callee2(
33 ; CHECK-NEXT: [[PASSTHRU:%.*]] = load <2 x i8>, <2 x i8>* [[PTR2:%.*]], align 2
34 ; CHECK-NEXT: [[RET:%.*]] = call <2 x i8> @llvm.masked.load.v2i8.p0v2i8(<2 x i8>* [[PTR1:%.*]], i32 1, <2 x i1> [[MASK:%.*]], <2 x i8> [[PASSTHRU]])
35 ; CHECK-NEXT: store <2 x i8> zeroinitializer, <2 x i8>* [[PTR2]], align 2
36 ; CHECK-NEXT: ret <2 x i8> [[RET]]
38 %passthru = load <2 x i8>, <2 x i8>* %ptr2
39 %ret = call <2 x i8> @llvm.masked.load.v2i8(<2 x i8>* %ptr1, i32 1, <2 x i1> %mask, <2 x i8> %passthru)
40 store <2 x i8> zeroinitializer, <2 x i8>* %ptr2
44 ; The load should not have !noalias.
45 define void @caller2(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
46 ; CHECK-LABEL: @caller2(
47 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]])
48 ; CHECK-NEXT: [[PASSTHRU_I:%.*]] = load <2 x i8>, <2 x i8>* [[PTR2:%.*]], align 2, !alias.scope !3{{$}}
49 ; CHECK-NEXT: store <2 x i8> zeroinitializer, <2 x i8>* [[PTR2]], align 2, !alias.scope !3
50 ; CHECK-NEXT: ret void
52 call <2 x i8> @callee2(<2 x i8>* %ptr1, <2 x i8>* %ptr2, <2 x i1> zeroinitializer)
56 declare <2 x i8> @llvm.masked.load.v2i8(<2 x i8>*, i32, <2 x i1>, <2 x i8>)