84 changes: 42 additions & 42 deletions llvm/test/Analysis/CostModel/ARM/sub-cast-vect.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,133 +15,133 @@ target triple = "armv7--linux-gnueabihf"
%T432 = type <4 x i32>
%T464 = type <4 x i64>

define void @direct(%T432* %loadaddr, %T432* %loadaddr2, %T432* %storeaddr) {
define void @direct(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'direct'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i32>, <4 x i32>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i32>, <4 x i32>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i32>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i32>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <4 x i32> %v0, %v1
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, <4 x i32>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T432, %T432* %loadaddr
%v0 = load %T432, ptr %loadaddr
; ASM: vld1.64
%v1 = load %T432, %T432* %loadaddr2
%v1 = load %T432, ptr %loadaddr2
; ASM: vld1.64
%r3 = sub %T432 %v0, %v1
; ASM: vsub.i32
store %T432 %r3, %T432* %storeaddr
store %T432 %r3, ptr %storeaddr
; ASM: vst1.64
ret void
}

define void @ups1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) {
define void @ups1632(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'ups1632'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i16>, <4 x i16>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i16>, <4 x i16>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i16>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i16>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r1 = sext <4 x i16> %v0 to <4 x i32>
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r2 = sext <4 x i16> %v1 to <4 x i32>
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <4 x i32> %r1, %r2
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, <4 x i32>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T416, %T416* %loadaddr
%v0 = load %T416, ptr %loadaddr
; ASM: vldr
%v1 = load %T416, %T416* %loadaddr2
%v1 = load %T416, ptr %loadaddr2
; ASM: vldr
%r1 = sext %T416 %v0 to %T432
%r2 = sext %T416 %v1 to %T432
%r3 = sub %T432 %r1, %r2
; ASM: vsubl.s16
store %T432 %r3, %T432* %storeaddr
store %T432 %r3, ptr %storeaddr
; ASM: vst1.64
ret void
}

define void @upu1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) {
define void @upu1632(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'upu1632'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i16>, <4 x i16>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i16>, <4 x i16>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i16>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i16>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r1 = zext <4 x i16> %v0 to <4 x i32>
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r2 = zext <4 x i16> %v1 to <4 x i32>
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <4 x i32> %r1, %r2
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, <4 x i32>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %r3, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T416, %T416* %loadaddr
%v0 = load %T416, ptr %loadaddr
; ASM: vldr
%v1 = load %T416, %T416* %loadaddr2
%v1 = load %T416, ptr %loadaddr2
; ASM: vldr
%r1 = zext %T416 %v0 to %T432
%r2 = zext %T416 %v1 to %T432
%r3 = sub %T432 %r1, %r2
; ASM: vsubl.u16
store %T432 %r3, %T432* %storeaddr
store %T432 %r3, ptr %storeaddr
; ASM: vst1.64
ret void
}

define void @ups3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) {
define void @ups3264(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'ups3264'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <2 x i32>, <2 x i32>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <2 x i32>, <2 x i32>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <2 x i32>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <2 x i32>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <2 x i32> %v0, %v1
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %st = sext <2 x i32> %r3 to <2 x i64>
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %st, <2 x i64>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %st, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T232, %T232* %loadaddr
%v0 = load %T232, ptr %loadaddr
; ASM: vldr
%v1 = load %T232, %T232* %loadaddr2
%v1 = load %T232, ptr %loadaddr2
; ASM: vldr
%r3 = sub %T232 %v0, %v1
; ASM: vsub.i32
%st = sext %T232 %r3 to %T264
; ASM: vmovl.s32
store %T264 %st, %T264* %storeaddr
store %T264 %st, ptr %storeaddr
; ASM: vst1.64
ret void
}

define void @upu3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) {
define void @upu3264(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'upu3264'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <2 x i32>, <2 x i32>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <2 x i32>, <2 x i32>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <2 x i32>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <2 x i32>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <2 x i32> %v0, %v1
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %st = zext <2 x i32> %r3 to <2 x i64>
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %st, <2 x i64>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %st, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T232, %T232* %loadaddr
%v0 = load %T232, ptr %loadaddr
; ASM: vldr
%v1 = load %T232, %T232* %loadaddr2
%v1 = load %T232, ptr %loadaddr2
; ASM: vldr
%r3 = sub %T232 %v0, %v1
; ASM: vsub.i32
%st = zext %T232 %r3 to %T264
; ASM: vmovl.u32
store %T264 %st, %T264* %storeaddr
store %T264 %st, ptr %storeaddr
; ASM: vst1.64
ret void
}

define void @dn3216(%T432* %loadaddr, %T432* %loadaddr2, %T416* %storeaddr) {
define void @dn3216(ptr %loadaddr, ptr %loadaddr2, ptr %storeaddr) {
; COST-LABEL: 'dn3216'
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i32>, <4 x i32>* %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i32>, <4 x i32>* %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v0 = load <4 x i32>, ptr %loadaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v1 = load <4 x i32>, ptr %loadaddr2, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r3 = sub <4 x i32> %v0, %v1
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %st = trunc <4 x i32> %r3 to <4 x i16>
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %st, <4 x i16>* %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %st, ptr %storeaddr, align 8
; COST-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%v0 = load %T432, %T432* %loadaddr
%v0 = load %T432, ptr %loadaddr
; ASM: vld1.64
%v1 = load %T432, %T432* %loadaddr2
%v1 = load %T432, ptr %loadaddr2
; ASM: vld1.64
%r3 = sub %T432 %v0, %v1
; ASM: vsub.i32
%st = trunc %T432 %r3 to %T416
; ASM: vmovn.i32
store %T416 %st, %T416* %storeaddr
store %T416 %st, ptr %storeaddr
; ASM: vstr
ret void
}
10 changes: 5 additions & 5 deletions llvm/test/Analysis/CostModel/ARM/target-intrinsics.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
define void @intrinsics() {
; CHECK-THUMB2-RECIP-LABEL: 'intrinsics'
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t1 = call i32 @llvm.arm.ssat(i32 undef, i32 undef)
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half* undef)
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0(ptr undef)
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 undef, i32 undef, i32 undef, i32 48)
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t4 = tail call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> undef, <8 x i16> undef)
; CHECK-THUMB2-RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; CHECK-THUMB2-LAT-LABEL: 'intrinsics'
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t1 = call i32 @llvm.arm.ssat(i32 undef, i32 undef)
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half* undef)
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0(ptr undef)
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 undef, i32 undef, i32 undef, i32 48)
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t4 = tail call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> undef, <8 x i16> undef)
; CHECK-THUMB2-LAT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; CHECK-THUMB2-SIZE-LABEL: 'intrinsics'
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t1 = call i32 @llvm.arm.ssat(i32 undef, i32 undef)
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half* undef)
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0(ptr undef)
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 undef, i32 undef, i32 undef, i32 48)
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %t4 = tail call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> undef, <8 x i16> undef)
; CHECK-THUMB2-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
%t1 = call i32 @llvm.arm.ssat(i32 undef, i32 undef)
%t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half* undef)
%t2 = tail call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0(ptr undef)
%t3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 undef, i32 undef, i32 undef, i32 48)
%t4 = tail call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> undef, <8 x i16> undef)
ret void
}

declare i32 @llvm.arm.ssat(i32, i32)
declare { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half*)
declare { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0(ptr)
declare { i32, i32 } @llvm.arm.mve.sqrshrl(i32, i32, i32, i32)
declare { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32, i32, i32, i32, i32, <8 x i16>, <8 x i16>)
12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/PowerPC/load-to-trunc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=CHECK

; Check that cost is 1 for unusual load to register sized load.
define i32 @loadUnusualIntegerWithTrunc(i128* %ptr) {
define i32 @loadUnusualIntegerWithTrunc(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualIntegerWithTrunc'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %trunc = trunc i128 %out to i32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %trunc
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
%trunc = trunc i128 %out to i32
ret i32 %trunc
}

define i128 @loadUnusualInteger(i128* %ptr) {
define i128 @loadUnusualInteger(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualInteger'
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i128 %out
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
ret i128 %out
}
26 changes: 13 additions & 13 deletions llvm/test/Analysis/CostModel/PowerPC/load_store.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ target triple = "powerpc64-unknown-linux-gnu"
define i32 @stores(i32 %arg) {

; CHECK: cost of 1 {{.*}} store
store i8 undef, i8* undef, align 4
store i8 undef, ptr undef, align 4
; CHECK: cost of 1 {{.*}} store
store i16 undef, i16* undef, align 4
store i16 undef, ptr undef, align 4
; CHECK: cost of 1 {{.*}} store
store i32 undef, i32* undef, align 4
store i32 undef, ptr undef, align 4
; CHECK: cost of 2 {{.*}} store
store i64 undef, i64* undef, align 4
store i64 undef, ptr undef, align 4
; CHECK: cost of 4 {{.*}} store
store i128 undef, i128* undef, align 4
store i128 undef, ptr undef, align 4

ret i32 undef
}
define i32 @loads(i32 %arg) {
; CHECK: cost of 1 {{.*}} load
load i8, i8* undef, align 4
load i8, ptr undef, align 4
; CHECK: cost of 1 {{.*}} load
load i16, i16* undef, align 4
load i16, ptr undef, align 4
; CHECK: cost of 1 {{.*}} load
load i32, i32* undef, align 4
load i32, ptr undef, align 4
; CHECK: cost of 2 {{.*}} load
load i64, i64* undef, align 4
load i64, ptr undef, align 4
; CHECK: cost of 4 {{.*}} load
load i128, i128* undef, align 4
load i128, ptr undef, align 4

; FIXME: There actually are sub-vector Altivec loads, and so we could handle
; this with a small expense, but we don't currently.
; CHECK: cost of 42 {{.*}} load
load <4 x i16>, <4 x i16>* undef, align 2
load <4 x i16>, ptr undef, align 2

; CHECK: cost of 2 {{.*}} load
load <4 x i32>, <4 x i32>* undef, align 4
load <4 x i32>, ptr undef, align 4

; CHECK: cost of 46 {{.*}} load
load <3 x float>, <3 x float>* undef, align 1
load <3 x float>, ptr undef, align 1

ret i32 undef
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Analysis/CostModel/PowerPC/matrix.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ target triple = "powerpc64-unknown-linux-gnu"

define void @matrix() {
; CHECK-LABEL: 'matrix'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %matrix1 = call <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(i32* nonnull align 4 undef, i64 1, i1 false, i32 1, i32 1)
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %matrix1 = call <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(ptr nonnull align 4 undef, i64 1, i1 false, i32 1, i32 1)
; CHECK-NEXT: Cost Model: Found an estimated cost of 452 for instruction: %0 = call <10 x i32> @llvm.matrix.multiply.v10i32.v10i32.v1i32(<10 x i32> undef, <1 x i32> %matrix1, i32 10, i32 1, i32 1)
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
entry:
%matrix1 = call <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(i32* nonnull align 4 undef, i64 1, i1 false, i32 1, i32 1)
%matrix1 = call <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(ptr nonnull align 4 undef, i64 1, i1 false, i32 1, i32 1)
%0 = call <10 x i32> @llvm.matrix.multiply.v10i32.v10i32.v1i32(<10 x i32> undef, <1 x i32> %matrix1, i32 10, i32 1, i32 1)
ret void
}

declare <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(i32* nocapture, i64, i1 immarg, i32 immarg, i32 immarg) #2
declare <1 x i32> @llvm.matrix.column.major.load.v1i32.i64(ptr nocapture, i64, i1 immarg, i32 immarg, i32 immarg) #2
declare <10 x i32> @llvm.matrix.multiply.v10i32.v10i32.v1i32(<10 x i32>, <1 x i32>, i32 immarg, i32 immarg, i32 immarg) #3
216 changes: 108 additions & 108 deletions llvm/test/Analysis/CostModel/PowerPC/unal-vec-ldst.ll

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions llvm/test/Analysis/CostModel/PowerPC/unaligned_ld_st.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ target triple = "powerpc64-unknown-linux-gnu"
define i32 @test(i32 %arg) {

; CHECK: cost of 1 {{.*}} load
load i8, i8* undef, align 1
load i8, ptr undef, align 1
; CHECK: cost of 1 {{.*}} load
load i16, i16* undef, align 1
load i16, ptr undef, align 1
; CHECK: cost of 1 {{.*}} load
load i32, i32* undef, align 1
load i32, ptr undef, align 1
; CHECK: cost of 1 {{.*}} load
load i64, i64* undef, align 1
load i64, ptr undef, align 1

; CHECK: cost of 1 {{.*}} store
store i8 undef, i8* undef, align 1
store i8 undef, ptr undef, align 1
; CHECK: cost of 1 {{.*}} store
store i16 undef, i16* undef, align 1
store i16 undef, ptr undef, align 1
; CHECK: cost of 1 {{.*}} store
store i32 undef, i32* undef, align 1
store i32 undef, ptr undef, align 1
; CHECK: cost of 1 {{.*}} store
store i64 undef, i64* undef, align 1
store i64 undef, ptr undef, align 1

ret i32 undef
}
12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/PowerPC/vector_unit.ll
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx | FileCheck %s
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr9 -mattr=+vsx | FileCheck --check-prefix=CHECK-P9 %s

define void @testi16(i16 %arg1, i16 %arg2, i16* %arg3) {
define void @testi16(i16 %arg1, i16 %arg2, ptr %arg3) {

%s1 = add i16 %arg1, %arg2
%s2 = zext i16 %arg1 to i32
%s3 = load i16, i16* %arg3
store i16 %arg2, i16* %arg3
%s3 = load i16, ptr %arg3
store i16 %arg2, ptr %arg3
%c = icmp eq i16 %arg1, %arg2

ret void
Expand Down Expand Up @@ -40,10 +40,10 @@ define void @test4xi16(<4 x i16> %arg1, <4 x i16> %arg2) {
; CHECK-P9: cost of 2 {{.*}} icmp
}

define void @test4xi32(<4 x i32> %arg1, <4 x i32> %arg2, <4 x i32>* %arg3) {
define void @test4xi32(<4 x i32> %arg1, <4 x i32> %arg2, ptr %arg3) {

%v1 = load <4 x i32>, <4 x i32>* %arg3
store <4 x i32> %arg2, <4 x i32>* %arg3
%v1 = load <4 x i32>, ptr %arg3
store <4 x i32> %arg2, ptr %arg3

ret void
; CHECK: cost of 1 {{.*}} load
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Analysis/CostModel/PowerPC/vsr_load_32_64.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ target triple = "powerpc64-unknown-linux-gnu"

define i32 @loads(i32 %arg) {
; CHECK: cost of 1 {{.*}} load
load <4 x i8>, <4 x i8>* undef, align 1
load <4 x i8>, ptr undef, align 1

; CHECK: cost of 1 {{.*}} load
load <8 x i8>, <8 x i8>* undef, align 1
load <8 x i8>, ptr undef, align 1

; CHECK: cost of 1 {{.*}} load
load <2 x i16>, <2 x i16>* undef, align 2
load <2 x i16>, ptr undef, align 2

; CHECK: cost of 1 {{.*}} load
load <4 x i16>, <4 x i16>* undef, align 2
load <4 x i16>, ptr undef, align 2

ret i32 undef
}
376 changes: 188 additions & 188 deletions llvm/test/Analysis/CostModel/RISCV/fixed-vector-gather.ll

Large diffs are not rendered by default.

376 changes: 188 additions & 188 deletions llvm/test/Analysis/CostModel/RISCV/fixed-vector-scatter.ll

Large diffs are not rendered by default.

252 changes: 114 additions & 138 deletions llvm/test/Analysis/CostModel/RISCV/gep.ll

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/RISCV/load-to-trunc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=riscv64 < %s | FileCheck %s --check-prefix=CHECK

; Check that cost is 1 for unusual load to register sized load.
define i32 @loadUnusualIntegerWithTrunc(i128* %ptr) {
define i32 @loadUnusualIntegerWithTrunc(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualIntegerWithTrunc'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %trunc = trunc i128 %out to i32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %trunc
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
%trunc = trunc i128 %out to i32
ret i32 %trunc
}

define i128 @loadUnusualInteger(i128* %ptr) {
define i128 @loadUnusualInteger(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualInteger'
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i128 %out
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
ret i128 %out
}
222 changes: 111 additions & 111 deletions llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll

Large diffs are not rendered by default.

546 changes: 273 additions & 273 deletions llvm/test/Analysis/CostModel/RISCV/scalable-gather.ll

Large diffs are not rendered by default.

546 changes: 273 additions & 273 deletions llvm/test/Analysis/CostModel/RISCV/scalable-scatter.ll

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/SystemZ/cmp-mem.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
;
; Test costs for i8 and i16 comparisons against memory with a small immediate.

define i32 @fun0(i8* %Src, i8* %Dst, i8 %Val) {
define i32 @fun0(ptr %Src, ptr %Dst, i8 %Val) {
; CHECK: function 'fun0'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i8, i8* %Src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i8, ptr %Src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Cmp = icmp eq i8 %Ld, 123
; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %Ret = zext i1 %Cmp to i32
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %Ret
%Ld = load i8, i8* %Src
%Ld = load i8, ptr %Src
%Cmp = icmp eq i8 %Ld, 123
%Ret = zext i1 %Cmp to i32
ret i32 %Ret
}

define i32 @fun1(i16* %Src, i16* %Dst, i16 %Val) {
define i32 @fun1(ptr %Src, ptr %Dst, i16 %Val) {
; CHECK: function 'fun1'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i16, i16* %Src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i16, ptr %Src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Cmp = icmp eq i16
; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %Ret = zext i1 %Cmp to i32
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %Ret
%Ld = load i16, i16* %Src
%Ld = load i16, ptr %Src
%Cmp = icmp eq i16 %Ld, 1234
%Ret = zext i1 %Cmp to i32
ret i32 %Ret
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/Analysis/CostModel/SystemZ/ext-load.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@
; where the load performs the extension.

define void @sext() {
%li8 = load i8, i8* undef
%li8 = load i8, ptr undef
sext i8 %li8 to i16
sext i8 %li8 to i32
sext i8 %li8 to i64

%li16 = load i16, i16* undef
%li16 = load i16, ptr undef
sext i16 %li16 to i32
sext i16 %li16 to i64

%li32 = load i32, i32* undef
%li32 = load i32, ptr undef
sext i32 %li32 to i64

ret void

; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, i8* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %1 = sext i8 %li8 to i16
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %2 = sext i8 %li8 to i32
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %3 = sext i8 %li8 to i64
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, i16* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %4 = sext i16 %li16 to i32
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %5 = sext i16 %li16 to i64
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, i32* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %6 = sext i32 %li32 to i64
}

define void @zext() {
%li8 = load i8, i8* undef
%li8 = load i8, ptr undef
zext i8 %li8 to i16
zext i8 %li8 to i32
zext i8 %li8 to i64

%li16 = load i16, i16* undef
%li16 = load i16, ptr undef
zext i16 %li16 to i32
zext i16 %li16 to i64

%li32 = load i32, i32* undef
%li32 = load i32, ptr undef
zext i32 %li32 to i64

ret void

; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, i8* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8 = load i8, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %1 = zext i8 %li8 to i16
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %2 = zext i8 %li8 to i32
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %3 = zext i8 %li8 to i64
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, i16* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16 = load i16, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %4 = zext i16 %li16 to i32
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %5 = zext i16 %li16 to i64
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, i32* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li32 = load i32, ptr undef
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %6 = zext i32 %li32 to i64
}
20 changes: 10 additions & 10 deletions llvm/test/Analysis/CostModel/SystemZ/fp-cast.ll
Original file line number Diff line number Diff line change
Expand Up @@ -559,45 +559,45 @@ define void @uitofp() {
ret void;
}

define void @sitofp_extload(i16 *%src16, i8 *%src8) {
%ld16 = load i16, i16 *%src16
define void @sitofp_extload(ptr %src16, ptr %src8) {
%ld16 = load i16, ptr %src16
%v6 = sitofp i16 %ld16 to fp128
%v7 = sitofp i16 %ld16 to double
%v8 = sitofp i16 %ld16 to float

%ld8 = load i8, i8 *%src8
%ld8 = load i8, ptr %src8
%v9 = sitofp i8 %ld8 to fp128
%v10 = sitofp i8 %ld8 to double
%v11 = sitofp i8 %ld8 to float

; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld16 = load i16, i16* %src16
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld16 = load i16, ptr %src16
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v6 = sitofp i16 %ld16 to fp128
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v7 = sitofp i16 %ld16 to double
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v8 = sitofp i16 %ld16 to float
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld8 = load i8, i8* %src8
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld8 = load i8, ptr %src8
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v9 = sitofp i8 %ld8 to fp128
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v10 = sitofp i8 %ld8 to double
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v11 = sitofp i8 %ld8 to float

ret void;
}

define void @uitofp_extload(i16 *%src16, i8 *%src8) {
%ld16 = load i16, i16 *%src16
define void @uitofp_extload(ptr %src16, ptr %src8) {
%ld16 = load i16, ptr %src16
%v6 = uitofp i16 %ld16 to fp128
%v7 = uitofp i16 %ld16 to double
%v8 = uitofp i16 %ld16 to float

%ld8 = load i8, i8 *%src8
%ld8 = load i8, ptr %src8
%v9 = uitofp i8 %ld8 to fp128
%v10 = uitofp i8 %ld8 to double
%v11 = uitofp i8 %ld8 to float

; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld16 = load i16, i16* %src16
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld16 = load i16, ptr %src16
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v6 = uitofp i16 %ld16 to fp128
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v7 = uitofp i16 %ld16 to double
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v8 = uitofp i16 %ld16 to float
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld8 = load i8, i8* %src8
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %ld8 = load i8, ptr %src8
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v9 = uitofp i8 %ld8 to fp128
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v10 = uitofp i8 %ld8 to double
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %v11 = uitofp i8 %ld8 to float
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Analysis/CostModel/SystemZ/huge-immediates.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
; Test that cost functions can handle immediates of more than 64 bits without crashing.

; Cost of a load which is checked for folding into a compare w/ memory.
define i32 @fun0(i72* %Src) {
%L = load i72, i72* %Src
define i32 @fun0(ptr %Src) {
%L = load i72, ptr %Src
%B = icmp ult i72 %L, 166153499473114484112
%Res = zext i1 %B to i32
ret i32 %Res
}

; Cost of a compare which is checked for elimination by Load and Test.
define i32 @fun1(i72* %Src, i72* %Dst) {
%L = load i72, i72* %Src
store i72 %L, i72* %Dst
define i32 @fun1(ptr %Src, ptr %Dst) {
%L = load i72, ptr %Src
store i72 %L, ptr %Dst
%B = icmp ult i72 %L, 166153499473114484112
%Res = zext i1 %B to i32
ret i32 %Res
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Analysis/CostModel/SystemZ/int-operands-extcost.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
; cases where this is needed.

define void @icmp() {
%li8_0 = load i8, i8* undef
%li8_1 = load i8, i8* undef
%li8_0 = load i8, ptr undef
%li8_1 = load i8, ptr undef
icmp slt i8 %li8_0, %li8_1

%a0 = add i8 %li8_0, 1
Expand All @@ -15,8 +15,8 @@ define void @icmp() {

icmp slt i8 %a0, 123

%li16_0 = load i16, i16* undef
%li16_1 = load i16, i16* undef
%li16_0 = load i16, ptr undef
%li16_1 = load i16, ptr undef
icmp slt i16 %li16_0, %li16_1

%a2 = add i16 %li16_0, 1
Expand All @@ -27,15 +27,15 @@ define void @icmp() {

ret void;
; CHECK: function 'icmp'
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8_0 = load i8, i8* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8_1 = load i8, i8* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8_0 = load i8, ptr undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li8_1 = load i8, ptr undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %1 = icmp slt i8 %li8_0, %li8_1
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %a0 = add i8 %li8_0, 1
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %a1 = add i8 %li8_1, 1
; CHECK: Cost Model: Found an estimated cost of 3 for instruction: %2 = icmp slt i8 %a0, %a1
; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %3 = icmp slt i8 %a0, 123
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16_0 = load i16, i16* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16_1 = load i16, i16* undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16_0 = load i16, ptr undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %li16_1 = load i16, ptr undef
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = icmp slt i16 %li16_0, %li16_1
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %a2 = add i16 %li16_0, 1
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %a3 = add i16 %li16_1, 1
Expand Down
126 changes: 63 additions & 63 deletions llvm/test/Analysis/CostModel/SystemZ/intrinsics.ll
Original file line number Diff line number Diff line change
Expand Up @@ -44,144 +44,144 @@ define void @bswap_i16(i16 %arg, <2 x i16> %arg2, <4 x i16> %arg4,
}

; Test that store/load reversed is reflected in costs.
define void @bswap_i64_mem(i64* %src, i64 %arg, i64* %dst) {
define void @bswap_i64_mem(ptr %src, i64 %arg, ptr %dst) {
; CHECK: function 'bswap_i64_mem'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i64, i64* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i64, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call i64 @llvm.bswap.i64(i64 %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call i64 @llvm.bswap.i64(i64 %arg)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i64 %swp2, i64* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i64, i64* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i64 %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i64, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call i64 @llvm.bswap.i64(i64 %Ld2)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i64 %swp3, i64* %dst
%Ld1 = load i64, i64* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i64 %swp3, ptr %dst
%Ld1 = load i64, ptr %src
%swp1 = tail call i64 @llvm.bswap.i64(i64 %Ld1)

%swp2 = tail call i64 @llvm.bswap.i64(i64 %arg)
store i64 %swp2, i64* %dst
store i64 %swp2, ptr %dst

%Ld2 = load i64, i64* %src
%Ld2 = load i64, ptr %src
%swp3 = tail call i64 @llvm.bswap.i64(i64 %Ld2)
store i64 %swp3, i64* %dst
store i64 %swp3, ptr %dst

ret void
}

define void @bswap_v2i64_mem(<2 x i64>* %src, <2 x i64> %arg, <2 x i64>* %dst) {
define void @bswap_v2i64_mem(ptr %src, <2 x i64> %arg, ptr %dst) {
; CHECK:function 'bswap_v2i64_mem'
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <2 x i64>, <2 x i64>* %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <2 x i64>, <2 x i64>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <2 x i64>, ptr %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <2 x i64>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %arg)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %swp2, <2 x i64>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <2 x i64> %swp2, <2 x i64>* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <2 x i64>, <2 x i64>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %swp2, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <2 x i64> %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <2 x i64>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %Ld2)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %swp3, <2 x i64>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <2 x i64> %swp3, <2 x i64>* %dst
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <2 x i64> %swp3, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <2 x i64> %swp3, ptr %dst

%Ld1 = load <2 x i64>, <2 x i64>* %src
%Ld1 = load <2 x i64>, ptr %src
%swp1 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %Ld1)

%swp2 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %arg)
store <2 x i64> %swp2, <2 x i64>* %dst
store <2 x i64> %swp2, ptr %dst

%Ld2 = load <2 x i64>, <2 x i64>* %src
%Ld2 = load <2 x i64>, ptr %src
%swp3 = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %Ld2)
store <2 x i64> %swp3, <2 x i64>* %dst
store <2 x i64> %swp3, ptr %dst

ret void
}

define void @bswap_i32_mem(i32* %src, i32 %arg, i32* %dst) {
define void @bswap_i32_mem(ptr %src, i32 %arg, ptr %dst) {
; CHECK: function 'bswap_i32_mem'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i32, i32* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i32, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call i32 @llvm.bswap.i32(i32 %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call i32 @llvm.bswap.i32(i32 %arg)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i32 %swp2, i32* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i32, i32* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i32 %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i32, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call i32 @llvm.bswap.i32(i32 %Ld2)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i32 %swp3, i32* %dst
%Ld1 = load i32, i32* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i32 %swp3, ptr %dst
%Ld1 = load i32, ptr %src
%swp1 = tail call i32 @llvm.bswap.i32(i32 %Ld1)

%swp2 = tail call i32 @llvm.bswap.i32(i32 %arg)
store i32 %swp2, i32* %dst
store i32 %swp2, ptr %dst

%Ld2 = load i32, i32* %src
%Ld2 = load i32, ptr %src
%swp3 = tail call i32 @llvm.bswap.i32(i32 %Ld2)
store i32 %swp3, i32* %dst
store i32 %swp3, ptr %dst

ret void
}

define void @bswap_v4i32_mem(<4 x i32>* %src, <4 x i32> %arg, <4 x i32>* %dst) {
define void @bswap_v4i32_mem(ptr %src, <4 x i32> %arg, ptr %dst) {
; CHECK: function 'bswap_v4i32_mem'
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <4 x i32>, <4 x i32>* %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <4 x i32>, <4 x i32>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <4 x i32>, ptr %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <4 x i32>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %arg)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %swp2, <4 x i32>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <4 x i32> %swp2, <4 x i32>* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <4 x i32>, <4 x i32>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %swp2, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <4 x i32> %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <4 x i32>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %Ld2)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %swp3, <4 x i32>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <4 x i32> %swp3, <4 x i32>* %dst
%Ld1 = load <4 x i32>, <4 x i32>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %swp3, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <4 x i32> %swp3, ptr %dst
%Ld1 = load <4 x i32>, ptr %src
%swp1 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %Ld1)

%swp2 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %arg)
store <4 x i32> %swp2, <4 x i32>* %dst
store <4 x i32> %swp2, ptr %dst

%Ld2 = load <4 x i32>, <4 x i32>* %src
%Ld2 = load <4 x i32>, ptr %src
%swp3 = tail call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %Ld2)
store <4 x i32> %swp3, <4 x i32>* %dst
store <4 x i32> %swp3, ptr %dst

ret void
}

define void @bswap_i16_mem(i16* %src, i16 %arg, i16* %dst) {
define void @bswap_i16_mem(ptr %src, i16 %arg, ptr %dst) {
; CHECK: function 'bswap_i16_mem'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i16, i16* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load i16, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call i16 @llvm.bswap.i16(i16 %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call i16 @llvm.bswap.i16(i16 %arg)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i16 %swp2, i16* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i16, i16* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i16 %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load i16, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call i16 @llvm.bswap.i16(i16 %Ld2)
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i16 %swp3, i16* %dst
%Ld1 = load i16, i16* %src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: store i16 %swp3, ptr %dst
%Ld1 = load i16, ptr %src
%swp1 = tail call i16 @llvm.bswap.i16(i16 %Ld1)

%swp2 = tail call i16 @llvm.bswap.i16(i16 %arg)
store i16 %swp2, i16* %dst
store i16 %swp2, ptr %dst

%Ld2 = load i16, i16* %src
%Ld2 = load i16, ptr %src
%swp3 = tail call i16 @llvm.bswap.i16(i16 %Ld2)
store i16 %swp3, i16* %dst
store i16 %swp3, ptr %dst

ret void
}

define void @bswap_v8i16_mem(<8 x i16>* %src, <8 x i16> %arg, <8 x i16>* %dst) {
define void @bswap_v8i16_mem(ptr %src, <8 x i16> %arg, ptr %dst) {
; CHECK: function 'bswap_v8i16_mem'
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <8 x i16>, <8 x i16>* %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <8 x i16>, <8 x i16>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load <8 x i16>, ptr %src
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %Ld1 = load <8 x i16>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp1 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %Ld1)
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp2 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %arg)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %swp2, <8 x i16>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <8 x i16> %swp2, <8 x i16>* %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <8 x i16>, <8 x i16>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %swp2, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <8 x i16> %swp2, ptr %dst
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld2 = load <8 x i16>, ptr %src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %swp3 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %Ld2)
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %swp3, <8 x i16>* %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <8 x i16> %swp3, <8 x i16>* %dst
%Ld1 = load <8 x i16>, <8 x i16>* %src
; Z13: Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %swp3, ptr %dst
; Z15: Cost Model: Found an estimated cost of 0 for instruction: store <8 x i16> %swp3, ptr %dst
%Ld1 = load <8 x i16>, ptr %src
%swp1 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %Ld1)

%swp2 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %arg)
store <8 x i16> %swp2, <8 x i16>* %dst
store <8 x i16> %swp2, ptr %dst

%Ld2 = load <8 x i16>, <8 x i16>* %src
%Ld2 = load <8 x i16>, ptr %src
%swp3 = tail call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %Ld2)
store <8 x i16> %swp3, <8 x i16>* %dst
store <8 x i16> %swp3, ptr %dst

ret void
}
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/SystemZ/load-and-test.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
;
; Test that load and test results in 0 cost for the compare.

define i64 @fun0(i64* %Src, i64 %Arg) {
%Ld1 = load i64, i64* %Src
define i64 @fun0(ptr %Src, i64 %Arg) {
%Ld1 = load i64, ptr %Src
%Cmp = icmp eq i64 %Ld1, 0
%S = select i1 %Cmp, i64 %Arg, i64 %Ld1
ret i64 %S
; CHECK: function 'fun0'
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i64, i64* %Src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i64, ptr %Src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Cmp = icmp eq i64 %Ld1, 0
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %S = select
}

define i32 @fun1(i32* %Src, i32 %Arg) {
%Ld1 = load i32, i32* %Src
define i32 @fun1(ptr %Src, i32 %Arg) {
%Ld1 = load i32, ptr %Src
%Cmp = icmp eq i32 %Ld1, 0
%S = select i1 %Cmp, i32 %Arg, i32 %Ld1
ret i32 %S
; CHECK: function 'fun1'
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i32, i32* %Src
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i32, ptr %Src
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Cmp = icmp eq i32 %Ld1, 0
; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %S = select
}
6 changes: 3 additions & 3 deletions llvm/test/Analysis/CostModel/SystemZ/load-ptr-cmp-fold.ll
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s

; Test that the cost heuristic for a folded load works also for a pointer operand.
define void @fun0(i64* %lhs, i64** %rhs_ptr) {
%rhs = load i64*, i64** %rhs_ptr
%c = icmp eq i64* %lhs, %rhs
define void @fun0(ptr %lhs, ptr %rhs_ptr) {
%rhs = load ptr, ptr %rhs_ptr
%c = icmp eq ptr %lhs, %rhs
ret void
; CHECK: function 'fun0'
; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %rhs = load
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/Analysis/CostModel/SystemZ/load-to-trunc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=systemz-unknown < %s | FileCheck %s --check-prefix=CHECK

; Check that cost is 1 for unusual load to register sized load.
define i32 @loadUnusualIntegerWithTrunc(i128* %ptr) {
define i32 @loadUnusualIntegerWithTrunc(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualIntegerWithTrunc'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %trunc = trunc i128 %out to i32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %trunc
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
%trunc = trunc i128 %out to i32
ret i32 %trunc
}

define i128 @loadUnusualInteger(i128* %ptr) {
define i128 @loadUnusualInteger(ptr %ptr) {
; CHECK-LABEL: 'loadUnusualInteger'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, i128* %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %out = load i128, ptr %ptr, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i128 %out
;
%out = load i128, i128* %ptr
%out = load i128, ptr %ptr
ret i128 %out
}
248 changes: 124 additions & 124 deletions llvm/test/Analysis/CostModel/SystemZ/load_store.ll

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions llvm/test/Analysis/CostModel/SystemZ/logic-miscext3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ define void @fun0(i32 %a) {
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res4 = xor i32 %c4, -1

entry:
%l0 = load i32, i32* undef
%l0 = load i32, ptr undef
%c0 = xor i32 %l0, -1
%res0 = or i32 %a, %c0
store i32 %res0, i32* undef
store i32 %res0, ptr undef

%l1 = load i32, i32* undef
%l1 = load i32, ptr undef
%c1 = xor i32 %l1, -1
%res1 = and i32 %a, %c1
store i32 %res1, i32* undef
store i32 %res1, ptr undef

%l2 = load i32, i32* undef
%l2 = load i32, ptr undef
%c2 = and i32 %l2, %a
%res2 = xor i32 %c2, -1
store i32 %res2, i32* undef
store i32 %res2, ptr undef

%l3 = load i32, i32* undef
%l3 = load i32, ptr undef
%c3 = or i32 %l3, %a
%res3 = xor i32 %c3, -1
store i32 %res3, i32* undef
store i32 %res3, ptr undef

%l4 = load i32, i32* undef
%l4 = load i32, ptr undef
%c4 = xor i32 %l4, %a
%res4 = xor i32 %c4, -1
store i32 %res4, i32* undef
store i32 %res4, ptr undef

ret void
}
Expand All @@ -68,30 +68,30 @@ define void @fun1(i64 %a) {
; Z13: Cost Model: Found an estimated cost of 1 for instruction: %res4 = xor i64 %c4, -1
; Z15: Cost Model: Found an estimated cost of 0 for instruction: %res4 = xor i64 %c4, -1
entry:
%l0 = load i64, i64* undef
%l0 = load i64, ptr undef
%c0 = xor i64 %l0, -1
%res0 = or i64 %a, %c0
store i64 %res0, i64* undef
store i64 %res0, ptr undef

%l1 = load i64, i64* undef
%l1 = load i64, ptr undef
%c1 = xor i64 %l1, -1
%res1 = and i64 %a, %c1
store i64 %res1, i64* undef
store i64 %res1, ptr undef

%l2 = load i64, i64* undef
%l2 = load i64, ptr undef
%c2 = and i64 %l2, %a
%res2 = xor i64 %c2, -1
store i64 %res2, i64* undef
store i64 %res2, ptr undef

%l3 = load i64, i64* undef
%l3 = load i64, ptr undef
%c3 = or i64 %l3, %a
%res3 = xor i64 %c3, -1
store i64 %res3, i64* undef
store i64 %res3, ptr undef

%l4 = load i64, i64* undef
%l4 = load i64, ptr undef
%c4 = xor i64 %l4, %a
%res4 = xor i64 %c4, -1
store i64 %res4, i64* undef
store i64 %res4, ptr undef

ret void
}
512 changes: 256 additions & 256 deletions llvm/test/Analysis/CostModel/SystemZ/memop-folding-int-arith.ll

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion llvm/test/Analysis/CostModel/SystemZ/oldarch-vectors.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; Check that some costs can be returned for vector instructions also without
; vector support.

define void @fun(<2 x double>* %arg) {
define void @fun(ptr %arg) {
entry:
%add = fadd <2 x double> undef, undef
shufflevector <2 x i32> undef, <2 x i32> undef, <2 x i32> <i32 1, i32 0>
Expand Down
108 changes: 54 additions & 54 deletions llvm/test/Analysis/CostModel/X86/bswap-store.ll

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions llvm/test/Analysis/CostModel/X86/costmodel.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ define i64 @foo(i64 %arg) {
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
; LATENCY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = load i64, i64* undef, align 4
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
; LATENCY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = load i64, ptr undef, align 4
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to ptr
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint ptr undef to i64
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
; LATENCY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void undef()
Expand All @@ -26,10 +25,9 @@ define i64 @foo(i64 %arg) {
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i64, i64* undef, align 4
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i64, ptr undef, align 4
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to ptr
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint ptr undef to i64
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void undef()
Expand All @@ -38,10 +36,9 @@ define i64 @foo(i64 %arg) {
%A1 = alloca i32, align 8
%A2 = alloca i64, i64 undef, align 8
%I64 = add i64 undef, undef
load i64, i64* undef, align 4
%BC = bitcast i8* undef to i32*
%I2P = inttoptr i64 undef to i8*
%P2I = ptrtoint i8* undef to i64
load i64, ptr undef, align 4
%I2P = inttoptr i64 undef to ptr
%P2I = ptrtoint ptr undef to i64
%TC = trunc i64 undef to i32
%uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
call void undef()
Expand Down
82 changes: 41 additions & 41 deletions llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,76 @@

define i32 @trivially_free() {
; CHECK-SIZE-LABEL: 'trivially_free'
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a0 = call i32 @llvm.annotation.i32.p0i8(i32 undef, i8* undef, i8* undef, i32 undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a0 = call i32 @llvm.annotation.i32.p0(i32 undef, ptr undef, ptr undef, i32 undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.assume(i1 undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.experimental.noalias.scope.decl(metadata !0)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.sideeffect()
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = call {}* @llvm.invariant.start.p0i8(i64 1, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0i8({}* undef, i64 1, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = call i8* @llvm.launder.invariant.group.p0i8(i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = call i8* @llvm.strip.invariant.group.p0i8(i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0i8(i64 1, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0i8(i64 1, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = call i64 @llvm.objectsize.i64.p0i8(i8* undef, i1 true, i1 true, i1 true)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a6 = call i8* @llvm.ptr.annotation.p0i8.p0i8(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.var.annotation.p0i8.p0i8(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(i64 1, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(i64 1, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = call i64 @llvm.objectsize.i64.p0(ptr undef, i1 true, i1 true, i1 true)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a6 = call ptr @llvm.ptr.annotation.p0.p0(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.var.annotation.p0.p0(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
;
; CHECK-THROUGHPUT-LABEL: 'trivially_free'
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a0 = call i32 @llvm.annotation.i32.p0i8(i32 undef, i8* undef, i8* undef, i32 undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a0 = call i32 @llvm.annotation.i32.p0(i32 undef, ptr undef, ptr undef, i32 undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.assume(i1 undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.experimental.noalias.scope.decl(metadata !0)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.sideeffect()
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = call {}* @llvm.invariant.start.p0i8(i64 1, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0i8({}* undef, i64 1, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = call i8* @llvm.launder.invariant.group.p0i8(i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = call i8* @llvm.strip.invariant.group.p0i8(i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0i8(i64 1, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0i8(i64 1, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = call i64 @llvm.objectsize.i64.p0i8(i8* undef, i1 true, i1 true, i1 true)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a6 = call i8* @llvm.ptr.annotation.p0i8.p0i8(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.var.annotation.p0i8.p0i8(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(i64 1, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(i64 1, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a5 = call i64 @llvm.objectsize.i64.p0(ptr undef, i1 true, i1 true, i1 true)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %a6 = call ptr @llvm.ptr.annotation.p0.p0(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.var.annotation.p0.p0(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
;
%a0 = call i32 @llvm.annotation.i32(i32 undef, i8* undef, i8* undef, i32 undef)
%a0 = call i32 @llvm.annotation.i32(i32 undef, ptr undef, ptr undef, i32 undef)
call void @llvm.assume(i1 undef)
call void @llvm.experimental.noalias.scope.decl(metadata !4)
call void @llvm.sideeffect()
call void @llvm.dbg.declare(metadata i8** undef, metadata !0, metadata !DIExpression())
call void @llvm.dbg.declare(metadata ptr undef, metadata !0, metadata !DIExpression())
call void @llvm.dbg.value(metadata i64 undef, i64 undef, metadata !DIExpression(), metadata !DIExpression())
call void @llvm.dbg.label(metadata !2)
%a1 = call {}* @llvm.invariant.start.p0i8(i64 1, i8* undef)
call void @llvm.invariant.end.p0i8({}* undef, i64 1, i8* undef)
%a2 = call i8* @llvm.launder.invariant.group.p0i8(i8* undef)
%a3 = call i8* @llvm.strip.invariant.group.p0i8(i8* undef)
%a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
%a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
%a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
%a4 = call i1 @llvm.is.constant.i32(i32 undef)
call void @llvm.lifetime.start.p0i8(i64 1, i8* undef)
call void @llvm.lifetime.end.p0i8(i64 1, i8* undef)
%a5 = call i64 @llvm.objectsize.i64.p0i8(i8* undef, i1 1, i1 1, i1 1)
%a6 = call i8* @llvm.ptr.annotation.p0i8(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
call void @llvm.var.annotation(i8* undef, i8* undef, i8* undef, i32 undef, i8* undef)
call void @llvm.lifetime.start.p0(i64 1, ptr undef)
call void @llvm.lifetime.end.p0(i64 1, ptr undef)
%a5 = call i64 @llvm.objectsize.i64.p0(ptr undef, i1 1, i1 1, i1 1)
%a6 = call ptr @llvm.ptr.annotation.p0(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
call void @llvm.var.annotation(ptr undef, ptr undef, ptr undef, i32 undef, ptr undef)
ret i32 undef
}

declare i32 @llvm.annotation.i32(i32, i8*, i8*, i32)
declare i32 @llvm.annotation.i32(i32, ptr, ptr, i32)
declare void @llvm.assume(i1)
declare void @llvm.experimental.noalias.scope.decl(metadata)
declare void @llvm.sideeffect()
declare void @llvm.dbg.declare(metadata, metadata, metadata)
declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
declare void @llvm.dbg.label(metadata)
declare {}* @llvm.invariant.start.p0i8(i64, i8*)
declare void @llvm.invariant.end.p0i8({}*, i64, i8*)
declare i8* @llvm.launder.invariant.group.p0i8(i8*)
declare i8* @llvm.strip.invariant.group.p0i8(i8*)
declare ptr @llvm.invariant.start.p0(i64, ptr)
declare void @llvm.invariant.end.p0(ptr, i64, ptr)
declare ptr @llvm.launder.invariant.group.p0(ptr)
declare ptr @llvm.strip.invariant.group.p0(ptr)
declare i1 @llvm.is.constant.i32(i32)
declare void @llvm.lifetime.start.p0i8(i64, i8*)
declare void @llvm.lifetime.end.p0i8(i64, i8*)
declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
declare i8* @llvm.ptr.annotation.p0i8(i8*, i8*, i8*, i32, i8*)
declare void @llvm.var.annotation(i8*, i8*, i8*, i32, i8*)
declare void @llvm.lifetime.start.p0(i64, ptr)
declare void @llvm.lifetime.end.p0(i64, ptr)
declare i64 @llvm.objectsize.i64.p0(ptr, i1, i1, i1)
declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr)
declare void @llvm.var.annotation(ptr, ptr, ptr, i32, ptr)


!0 = !DILocalVariable(scope: !1)
Expand Down
72 changes: 36 additions & 36 deletions llvm/test/Analysis/CostModel/X86/gather-i16-with-i8-index.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,60 @@ target triple = "x86_64-unknown-linux-gnu"

define void @test() {
; SSE-LABEL: 'test'
; SSE: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, i16* %inB, align 2
; SSE: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, i16* %inB, align 2
; SSE: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, i16* %inB, align 2
; SSE: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, i16* %inB, align 2
; SSE: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i16, i16* %inB, align 2
; SSE: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 193 for VF 16 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 386 for VF 32 For instruction: %valB = load i16, i16* %inB, align 2
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 193 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 386 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 33 for VF 16 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 66 for VF 32 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 33 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 66 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 53 for VF 16 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 106 for VF 32 For instruction: %valB = load i16, i16* %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 53 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 106 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 55 for VF 16 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 111 for VF 32 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 222 for VF 64 For instruction: %valB = load i16, i16* %inB, align 2
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 55 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 111 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 222 for VF 64 For instruction: %valB = load i16, ptr %inB, align 2
;
entry:
br label %for.body

for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]

%inA = getelementptr inbounds [1024 x i8], [1024 x i8]* @A, i64 0, i64 %iv
%valA = load i8, i8* %inA
%inA = getelementptr inbounds [1024 x i8], ptr @A, i64 0, i64 %iv
%valA = load i8, ptr %inA
%valA.ext = sext i8 %valA to i64

%inB = getelementptr inbounds [1024 x i16], [1024 x i16]* @B, i64 0, i64 %valA.ext
%valB = load i16, i16* %inB
%inB = getelementptr inbounds [1024 x i16], ptr @B, i64 0, i64 %valA.ext
%valB = load i16, ptr %inB

%out = getelementptr inbounds [1024 x i16], [1024 x i16]* @C, i64 0, i64 %iv
store i16 %valB, i16* %out
%out = getelementptr inbounds [1024 x i16], ptr @C, i64 0, i64 %iv
store i16 %valB, ptr %out

%iv.next = add nuw nsw i64 %iv, 1
%cmp = icmp ult i64 %iv.next, 1024
Expand Down
82 changes: 41 additions & 41 deletions llvm/test/Analysis/CostModel/X86/gather-i32-with-i8-index.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,67 +17,67 @@ target triple = "x86_64-unknown-linux-gnu"

define void @test() {
; SSE2-LABEL: 'test'
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; SSE2: LV: Found an estimated cost of 204 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 204 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
;
; SSE42-LABEL: 'test'
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 97 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 194 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 388 for VF 32 For instruction: %valB = load i32, i32* %inB, align 4
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 97 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 194 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 388 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 17 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 34 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 68 for VF 32 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 17 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 34 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 68 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i32, i32* %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 18 for VF 16 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 36 for VF 32 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 72 for VF 64 For instruction: %valB = load i32, i32* %inB, align 4
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 18 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 36 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 72 for VF 64 For instruction: %valB = load i32, ptr %inB, align 4
;
entry:
br label %for.body

for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]

%inA = getelementptr inbounds [1024 x i8], [1024 x i8]* @A, i64 0, i64 %iv
%valA = load i8, i8* %inA
%inA = getelementptr inbounds [1024 x i8], ptr @A, i64 0, i64 %iv
%valA = load i8, ptr %inA
%valA.ext = sext i8 %valA to i64

%inB = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %valA.ext
%valB = load i32, i32* %inB
%inB = getelementptr inbounds [1024 x i32], ptr @B, i64 0, i64 %valA.ext
%valB = load i32, ptr %inB

%out = getelementptr inbounds [1024 x i32], [1024 x i32]* @C, i64 0, i64 %iv
store i32 %valB, i32* %out
%out = getelementptr inbounds [1024 x i32], ptr @C, i64 0, i64 %iv
store i32 %valB, ptr %out

%iv.next = add nuw nsw i64 %iv, 1
%cmp = icmp ult i64 %iv.next, 1024
Expand Down
82 changes: 41 additions & 41 deletions llvm/test/Analysis/CostModel/X86/gather-i64-with-i8-index.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,67 +17,67 @@ target triple = "x86_64-unknown-linux-gnu"

define void @test() {
; SSE2-LABEL: 'test'
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; SSE2: LV: Found an estimated cost of 50 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; SSE2: LV: Found an estimated cost of 100 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; SSE2: LV: Found an estimated cost of 200 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 50 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 100 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 200 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
;
; SSE42-LABEL: 'test'
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 49 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 98 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 196 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 392 for VF 32 For instruction: %valB = load i64, i64* %inB, align 8
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 49 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 98 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 196 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 392 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 9 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 18 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 36 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 72 for VF 32 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 9 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 18 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 36 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 72 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i64, i64* %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 14 for VF 4 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 20 for VF 16 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 40 for VF 32 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 80 for VF 64 For instruction: %valB = load i64, i64* %inB, align 8
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 14 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 20 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 40 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 80 for VF 64 For instruction: %valB = load i64, ptr %inB, align 8
;
entry:
br label %for.body

for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]

%inA = getelementptr inbounds [1024 x i8], [1024 x i8]* @A, i64 0, i64 %iv
%valA = load i8, i8* %inA
%inA = getelementptr inbounds [1024 x i8], ptr @A, i64 0, i64 %iv
%valA = load i8, ptr %inA
%valA.ext = sext i8 %valA to i64

%inB = getelementptr inbounds [1024 x i64], [1024 x i64]* @B, i64 0, i64 %valA.ext
%valB = load i64, i64* %inB
%inB = getelementptr inbounds [1024 x i64], ptr @B, i64 0, i64 %valA.ext
%valB = load i64, ptr %inB

%out = getelementptr inbounds [1024 x i64], [1024 x i64]* @C, i64 0, i64 %iv
store i64 %valB, i64* %out
%out = getelementptr inbounds [1024 x i64], ptr @C, i64 0, i64 %iv
store i64 %valB, ptr %out

%iv.next = add nuw nsw i64 %iv, 1
%cmp = icmp ult i64 %iv.next, 1024
Expand Down
82 changes: 41 additions & 41 deletions llvm/test/Analysis/CostModel/X86/gather-i8-with-i8-index.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,67 +17,67 @@ target triple = "x86_64-unknown-linux-gnu"

define void @test() {
; SSE2-LABEL: 'test'
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; SSE2: LV: Found an estimated cost of 103 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; SSE2: LV: Found an estimated cost of 207 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; SSE2: LV: Found an estimated cost of 103 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; SSE2: LV: Found an estimated cost of 207 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
;
; SSE42-LABEL: 'test'
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 385 for VF 32 For instruction: %valB = load i8, i8* %inB, align 1
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; AVX1: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
; AVX1: LV: Found an estimated cost of 385 for VF 32 For instruction: %valB = load i8, ptr %inB, align 1
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 32 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 65 for VF 32 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 32 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-SLOWGATHER: LV: Found an estimated cost of 65 for VF 32 For instruction: %valB = load i8, ptr %inB, align 1
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 52 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 105 for VF 32 For instruction: %valB = load i8, i8* %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 52 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
; AVX2-FASTGATHER: LV: Found an estimated cost of 105 for VF 32 For instruction: %valB = load i8, ptr %inB, align 1
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 54 for VF 16 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 109 for VF 32 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 219 for VF 64 For instruction: %valB = load i8, i8* %inB, align 1
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 54 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 109 for VF 32 For instruction: %valB = load i8, ptr %inB, align 1
; AVX512: LV: Found an estimated cost of 219 for VF 64 For instruction: %valB = load i8, ptr %inB, align 1
;
entry:
br label %for.body

for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]

%inA = getelementptr inbounds [1024 x i8], [1024 x i8]* @A, i64 0, i64 %iv
%valA = load i8, i8* %inA
%inA = getelementptr inbounds [1024 x i8], ptr @A, i64 0, i64 %iv
%valA = load i8, ptr %inA
%valA.ext = sext i8 %valA to i64

%inB = getelementptr inbounds [1024 x i8], [1024 x i8]* @B, i64 0, i64 %valA.ext
%valB = load i8, i8* %inB
%inB = getelementptr inbounds [1024 x i8], ptr @B, i64 0, i64 %valA.ext
%valB = load i8, ptr %inB

%out = getelementptr inbounds [1024 x i8], [1024 x i8]* @C, i64 0, i64 %iv
store i8 %valB, i8* %out
%out = getelementptr inbounds [1024 x i8], ptr @C, i64 0, i64 %iv
store i8 %valB, ptr %out

%iv.next = add nuw nsw i64 %iv, 1
%cmp = icmp ult i64 %iv.next, 1024
Expand Down
Loading