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
66 lines
2.1 KiB
LLVM
66 lines
2.1 KiB
LLVM
; RUN: opt -passes=gvn-hoist -S < %s | FileCheck %s
|
|
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
@input = local_unnamed_addr global ptr null, align 8
|
|
|
|
; Check that the load instruction is **not** hoisted
|
|
; CHECK-LABEL: @_Z3fooPii
|
|
; CHECK-LABEL: if.then:
|
|
; CHECK-NEXT: load
|
|
; CHECK-LABEL: if2:
|
|
; CHECK: load
|
|
; CHECK-LABEL: @main
|
|
|
|
define i32 @_Z3fooPii(ptr %p, i32 %x) local_unnamed_addr {
|
|
entry:
|
|
%cmp.not = icmp eq ptr %p, null
|
|
br i1 %cmp.not, label %if.end3, label %if.then
|
|
|
|
if.then: ; preds = %entry
|
|
%0 = load i32, ptr %p, align 4, !tbaa !3
|
|
%add = add nsw i32 %0, %x
|
|
%cmp1 = icmp eq i32 %add, 4
|
|
br i1 %cmp1, label %if2, label %if.end3
|
|
|
|
if.end3: ; preds = %entry, %if.then
|
|
%x.addr.0 = phi i32 [ %add, %if.then ], [ %x, %entry ]
|
|
%add4 = add nsw i32 %x.addr.0, 2
|
|
br i1 %cmp.not, label %if.end11, label %if2
|
|
|
|
if2: ; preds = %if.end3, %if.then
|
|
%x.addr.1 = phi i32 [ 4, %if.then ], [ %x.addr.0, %if.end3 ]
|
|
%y.0 = phi i32 [ 2, %if.then ], [ %add4, %if.end3 ]
|
|
%1 = load i32, ptr %p, align 4, !tbaa !3
|
|
%add7 = add nsw i32 %x.addr.1, %1
|
|
%cmp8 = icmp eq i32 %add7, 5
|
|
br i1 %cmp8, label %end, label %if.end11
|
|
|
|
if.end11: ; preds = %if.end3, %if2
|
|
%x.addr.2 = phi i32 [ %add7, %if2 ], [ %x.addr.0, %if.end3 ]
|
|
%y.1 = phi i32 [ %y.0, %if2 ], [ %add4, %if.end3 ]
|
|
%add12 = add nsw i32 %y.1, %x.addr.2
|
|
br label %end
|
|
|
|
end: ; preds = %if2, %if.end11
|
|
%x.addr.3 = phi i32 [ 5, %if2 ], [ %x.addr.2, %if.end11 ]
|
|
%y.2 = phi i32 [ %y.0, %if2 ], [ %add12, %if.end11 ]
|
|
%add13 = add nsw i32 %x.addr.3, %y.2
|
|
ret i32 %add13
|
|
}
|
|
|
|
define i32 @main() local_unnamed_addr {
|
|
entry:
|
|
%0 = load ptr, ptr @input, align 8, !tbaa !7
|
|
%call = call i32 @_Z3fooPii(ptr %0, i32 0)
|
|
ret i32 %call
|
|
}
|
|
|
|
|
|
!3 = !{!4, !4, i64 0}
|
|
!4 = !{!"int", !5, i64 0}
|
|
!5 = !{!"omnipotent char", !6, i64 0}
|
|
!6 = !{!"Simple C++ TBAA"}
|
|
!7 = !{!8, !8, i64 0}
|
|
!8 = !{!"pointer@_ZTSPi", !5, i64 0}
|