Skip to content

[AMDGPU][NFC] Add tests in preparation for i8 vectorization #138801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025

Conversation

doru1004
Copy link
Contributor

@doru1004 doru1004 commented May 7, 2025

Precommit tests for PR: #134934

@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/pr-subscribers-llvm-analysis
@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-backend-amdgpu

Author: Gheorghe-Teodor Bercea (doru1004)

Changes

Precommit tests for PR: #134934


Patch is 98.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/138801.diff

2 Files Affected:

  • (added) llvm/test/Analysis/CostModel/AMDGPU/load.ll (+356)
  • (added) llvm/test/Transforms/SLPVectorizer/AMDGPU/vectorize-i8-as-i32.ll (+1261)
diff --git a/llvm/test/Analysis/CostModel/AMDGPU/load.ll b/llvm/test/Analysis/CostModel/AMDGPU/load.ll
new file mode 100644
index 0000000000000..4abf18f957e5b
--- /dev/null
+++ b/llvm/test/Analysis/CostModel/AMDGPU/load.ll
@@ -0,0 +1,356 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a < %s | FileCheck %s --check-prefixes=GFX90A
+
+
+define void @loads_i1(i32 %arg) {
+; GFX90A-LABEL: 'loads_i1'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load i1, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = load <2 x i1>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %3 = load <4 x i1>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+  load i1, ptr poison
+  load <2 x i1>, ptr poison
+  load <4 x i1>, ptr poison
+
+  ret void
+}
+
+define void @loads_i8(i32 %arg) {
+; GFX90A-LABEL: 'loads_i8'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load i8, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = load <2 x i8>, ptr poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %3 = load <4 x i8>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %4 = load i8, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i8>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %6 = load <4 x i8>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %7 = load i8, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %8 = load <2 x i8>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %9 = load <4 x i8>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+  load i8, ptr poison
+  load <2 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 <4 x i8>, ptr poison, align 1
+
+  load i8, ptr poison, align 4
+  load <2 x i8>, ptr poison, align 4
+  load <4 x i8>, ptr poison, align 4
+
+  ret void
+}
+
+define void @loads_i16(i32 %arg) {
+; GFX90A-LABEL: 'loads_i16'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load i16, ptr poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = load <2 x i16>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %3 = load <4 x i16>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %4 = load i16, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %5 = load <2 x i16>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %6 = load <4 x i16>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %7 = load i16, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i16>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %9 = load <4 x i16>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %10 = load i16, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %11 = load <2 x i16>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i16>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+  load i16, ptr poison
+  load <2 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 <4 x i16>, ptr poison, align 1
+
+  load i16, ptr poison, align 4
+  load <2 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 <4 x i16>, ptr poison, align 8
+
+  ret void
+}
+
+define void @loads_i32(i32 %arg) {
+; GFX90A-LABEL: 'loads_i32'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load i32, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = load <2 x i32>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %3 = load <4 x i32>, ptr poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %4 = load i32, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %5 = load <2 x i32>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %6 = load <4 x i32>, ptr poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %7 = load i32, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %9 = load <4 x i32>, ptr poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %10 = load i32, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %11 = load <2 x i32>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i32>, ptr poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %13 = load i32, ptr poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %14 = load <2 x i32>, ptr poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %15 = load <4 x i32>, ptr poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
+;
+  load i32, ptr poison
+  load <2 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 <4 x i32>, ptr poison, align 1
+
+  load i32, ptr poison, align 4
+  load <2 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 <4 x i32>, ptr poison, align 8
+
+  load i32, ptr poison, align 16
+  load <2 x i32>, ptr poison, align 16
+  load <4 x i32>, ptr poison, align 16
+
+  ret void
+}
+
+define void @loads_addrspace_1(i32 %arg) {
+; GFX90A-LABEL: 'loads_addrspace_1'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(1) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(1) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(1) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(1) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(1) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %6 = load <2 x i8>, ptr addrspace(1) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(1) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(1) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %9 = load <4 x i1>, ptr addrspace(1) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %10 = load <4 x i8>, ptr addrspace(1) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %11 = load <4 x i16>, ptr addrspace(1) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i32>, ptr addrspace(1) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %13 = load <8 x i1>, ptr addrspace(1) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %14 = load <8 x i8>, ptr addrspace(1) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %15 = load <8 x i16>, ptr addrspace(1) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %16 = load <8 x i32>, ptr addrspace(1) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %17 = load <16 x i1>, ptr addrspace(1) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %18 = load <16 x i8>, ptr addrspace(1) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %19 = load <16 x i16>, ptr addrspace(1) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %20 = load <16 x i32>, ptr addrspace(1) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %21 = load <32 x i1>, ptr addrspace(1) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %22 = load <32 x i8>, ptr addrspace(1) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %23 = load <32 x i16>, ptr addrspace(1) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %24 = load <32 x i32>, ptr addrspace(1) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %25 = load <64 x i1>, ptr addrspace(1) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %26 = load <64 x i8>, ptr addrspace(1) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %27 = load <64 x i16>, ptr addrspace(1) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %28 = load <64 x i32>, ptr addrspace(1) poison, align 256
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 128 for instruction: %29 = load <128 x i1>, ptr addrspace(1) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 128 for instruction: %30 = load <128 x i8>, ptr addrspace(1) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %31 = load <128 x i16>, ptr addrspace(1) poison, align 256
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %32 = load <128 x i32>, ptr addrspace(1) poison, align 512
+; GFX90A-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 <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) {
+; GFX90A-LABEL: 'loads_addrspace_3'
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <1 x i1>, ptr addrspace(3) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = load <1 x i8>, ptr addrspace(3) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %3 = load <1 x i16>, ptr addrspace(3) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %4 = load <1 x i32>, ptr addrspace(3) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %5 = load <2 x i1>, ptr addrspace(3) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %6 = load <2 x i8>, ptr addrspace(3) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %7 = load <2 x i16>, ptr addrspace(3) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %8 = load <2 x i32>, ptr addrspace(3) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %9 = load <4 x i1>, ptr addrspace(3) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %10 = load <4 x i8>, ptr addrspace(3) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %11 = load <4 x i16>, ptr addrspace(3) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i32>, ptr addrspace(3) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %13 = load <8 x i1>, ptr addrspace(3) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %14 = load <8 x i8>, ptr addrspace(3) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %15 = load <8 x i16>, ptr addrspace(3) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %16 = load <8 x i32>, ptr addrspace(3) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %17 = load <16 x i1>, ptr addrspace(3) poison, align 2
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %18 = load <16 x i8>, ptr addrspace(3) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %19 = load <16 x i16>, ptr addrspace(3) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %20 = load <16 x i32>, ptr addrspace(3) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %21 = load <32 x i1>, ptr addrspace(3) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %22 = load <32 x i8>, ptr addrspace(3) poison, align 32
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %23 = load <32 x i16>, ptr addrspace(3) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %24 = load <32 x i32>, ptr addrspace(3) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %25 = load <64 x i1>, ptr addrspace(3) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %26 = load <64 x i8>, ptr addrspace(3) poison, align 64
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %27 = load <64 x i16>, ptr addrspace(3) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %28 = load <64 x i32>, ptr addrspace(3) poison, align 256
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 128 for instruction: %29 = load <128 x i1>, ptr addrspace(3) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 128 for instruction: %30 = load <128 x i8>, ptr addrspace(3) poison, align 128
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %31 = load <128 x i16>, ptr addrspace(3) poison, align 256
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %32 = load <128 x i32>, ptr addrspace(3) poison, align 512
+; GFX90A-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 <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) {
+; 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 2 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 <4 x i1>, ptr addrspace(5) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %10 = load <4 x i8>, ptr addrspace(5) poison, align 4
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %11 = load <4 x i16>, ptr addrspace(5) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %12 = load <4 x i32>, ptr addrspace(5) poison, align 16
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %13 = load <8 x i1>, ptr addrspace(5) poison, align 1
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %14 = load <8 x i8>, ptr addrspace(5) poison, align 8
+; GFX90A-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %15 = load <8 x i16>, ptr addrspac...
[truncated]

Copy link
Contributor

@jrbyrnes jrbyrnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #134934 is changing costs for stores as well, we should add equivalent cost model test for stores.

@doru1004 doru1004 force-pushed the precommit-i8-vectorization-tests branch from ed50b65 to 835feca Compare May 8, 2025 15:34
Copy link
Contributor

@jrbyrnes jrbyrnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks

@doru1004 doru1004 merged commit 25a0319 into llvm:main May 9, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants