; RUN: opt -passes='sroa<preserve-cfg>' -data-layout="E-n8:16:32" -S %s | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-SCALAR,CHECK-SCALAR-32,CHECK-BE-32
; RUN: opt -passes='sroa<modify-cfg>' -data-layout="E-n8:16:32" -S %s | FileCheck %s --check-prefixes=CHECK-ALL,CHECK-SCALAR,CHECK-SCALAR-32,CHECK-BE-32
-define void @load-1byte-chunk-of-1byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-1byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-1byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [1 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <1 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <1 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [1 x i8], align 64
store <1 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-1byte-chunk-of-2byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-2byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-2byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [2 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <2 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <2 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [2 x i8], align 64
store <2 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-2byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-2byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-2byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [2 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <2 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <2 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [2 x i8], align 64
store <2 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-1byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-4byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [4 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <4 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <4 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [4 x i8], align 64
store <4 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-4byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [4 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <4 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <4 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [4 x i8], align 64
store <4 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-4byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-4byte-chunk-of-4byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-4byte-chunk-of-4byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [4 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <4 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <4 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <4 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v4i8(<4 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <4 x i8> [[CHUNK]], ptr [[DST:%.*]], align 4
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [4 x i8], align 64
store <4 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <4 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v4i8(<4 x i8> %chunk)
+ store <4 x i8> %chunk, ptr %dst
ret void
}
-define void @load-1byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-8byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-4byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-4byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-4byte-chunk-of-8byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <4 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v4i8(<4 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <4 x i8> [[CHUNK]], ptr [[DST:%.*]], align 4
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <4 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v4i8(<4 x i8> %chunk)
+ store <4 x i8> %chunk, ptr %dst
ret void
}
-define void @load-8byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-8byte-chunk-of-8byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-8byte-chunk-of-8byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <8 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v8i8(<8 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <8 x i8> [[CHUNK]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <8 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v8i8(<8 x i8> %chunk)
+ store <8 x i8> %chunk, ptr %dst
ret void
}
-define void @load-1byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-4byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-4byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-4byte-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <4 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v4i8(<4 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <4 x i8> [[CHUNK]], ptr [[DST:%.*]], align 4
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <4 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v4i8(<4 x i8> %chunk)
+ store <4 x i8> %chunk, ptr %dst
ret void
}
-define void @load-8byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-8byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-8byte-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <8 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v8i8(<8 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <8 x i8> [[CHUNK]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <8 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v8i8(<8 x i8> %chunk)
+ store <8 x i8> %chunk, ptr %dst
ret void
}
-define void @load-16byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-16byte-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-16byte-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <16 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v16i8(<16 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <16 x i8> [[CHUNK]], ptr [[DST:%.*]], align 16
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <16 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v16i8(<16 x i8> %chunk)
+ store <16 x i8> %chunk, ptr %dst
ret void
}
-define void @load-1byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-1byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-1byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1i8(<1 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x i8> [[CHUNK]], ptr [[DST:%.*]], align 1
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v1i8(<1 x i8> %chunk)
+ store <1 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-4byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-4byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-4byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <4 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v4i8(<4 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <4 x i8> [[CHUNK]], ptr [[DST:%.*]], align 4
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <4 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v4i8(<4 x i8> %chunk)
+ store <4 x i8> %chunk, ptr %dst
ret void
}
-define void @load-8byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-8byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-8byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <8 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v8i8(<8 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <8 x i8> [[CHUNK]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <8 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v8i8(<8 x i8> %chunk)
+ store <8 x i8> %chunk, ptr %dst
ret void
}
-define void @load-16byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-16byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-16byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <16 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v16i8(<16 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <16 x i8> [[CHUNK]], ptr [[DST:%.*]], align 16
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <16 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v16i8(<16 x i8> %chunk)
+ store <16 x i8> %chunk, ptr %dst
ret void
}
-define void @load-32byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-32byte-chunk-of-32byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-32byte-chunk-of-32byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [32 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <32 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <32 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <32 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v32i8(<32 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <32 x i8> [[CHUNK]], ptr [[DST:%.*]], align 32
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [32 x i8], align 64
store <32 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <32 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v32i8(<32 x i8> %chunk)
+ store <32 x i8> %chunk, ptr %dst
ret void
}
;; Special test
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff) {
+define void @load-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load volatile <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
%chunk = load volatile <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @store-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, <2 x i8> %reinit) {
+define void @store-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, <2 x i8> %reinit, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @store-2byte-chunk-of-8byte-alloca-with-2byte-step(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: store <2 x i8> [[REINIT:%.*]], ptr [[INTERMEDIATE_OFF_ADDR]], align 1
; CHECK-ALL-NEXT: [[FINAL:%.*]] = load <8 x i8>, ptr [[INTERMEDIATE]], align 1
-; CHECK-ALL-NEXT: call void @use.v8i8(<8 x i8> [[FINAL]])
+; CHECK-ALL-NEXT: store <8 x i8> [[FINAL]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
store <2 x i8> %reinit, ptr %intermediate.off.addr, align 1
%final = load <8 x i8>, ptr %intermediate, align 1
- call void @use.v8i8(<8 x i8> %final)
+ store <8 x i8> %final, ptr %dst
ret void
}
-define void @store-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, <2 x i8> %reinit) {
+define void @store-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(ptr %src, i64 %byteOff, <2 x i8> %reinit, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @store-volatile-2byte-chunk-of-8byte-alloca-with-2byte-step(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: store volatile <2 x i8> [[REINIT:%.*]], ptr [[INTERMEDIATE_OFF_ADDR]], align 1
; CHECK-ALL-NEXT: [[FINAL:%.*]] = load <8 x i8>, ptr [[INTERMEDIATE]], align 1
-; CHECK-ALL-NEXT: call void @use.v8i8(<8 x i8> [[FINAL]])
+; CHECK-ALL-NEXT: store <8 x i8> [[FINAL]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
store volatile <2 x i8> %reinit, ptr %intermediate.off.addr, align 1
%final = load <8 x i8>, ptr %intermediate, align 1
- call void @use.v8i8(<8 x i8> %final)
+ store <8 x i8> %final, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-beforehand(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-beforehand(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-beforehand(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR_CST:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF_ADDR_CST]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr.cst = getelementptr inbounds i16, ptr %intermediate, i64 1
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate.off.addr.cst, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-afterwards(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-afterwards(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-constant-offset-afterwards(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR_VARIABLE:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF_ADDR_VARIABLE]], i64 1
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr.variable = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate.off.addr.variable, i64 1
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-variable-offset-inbetween-constant-offsets(ptr %src, i64 %byteOff) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-variable-offset-inbetween-constant-offsets(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-with-variable-offset-inbetween-constant-offsets(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR_VARIABLE:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF_ADDR_CST]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF_ADDR_VARIABLE]], i64 1
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr.variable = getelementptr inbounds i16, ptr %intermediate.off.addr.cst, i64 %byteOff
%intermediate.off.addr = getelementptr inbounds i16, ptr %intermediate.off.addr.variable, i64 1
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-geps(ptr %src, i64 %byteOff0, i64 %byteOff1, i1 %cond) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-geps(ptr %src, i64 %byteOff0, i64 %byteOff1, i1 %cond, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-geps(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF1:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF1:%.*]]
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = select i1 [[COND:%.*]], ptr [[INTERMEDIATE_OFF0]], ptr [[INTERMEDIATE_OFF1]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off1 = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff1
%intermediate.off.addr = select i1 %cond, ptr %intermediate.off0, ptr %intermediate.off1
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-and-const-geps(ptr %src, i64 %byteOff0, i64 %byteOff1, i1 %cond) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-and-const-geps(ptr %src, i64 %byteOff0, i64 %byteOff1, i1 %cond, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-select-of-variable-and-const-geps(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF1:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF1:%.*]]
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = select i1 [[COND:%.*]], ptr [[INTERMEDIATE_OFF0]], ptr [[INTERMEDIATE_OFF1]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off1 = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff1
%intermediate.off.addr = select i1 %cond, ptr %intermediate.off0, ptr %intermediate.off1
%chunk = load <2 x i8>, ptr %intermediate.off.addr, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-variable-gep-of-select-of-const-geps(ptr %src, i64 %byteOff, i1 %cond) {
+define void @load-2byte-chunk-of-8byte-alloca-with-2byte-step-variable-gep-of-select-of-const-geps(ptr %src, i64 %byteOff, i1 %cond, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-2byte-chunk-of-8byte-alloca-with-2byte-step-variable-gep-of-select-of-const-geps(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = select i1 [[COND:%.*]], ptr [[INTERMEDIATE_OFF0]], ptr [[INTERMEDIATE_OFF1]]
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR_VAR:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF_ADDR]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF_ADDR_VAR]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK]], ptr [[DST:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
%intermediate.off.addr = select i1 %cond, ptr %intermediate.off0, ptr %intermediate.off1
%intermediate.off.addr.var = getelementptr inbounds i16, ptr %intermediate.off.addr, i64 %byteOff
%chunk = load <2 x i8>, ptr %intermediate.off.addr.var, align 1
- call void @use.v2i8(<2 x i8> %chunk)
+ store <2 x i8> %chunk, ptr %dst
ret void
}
-define void @load-ptr-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-ptr-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-ptr-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x ptr>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1ptr(<1 x ptr> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x ptr> [[CHUNK]], ptr [[DST:%.*]], align 8
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x ptr>, ptr %intermediate.off.addr, align 1
- call void @use.v1ptr(<1 x ptr> %chunk)
+ store <1 x ptr> %chunk, ptr %dst
ret void
}
-define void @load-float-chunk-of-16byte-alloca(ptr %src, i64 %byteOff) {
+define void @load-float-chunk-of-16byte-alloca(ptr %src, i64 %byteOff, ptr %dst) nounwind {
; CHECK-ALL-LABEL: @load-float-chunk-of-16byte-alloca(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [16 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <16 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <16 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF_ADDR:%.*]] = getelementptr inbounds i8, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK:%.*]] = load <1 x float>, ptr [[INTERMEDIATE_OFF_ADDR]], align 1
-; CHECK-ALL-NEXT: call void @use.v1float(<1 x float> [[CHUNK]])
+; CHECK-ALL-NEXT: store <1 x float> [[CHUNK]], ptr [[DST:%.*]], align 4
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [16 x i8], align 64
store <16 x i8> %init, ptr %intermediate, align 64
%intermediate.off.addr = getelementptr inbounds i8, ptr %intermediate, i64 %byteOff
%chunk = load <1 x float>, ptr %intermediate.off.addr, align 1
- call void @use.v1float(<1 x float> %chunk)
+ store <1 x float> %chunk, ptr %dst
ret void
}
-define void @two-loads-of-same-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-gep(ptr %src, i64 %byteOff) {
+define void @two-loads-of-same-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-gep(ptr %src, i64 %byteOff, ptr %dst0, ptr %dst1) nounwind {
; CHECK-ALL-LABEL: @two-loads-of-same-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-gep(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF:%.*]]
; CHECK-ALL-NEXT: [[CHUNK0:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK0]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK0]], ptr [[DST0:%.*]], align 2
; CHECK-ALL-NEXT: [[CHUNK1:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK1]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK1]], ptr [[DST1:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff
%chunk0 = load <2 x i8>, ptr %intermediate.off, align 1
- call void @use.v2i8(<2 x i8> %chunk0)
+ store <2 x i8> %chunk0, ptr %dst0
%chunk1 = load <2 x i8>, ptr %intermediate.off, align 1
- call void @use.v2i8(<2 x i8> %chunk1)
+ store <2 x i8> %chunk1, ptr %dst1
ret void
}
-define void @two-loads-of-two-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-geps(ptr %src, i64 %byteOff0, i64 %byteOff1) {
+define void @two-loads-of-two-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-geps(ptr %src, i64 %byteOff0, i64 %byteOff1, ptr %dst0, ptr %dst1) nounwind {
; CHECK-ALL-LABEL: @two-loads-of-two-2byte-chunks-of-8byte-alloca-with-2byte-step-variable-geps(
; CHECK-ALL-NEXT: [[INTERMEDIATE:%.*]] = alloca [8 x i8], align 64
; CHECK-ALL-NEXT: [[INIT:%.*]] = load <8 x i8>, ptr [[SRC:%.*]], align 1
; CHECK-ALL-NEXT: store <8 x i8> [[INIT]], ptr [[INTERMEDIATE]], align 64
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF0:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE]], i64 [[BYTEOFF0:%.*]]
; CHECK-ALL-NEXT: [[CHUNK0:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF0]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK0]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK0]], ptr [[DST0:%.*]], align 2
; CHECK-ALL-NEXT: [[INTERMEDIATE_OFF1:%.*]] = getelementptr inbounds i16, ptr [[INTERMEDIATE_OFF0]], i64 [[BYTEOFF1:%.*]]
; CHECK-ALL-NEXT: [[CHUNK1:%.*]] = load <2 x i8>, ptr [[INTERMEDIATE_OFF1]], align 1
-; CHECK-ALL-NEXT: call void @use.v2i8(<2 x i8> [[CHUNK1]])
+; CHECK-ALL-NEXT: store <2 x i8> [[CHUNK1]], ptr [[DST1:%.*]], align 2
; CHECK-ALL-NEXT: ret void
;
%intermediate = alloca [8 x i8], align 64
store <8 x i8> %init, ptr %intermediate, align 64
%intermediate.off0 = getelementptr inbounds i16, ptr %intermediate, i64 %byteOff0
%chunk0 = load <2 x i8>, ptr %intermediate.off0, align 1
- call void @use.v2i8(<2 x i8> %chunk0)
+ store <2 x i8> %chunk0, ptr %dst0
%intermediate.off1 = getelementptr inbounds i16, ptr %intermediate.off0, i64 %byteOff1
%chunk1 = load <2 x i8>, ptr %intermediate.off1, align 1
- call void @use.v2i8(<2 x i8> %chunk1)
+ store <2 x i8> %chunk1, ptr %dst1
ret void
}
-
-declare void @use.v1ptr(<1 x ptr>)
-declare void @use.v1float(<1 x float>)
-declare void @use.v1i8(<1 x i8>)
-declare void @use.v2i8(<2 x i8>)
-declare void @use.v4i8(<4 x i8>)
-declare void @use.v8i8(<8 x i8>)
-declare void @use.v16i8(<16 x i8>)
-declare void @use.v32i8(<32 x i8>)
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK-BE-32: {{.*}}
; CHECK-BE-64: {{.*}}