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
114 lines
3.8 KiB
LLVM
114 lines
3.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --include-generated-funcs --version 5
|
|
; RUN: opt -passes='print<predicate-info>' -disable-output -S < %s 2>&1 | FileCheck %s --check-prefix=PREDINF
|
|
; RUN: opt -passes="ipsccp<func-spec>" -funcspec-min-function-size=1 \
|
|
; RUN: -funcspec-for-literal-constant=true \
|
|
; RUN: -funcspec-min-codesize-savings=50 \
|
|
; RUN: -funcspec-min-latency-savings=0 \
|
|
; RUN: -S < %s | FileCheck %s --check-prefix=FUNCSPEC
|
|
|
|
; Verify that we are able to estimate the codesize savings by looking through
|
|
; calls to ssa_copy intrinsics, which are inserted by PredicateInfo when IPSCCP
|
|
; is run prior to FunctionSpecialization.
|
|
define i32 @main() {
|
|
entry:
|
|
%res = call i32 @test_ssa_copy(i32 0)
|
|
ret i32 %res
|
|
}
|
|
|
|
define i32 @test_ssa_copy(i32 %x) {
|
|
entry:
|
|
br label %block1
|
|
|
|
block1:
|
|
%cmp = icmp eq i32 %x, 0
|
|
br i1 %cmp, label %block2, label %exit1
|
|
|
|
block2:
|
|
br i1 %cmp, label %block3, label %exit2
|
|
|
|
block3:
|
|
br i1 %cmp, label %exit4, label %exit3
|
|
|
|
exit1:
|
|
ret i32 %x
|
|
|
|
exit2:
|
|
ret i32 %x
|
|
|
|
exit3:
|
|
ret i32 %x
|
|
|
|
exit4:
|
|
ret i32 999
|
|
}
|
|
; PREDINF-LABEL: define i32 @main() {
|
|
; PREDINF-NEXT: [[ENTRY:.*:]]
|
|
; PREDINF-NEXT: [[RES:%.*]] = call i32 @test_ssa_copy(i32 0)
|
|
; PREDINF-NEXT: ret i32 [[RES]]
|
|
;
|
|
;
|
|
; PREDINF-LABEL: define i32 @test_ssa_copy(
|
|
; PREDINF-SAME: i32 [[X:%.*]]) {
|
|
; PREDINF-NEXT: [[ENTRY:.*:]]
|
|
; PREDINF-NEXT: br label %[[BLOCK1:.*]]
|
|
; PREDINF: [[BLOCK1]]:
|
|
; PREDINF-NEXT: [[CMP:%.*]] = icmp eq i32 [[X]], 0
|
|
; PREDINF: [[CMP_0:%.*]] = bitcast i1 [[CMP]] to i1
|
|
; PREDINF: [[X_0:%.*]] = bitcast i32 [[X]] to i32
|
|
; PREDINF: [[X_4:%.*]] = bitcast i32 [[X]] to i32
|
|
; PREDINF-NEXT: br i1 [[CMP]], label %[[BLOCK2:.*]], label %[[EXIT1:.*]]
|
|
; PREDINF: [[BLOCK2]]:
|
|
; PREDINF: [[CMP_0_1:%.*]] = bitcast i1 [[CMP_0]] to i1
|
|
; PREDINF: [[X_0_1:%.*]] = bitcast i32 [[X_0]] to i32
|
|
; PREDINF: [[X_0_3:%.*]] = bitcast i32 [[X_0]] to i32
|
|
; PREDINF-NEXT: br i1 [[CMP_0]], label %[[BLOCK3:.*]], label %[[EXIT2:.*]]
|
|
; PREDINF: [[BLOCK3]]:
|
|
; PREDINF: [[X_0_1_2:%.*]] = bitcast i32 [[X_0_1]] to i32
|
|
; PREDINF-NEXT: br i1 [[CMP_0_1]], label %[[EXIT4:.*]], label %[[EXIT3:.*]]
|
|
; PREDINF: [[EXIT1]]:
|
|
; PREDINF-NEXT: ret i32 [[X_4]]
|
|
; PREDINF: [[EXIT2]]:
|
|
; PREDINF-NEXT: ret i32 [[X_0_3]]
|
|
; PREDINF: [[EXIT3]]:
|
|
; PREDINF-NEXT: ret i32 [[X_0_1_2]]
|
|
; PREDINF: [[EXIT4]]:
|
|
; PREDINF-NEXT: ret i32 999
|
|
;
|
|
;
|
|
; FUNCSPEC-LABEL: define i32 @main() {
|
|
; FUNCSPEC-NEXT: [[ENTRY:.*:]]
|
|
; FUNCSPEC-NEXT: [[RES:%.*]] = call i32 @test_ssa_copy.specialized.1(i32 0)
|
|
; FUNCSPEC-NEXT: ret i32 999
|
|
;
|
|
;
|
|
; FUNCSPEC-LABEL: define range(i32 1, 0) i32 @test_ssa_copy(
|
|
; FUNCSPEC-SAME: i32 [[X:%.*]]) {
|
|
; FUNCSPEC-NEXT: [[ENTRY:.*:]]
|
|
; FUNCSPEC-NEXT: br label %[[BLOCK1:.*]]
|
|
; FUNCSPEC: [[BLOCK1]]:
|
|
; FUNCSPEC-NEXT: [[CMP:%.*]] = icmp eq i32 [[X]], 0
|
|
; FUNCSPEC-NEXT: br i1 [[CMP]], label %[[BLOCK2:.*]], label %[[EXIT1:.*]]
|
|
; FUNCSPEC: [[BLOCK2]]:
|
|
; FUNCSPEC-NEXT: br label %[[BLOCK3:.*]]
|
|
; FUNCSPEC: [[BLOCK3]]:
|
|
; FUNCSPEC-NEXT: br label %[[EXIT4:.*]]
|
|
; FUNCSPEC: [[EXIT1]]:
|
|
; FUNCSPEC-NEXT: ret i32 [[X]]
|
|
; FUNCSPEC: [[EXIT4]]:
|
|
; FUNCSPEC-NEXT: ret i32 999
|
|
;
|
|
;
|
|
; FUNCSPEC-LABEL: define internal i32 @test_ssa_copy.specialized.1(
|
|
; FUNCSPEC-SAME: i32 [[X:%.*]]) {
|
|
; FUNCSPEC-NEXT: [[ENTRY:.*:]]
|
|
; FUNCSPEC-NEXT: br label %[[BLOCK1:.*]]
|
|
; FUNCSPEC: [[BLOCK1]]:
|
|
; FUNCSPEC-NEXT: br label %[[BLOCK2:.*]]
|
|
; FUNCSPEC: [[BLOCK2]]:
|
|
; FUNCSPEC-NEXT: br label %[[BLOCK3:.*]]
|
|
; FUNCSPEC: [[BLOCK3]]:
|
|
; FUNCSPEC-NEXT: br label %[[EXIT4:.*]]
|
|
; FUNCSPEC: [[EXIT4]]:
|
|
; FUNCSPEC-NEXT: ret i32 poison
|
|
;
|