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
123 lines
3.9 KiB
LLVM
123 lines
3.9 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt -S -passes=gvn -enable-load-pre < %s | FileCheck %s --check-prefixes=CHECK,MDEP
|
|
; RUN: opt -S -passes='gvn<memoryssa>' -enable-load-pre < %s | FileCheck %s --check-prefixes=CHECK,MSSA
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
; These tests exercise situations when instructions that were first instructions
|
|
; with implicit control flow get removed. We make sure that after that we don't
|
|
; face crashes and are still able to perform PRE correctly.
|
|
|
|
declare i32 @foo(i32 %arg) #0
|
|
|
|
define hidden void @test_01(i32 %x, i32 %y) {
|
|
; c2 only throws if c1 throws, so it can be safely removed and then PRE can
|
|
; hoist the load out of loop.
|
|
; CHECK-LABEL: define hidden void @test_01(
|
|
; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[C1:%.*]] = call i32 @foo(i32 [[X]])
|
|
; CHECK-NEXT: [[VAL_PRE:%.*]] = load i32, ptr null, align 8
|
|
; CHECK-NEXT: br label %[[LOOP:.*]]
|
|
; CHECK: [[LOOP]]:
|
|
; CHECK-NEXT: [[C3:%.*]] = call i32 @foo(i32 [[VAL_PRE]])
|
|
; CHECK-NEXT: br label %[[LOOP]]
|
|
;
|
|
|
|
entry:
|
|
%c1 = call i32 @foo(i32 %x)
|
|
br label %loop
|
|
|
|
loop:
|
|
%c2 = call i32 @foo(i32 %x)
|
|
%val = load i32, ptr null, align 8
|
|
%c3 = call i32 @foo(i32 %val)
|
|
br label %loop
|
|
}
|
|
|
|
define hidden void @test_02(i32 %x, i32 %y) {
|
|
; PRE is not allowed because c2 may throw.
|
|
; CHECK-LABEL: define hidden void @test_02(
|
|
; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[C1:%.*]] = call i32 @foo(i32 [[X]])
|
|
; CHECK-NEXT: br label %[[LOOP:.*]]
|
|
; CHECK: [[LOOP]]:
|
|
; CHECK-NEXT: [[C2:%.*]] = call i32 @foo(i32 [[Y]])
|
|
; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr null, align 8
|
|
; CHECK-NEXT: [[C3:%.*]] = call i32 @foo(i32 [[VAL]])
|
|
; CHECK-NEXT: br label %[[LOOP]]
|
|
;
|
|
|
|
entry:
|
|
%c1 = call i32 @foo(i32 %x)
|
|
br label %loop
|
|
|
|
loop:
|
|
%c2 = call i32 @foo(i32 %y)
|
|
%val = load i32, ptr null, align 8
|
|
%c3 = call i32 @foo(i32 %val)
|
|
br label %loop
|
|
}
|
|
|
|
define hidden void @test_03(i32 %x, i32 %y) {
|
|
; PRE of load is allowed because c2 only throws if c1 throws. c3 should
|
|
; not be eliminated. c4 is eliminated because it only throws if c3 throws.
|
|
; CHECK-LABEL: define hidden void @test_03(
|
|
; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[C1:%.*]] = call i32 @foo(i32 [[X]])
|
|
; CHECK-NEXT: [[VAL_PRE:%.*]] = load i32, ptr null, align 8
|
|
; CHECK-NEXT: br label %[[LOOP:.*]]
|
|
; CHECK: [[LOOP]]:
|
|
; CHECK-NEXT: [[C3:%.*]] = call i32 @foo(i32 [[Y]])
|
|
; CHECK-NEXT: [[C5:%.*]] = call i32 @foo(i32 [[VAL_PRE]])
|
|
; CHECK-NEXT: br label %[[LOOP]]
|
|
;
|
|
|
|
entry:
|
|
%c1 = call i32 @foo(i32 %x)
|
|
br label %loop
|
|
|
|
loop:
|
|
%c2 = call i32 @foo(i32 %x)
|
|
%val = load i32, ptr null, align 8
|
|
%c3 = call i32 @foo(i32 %y)
|
|
%val2 = load i32, ptr null, align 8
|
|
%c4 = call i32 @foo(i32 %y)
|
|
%c5 = call i32 @foo(i32 %val)
|
|
br label %loop
|
|
}
|
|
|
|
define hidden void @test_04(i32 %x, i32 %y) {
|
|
; PRE is not allowed even after we remove c2 because now c3 prevents us from it.
|
|
; CHECK-LABEL: define hidden void @test_04(
|
|
; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[C1:%.*]] = call i32 @foo(i32 [[X]])
|
|
; CHECK-NEXT: br label %[[LOOP:.*]]
|
|
; CHECK: [[LOOP]]:
|
|
; CHECK-NEXT: [[C3:%.*]] = call i32 @foo(i32 [[Y]])
|
|
; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr null, align 8
|
|
; CHECK-NEXT: [[C5:%.*]] = call i32 @foo(i32 [[VAL]])
|
|
; CHECK-NEXT: br label %[[LOOP]]
|
|
;
|
|
|
|
entry:
|
|
%c1 = call i32 @foo(i32 %x)
|
|
br label %loop
|
|
|
|
loop:
|
|
%c2 = call i32 @foo(i32 %x)
|
|
%c3 = call i32 @foo(i32 %y)
|
|
%val = load i32, ptr null, align 8
|
|
%c4 = call i32 @foo(i32 %y)
|
|
%c5 = call i32 @foo(i32 %val)
|
|
br label %loop
|
|
}
|
|
|
|
attributes #0 = { readnone }
|
|
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
|
|
; MDEP: {{.*}}
|
|
; MSSA: {{.*}}
|