Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/Reassociate/fast-ArrayOutOfBounds.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

71 lines
2.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -passes=reassociate,instcombine -S | FileCheck %s
; Not marked as fast, so must not change.
define float @test1(float %a0, float %a1, float %a2, float %a3, float %a4) {
; CHECK-LABEL: define float @test1(
; CHECK-SAME: float [[A0:%.*]], float [[A1:%.*]], float [[A2:%.*]], float [[A3:%.*]], float [[A4:%.*]]) {
; CHECK-NEXT: [[TMP_2:%.*]] = fadd float [[A3]], [[A4]]
; CHECK-NEXT: [[TMP_4:%.*]] = fadd float [[A2]], [[TMP_2]]
; CHECK-NEXT: [[TMP_6:%.*]] = fadd float [[A1]], [[TMP_4]]
; CHECK-NEXT: [[TMP_8:%.*]] = fadd float [[A0]], [[TMP_6]]
; CHECK-NEXT: [[TMP_11:%.*]] = fadd float [[A2]], [[A3]]
; CHECK-NEXT: [[TMP_13:%.*]] = fadd float [[A1]], [[TMP_11]]
; CHECK-NEXT: [[TMP_15:%.*]] = fadd float [[A0]], [[TMP_13]]
; CHECK-NEXT: [[TMP_18:%.*]] = fadd float [[A1]], [[A2]]
; CHECK-NEXT: [[TMP_20:%.*]] = fadd float [[A0]], [[TMP_18]]
; CHECK-NEXT: [[TMP_23:%.*]] = fadd float [[A0]], [[A1]]
; CHECK-NEXT: [[TMP_26:%.*]] = fsub float [[TMP_8]], [[TMP_15]]
; CHECK-NEXT: [[TMP_28:%.*]] = fadd float [[TMP_20]], [[TMP_26]]
; CHECK-NEXT: [[TMP_30:%.*]] = fsub float [[TMP_28]], [[TMP_23]]
; CHECK-NEXT: [[TMP_32:%.*]] = fsub float [[TMP_30]], [[A4]]
; CHECK-NEXT: [[TMP_34:%.*]] = fsub float [[TMP_32]], [[A2]]
; CHECK-NEXT: [[T:%.*]] = fmul float [[TMP_34]], [[TMP_34]]
; CHECK-NEXT: ret float [[T]]
;
%tmp.2 = fadd float %a4, %a3
%tmp.4 = fadd float %tmp.2, %a2
%tmp.6 = fadd float %tmp.4, %a1
%tmp.8 = fadd float %tmp.6, %a0
%tmp.11 = fadd float %a3, %a2
%tmp.13 = fadd float %tmp.11, %a1
%tmp.15 = fadd float %tmp.13, %a0
%tmp.18 = fadd float %a2, %a1
%tmp.20 = fadd float %tmp.18, %a0
%tmp.23 = fadd float %a1, %a0
%tmp.26 = fsub float %tmp.8, %tmp.15
%tmp.28 = fadd float %tmp.26, %tmp.20
%tmp.30 = fsub float %tmp.28, %tmp.23
%tmp.32 = fsub float %tmp.30, %a4
%tmp.34 = fsub float %tmp.32, %a2
%T = fmul float %tmp.34, %tmp.34
ret float %T
}
; Should be able to eliminate everything.
define float @test2(float %a0, float %a1, float %a2, float %a3, float %a4) {
; CHECK-LABEL: define float @test2(
; CHECK-SAME: float [[A0:%.*]], float [[A1:%.*]], float [[A2:%.*]], float [[A3:%.*]], float [[A4:%.*]]) {
; CHECK-NEXT: ret float 0.000000e+00
;
%tmp.2 = fadd fast float %a4, %a3
%tmp.4 = fadd fast float %tmp.2, %a2
%tmp.6 = fadd fast float %tmp.4, %a1
%tmp.8 = fadd fast float %tmp.6, %a0
%tmp.11 = fadd fast float %a3, %a2
%tmp.13 = fadd fast float %tmp.11, %a1
%tmp.15 = fadd fast float %tmp.13, %a0
%tmp.18 = fadd fast float %a2, %a1
%tmp.20 = fadd fast float %tmp.18, %a0
%tmp.23 = fadd fast float %a1, %a0
%tmp.26 = fsub fast float %tmp.8, %tmp.15
%tmp.28 = fadd fast float %tmp.26, %tmp.20
%tmp.30 = fsub fast float %tmp.28, %tmp.23
%tmp.32 = fsub fast float %tmp.30, %a4
%tmp.34 = fsub fast float %tmp.32, %a2
%T = fmul fast float %tmp.34, %tmp.34
ret float %T
}