Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

262 lines
18 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8m.base | FileCheck %s --check-prefix=CHECK-T1
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8m.main | FileCheck %s --check-prefix=CHECK-V8M
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8.1m.main -mattr=+mve | FileCheck %s --check-prefix=CHECK-MVE
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=armv8a -mattr=+neon | FileCheck %s --check-prefix=CHECK-NEON
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
define i32 @simple_loop_cost(i32 %N) {
; CHECK-T1-LABEL: 'simple_loop_cost'
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-V8M-LABEL: 'simple_loop_cost'
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-MVE-LABEL: 'simple_loop_cost'
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
; CHECK-NEON-LABEL: 'simple_loop_cost'
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
entry:
%zero = icmp eq i32 %N, 0
br i1 %zero, label %exit, label %preheader
preheader:
br label %loop
loop:
%iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
%iv.next = add nuw i32 %iv, 1
%cmp = icmp ne i32 %iv.next, %N
br i1 %cmp, label %loop, label %exit
exit:
%res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
ret i32 %res
}
define i32 @simple_mul_loop(ptr %A, ptr %B, i32 %N) {
; CHECK-T1-LABEL: 'simple_mul_loop'
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %addr.a = getelementptr i32, ptr %A, i32 %iv
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i32, ptr %addr.a, align 4
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %load, %load
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %addr.b = getelementptr i32, ptr %B, i32 %iv
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-V8M-LABEL: 'simple_mul_loop'
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of 0 for: %addr.a = getelementptr i32, ptr %A, i32 %iv
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i32, ptr %addr.a, align 4
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %load, %load
; CHECK-V8M-NEXT: Cost Model: Found costs of 0 for: %addr.b = getelementptr i32, ptr %B, i32 %iv
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-MVE-LABEL: 'simple_mul_loop'
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.a = getelementptr i32, ptr %A, i32 %iv
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i32, ptr %addr.a, align 4
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %load, %load
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.b = getelementptr i32, ptr %B, i32 %iv
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
; CHECK-NEON-LABEL: 'simple_mul_loop'
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.a = getelementptr i32, ptr %A, i32 %iv
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i32, ptr %addr.a, align 4
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %load, %load
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.b = getelementptr i32, ptr %B, i32 %iv
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
entry:
%zero = icmp eq i32 %N, 0
br i1 %zero, label %exit, label %preheader
preheader:
br label %loop
loop:
%iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
%addr.a = getelementptr i32, ptr %A, i32 %iv
%load = load i32, ptr %addr.a
%mul = mul i32 %load, %load
%addr.b = getelementptr i32, ptr %B, i32 %iv
store i32 %mul, ptr %addr.b
%iv.next = add nuw i32 %iv, 1
%cmp = icmp ne i32 %iv.next, %N
br i1 %cmp, label %loop, label %exit
exit:
%res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
ret i32 %res
}
define i32 @simple_mul_ext_lsr_loop(ptr %A, ptr %B, i32 %N) {
; CHECK-T1-LABEL: 'simple_mul_ext_lsr_loop'
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %addr.a = phi ptr [ %A, %preheader ], [ %addr.a, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %addr.b = phi ptr [ %B, %preheader ], [ %addr.b, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i16, ptr %addr.a, align 2
; CHECK-T1-NEXT: Cost Model: Found costs of 0 for: %sext = sext i16 %load to i32
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %sext, 7
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-T1-NEXT: Cost Model: Found costs of 0 for: %addr.a.next = getelementptr i16, ptr %addr.a, i32 1
; CHECK-T1-NEXT: Cost Model: Found costs of 0 for: %addr.b.next = getelementptr i32, ptr %addr.b, i32 1
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-T1-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-T1-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-V8M-LABEL: 'simple_mul_ext_lsr_loop'
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %zero, label %exit, label %preheader
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br label %loop
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %addr.a = phi ptr [ %A, %preheader ], [ %addr.a, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %addr.b = phi ptr [ %B, %preheader ], [ %addr.b, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i16, ptr %addr.a, align 2
; CHECK-V8M-NEXT: Cost Model: Found costs of 0 for: %sext = sext i16 %load to i32
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %sext, 7
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-V8M-NEXT: Cost Model: Found costs of 0 for: %addr.a.next = getelementptr i16, ptr %addr.a, i32 1
; CHECK-V8M-NEXT: Cost Model: Found costs of 0 for: %addr.b.next = getelementptr i32, ptr %addr.b, i32 1
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: br i1 %cmp, label %loop, label %exit
; CHECK-V8M-NEXT: Cost Model: Found costs of RThru:1 CodeSize:0 Lat:0 SizeLat:0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-V8M-NEXT: Cost Model: Found costs of 1 for: ret i32 %res
;
; CHECK-MVE-LABEL: 'simple_mul_ext_lsr_loop'
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.a = phi ptr [ %A, %preheader ], [ %addr.a, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.b = phi ptr [ %B, %preheader ], [ %addr.b, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i16, ptr %addr.a, align 2
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %sext = sext i16 %load to i32
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %sext, 7
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.a.next = getelementptr i16, ptr %addr.a, i32 1
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %addr.b.next = getelementptr i32, ptr %addr.b, i32 1
; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
; CHECK-NEON-LABEL: 'simple_mul_ext_lsr_loop'
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %zero = icmp eq i32 %N, 0
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %zero, label %exit, label %preheader
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br label %loop
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.a = phi ptr [ %A, %preheader ], [ %addr.a, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.b = phi ptr [ %B, %preheader ], [ %addr.b, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat:1 for: %load = load i16, ptr %addr.a, align 2
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %sext = sext i16 %load to i32
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %mul = mul i32 %sext, 7
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: store i32 %mul, ptr %addr.b, align 4
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %iv.next = add nuw i32 %iv, 1
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.a.next = getelementptr i16, ptr %addr.a, i32 1
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %addr.b.next = getelementptr i32, ptr %addr.b, i32 1
; CHECK-NEON-NEXT: Cost Model: Found costs of 1 for: %cmp = icmp ne i32 %iv.next, %N
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: br i1 %cmp, label %loop, label %exit
; CHECK-NEON-NEXT: Cost Model: Found costs of 0 for: %res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
; CHECK-NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %res
;
entry:
%zero = icmp eq i32 %N, 0
br i1 %zero, label %exit, label %preheader
preheader:
br label %loop
loop:
%iv = phi i32 [ 0, %preheader ], [ %iv.next, %loop ]
%addr.a = phi ptr [ %A, %preheader ], [ %addr.a, %loop ]
%addr.b = phi ptr [ %B, %preheader ], [ %addr.b, %loop ]
%load = load i16, ptr %addr.a
%sext = sext i16 %load to i32
%mul = mul i32 %sext, 7
store i32 %mul, ptr %addr.b
%iv.next = add nuw i32 %iv, 1
%addr.a.next = getelementptr i16, ptr %addr.a, i32 1
%addr.b.next = getelementptr i32, ptr %addr.b, i32 1
%cmp = icmp ne i32 %iv.next, %N
br i1 %cmp, label %loop, label %exit
exit:
%res = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
ret i32 %res
}