blob: 0383737cc758602938996dc4956c29f1932201a7 [file]
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu8.03-unknown-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,GFX8
; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,GFX90A
; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu9.0a-unknown-amdhsa -mattr=-unaligned-access-mode < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,GFX90A
; RUN: opt -passes="print<cost-model>" -disable-output -mtriple=amdgpu12.01-unknown-amdhsa < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,GFX12
define void @loads_i1(i32 %arg) {
; CHECK-LABEL: 'loads_i1'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i1, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = load <2 x i1>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %3 = load <3 x i1>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %4 = load <4 x i1>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load i1, ptr poison
load <2 x i1>, ptr poison
load <3 x i1>, ptr poison
load <4 x i1>, ptr poison
ret void
}
define void @loads_i8(i32 %arg) {
; CHECK-LABEL: 'loads_i8'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i8, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <2 x i8>, ptr poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <3 x i8>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i8>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load i8, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <3 x i8>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <4 x i8>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load i8, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <2 x i8>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load <3 x i8>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i8>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load i8, ptr poison
load <2 x i8>, ptr poison
load <3 x i8>, ptr poison
load <4 x i8>, ptr poison
load i8, ptr poison, align 1
load <2 x i8>, ptr poison, align 1
load <3 x i8>, ptr poison, align 1
load <4 x i8>, ptr poison, align 1
load i8, ptr poison, align 4
load <2 x i8>, ptr poison, align 4
load <3 x i8>, ptr poison, align 4
load <4 x i8>, ptr poison, align 4
ret void
}
define void @loads_i16(i32 %arg) {
; CHECK-LABEL: 'loads_i16'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i16, ptr poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <2 x i16>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %3 = load <3 x i16>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i16>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load i16, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i16>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %7 = load <3 x i16>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <4 x i16>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load i16, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <2 x i16>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i16>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = load i16, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <2 x i16>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %15 = load <3 x i16>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i16>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load i16, ptr poison
load <2 x i16>, ptr poison
load <3 x i16>, ptr poison
load <4 x i16>, ptr poison
load i16, ptr poison, align 1
load <2 x i16>, ptr poison, align 1
load <3 x i16>, ptr poison, align 1
load <4 x i16>, ptr poison, align 1
load i16, ptr poison, align 4
load <2 x i16>, ptr poison, align 4
load <3 x i16>, ptr poison, align 4
load <4 x i16>, ptr poison, align 4
load i16, ptr poison, align 8
load <2 x i16>, ptr poison, align 8
load <3 x i16>, ptr poison, align 8
load <4 x i16>, ptr poison, align 8
ret void
}
define void @loads_i32(i32 %arg) {
; CHECK-LABEL: 'loads_i32'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i32, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <2 x i32>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <3 x i32>, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i32>, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load i32, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i32>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <3 x i32>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <4 x i32>, ptr poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load i32, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <2 x i32>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load <3 x i32>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i32>, ptr poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = load i32, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <2 x i32>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <3 x i32>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = load i32, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <2 x i32>, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <3 x i32>, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <4 x i32>, ptr poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load i32, ptr poison
load <2 x i32>, ptr poison
load <3 x i32>, ptr poison
load <4 x i32>, ptr poison
load i32, ptr poison, align 1
load <2 x i32>, ptr poison, align 1
load <3 x i32>, ptr poison, align 1
load <4 x i32>, ptr poison, align 1
load i32, ptr poison, align 4
load <2 x i32>, ptr poison, align 4
load <3 x i32>, ptr poison, align 4
load <4 x i32>, ptr poison, align 4
load i32, ptr poison, align 8
load <2 x i32>, ptr poison, align 8
load <3 x i32>, ptr poison, align 8
load <4 x i32>, ptr poison, align 8
load i32, ptr poison, align 16
load <2 x i32>, ptr poison, align 16
load <3 x i32>, ptr poison, align 16
load <4 x i32>, ptr poison, align 16
ret void
}
define void @loads_addrspace_1(i32 %arg) {
; CHECK-LABEL: 'loads_addrspace_1'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <3 x i1>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <3 x i8>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <3 x i32>, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load <4 x i1>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <4 x i8>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i16>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %17 = load <8 x i1>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i8>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <8 x i16>, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <8 x i32>, ptr addrspace(1) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %21 = load <16 x i1>, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load <16 x i8>, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load <16 x i16>, ptr addrspace(1) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load <16 x i32>, ptr addrspace(1) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %25 = load <32 x i1>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = load <32 x i8>, ptr addrspace(1) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load <32 x i16>, ptr addrspace(1) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <32 x i32>, ptr addrspace(1) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %29 = load <64 x i1>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = load <64 x i8>, ptr addrspace(1) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <64 x i16>, ptr addrspace(1) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = load <64 x i32>, ptr addrspace(1) poison, align 256
; CHECK-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %33 = load <128 x i1>, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %34 = load <128 x i8>, ptr addrspace(1) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %35 = load <128 x i16>, ptr addrspace(1) poison, align 256
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %36 = load <128 x i32>, ptr addrspace(1) poison, align 512
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <1 x i1>, ptr addrspace(1) poison
load <1 x i8>, ptr addrspace(1) poison
load <1 x i16>, ptr addrspace(1) poison
load <1 x i32>, ptr addrspace(1) poison
load <2 x i1>, ptr addrspace(1) poison
load <2 x i8>, ptr addrspace(1) poison
load <2 x i16>, ptr addrspace(1) poison
load <2 x i32>, ptr addrspace(1) poison
load <3 x i1>, ptr addrspace(1) poison
load <3 x i8>, ptr addrspace(1) poison
load <3 x i16>, ptr addrspace(1) poison
load <3 x i32>, ptr addrspace(1) poison
load <4 x i1>, ptr addrspace(1) poison
load <4 x i8>, ptr addrspace(1) poison
load <4 x i16>, ptr addrspace(1) poison
load <4 x i32>, ptr addrspace(1) poison
load <8 x i1>, ptr addrspace(1) poison
load <8 x i8>, ptr addrspace(1) poison
load <8 x i16>, ptr addrspace(1) poison
load <8 x i32>, ptr addrspace(1) poison
load <16 x i1>, ptr addrspace(1) poison
load <16 x i8>, ptr addrspace(1) poison
load <16 x i16>, ptr addrspace(1) poison
load <16 x i32>, ptr addrspace(1) poison
load <32 x i1>, ptr addrspace(1) poison
load <32 x i8>, ptr addrspace(1) poison
load <32 x i16>, ptr addrspace(1) poison
load <32 x i32>, ptr addrspace(1) poison
load <64 x i1>, ptr addrspace(1) poison
load <64 x i8>, ptr addrspace(1) poison
load <64 x i16>, ptr addrspace(1) poison
load <64 x i32>, ptr addrspace(1) poison
load <128 x i1>, ptr addrspace(1) poison
load <128 x i8>, ptr addrspace(1) poison
load <128 x i16>, ptr addrspace(1) poison
load <128 x i32>, ptr addrspace(1) poison
ret void
}
define void @loads_addrspace_3(i32 %arg) {
; CHECK-LABEL: 'loads_addrspace_3'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(3) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr addrspace(3) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <3 x i1>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <3 x i8>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <3 x i32>, ptr addrspace(3) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load <4 x i1>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <4 x i8>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i16>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr addrspace(3) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %17 = load <8 x i1>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i8>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <8 x i16>, ptr addrspace(3) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <8 x i32>, ptr addrspace(3) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %21 = load <16 x i1>, ptr addrspace(3) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load <16 x i8>, ptr addrspace(3) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load <16 x i16>, ptr addrspace(3) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load <16 x i32>, ptr addrspace(3) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %25 = load <32 x i1>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %26 = load <32 x i8>, ptr addrspace(3) poison, align 32
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load <32 x i16>, ptr addrspace(3) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <32 x i32>, ptr addrspace(3) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %29 = load <64 x i1>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %30 = load <64 x i8>, ptr addrspace(3) poison, align 64
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <64 x i16>, ptr addrspace(3) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = load <64 x i32>, ptr addrspace(3) poison, align 256
; CHECK-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %33 = load <128 x i1>, ptr addrspace(3) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %34 = load <128 x i8>, ptr addrspace(3) poison, align 128
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %35 = load <128 x i16>, ptr addrspace(3) poison, align 256
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %36 = load <128 x i32>, ptr addrspace(3) poison, align 512
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <1 x i1>, ptr addrspace(3) poison
load <1 x i8>, ptr addrspace(3) poison
load <1 x i16>, ptr addrspace(3) poison
load <1 x i32>, ptr addrspace(3) poison
load <2 x i1>, ptr addrspace(3) poison
load <2 x i8>, ptr addrspace(3) poison
load <2 x i16>, ptr addrspace(3) poison
load <2 x i32>, ptr addrspace(3) poison
load <3 x i1>, ptr addrspace(3) poison
load <3 x i8>, ptr addrspace(3) poison
load <3 x i16>, ptr addrspace(3) poison
load <3 x i32>, ptr addrspace(3) poison
load <4 x i1>, ptr addrspace(3) poison
load <4 x i8>, ptr addrspace(3) poison
load <4 x i16>, ptr addrspace(3) poison
load <4 x i32>, ptr addrspace(3) poison
load <8 x i1>, ptr addrspace(3) poison
load <8 x i8>, ptr addrspace(3) poison
load <8 x i16>, ptr addrspace(3) poison
load <8 x i32>, ptr addrspace(3) poison
load <16 x i1>, ptr addrspace(3) poison
load <16 x i8>, ptr addrspace(3) poison
load <16 x i16>, ptr addrspace(3) poison
load <16 x i32>, ptr addrspace(3) poison
load <32 x i1>, ptr addrspace(3) poison
load <32 x i8>, ptr addrspace(3) poison
load <32 x i16>, ptr addrspace(3) poison
load <32 x i32>, ptr addrspace(3) poison
load <64 x i1>, ptr addrspace(3) poison
load <64 x i8>, ptr addrspace(3) poison
load <64 x i16>, ptr addrspace(3) poison
load <64 x i32>, ptr addrspace(3) poison
load <128 x i1>, ptr addrspace(3) poison
load <128 x i8>, ptr addrspace(3) poison
load <128 x i16>, ptr addrspace(3) poison
load <128 x i32>, ptr addrspace(3) poison
ret void
}
define void @loads_addrspace_5(i32 %arg) {
; GFX8-LABEL: 'loads_addrspace_5'
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(5) poison, align 2
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr addrspace(5) poison, align 2
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <3 x i1>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <3 x i8>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <3 x i32>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load <4 x i1>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <4 x i8>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i16>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %17 = load <8 x i1>, ptr addrspace(5) poison, align 1
; GFX8-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %18 = load <8 x i8>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <8 x i16>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <8 x i32>, ptr addrspace(5) poison, align 32
; GFX8-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %21 = load <16 x i1>, ptr addrspace(5) poison, align 2
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %22 = load <16 x i8>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load <16 x i16>, ptr addrspace(5) poison, align 32
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load <16 x i32>, ptr addrspace(5) poison, align 64
; GFX8-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %25 = load <32 x i1>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %26 = load <32 x i8>, ptr addrspace(5) poison, align 32
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load <32 x i16>, ptr addrspace(5) poison, align 64
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <32 x i32>, ptr addrspace(5) poison, align 128
; GFX8-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %29 = load <64 x i1>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %30 = load <64 x i8>, ptr addrspace(5) poison, align 64
; GFX8-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <64 x i16>, ptr addrspace(5) poison, align 128
; GFX8-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = load <64 x i32>, ptr addrspace(5) poison, align 256
; GFX8-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %33 = load <128 x i1>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %34 = load <128 x i8>, ptr addrspace(5) poison, align 128
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %35 = load <128 x i16>, ptr addrspace(5) poison, align 256
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %36 = load <128 x i32>, ptr addrspace(5) poison, align 512
; GFX8-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX90A-LABEL: 'loads_addrspace_5'
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(5) poison, align 2
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr addrspace(5) poison, align 2
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <3 x i1>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <3 x i8>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <3 x i32>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load <4 x i1>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <4 x i8>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i16>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %17 = load <8 x i1>, ptr addrspace(5) poison, align 1
; GFX90A-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %18 = load <8 x i8>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <8 x i16>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <8 x i32>, ptr addrspace(5) poison, align 32
; GFX90A-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %21 = load <16 x i1>, ptr addrspace(5) poison, align 2
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %22 = load <16 x i8>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load <16 x i16>, ptr addrspace(5) poison, align 32
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load <16 x i32>, ptr addrspace(5) poison, align 64
; GFX90A-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %25 = load <32 x i1>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %26 = load <32 x i8>, ptr addrspace(5) poison, align 32
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load <32 x i16>, ptr addrspace(5) poison, align 64
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <32 x i32>, ptr addrspace(5) poison, align 128
; GFX90A-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %29 = load <64 x i1>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %30 = load <64 x i8>, ptr addrspace(5) poison, align 64
; GFX90A-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <64 x i16>, ptr addrspace(5) poison, align 128
; GFX90A-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = load <64 x i32>, ptr addrspace(5) poison, align 256
; GFX90A-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %33 = load <128 x i1>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %34 = load <128 x i8>, ptr addrspace(5) poison, align 128
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %35 = load <128 x i16>, ptr addrspace(5) poison, align 256
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %36 = load <128 x i32>, ptr addrspace(5) poison, align 512
; GFX90A-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX12-LABEL: 'loads_addrspace_5'
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(5) poison, align 2
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <2 x i8>, ptr addrspace(5) poison, align 2
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <3 x i1>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <3 x i8>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = load <3 x i16>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = load <3 x i32>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %13 = load <4 x i1>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = load <4 x i8>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i16>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = load <4 x i32>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %17 = load <8 x i1>, ptr addrspace(5) poison, align 1
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = load <8 x i8>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = load <8 x i16>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = load <8 x i32>, ptr addrspace(5) poison, align 32
; GFX12-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %21 = load <16 x i1>, ptr addrspace(5) poison, align 2
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = load <16 x i8>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = load <16 x i16>, ptr addrspace(5) poison, align 32
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = load <16 x i32>, ptr addrspace(5) poison, align 64
; GFX12-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %25 = load <32 x i1>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %26 = load <32 x i8>, ptr addrspace(5) poison, align 32
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = load <32 x i16>, ptr addrspace(5) poison, align 64
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = load <32 x i32>, ptr addrspace(5) poison, align 128
; GFX12-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %29 = load <64 x i1>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %30 = load <64 x i8>, ptr addrspace(5) poison, align 64
; GFX12-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = load <64 x i16>, ptr addrspace(5) poison, align 128
; GFX12-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = load <64 x i32>, ptr addrspace(5) poison, align 256
; GFX12-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %33 = load <128 x i1>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %34 = load <128 x i8>, ptr addrspace(5) poison, align 128
; GFX12-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %35 = load <128 x i16>, ptr addrspace(5) poison, align 256
; GFX12-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %36 = load <128 x i32>, ptr addrspace(5) poison, align 512
; GFX12-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <1 x i1>, ptr addrspace(5) poison
load <1 x i8>, ptr addrspace(5) poison
load <1 x i16>, ptr addrspace(5) poison
load <1 x i32>, ptr addrspace(5) poison
load <2 x i1>, ptr addrspace(5) poison
load <2 x i8>, ptr addrspace(5) poison
load <2 x i16>, ptr addrspace(5) poison
load <2 x i32>, ptr addrspace(5) poison
load <3 x i1>, ptr addrspace(5) poison
load <3 x i8>, ptr addrspace(5) poison
load <3 x i16>, ptr addrspace(5) poison
load <3 x i32>, ptr addrspace(5) poison
load <4 x i1>, ptr addrspace(5) poison
load <4 x i8>, ptr addrspace(5) poison
load <4 x i16>, ptr addrspace(5) poison
load <4 x i32>, ptr addrspace(5) poison
load <8 x i1>, ptr addrspace(5) poison
load <8 x i8>, ptr addrspace(5) poison
load <8 x i16>, ptr addrspace(5) poison
load <8 x i32>, ptr addrspace(5) poison
load <16 x i1>, ptr addrspace(5) poison
load <16 x i8>, ptr addrspace(5) poison
load <16 x i16>, ptr addrspace(5) poison
load <16 x i32>, ptr addrspace(5) poison
load <32 x i1>, ptr addrspace(5) poison
load <32 x i8>, ptr addrspace(5) poison
load <32 x i16>, ptr addrspace(5) poison
load <32 x i32>, ptr addrspace(5) poison
load <64 x i1>, ptr addrspace(5) poison
load <64 x i8>, ptr addrspace(5) poison
load <64 x i16>, ptr addrspace(5) poison
load <64 x i32>, ptr addrspace(5) poison
load <128 x i1>, ptr addrspace(5) poison
load <128 x i8>, ptr addrspace(5) poison
load <128 x i16>, ptr addrspace(5) poison
load <128 x i32>, ptr addrspace(5) poison
ret void
}
define void @loads_underaligned(i32 %arg) {
; CHECK-LABEL: 'loads_underaligned'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <3 x i32>, ptr addrspace(3) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <3 x i32>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <3 x i32>, ptr addrspace(3) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <4 x i32>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <4 x i32>, ptr addrspace(5) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load i32, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load i32, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <4 x i32>, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load <4 x i32>, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load i32, ptr poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = load <4 x i32>, ptr poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <3 x i32>, ptr addrspace(3) poison, align 1
load <3 x i32>, ptr addrspace(3) poison, align 4
load <3 x i32>, ptr addrspace(3) poison, align 8
load <4 x i32>, ptr addrspace(3) poison, align 4
load <4 x i32>, ptr addrspace(5) poison, align 1
load i32, ptr addrspace(1) poison, align 1
load i32, ptr addrspace(1) poison, align 2
load <4 x i32>, ptr addrspace(1) poison, align 1
load <4 x i32>, ptr addrspace(1) poison, align 2
load i32, ptr poison, align 2
load <4 x i32>, ptr poison, align 2
ret void
}
define void @loads_overaligned(i32 %arg) {
; GFX8-LABEL: 'loads_overaligned'
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <7 x i8>, ptr addrspace(1) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <7 x i16>, ptr addrspace(1) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <5 x i16>, ptr addrspace(3) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %4 = load <7 x i8>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(5) poison, align 16
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i8>, ptr poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX90A-LABEL: 'loads_overaligned'
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <7 x i8>, ptr addrspace(1) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <7 x i16>, ptr addrspace(1) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <5 x i16>, ptr addrspace(3) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %4 = load <7 x i8>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(5) poison, align 16
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i8>, ptr poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX12-LABEL: 'loads_overaligned'
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <7 x i8>, ptr addrspace(1) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <7 x i16>, ptr addrspace(1) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <5 x i16>, ptr addrspace(3) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <7 x i8>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(5) poison, align 16
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i8>, ptr poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <7 x i8>, ptr addrspace(1) poison, align 8
load <7 x i16>, ptr addrspace(1) poison, align 16
load <5 x i16>, ptr addrspace(3) poison, align 16
load <7 x i8>, ptr addrspace(5) poison, align 8
load <7 x i16>, ptr addrspace(5) poison, align 16
load <7 x i8>, ptr poison, align 8
ret void
}
define void @loads_widened_tail(i32 %arg) {
; GFX8-LABEL: 'loads_widened_tail'
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <5 x i8>, ptr addrspace(1) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <6 x i8>, ptr addrspace(1) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <7 x i8>, ptr addrspace(1) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <7 x i8>, ptr addrspace(1) poison, align 2
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(1) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i16>, ptr addrspace(1) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <7 x i8>, ptr addrspace(3) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <7 x i8>, ptr poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <13 x i8>, ptr addrspace(5) poison, align 4
; GFX8-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <7 x i16>, ptr addrspace(5) poison, align 8
; GFX8-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX90A-LABEL: 'loads_widened_tail'
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <5 x i8>, ptr addrspace(1) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <6 x i8>, ptr addrspace(1) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <7 x i8>, ptr addrspace(1) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <7 x i8>, ptr addrspace(1) poison, align 2
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(1) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i16>, ptr addrspace(1) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <7 x i8>, ptr addrspace(3) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <7 x i8>, ptr poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %9 = load <13 x i8>, ptr addrspace(5) poison, align 4
; GFX90A-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <7 x i16>, ptr addrspace(5) poison, align 8
; GFX90A-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
; GFX12-LABEL: 'loads_widened_tail'
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load <5 x i8>, ptr addrspace(1) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load <6 x i8>, ptr addrspace(1) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load <7 x i8>, ptr addrspace(1) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load <7 x i8>, ptr addrspace(1) poison, align 2
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = load <7 x i16>, ptr addrspace(1) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = load <7 x i16>, ptr addrspace(1) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = load <7 x i8>, ptr addrspace(3) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = load <7 x i8>, ptr poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load <13 x i8>, ptr addrspace(5) poison, align 4
; GFX12-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = load <7 x i16>, ptr addrspace(5) poison, align 8
; GFX12-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load <5 x i8>, ptr addrspace(1) poison, align 4
load <6 x i8>, ptr addrspace(1) poison, align 4
load <7 x i8>, ptr addrspace(1) poison, align 4
load <7 x i8>, ptr addrspace(1) poison, align 2
load <7 x i16>, ptr addrspace(1) poison, align 4
load <7 x i16>, ptr addrspace(1) poison, align 8
load <7 x i8>, ptr addrspace(3) poison, align 4
load <7 x i8>, ptr poison, align 4
load <13 x i8>, ptr addrspace(5) poison, align 4
load <7 x i16>, ptr addrspace(5) poison, align 8
ret void
}
define void @loads_odd_widths(i32 %arg) {
; CHECK-LABEL: 'loads_odd_widths'
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i24, ptr addrspace(1) poison, align 1
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = load i48, ptr addrspace(1) poison, align 2
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = load i24, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = load i48, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = load i80, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %6 = load i112, ptr addrspace(1) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %7 = load <3 x i12>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %8 = load <4 x i24>, ptr addrspace(1) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = load <2 x i48>, ptr addrspace(1) poison, align 8
; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %10 = load <4 x i24>, ptr addrspace(3) poison, align 4
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %11 = load <2 x i96>, ptr addrspace(5) poison, align 16
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
;
load i24, ptr addrspace(1) poison, align 1
load i48, ptr addrspace(1) poison, align 2
load i24, ptr addrspace(1) poison, align 4
load i48, ptr addrspace(1) poison, align 8
load i80, ptr addrspace(1) poison, align 16
load i112, ptr addrspace(1) poison, align 16
load <3 x i12>, ptr addrspace(1) poison, align 4
load <4 x i24>, ptr addrspace(1) poison, align 4
load <2 x i48>, ptr addrspace(1) poison, align 8
load <4 x i24>, ptr addrspace(3) poison, align 4
load <2 x i96>, ptr addrspace(5) poison, align 16
ret void
}