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
96 lines
3.5 KiB
LLVM
96 lines
3.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt -passes=gvn -S < %s | FileCheck --check-prefixes=CHECK,MDEP %s
|
|
; RUN: opt -passes='gvn<memoryssa>' -S < %s | FileCheck --check-prefixes=CHECK,MSSA %s
|
|
|
|
; C source:
|
|
;
|
|
; void f(int x) {
|
|
; if (x != 1)
|
|
; puts (x == 2 ? "a" : "b");
|
|
; for (;;) {
|
|
; puts("step 1");
|
|
; if (x == 2)
|
|
; continue;
|
|
; printf("step 2: %d\n", x);
|
|
; }
|
|
; }
|
|
;
|
|
; If we PRE %cmp3, CodeGenPrepare won't be able to sink the compare down to its
|
|
; uses, and we are forced to keep both %x and %cmp3 in registers in the loop.
|
|
;
|
|
; It is just as cheap to recompute the icmp against %x as it is to compare a
|
|
; GPR against 0. On x86-64, the br i1 %cmp3 becomes:
|
|
;
|
|
; testb %r12b, %r12b
|
|
; jne LBB0_3
|
|
;
|
|
; The sunk icmp is:
|
|
;
|
|
; cmpl $2, %ebx
|
|
; je LBB0_3
|
|
;
|
|
; This is just as good, and it doesn't require a separate register.
|
|
;
|
|
; CHECK-NOT: phi i1
|
|
|
|
@.str = private unnamed_addr constant [2 x i8] c"a\00", align 1
|
|
@.str1 = private unnamed_addr constant [2 x i8] c"b\00", align 1
|
|
@.str2 = private unnamed_addr constant [7 x i8] c"step 1\00", align 1
|
|
@.str3 = private unnamed_addr constant [12 x i8] c"step 2: %d\0A\00", align 1
|
|
|
|
define void @f(i32 %x) noreturn nounwind uwtable ssp {
|
|
; CHECK-LABEL: define void @f(
|
|
; CHECK-SAME: i32 [[X:%.*]]) #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X]], 1
|
|
; CHECK-NEXT: br i1 [[CMP]], label %[[FOR_COND_PREHEADER:.*]], label %[[IF_THEN:.*]]
|
|
; CHECK: [[IF_THEN]]:
|
|
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[X]], 2
|
|
; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP1]], ptr @.str, ptr @.str1
|
|
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @puts(ptr [[COND]]) #[[ATTR1:[0-9]+]]
|
|
; CHECK-NEXT: br label %[[FOR_COND_PREHEADER]]
|
|
; CHECK: [[FOR_COND_PREHEADER]]:
|
|
; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i32 [[X]], 2
|
|
; CHECK-NEXT: br label %[[FOR_COND:.*]]
|
|
; CHECK: [[FOR_COND]]:
|
|
; CHECK-NEXT: [[CALL2:%.*]] = tail call i32 @puts(ptr @.str2) #[[ATTR1]]
|
|
; CHECK-NEXT: br i1 [[CMP3]], label %[[FOR_COND_BACKEDGE:.*]], label %[[IF_END5:.*]]
|
|
; CHECK: [[IF_END5]]:
|
|
; CHECK-NEXT: [[CALL6:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str3, i32 [[X]]) #[[ATTR1]]
|
|
; CHECK-NEXT: br label %[[FOR_COND_BACKEDGE]]
|
|
; CHECK: [[FOR_COND_BACKEDGE]]:
|
|
; CHECK-NEXT: br label %[[FOR_COND]]
|
|
;
|
|
entry:
|
|
%cmp = icmp eq i32 %x, 1
|
|
br i1 %cmp, label %for.cond.preheader, label %if.then
|
|
|
|
if.then: ; preds = %entry
|
|
%cmp1 = icmp eq i32 %x, 2
|
|
%cond = select i1 %cmp1, ptr @.str, ptr @.str1
|
|
%call = tail call i32 @puts(ptr %cond) nounwind
|
|
br label %for.cond.preheader
|
|
|
|
for.cond.preheader: ; preds = %entry, %if.then
|
|
%cmp3 = icmp eq i32 %x, 2
|
|
br label %for.cond
|
|
|
|
for.cond: ; preds = %for.cond.backedge, %for.cond.preheader
|
|
%call2 = tail call i32 @puts(ptr @.str2) nounwind
|
|
br i1 %cmp3, label %for.cond.backedge, label %if.end5
|
|
|
|
if.end5: ; preds = %for.cond
|
|
%call6 = tail call i32 (ptr, ...) @printf(ptr @.str3, i32 %x) nounwind
|
|
br label %for.cond.backedge
|
|
|
|
for.cond.backedge: ; preds = %if.end5, %for.cond
|
|
br label %for.cond
|
|
}
|
|
|
|
declare i32 @puts(ptr nocapture) nounwind
|
|
|
|
declare i32 @printf(ptr nocapture, ...) nounwind
|
|
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
|
|
; MDEP: {{.*}}
|
|
; MSSA: {{.*}}
|