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
122 lines
4.2 KiB
LLVM
122 lines
4.2 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
|
|
; RUN: opt -S -passes=jump-threading < %s | FileCheck %s
|
|
|
|
; Threading a loop exit (via cloneInstructions) must clone the block's noalias
|
|
; scope declarations so the threaded copy does not share the original's scopes.
|
|
define void @test(ptr %ptr) {
|
|
; CHECK-LABEL: @test(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META0:![0-9]+]])
|
|
; CHECK-NEXT: br label [[LOOP:%.*]]
|
|
; CHECK: loop:
|
|
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LATCH:%.*]] ]
|
|
; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[I]], 100
|
|
; CHECK-NEXT: br i1 [[C]], label [[EXIT:%.*]], label [[LATCH]]
|
|
; CHECK: latch:
|
|
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META3:![0-9]+]])
|
|
; CHECK-NEXT: store i8 0, ptr [[PTR:%.*]], align 1, !noalias [[META0]]
|
|
; CHECK-NEXT: store i8 1, ptr [[PTR]], align 1, !noalias [[META3]]
|
|
; CHECK-NEXT: [[I_INC]] = add i32 [[I]], 1
|
|
; CHECK-NEXT: br label [[LOOP]]
|
|
; CHECK: exit:
|
|
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META5:![0-9]+]])
|
|
; CHECK-NEXT: store i8 0, ptr [[PTR]], align 1, !noalias [[META0]]
|
|
; CHECK-NEXT: store i8 1, ptr [[PTR]], align 1, !noalias [[META5]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
call void @llvm.experimental.noalias.scope.decl(metadata !0)
|
|
br label %loop
|
|
|
|
loop:
|
|
%i = phi i32 [ 0, %entry ], [ %i.inc, %latch ]
|
|
%c = icmp eq i32 %i, 100
|
|
br i1 %c, label %if, label %latch
|
|
|
|
if:
|
|
br label %latch
|
|
|
|
latch:
|
|
%p = phi i1 [ true, %if ], [ false, %loop ]
|
|
call void @llvm.experimental.noalias.scope.decl(metadata !3)
|
|
store i8 0, ptr %ptr, !noalias !0
|
|
store i8 1, ptr %ptr, !noalias !3
|
|
%i.inc = add i32 %i, 1
|
|
br i1 %p, label %exit, label %loop
|
|
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; duplicateCondBranchOnPHIIntoPred duplicates a block whose conditional branch
|
|
; is on a PHI of non-constant values into a predecessor. It must likewise clone
|
|
; the block's noalias scope declarations, otherwise the duplicate shares the
|
|
; original's scope MDNodes and alias analysis can wrongly conclude two accesses
|
|
; on different paths do not alias.
|
|
define void @dup_clones_noalias_scope(ptr %p) {
|
|
; CHECK-LABEL: @dup_clones_noalias_scope(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[C:%.*]] = call i1 @opaque()
|
|
; CHECK-NEXT: br i1 [[C]], label [[PRED:%.*]], label [[BB:%.*]]
|
|
; CHECK: pred:
|
|
; CHECK-NEXT: [[PV:%.*]] = call i1 @opaque()
|
|
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META7:![0-9]+]])
|
|
; CHECK-NEXT: store i8 0, ptr [[P:%.*]], align 1, !noalias [[META7]]
|
|
; CHECK-NEXT: br i1 [[PV]], label [[TB:%.*]], label [[FB:%.*]]
|
|
; CHECK: bb:
|
|
; CHECK-NEXT: [[OV:%.*]] = call i1 @opaque()
|
|
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META0]])
|
|
; CHECK-NEXT: store i8 0, ptr [[P]], align 1, !noalias [[META0]]
|
|
; CHECK-NEXT: br i1 [[OV]], label [[TB]], label [[FB]]
|
|
; CHECK: tb:
|
|
; CHECK-NEXT: ret void
|
|
; CHECK: fb:
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%c = call i1 @opaque()
|
|
br i1 %c, label %pred, label %other
|
|
|
|
pred:
|
|
%pv = call i1 @opaque()
|
|
br label %bb
|
|
|
|
other:
|
|
%ov = call i1 @opaque()
|
|
br label %bb
|
|
|
|
bb:
|
|
%x = phi i1 [ %pv, %pred ], [ %ov, %other ]
|
|
call void @llvm.experimental.noalias.scope.decl(metadata !0)
|
|
store i8 0, ptr %p, !noalias !0
|
|
br i1 %x, label %tb, label %fb
|
|
|
|
tb:
|
|
ret void
|
|
|
|
fb:
|
|
ret void
|
|
}
|
|
|
|
declare i1 @opaque()
|
|
declare void @llvm.experimental.noalias.scope.decl(metadata)
|
|
|
|
!0 = !{!1}
|
|
!1 = distinct !{!1, !2, !"scope1"}
|
|
!2 = distinct !{!2, !"domain"}
|
|
!3 = !{!4}
|
|
!4 = distinct !{!4, !2, !"scope2"}
|
|
;.
|
|
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
|
|
;.
|
|
; CHECK: [[META0]] = !{[[META1:![0-9]+]]}
|
|
; CHECK: [[META1]] = distinct !{[[META1]], [[META2:![0-9]+]], !"scope1"}
|
|
; CHECK: [[META2]] = distinct !{[[META2]], !"domain"}
|
|
; CHECK: [[META3]] = !{[[META4:![0-9]+]]}
|
|
; CHECK: [[META4]] = distinct !{[[META4]], [[META2]], !"scope2"}
|
|
; CHECK: [[META5]] = !{[[META6:![0-9]+]]}
|
|
; CHECK: [[META6]] = distinct !{[[META6]], [[META2]], !"scope2:thread"}
|
|
; CHECK: [[META7]] = !{[[META8:![0-9]+]]}
|
|
; CHECK: [[META8]] = distinct !{[[META8]], [[META2]], !"scope1:thread"}
|
|
;.
|