Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVN/pr33549.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

97 lines
4.4 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -passes=gvn -S < %s | FileCheck %s
@Data = common local_unnamed_addr global [32 x i32] zeroinitializer, align 4
; Function Attrs: norecurse nounwind
define void @testshl() local_unnamed_addr {
; CHECK-LABEL: define void @testshl(
; CHECK-SAME: ) local_unnamed_addr {
; CHECK-NEXT: [[ENTRY:.*]]:
; CHECK-NEXT: br label %[[FOR_BODY:.*]]
; CHECK: [[FOR_BODY]]:
; CHECK-NEXT: [[K_031:%.*]] = phi i32 [ 1, %[[ENTRY]] ], [ [[INC9:%.*]], %[[FOR_INC8:.*]] ]
; CHECK-NEXT: [[SHL:%.*]] = shl i32 1, [[K_031]]
; CHECK-NEXT: [[SHR:%.*]] = ashr exact i32 [[SHL]], 1
; CHECK-NEXT: [[CMP229:%.*]] = icmp slt i32 [[SHL]], 64
; CHECK-NEXT: br i1 [[CMP229]], label %[[FOR_BODY3_PREHEADER:.*]], label %[[FOR_INC8]]
; CHECK: [[FOR_BODY3_PREHEADER]]:
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[SHR]], 2
; CHECK-NEXT: br label %[[FOR_BODY3:.*]]
; CHECK: [[FOR_BODY3]]:
; CHECK-NEXT: [[I_030:%.*]] = phi i32 [ [[INC:%.*]], %[[FOR_BODY3]] ], [ [[DIV]], %[[FOR_BODY3_PREHEADER]] ]
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[I_030]], [[SHR]]
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [32 x i32], ptr @Data, i32 0, i32 [[ADD]]
; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [32 x i32], ptr @Data, i32 0, i32 [[I_030]]
; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !tbaa [[INT_TBAA3:![0-9]+]]
; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4, !tbaa [[INT_TBAA3]]
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], [[TMP0]]
; CHECK-NEXT: store i32 [[SUB]], ptr [[ARRAYIDX]], align 4, !tbaa [[INT_TBAA3]]
; CHECK-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP1]], [[TMP0]]
; CHECK-NEXT: store i32 [[ADD7]], ptr [[ARRAYIDX4]], align 4, !tbaa [[INT_TBAA3]]
; CHECK-NEXT: [[INC]] = add nsw i32 [[I_030]], 1
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[I_030]], 15
; CHECK-NEXT: br i1 [[CMP2]], label %[[FOR_BODY3]], label %[[FOR_INC8]]
; CHECK: [[FOR_INC8]]:
; CHECK-NEXT: [[INC9]] = add nuw nsw i32 [[K_031]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC9]], 8
; CHECK-NEXT: br i1 [[EXITCOND]], label %[[FOR_END10:.*]], label %[[FOR_BODY]]
; CHECK: [[FOR_END10]]:
; CHECK-NEXT: ret void
;
entry:
br label %for.body
for.body: ; preds = %for.inc8, %entry
%k.031 = phi i32 [ 1, %entry ], [ %inc9, %for.inc8 ]
%shl = shl i32 1, %k.031
%shr = ashr exact i32 %shl, 1
%cmp229 = icmp slt i32 %shl, 64
br i1 %cmp229, label %for.body3.preheader, label %for.inc8
for.body3.preheader: ; preds = %for.body
%div = sdiv i32 %shr, 2
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%i.030 = phi i32 [ %inc, %for.body3 ], [ %div, %for.body3.preheader ]
%add = add nsw i32 %i.030, %shr
%arrayidx = getelementptr inbounds [32 x i32], ptr @Data, i32 0, i32 %add
%arrayidx4 = getelementptr inbounds [32 x i32], ptr @Data, i32 0, i32 %i.030
%0 = load i32, ptr %arrayidx, align 4, !tbaa !3
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !3
%sub = sub nsw i32 %1, %0
store i32 %sub, ptr %arrayidx, align 4, !tbaa !3
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !3
%add7 = add nsw i32 %2, %0
store i32 %add7, ptr %arrayidx4, align 4, !tbaa !3
%inc = add nsw i32 %i.030, 1
%cmp2 = icmp slt i32 %i.030, 15
br i1 %cmp2, label %for.body3, label %for.inc8
for.inc8: ; preds = %for.body3, %for.body
%inc9 = add nuw nsw i32 %k.031, 1
%exitcond = icmp eq i32 %inc9, 8
br i1 %exitcond, label %for.end10, label %for.body
for.end10: ; preds = %for.inc8
ret void
}
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 1, !"min_enum_size", i32 4}
!2 = !{!"clang version 5.0.0 (http://llvm.org/git/clang.git 100ecde90ef26ee81763214d5fb335415ffc2b53) (http://llvm.org/git/llvm.git f2fe26d60eb81a699f2d565e8baabcaf32f9c5ea)"}
!3 = !{!4, !4, i64 0}
!4 = !{!"int", !5, i64 0}
!5 = !{!"omnipotent char", !6, i64 0}
!6 = !{!"Simple C/C++ TBAA"}
;.
; CHECK: [[INT_TBAA3]] = !{[[META4:![0-9]+]], [[META4]], i64 0}
; CHECK: [[META4]] = !{!"int", [[META5:![0-9]+]], i64 0}
; CHECK: [[META5]] = !{!"omnipotent char", [[META6:![0-9]+]], i64 0}
; CHECK: [[META6]] = !{!"Simple C/C++ TBAA"}
;.