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
47 lines
3.3 KiB
LLVM
47 lines
3.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
|
|
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=latency 2>&1 -disable-output -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=LATENCY
|
|
; RUN: opt < %s -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=CODESIZE
|
|
|
|
; Tests if the interface TargetTransformInfo::getInstructionCost() works correctly.
|
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
|
|
|
declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
|
|
|
|
define i64 @foo(i64 %arg) {
|
|
; LATENCY-LABEL: 'foo'
|
|
; 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, 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()
|
|
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
|
|
;
|
|
; CODESIZE-LABEL: 'foo'
|
|
; 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, 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 4 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()
|
|
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
|
|
;
|
|
%A1 = alloca i32, align 8
|
|
%A2 = alloca i64, i64 undef, align 8
|
|
%I64 = add i64 undef, undef
|
|
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()
|
|
ret i64 undef
|
|
}
|