[llvm] r290385 - [AArch64] Simplify indexed-memory testcase. NFC.
Ahmed Bougacha via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 14:27:05 PST 2016
Author: ab
Date: Thu Dec 22 16:27:05 2016
New Revision: 290385
URL: http://llvm.org/viewvc/llvm-project?rev=290385&view=rev
Log:
[AArch64] Simplify indexed-memory testcase. NFC.
We're only testing the addressing mode on the stores; we don't
need to load/store pointers we can simply pass/return.
Modified:
llvm/trunk/test/CodeGen/AArch64/arm64-indexed-memory.ll
Modified: llvm/trunk/test/CodeGen/AArch64/arm64-indexed-memory.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-indexed-memory.ll?rev=290385&r1=290384&r2=290385&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-indexed-memory.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/arm64-indexed-memory.ll Thu Dec 22 16:27:05 2016
@@ -1,414 +1,347 @@
; RUN: llc < %s -mtriple=arm64-eabi -aarch64-redzone | FileCheck %s
-define void @store64(i64** nocapture %out, i64 %index, i64 %spacing) nounwind noinline ssp {
+define i64* @store64(i64* %ptr, i64 %index, i64 %spacing) {
; CHECK-LABEL: store64:
; CHECK: str x{{[0-9+]}}, [x{{[0-9+]}}], #8
; CHECK: ret
- %tmp = load i64*, i64** %out, align 8
- %incdec.ptr = getelementptr inbounds i64, i64* %tmp, i64 1
- store i64 %spacing, i64* %tmp, align 4
- store i64* %incdec.ptr, i64** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 1
+ store i64 %spacing, i64* %ptr, align 4
+ ret i64* %incdec.ptr
}
-define void @store64idxpos256(i64** nocapture %out, i64 %index, i64 %spacing) nounwind noinline ssp {
+define i64* @store64idxpos256(i64* %ptr, i64 %index, i64 %spacing) {
; CHECK-LABEL: store64idxpos256:
; CHECK: add x{{[0-9+]}}, x{{[0-9+]}}, #256
; CHECK: str x{{[0-9+]}}, [x{{[0-9+]}}]
; CHECK: ret
- %tmp = load i64*, i64** %out, align 8
- %incdec.ptr = getelementptr inbounds i64, i64* %tmp, i64 32
- store i64 %spacing, i64* %tmp, align 4
- store i64* %incdec.ptr, i64** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 32
+ store i64 %spacing, i64* %ptr, align 4
+ ret i64* %incdec.ptr
}
-define void @store64idxneg256(i64** nocapture %out, i64 %index, i64 %spacing) nounwind noinline ssp {
+define i64* @store64idxneg256(i64* %ptr, i64 %index, i64 %spacing) {
; CHECK-LABEL: store64idxneg256:
; CHECK: str x{{[0-9+]}}, [x{{[0-9+]}}], #-256
; CHECK: ret
- %tmp = load i64*, i64** %out, align 8
- %incdec.ptr = getelementptr inbounds i64, i64* %tmp, i64 -32
- store i64 %spacing, i64* %tmp, align 4
- store i64* %incdec.ptr, i64** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 -32
+ store i64 %spacing, i64* %ptr, align 4
+ ret i64* %incdec.ptr
}
-define void @store32(i32** nocapture %out, i32 %index, i32 %spacing) nounwind noinline ssp {
+define i32* @store32(i32* %ptr, i32 %index, i32 %spacing) {
; CHECK-LABEL: store32:
; CHECK: str w{{[0-9+]}}, [x{{[0-9+]}}], #4
; CHECK: ret
- %tmp = load i32*, i32** %out, align 8
- %incdec.ptr = getelementptr inbounds i32, i32* %tmp, i64 1
- store i32 %spacing, i32* %tmp, align 4
- store i32* %incdec.ptr, i32** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 1
+ store i32 %spacing, i32* %ptr, align 4
+ ret i32* %incdec.ptr
}
-define void @store32idxpos256(i32** nocapture %out, i32 %index, i32 %spacing) nounwind noinline ssp {
+define i32* @store32idxpos256(i32* %ptr, i32 %index, i32 %spacing) {
; CHECK-LABEL: store32idxpos256:
; CHECK: add x{{[0-9+]}}, x{{[0-9+]}}, #256
; CHECK: str w{{[0-9+]}}, [x{{[0-9+]}}]
; CHECK: ret
- %tmp = load i32*, i32** %out, align 8
- %incdec.ptr = getelementptr inbounds i32, i32* %tmp, i64 64
- store i32 %spacing, i32* %tmp, align 4
- store i32* %incdec.ptr, i32** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 64
+ store i32 %spacing, i32* %ptr, align 4
+ ret i32* %incdec.ptr
}
-define void @store32idxneg256(i32** nocapture %out, i32 %index, i32 %spacing) nounwind noinline ssp {
+define i32* @store32idxneg256(i32* %ptr, i32 %index, i32 %spacing) {
; CHECK-LABEL: store32idxneg256:
; CHECK: str w{{[0-9+]}}, [x{{[0-9+]}}], #-256
; CHECK: ret
- %tmp = load i32*, i32** %out, align 8
- %incdec.ptr = getelementptr inbounds i32, i32* %tmp, i64 -64
- store i32 %spacing, i32* %tmp, align 4
- store i32* %incdec.ptr, i32** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 -64
+ store i32 %spacing, i32* %ptr, align 4
+ ret i32* %incdec.ptr
}
-define void @store16(i16** nocapture %out, i16 %index, i16 %spacing) nounwind noinline ssp {
+define i16* @store16(i16* %ptr, i16 %index, i16 %spacing) {
; CHECK-LABEL: store16:
; CHECK: strh w{{[0-9+]}}, [x{{[0-9+]}}], #2
; CHECK: ret
- %tmp = load i16*, i16** %out, align 8
- %incdec.ptr = getelementptr inbounds i16, i16* %tmp, i64 1
- store i16 %spacing, i16* %tmp, align 4
- store i16* %incdec.ptr, i16** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 1
+ store i16 %spacing, i16* %ptr, align 4
+ ret i16* %incdec.ptr
}
-define void @store16idxpos256(i16** nocapture %out, i16 %index, i16 %spacing) nounwind noinline ssp {
+define i16* @store16idxpos256(i16* %ptr, i16 %index, i16 %spacing) {
; CHECK-LABEL: store16idxpos256:
; CHECK: add x{{[0-9+]}}, x{{[0-9+]}}, #256
; CHECK: strh w{{[0-9+]}}, [x{{[0-9+]}}]
; CHECK: ret
- %tmp = load i16*, i16** %out, align 8
- %incdec.ptr = getelementptr inbounds i16, i16* %tmp, i64 128
- store i16 %spacing, i16* %tmp, align 4
- store i16* %incdec.ptr, i16** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 128
+ store i16 %spacing, i16* %ptr, align 4
+ ret i16* %incdec.ptr
}
-define void @store16idxneg256(i16** nocapture %out, i16 %index, i16 %spacing) nounwind noinline ssp {
+define i16* @store16idxneg256(i16* %ptr, i16 %index, i16 %spacing) {
; CHECK-LABEL: store16idxneg256:
; CHECK: strh w{{[0-9+]}}, [x{{[0-9+]}}], #-256
; CHECK: ret
- %tmp = load i16*, i16** %out, align 8
- %incdec.ptr = getelementptr inbounds i16, i16* %tmp, i64 -128
- store i16 %spacing, i16* %tmp, align 4
- store i16* %incdec.ptr, i16** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 -128
+ store i16 %spacing, i16* %ptr, align 4
+ ret i16* %incdec.ptr
}
-define void @store8(i8** nocapture %out, i8 %index, i8 %spacing) nounwind noinline ssp {
+define i8* @store8(i8* %ptr, i8 %index, i8 %spacing) {
; CHECK-LABEL: store8:
; CHECK: strb w{{[0-9+]}}, [x{{[0-9+]}}], #1
; CHECK: ret
- %tmp = load i8*, i8** %out, align 8
- %incdec.ptr = getelementptr inbounds i8, i8* %tmp, i64 1
- store i8 %spacing, i8* %tmp, align 4
- store i8* %incdec.ptr, i8** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 1
+ store i8 %spacing, i8* %ptr, align 4
+ ret i8* %incdec.ptr
}
-define void @store8idxpos256(i8** nocapture %out, i8 %index, i8 %spacing) nounwind noinline ssp {
+define i8* @store8idxpos256(i8* %ptr, i8 %index, i8 %spacing) {
; CHECK-LABEL: store8idxpos256:
; CHECK: add x{{[0-9+]}}, x{{[0-9+]}}, #256
; CHECK: strb w{{[0-9+]}}, [x{{[0-9+]}}]
; CHECK: ret
- %tmp = load i8*, i8** %out, align 8
- %incdec.ptr = getelementptr inbounds i8, i8* %tmp, i64 256
- store i8 %spacing, i8* %tmp, align 4
- store i8* %incdec.ptr, i8** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 256
+ store i8 %spacing, i8* %ptr, align 4
+ ret i8* %incdec.ptr
}
-define void @store8idxneg256(i8** nocapture %out, i8 %index, i8 %spacing) nounwind noinline ssp {
+define i8* @store8idxneg256(i8* %ptr, i8 %index, i8 %spacing) {
; CHECK-LABEL: store8idxneg256:
; CHECK: strb w{{[0-9+]}}, [x{{[0-9+]}}], #-256
; CHECK: ret
- %tmp = load i8*, i8** %out, align 8
- %incdec.ptr = getelementptr inbounds i8, i8* %tmp, i64 -256
- store i8 %spacing, i8* %tmp, align 4
- store i8* %incdec.ptr, i8** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 -256
+ store i8 %spacing, i8* %ptr, align 4
+ ret i8* %incdec.ptr
}
-define void @truncst64to32(i32** nocapture %out, i32 %index, i64 %spacing) nounwind noinline ssp {
+define i32* @truncst64to32(i32* %ptr, i32 %index, i64 %spacing) {
; CHECK-LABEL: truncst64to32:
; CHECK: str w{{[0-9+]}}, [x{{[0-9+]}}], #4
; CHECK: ret
- %tmp = load i32*, i32** %out, align 8
- %incdec.ptr = getelementptr inbounds i32, i32* %tmp, i64 1
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 1
%trunc = trunc i64 %spacing to i32
- store i32 %trunc, i32* %tmp, align 4
- store i32* %incdec.ptr, i32** %out, align 8
- ret void
+ store i32 %trunc, i32* %ptr, align 4
+ ret i32* %incdec.ptr
}
-define void @truncst64to16(i16** nocapture %out, i16 %index, i64 %spacing) nounwind noinline ssp {
+define i16* @truncst64to16(i16* %ptr, i16 %index, i64 %spacing) {
; CHECK-LABEL: truncst64to16:
; CHECK: strh w{{[0-9+]}}, [x{{[0-9+]}}], #2
; CHECK: ret
- %tmp = load i16*, i16** %out, align 8
- %incdec.ptr = getelementptr inbounds i16, i16* %tmp, i64 1
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 1
%trunc = trunc i64 %spacing to i16
- store i16 %trunc, i16* %tmp, align 4
- store i16* %incdec.ptr, i16** %out, align 8
- ret void
+ store i16 %trunc, i16* %ptr, align 4
+ ret i16* %incdec.ptr
}
-define void @truncst64to8(i8** nocapture %out, i8 %index, i64 %spacing) nounwind noinline ssp {
+define i8* @truncst64to8(i8* %ptr, i8 %index, i64 %spacing) {
; CHECK-LABEL: truncst64to8:
; CHECK: strb w{{[0-9+]}}, [x{{[0-9+]}}], #1
; CHECK: ret
- %tmp = load i8*, i8** %out, align 8
- %incdec.ptr = getelementptr inbounds i8, i8* %tmp, i64 1
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 1
%trunc = trunc i64 %spacing to i8
- store i8 %trunc, i8* %tmp, align 4
- store i8* %incdec.ptr, i8** %out, align 8
- ret void
+ store i8 %trunc, i8* %ptr, align 4
+ ret i8* %incdec.ptr
}
-define void @storef16(half** %out, half %index, half %spacing) nounwind {
+define half* @storef16(half* %ptr, half %index, half %spacing) nounwind {
; CHECK-LABEL: storef16:
; CHECK: str h{{[0-9+]}}, [x{{[0-9+]}}], #2
; CHECK: ret
- %tmp = load half*, half** %out, align 2
- %incdec.ptr = getelementptr inbounds half, half* %tmp, i64 1
- store half %spacing, half* %tmp, align 2
- store half* %incdec.ptr, half** %out, align 2
- ret void
+ %incdec.ptr = getelementptr inbounds half, half* %ptr, i64 1
+ store half %spacing, half* %ptr, align 2
+ ret half* %incdec.ptr
}
-define void @storef32(float** nocapture %out, float %index, float %spacing) nounwind noinline ssp {
+define float* @storef32(float* %ptr, float %index, float %spacing) {
; CHECK-LABEL: storef32:
; CHECK: str s{{[0-9+]}}, [x{{[0-9+]}}], #4
; CHECK: ret
- %tmp = load float*, float** %out, align 8
- %incdec.ptr = getelementptr inbounds float, float* %tmp, i64 1
- store float %spacing, float* %tmp, align 4
- store float* %incdec.ptr, float** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds float, float* %ptr, i64 1
+ store float %spacing, float* %ptr, align 4
+ ret float* %incdec.ptr
}
-define void @storef64(double** nocapture %out, double %index, double %spacing) nounwind noinline ssp {
+define double* @storef64(double* %ptr, double %index, double %spacing) {
; CHECK-LABEL: storef64:
; CHECK: str d{{[0-9+]}}, [x{{[0-9+]}}], #8
; CHECK: ret
- %tmp = load double*, double** %out, align 8
- %incdec.ptr = getelementptr inbounds double, double* %tmp, i64 1
- store double %spacing, double* %tmp, align 4
- store double* %incdec.ptr, double** %out, align 8
- ret void
+ %incdec.ptr = getelementptr inbounds double, double* %ptr, i64 1
+ store double %spacing, double* %ptr, align 4
+ ret double* %incdec.ptr
}
-define double * @pref64(double** nocapture %out, double %spacing) nounwind noinline ssp {
+
+define double* @pref64(double* %ptr, double %spacing) {
; CHECK-LABEL: pref64:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str d0, [x0, #32]!
+; CHECK: str d0, [x0, #32]!
; CHECK-NEXT: ret
- %tmp = load double*, double** %out, align 8
- %ptr = getelementptr inbounds double, double* %tmp, i64 4
- store double %spacing, double* %ptr, align 4
- ret double *%ptr
+ %incdec.ptr = getelementptr inbounds double, double* %ptr, i64 4
+ store double %spacing, double* %incdec.ptr, align 4
+ ret double *%incdec.ptr
}
-define float * @pref32(float** nocapture %out, float %spacing) nounwind noinline ssp {
+define float* @pref32(float* %ptr, float %spacing) {
; CHECK-LABEL: pref32:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str s0, [x0, #12]!
+; CHECK: str s0, [x0, #12]!
; CHECK-NEXT: ret
- %tmp = load float*, float** %out, align 8
- %ptr = getelementptr inbounds float, float* %tmp, i64 3
- store float %spacing, float* %ptr, align 4
- ret float *%ptr
+ %incdec.ptr = getelementptr inbounds float, float* %ptr, i64 3
+ store float %spacing, float* %incdec.ptr, align 4
+ ret float *%incdec.ptr
}
-define half* @pref16(half** %out, half %spacing) nounwind {
+define half* @pref16(half* %ptr, half %spacing) nounwind {
; CHECK-LABEL: pref16:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str h0, [x0, #6]!
+; CHECK: str h0, [x0, #6]!
; CHECK-NEXT: ret
- %tmp = load half*, half** %out, align 2
- %ptr = getelementptr inbounds half, half* %tmp, i64 3
- store half %spacing, half* %ptr, align 2
- ret half *%ptr
+ %incdec.ptr = getelementptr inbounds half, half* %ptr, i64 3
+ store half %spacing, half* %incdec.ptr, align 2
+ ret half *%incdec.ptr
}
-define i64 * @pre64(i64** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i64* @pre64(i64* %ptr, i64 %spacing) {
; CHECK-LABEL: pre64:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str x1, [x0, #16]!
+; CHECK: str x1, [x0, #16]!
; CHECK-NEXT: ret
- %tmp = load i64*, i64** %out, align 8
- %ptr = getelementptr inbounds i64, i64* %tmp, i64 2
- store i64 %spacing, i64* %ptr, align 4
- ret i64 *%ptr
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 2
+ store i64 %spacing, i64* %incdec.ptr, align 4
+ ret i64 *%incdec.ptr
}
-define i64 * @pre64idxpos256(i64** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i64* @pre64idxpos256(i64* %ptr, i64 %spacing) {
; CHECK-LABEL: pre64idxpos256:
-; CHECK: ldr x{{[0-9+]}}, [x0]
-; CHECK-NEXT: add x0, x{{[0-9+]}}, #256
-; CHECK-NEXT: str x1, [x{{[0-9+]}}, #256]
+; CHECK: add x8, x0, #256
+; CHECK-NEXT: str x1, [x0, #256]
+; CHECK-NEXT: mov x0, x8
; CHECK-NEXT: ret
- %tmp = load i64*, i64** %out, align 8
- %ptr = getelementptr inbounds i64, i64* %tmp, i64 32
- store i64 %spacing, i64* %ptr, align 4
- ret i64 *%ptr
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 32
+ store i64 %spacing, i64* %incdec.ptr, align 4
+ ret i64 *%incdec.ptr
}
-define i64 * @pre64idxneg256(i64** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i64* @pre64idxneg256(i64* %ptr, i64 %spacing) {
; CHECK-LABEL: pre64idxneg256:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str x1, [x0, #-256]!
+; CHECK: str x1, [x0, #-256]!
; CHECK-NEXT: ret
- %tmp = load i64*, i64** %out, align 8
- %ptr = getelementptr inbounds i64, i64* %tmp, i64 -32
- store i64 %spacing, i64* %ptr, align 4
- ret i64 *%ptr
+ %incdec.ptr = getelementptr inbounds i64, i64* %ptr, i64 -32
+ store i64 %spacing, i64* %incdec.ptr, align 4
+ ret i64 *%incdec.ptr
}
-define i32 * @pre32(i32** nocapture %out, i32 %spacing) nounwind noinline ssp {
+define i32* @pre32(i32* %ptr, i32 %spacing) {
; CHECK-LABEL: pre32:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str w1, [x0, #8]!
+; CHECK: str w1, [x0, #8]!
; CHECK-NEXT: ret
- %tmp = load i32*, i32** %out, align 8
- %ptr = getelementptr inbounds i32, i32* %tmp, i64 2
- store i32 %spacing, i32* %ptr, align 4
- ret i32 *%ptr
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 2
+ store i32 %spacing, i32* %incdec.ptr, align 4
+ ret i32 *%incdec.ptr
}
-define i32 * @pre32idxpos256(i32** nocapture %out, i32 %spacing) nounwind noinline ssp {
+define i32* @pre32idxpos256(i32* %ptr, i32 %spacing) {
; CHECK-LABEL: pre32idxpos256:
-; CHECK: ldr x{{[0-9+]}}, [x0]
-; CHECK-NEXT: add x0, x{{[0-9+]}}, #256
-; CHECK-NEXT: str w1, [x{{[0-9+]}}, #256]
+; CHECK: add x8, x0, #256
+; CHECK-NEXT: str w1, [x0, #256]
+; CHECK-NEXT: mov x0, x8
; CHECK-NEXT: ret
- %tmp = load i32*, i32** %out, align 8
- %ptr = getelementptr inbounds i32, i32* %tmp, i64 64
- store i32 %spacing, i32* %ptr, align 4
- ret i32 *%ptr
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 64
+ store i32 %spacing, i32* %incdec.ptr, align 4
+ ret i32 *%incdec.ptr
}
-define i32 * @pre32idxneg256(i32** nocapture %out, i32 %spacing) nounwind noinline ssp {
+define i32* @pre32idxneg256(i32* %ptr, i32 %spacing) {
; CHECK-LABEL: pre32idxneg256:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str w1, [x0, #-256]!
+; CHECK: str w1, [x0, #-256]!
; CHECK-NEXT: ret
- %tmp = load i32*, i32** %out, align 8
- %ptr = getelementptr inbounds i32, i32* %tmp, i64 -64
- store i32 %spacing, i32* %ptr, align 4
- ret i32 *%ptr
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 -64
+ store i32 %spacing, i32* %incdec.ptr, align 4
+ ret i32 *%incdec.ptr
}
-define i16 * @pre16(i16** nocapture %out, i16 %spacing) nounwind noinline ssp {
+define i16* @pre16(i16* %ptr, i16 %spacing) {
; CHECK-LABEL: pre16:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strh w1, [x0, #4]!
+; CHECK: strh w1, [x0, #4]!
; CHECK-NEXT: ret
- %tmp = load i16*, i16** %out, align 8
- %ptr = getelementptr inbounds i16, i16* %tmp, i64 2
- store i16 %spacing, i16* %ptr, align 4
- ret i16 *%ptr
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 2
+ store i16 %spacing, i16* %incdec.ptr, align 4
+ ret i16 *%incdec.ptr
}
-define i16 * @pre16idxpos256(i16** nocapture %out, i16 %spacing) nounwind noinline ssp {
+define i16* @pre16idxpos256(i16* %ptr, i16 %spacing) {
; CHECK-LABEL: pre16idxpos256:
-; CHECK: ldr x{{[0-9+]}}, [x0]
-; CHECK-NEXT: add x0, x{{[0-9+]}}, #256
-; CHECK-NEXT: strh w1, [x{{[0-9+]}}, #256]
+; CHECK: add x8, x0, #256
+; CHECK-NEXT: strh w1, [x0, #256]
+; CHECK-NEXT: mov x0, x8
; CHECK-NEXT: ret
- %tmp = load i16*, i16** %out, align 8
- %ptr = getelementptr inbounds i16, i16* %tmp, i64 128
- store i16 %spacing, i16* %ptr, align 4
- ret i16 *%ptr
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 128
+ store i16 %spacing, i16* %incdec.ptr, align 4
+ ret i16 *%incdec.ptr
}
-define i16 * @pre16idxneg256(i16** nocapture %out, i16 %spacing) nounwind noinline ssp {
+define i16* @pre16idxneg256(i16* %ptr, i16 %spacing) {
; CHECK-LABEL: pre16idxneg256:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strh w1, [x0, #-256]!
+; CHECK: strh w1, [x0, #-256]!
; CHECK-NEXT: ret
- %tmp = load i16*, i16** %out, align 8
- %ptr = getelementptr inbounds i16, i16* %tmp, i64 -128
- store i16 %spacing, i16* %ptr, align 4
- ret i16 *%ptr
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 -128
+ store i16 %spacing, i16* %incdec.ptr, align 4
+ ret i16 *%incdec.ptr
}
-define i8 * @pre8(i8** nocapture %out, i8 %spacing) nounwind noinline ssp {
+define i8* @pre8(i8* %ptr, i8 %spacing) {
; CHECK-LABEL: pre8:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strb w1, [x0, #2]!
+; CHECK: strb w1, [x0, #2]!
; CHECK-NEXT: ret
- %tmp = load i8*, i8** %out, align 8
- %ptr = getelementptr inbounds i8, i8* %tmp, i64 2
- store i8 %spacing, i8* %ptr, align 4
- ret i8 *%ptr
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 2
+ store i8 %spacing, i8* %incdec.ptr, align 4
+ ret i8 *%incdec.ptr
}
-define i8 * @pre8idxpos256(i8** nocapture %out, i8 %spacing) nounwind noinline ssp {
+define i8* @pre8idxpos256(i8* %ptr, i8 %spacing) {
; CHECK-LABEL: pre8idxpos256:
-; CHECK: ldr x{{[0-9+]}}, [x0]
-; CHECK-NEXT: add x0, x{{[0-9+]}}, #256
-; CHECK-NEXT: strb w1, [x{{[0-9+]}}, #256]
+; CHECK: add x8, x0, #256
+; CHECK-NEXT: strb w1, [x0, #256]
+; CHECK-NEXT: mov x0, x8
; CHECK-NEXT: ret
- %tmp = load i8*, i8** %out, align 8
- %ptr = getelementptr inbounds i8, i8* %tmp, i64 256
- store i8 %spacing, i8* %ptr, align 4
- ret i8 *%ptr
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 256
+ store i8 %spacing, i8* %incdec.ptr, align 4
+ ret i8 *%incdec.ptr
}
-define i8 * @pre8idxneg256(i8** nocapture %out, i8 %spacing) nounwind noinline ssp {
+define i8* @pre8idxneg256(i8* %ptr, i8 %spacing) {
; CHECK-LABEL: pre8idxneg256:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strb w1, [x0, #-256]!
+; CHECK: strb w1, [x0, #-256]!
; CHECK-NEXT: ret
- %tmp = load i8*, i8** %out, align 8
- %ptr = getelementptr inbounds i8, i8* %tmp, i64 -256
- store i8 %spacing, i8* %ptr, align 4
- ret i8 *%ptr
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 -256
+ store i8 %spacing, i8* %incdec.ptr, align 4
+ ret i8 *%incdec.ptr
}
-define i32 * @pretrunc64to32(i32** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i32* @pretrunc64to32(i32* %ptr, i64 %spacing) {
; CHECK-LABEL: pretrunc64to32:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: str w1, [x0, #8]!
+; CHECK: str w1, [x0, #8]!
; CHECK-NEXT: ret
- %tmp = load i32*, i32** %out, align 8
- %ptr = getelementptr inbounds i32, i32* %tmp, i64 2
+ %incdec.ptr = getelementptr inbounds i32, i32* %ptr, i64 2
%trunc = trunc i64 %spacing to i32
- store i32 %trunc, i32* %ptr, align 4
- ret i32 *%ptr
+ store i32 %trunc, i32* %incdec.ptr, align 4
+ ret i32 *%incdec.ptr
}
-define i16 * @pretrunc64to16(i16** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i16* @pretrunc64to16(i16* %ptr, i64 %spacing) {
; CHECK-LABEL: pretrunc64to16:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strh w1, [x0, #4]!
+; CHECK: strh w1, [x0, #4]!
; CHECK-NEXT: ret
- %tmp = load i16*, i16** %out, align 8
- %ptr = getelementptr inbounds i16, i16* %tmp, i64 2
+ %incdec.ptr = getelementptr inbounds i16, i16* %ptr, i64 2
%trunc = trunc i64 %spacing to i16
- store i16 %trunc, i16* %ptr, align 4
- ret i16 *%ptr
+ store i16 %trunc, i16* %incdec.ptr, align 4
+ ret i16 *%incdec.ptr
}
-define i8 * @pretrunc64to8(i8** nocapture %out, i64 %spacing) nounwind noinline ssp {
+define i8* @pretrunc64to8(i8* %ptr, i64 %spacing) {
; CHECK-LABEL: pretrunc64to8:
-; CHECK: ldr x0, [x0]
-; CHECK-NEXT: strb w1, [x0, #2]!
+; CHECK: strb w1, [x0, #2]!
; CHECK-NEXT: ret
- %tmp = load i8*, i8** %out, align 8
- %ptr = getelementptr inbounds i8, i8* %tmp, i64 2
+ %incdec.ptr = getelementptr inbounds i8, i8* %ptr, i64 2
%trunc = trunc i64 %spacing to i8
- store i8 %trunc, i8* %ptr, align 4
- ret i8 *%ptr
+ store i8 %trunc, i8* %incdec.ptr, align 4
+ ret i8 *%incdec.ptr
}
;-----
More information about the llvm-commits
mailing list