Files
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

108 lines
4.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s
; This test checks that floating point commutative instructions are not treated
; as commutative. Even though an ffadd is technically commutative, the order
; of operands still needs to be enforced since the process of fadding floating
; point values requires the order to be the same.
; We make sure that we outline the identical regions from the first two
; functions, but not the third. this is because the operands are in a different
; order in a floating point instruction in this section.
define void @outline_from_fadd1() {
; CHECK-LABEL: @outline_from_fadd1(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A:%.*]] = alloca double, align 4
; CHECK-NEXT: [[B:%.*]] = alloca double, align 4
; CHECK-NEXT: [[C:%.*]] = alloca double, align 4
; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
; CHECK-NEXT: ret void
;
entry:
%a = alloca double, align 4
%b = alloca double, align 4
%c = alloca double, align 4
store double 2.0, ptr %a, align 4
store double 3.0, ptr %b, align 4
store double 4.0, ptr %c, align 4
%al = load double, ptr %a
%bl = load double, ptr %b
%cl = load double, ptr %c
%0 = fadd double %al, %bl
%1 = fadd double %al, %cl
%2 = fadd double %bl, %cl
ret void
}
define void @outline_from_fadd2.0() {
; CHECK-LABEL: @outline_from_fadd2.0(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A:%.*]] = alloca double, align 4
; CHECK-NEXT: [[B:%.*]] = alloca double, align 4
; CHECK-NEXT: [[C:%.*]] = alloca double, align 4
; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
; CHECK-NEXT: ret void
;
entry:
%a = alloca double, align 4
%b = alloca double, align 4
%c = alloca double, align 4
store double 2.0, ptr %a, align 4
store double 3.0, ptr %b, align 4
store double 4.0, ptr %c, align 4
%al = load double, ptr %a
%bl = load double, ptr %b
%cl = load double, ptr %c
%0 = fadd double %al, %bl
%1 = fadd double %al, %cl
%2 = fadd double %bl, %cl
ret void
}
define void @outline_from_flipped_fadd3.0() {
; CHECK-LABEL: @outline_from_flipped_fadd3.0(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A:%.*]] = alloca double, align 4
; CHECK-NEXT: [[B:%.*]] = alloca double, align 4
; CHECK-NEXT: [[C:%.*]] = alloca double, align 4
; CHECK-NEXT: store double 2.000000e+00, ptr [[A]], align 4
; CHECK-NEXT: store double 3.000000e+00, ptr [[B]], align 4
; CHECK-NEXT: store double 4.000000e+00, ptr [[C]], align 4
; CHECK-NEXT: [[AL:%.*]] = load double, ptr [[A]], align 8
; CHECK-NEXT: [[BL:%.*]] = load double, ptr [[B]], align 8
; CHECK-NEXT: [[CL:%.*]] = load double, ptr [[C]], align 8
; CHECK-NEXT: [[TMP0:%.*]] = fadd double [[BL]], [[AL]]
; CHECK-NEXT: [[TMP1:%.*]] = fadd double [[CL]], [[AL]]
; CHECK-NEXT: [[TMP2:%.*]] = fadd double [[CL]], [[BL]]
; CHECK-NEXT: ret void
;
entry:
%a = alloca double, align 4
%b = alloca double, align 4
%c = alloca double, align 4
store double 2.0, ptr %a, align 4
store double 3.0, ptr %b, align 4
store double 4.0, ptr %c, align 4
%al = load double, ptr %a
%bl = load double, ptr %b
%cl = load double, ptr %c
%0 = fadd double %bl, %al
%1 = fadd double %cl, %al
%2 = fadd double %cl, %bl
ret void
}
; CHECK: define internal void @outlined_ir_func_0(ptr [[ARG0:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #0 {
; CHECK: entry_to_outline:
; CHECK-NEXT: store double 2.000000e+00, ptr [[ARG0]], align 4
; CHECK-NEXT: store double 3.000000e+00, ptr [[ARG1]], align 4
; CHECK-NEXT: store double 4.000000e+00, ptr [[ARG2]], align 4
; CHECK-NEXT: [[AL:%.*]] = load double, ptr [[ARG0]], align 8
; CHECK-NEXT: [[BL:%.*]] = load double, ptr [[ARG1]], align 8
; CHECK-NEXT: [[CL:%.*]] = load double, ptr [[ARG2]], align 8
; CHECK-NEXT: [[TMP0:%.*]] = fadd double [[AL]], [[BL]]
; CHECK-NEXT: [[TMP1:%.*]] = fadd double [[AL]], [[CL]]
; CHECK-NEXT: [[TMP2:%.*]] = fadd double [[BL]], [[CL]]