Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVNHoist/hoist-unsafe-pr31729.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

80 lines
1.8 KiB
LLVM

; RUN: opt -passes=gvn-hoist -S < %s | FileCheck %s
; Check that urem is not hoisted.
; CHECK-LABEL: @main
; CHECK: urem
; CHECK: urem
; CHECK: urem
@g_x_s = global i32 -470211272, align 4
@g_z_s = global i32 2007237709, align 4
@g_x_u = global i32 282475249, align 4
@g_z_u = global i32 984943658, align 4
@g_m = global i32 16807, align 4
@res = common global i32 0, align 4
; Function Attrs:
define i64 @func() {
entry:
ret i64 1
}
; Function Attrs:
define i32 @main() {
entry:
%0 = load volatile i32, ptr @g_x_s, align 4
%1 = load volatile i32, ptr @g_z_s, align 4
%2 = load volatile i32, ptr @g_x_u, align 4
%3 = load volatile i32, ptr @g_z_u, align 4
%4 = load volatile i32, ptr @g_m, align 4
%call = call i64 @func()
%conv = sext i32 %1 to i64
%cmp = icmp ne i64 %call, %conv
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false:
%div = udiv i32 %4, %1
%rem = urem i32 %0, %div
%cmp2 = icmp eq i32 %rem, 0
br i1 %cmp2, label %if.end, label %if.then
if.then:
br label %cleanup
if.end:
%call4 = call i64 @func()
%conv5 = zext i32 %3 to i64
%cmp6 = icmp ne i64 %call4, %conv5
br i1 %cmp6, label %if.end14, label %lor.lhs.false8
lor.lhs.false8:
%div9 = udiv i32 %4, %3
%rem10 = urem i32 %0, %div9
%cmp11 = icmp eq i32 %rem10, 0
br i1 %cmp11, label %if.end14, label %if.then13
if.then13:
br label %cleanup
if.end14:
%call15 = call i64 @func()
%cmp17 = icmp ne i64 %call15, %conv
br i1 %cmp17, label %if.end25, label %lor.lhs.false19
lor.lhs.false19:
%div20 = udiv i32 %4, %1
%rem21 = urem i32 %0, %div20
%cmp22 = icmp eq i32 %rem21, 0
br i1 %cmp22, label %if.end25, label %if.then24
if.then24:
br label %cleanup
if.end25:
br label %cleanup
cleanup:
%retval.0 = phi i32 [ 0, %if.end25 ], [ 1, %if.then24 ], [ 1, %if.then13 ], [ 1, %if.then ]
ret i32 %retval.0
}