Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/LICM/speculate-div.ll
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

136 lines
3.4 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=licm -S | FileCheck %s
declare void @maythrow()
declare void @use(i16)
define void @sdiv_not_ok(i16 %n, i16 %xx) {
; CHECK-LABEL: @sdiv_not_ok(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X:%.*]] = or i16 [[XX:%.*]], 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = sdiv i16 [[N:%.*]], [[X]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%x = or i16 %xx, 1
br label %loop
loop:
call void @maythrow()
%div = sdiv i16 %n, %x
call void @use(i16 %div)
br label %loop
}
define void @srem_not_ok2(i16 %nn, i16 %x) {
; CHECK-LABEL: @srem_not_ok2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[N:%.*]] = and i16 [[NN:%.*]], 1323
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = srem i16 [[N]], [[X:%.*]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%n = and i16 %nn, 1323
br label %loop
loop:
call void @maythrow()
%div = srem i16 %n, %x
call void @use(i16 %div)
br label %loop
}
define void @sdiv_ok(i16 %n, i16 %xx) {
; CHECK-LABEL: @sdiv_ok(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[XO:%.*]] = or i16 [[XX:%.*]], 1
; CHECK-NEXT: [[X:%.*]] = and i16 [[XO]], 123
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = sdiv i16 [[N:%.*]], [[X]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%xo = or i16 %xx, 1
%x = and i16 %xo, 123
br label %loop
loop:
call void @maythrow()
%div = sdiv i16 %n, %x
call void @use(i16 %div)
br label %loop
}
define void @srem_ok2(i16 %nn, i16 %xx) {
; CHECK-LABEL: @srem_ok2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[N:%.*]] = and i16 [[NN:%.*]], 123
; CHECK-NEXT: [[X:%.*]] = or i16 [[XX:%.*]], 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = srem i16 [[N]], [[X]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%n = and i16 %nn, 123
%x = or i16 %xx, 1
br label %loop
loop:
call void @maythrow()
%div = srem i16 %n, %x
call void @use(i16 %div)
br label %loop
}
define void @udiv_not_ok(i16 %n, i16 %xx) {
; CHECK-LABEL: @udiv_not_ok(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X:%.*]] = xor i16 [[XX:%.*]], 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = udiv i16 [[N:%.*]], [[X]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%x = xor i16 %xx, 1
br label %loop
loop:
call void @maythrow()
%div = udiv i16 %n, %x
call void @use(i16 %div)
br label %loop
}
define void @udiv_ok(i16 %n, i16 %xx) {
; CHECK-LABEL: @udiv_ok(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X:%.*]] = or i16 [[XX:%.*]], 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void @maythrow()
; CHECK-NEXT: [[DIV:%.*]] = udiv i16 [[N:%.*]], [[X]]
; CHECK-NEXT: call void @use(i16 [[DIV]])
; CHECK-NEXT: br label [[LOOP]]
;
entry:
%x = or i16 %xx, 1
br label %loop
loop:
call void @maythrow()
%div = udiv i16 %n, %x
call void @use(i16 %div)
br label %loop
}