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
81 lines
4.6 KiB
LLVM
81 lines
4.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
|
|
; RUN: opt -S -mtriple=x86_64-- -expand-ir-insts -expand-div-rem-bits 128 < %s | FileCheck %s
|
|
; RUN: opt -S -mtriple=x86_64-- -passes='require<libcall-lowering-info>,expand-ir-insts' -expand-div-rem-bits 128 < %s | FileCheck %s
|
|
|
|
define void @test(ptr %ptr, ptr %out) nounwind !prof !0 {
|
|
; CHECK-LABEL: @test(
|
|
; CHECK-NEXT: _udiv-special-cases:
|
|
; CHECK-NEXT: [[A:%.*]] = load i129, ptr [[PTR:%.*]], align 16
|
|
; CHECK-NEXT: [[TMP0:%.*]] = freeze i129 [[A]]
|
|
; CHECK-NEXT: [[TMP1:%.*]] = freeze i129 3
|
|
; CHECK-NEXT: [[TMP2:%.*]] = freeze i129 [[TMP1]]
|
|
; CHECK-NEXT: [[TMP3:%.*]] = freeze i129 [[TMP0]]
|
|
; CHECK-NEXT: [[TMP4:%.*]] = icmp eq i129 [[TMP2]], 0
|
|
; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i129 [[TMP3]], 0
|
|
; CHECK-NEXT: [[TMP6:%.*]] = or i1 [[TMP4]], [[TMP5]]
|
|
; CHECK-NEXT: [[TMP7:%.*]] = call i129 @llvm.ctlz.i129(i129 [[TMP2]], i1 true)
|
|
; CHECK-NEXT: [[TMP8:%.*]] = call i129 @llvm.ctlz.i129(i129 [[TMP3]], i1 true)
|
|
; CHECK-NEXT: [[TMP9:%.*]] = sub i129 [[TMP7]], [[TMP8]]
|
|
; CHECK-NEXT: [[TMP10:%.*]] = icmp ugt i129 [[TMP9]], 128
|
|
; CHECK-NEXT: [[TMP11:%.*]] = select i1 [[TMP6]], i1 true, i1 [[TMP10]], !prof [[PROF1:![0-9]+]]
|
|
; CHECK-NEXT: [[TMP12:%.*]] = icmp eq i129 [[TMP9]], 128
|
|
; CHECK-NEXT: [[TMP13:%.*]] = select i1 [[TMP11]], i129 0, i129 [[TMP3]], !prof [[PROF2:![0-9]+]]
|
|
; CHECK-NEXT: [[TMP14:%.*]] = select i1 [[TMP11]], i1 true, i1 [[TMP12]], !prof [[PROF2]]
|
|
; CHECK-NEXT: br i1 [[TMP14]], label [[UDIV_END:%.*]], label [[UDIV_BB1:%.*]], !prof [[PROF1]]
|
|
; CHECK: udiv-loop-exit:
|
|
; CHECK-NEXT: [[TMP15:%.*]] = phi i129 [ 0, [[UDIV_BB1]] ], [ [[TMP30:%.*]], [[UDIV_DO_WHILE:%.*]] ]
|
|
; CHECK-NEXT: [[TMP16:%.*]] = phi i129 [ [[TMP39:%.*]], [[UDIV_BB1]] ], [ [[TMP27:%.*]], [[UDIV_DO_WHILE]] ]
|
|
; CHECK-NEXT: [[TMP17:%.*]] = shl i129 [[TMP16]], 1
|
|
; CHECK-NEXT: [[TMP18:%.*]] = or i129 [[TMP15]], [[TMP17]]
|
|
; CHECK-NEXT: br label [[UDIV_END]]
|
|
; CHECK: udiv-do-while:
|
|
; CHECK-NEXT: [[TMP19:%.*]] = phi i129 [ 0, [[UDIV_PREHEADER:%.*]] ], [ [[TMP30]], [[UDIV_DO_WHILE]] ]
|
|
; CHECK-NEXT: [[TMP20:%.*]] = phi i129 [ [[TMP37:%.*]], [[UDIV_PREHEADER]] ], [ [[TMP33:%.*]], [[UDIV_DO_WHILE]] ]
|
|
; CHECK-NEXT: [[TMP21:%.*]] = phi i129 [ [[TMP35:%.*]], [[UDIV_PREHEADER]] ], [ [[TMP32:%.*]], [[UDIV_DO_WHILE]] ]
|
|
; CHECK-NEXT: [[TMP22:%.*]] = phi i129 [ [[TMP39]], [[UDIV_PREHEADER]] ], [ [[TMP27]], [[UDIV_DO_WHILE]] ]
|
|
; CHECK-NEXT: [[TMP23:%.*]] = shl i129 [[TMP21]], 1
|
|
; CHECK-NEXT: [[TMP24:%.*]] = lshr i129 [[TMP22]], 128
|
|
; CHECK-NEXT: [[TMP25:%.*]] = or i129 [[TMP23]], [[TMP24]]
|
|
; CHECK-NEXT: [[TMP26:%.*]] = shl i129 [[TMP22]], 1
|
|
; CHECK-NEXT: [[TMP27]] = or i129 [[TMP19]], [[TMP26]]
|
|
; CHECK-NEXT: [[TMP28:%.*]] = sub i129 [[TMP36:%.*]], [[TMP25]]
|
|
; CHECK-NEXT: [[TMP29:%.*]] = ashr i129 [[TMP28]], 128
|
|
; CHECK-NEXT: [[TMP30]] = and i129 [[TMP29]], 1
|
|
; CHECK-NEXT: [[TMP31:%.*]] = and i129 [[TMP29]], [[TMP2]]
|
|
; CHECK-NEXT: [[TMP32]] = sub i129 [[TMP25]], [[TMP31]]
|
|
; CHECK-NEXT: [[TMP33]] = add i129 [[TMP20]], -1
|
|
; CHECK-NEXT: [[TMP34:%.*]] = icmp eq i129 [[TMP33]], 0
|
|
; CHECK-NEXT: br i1 [[TMP34]], label [[UDIV_LOOP_EXIT:%.*]], label [[UDIV_DO_WHILE]], !prof [[PROF1]]
|
|
; CHECK: udiv-preheader:
|
|
; CHECK-NEXT: [[TMP35]] = lshr i129 [[TMP3]], [[TMP37]]
|
|
; CHECK-NEXT: [[TMP36]] = add i129 [[TMP2]], -1
|
|
; CHECK-NEXT: br label [[UDIV_DO_WHILE]]
|
|
; CHECK: udiv-bb1:
|
|
; CHECK-NEXT: [[TMP37]] = add i129 [[TMP9]], 1
|
|
; CHECK-NEXT: [[TMP38:%.*]] = sub i129 128, [[TMP9]]
|
|
; CHECK-NEXT: [[TMP39]] = shl i129 [[TMP3]], [[TMP38]]
|
|
; CHECK-NEXT: [[TMP40:%.*]] = icmp eq i129 [[TMP37]], 0
|
|
; CHECK-NEXT: br i1 [[TMP40]], label [[UDIV_LOOP_EXIT]], label [[UDIV_PREHEADER]], !prof [[PROF1]]
|
|
; CHECK: udiv-end:
|
|
; CHECK-NEXT: [[TMP41:%.*]] = phi i129 [ [[TMP18]], [[UDIV_LOOP_EXIT]] ], [ [[TMP13]], [[_UDIV_SPECIAL_CASES:%.*]] ]
|
|
; CHECK-NEXT: [[TMP42:%.*]] = mul i129 [[TMP1]], [[TMP41]]
|
|
; CHECK-NEXT: [[TMP43:%.*]] = sub i129 [[TMP0]], [[TMP42]]
|
|
; CHECK-NEXT: store i129 [[TMP43]], ptr [[OUT:%.*]], align 16
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%a = load i129, ptr %ptr
|
|
%res = urem i129 %a, 3
|
|
store i129 %res, ptr %out
|
|
ret void
|
|
}
|
|
|
|
!0 = !{!"function_entry_count", i64 1000}
|
|
;.
|
|
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind }
|
|
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
|
|
;.
|
|
; CHECK: [[META0:![0-9]+]] = !{!"function_entry_count", i64 1000}
|
|
; CHECK: [[PROF1]] = !{!"branch_weights", i32 1, i32 1048575}
|
|
; CHECK: [[PROF2]] = !{!"unknown", !"integer-division"}
|
|
;.
|