Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/ArgumentPromotion/store-into-inself.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

102 lines
3.2 KiB
LLVM

; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
%struct.ss = type { i32, i64 }
define internal void @f(ptr byval(ptr) align 4 %p) nounwind {
; CHECK-LABEL: define {{[^@]+}}@f
; CHECK-SAME: (ptr byval(ptr) align 4 [[P:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: store ptr [[P]], ptr [[P]]
; CHECK-NEXT: ret void
;
entry:
store ptr %p, ptr %p
ret void
}
define internal void @g(ptr byval(ptr) align 4 %p) nounwind {
; CHECK-LABEL: define {{[^@]+}}@g
; CHECK-SAME: (ptr byval(ptr) align 4 [[P:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[P1:%.*]] = getelementptr i8, ptr [[P]], i64 4
; CHECK-NEXT: store ptr [[P]], ptr [[P1]]
; CHECK-NEXT: ret void
;
entry:
%p1 = getelementptr i8, ptr %p, i64 4
store ptr %p, ptr %p1
ret void
}
define internal void @h(ptr byval(ptr) align 4 %p) nounwind {
; CHECK-LABEL: define {{[^@]+}}@h
; CHECK-SAME: (ptr byval(ptr) align 4 [[P:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[P1:%.*]] = getelementptr i8, ptr [[P]], i64 4
; CHECK-NEXT: store ptr [[P1]], ptr [[P]]
; CHECK-NEXT: ret void
;
entry:
%p1 = getelementptr i8, ptr %p, i64 4
store ptr %p1, ptr %p
ret void
}
define internal void @k(ptr byval(ptr) align 4 %p) nounwind {
; CHECK-LABEL: define {{[^@]+}}@k
; CHECK-SAME: (ptr byval(ptr) align 4 [[P:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X:%.*]] = load ptr, ptr [[P]]
; CHECK-NEXT: store ptr [[P]], ptr [[X]]
; CHECK-NEXT: ret void
;
entry:
%x = load ptr, ptr %p
store ptr %p, ptr %x
ret void
}
define internal void @l(ptr byval(ptr) align 4 %p) nounwind {
; CHECK-LABEL: define {{[^@]+}}@l
; CHECK-SAME: () #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: ret void
;
entry:
%x = load ptr, ptr %p
store ptr %x, ptr %p
ret void
}
define i32 @main() nounwind {
; CHECK-LABEL: define {{[^@]+}}@main
; CHECK-SAME: () #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 32
; CHECK-NEXT: [[TEMP1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 0
; CHECK-NEXT: store i32 1, ptr [[TEMP1]], align 4
; CHECK-NEXT: [[TEMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
; CHECK-NEXT: store i64 2, ptr [[TEMP4]], align 8
; CHECK-NEXT: call void @f(ptr byval(ptr) align 4 [[S]]) #[[ATTR0]]
; CHECK-NEXT: call void @g(ptr byval(ptr) align 4 [[S]]) #[[ATTR0]]
; CHECK-NEXT: call void @h(ptr byval(ptr) align 4 [[S]]) #[[ATTR0]]
; CHECK-NEXT: call void @k(ptr byval(ptr) align 4 [[S]]) #[[ATTR0]]
; CHECK-NEXT: call void @l() #[[ATTR0]]
; CHECK-NEXT: ret i32 0
;
entry:
%S = alloca %struct.ss, align 32
%temp1 = getelementptr %struct.ss, ptr %S, i32 0, i32 0
store i32 1, ptr %temp1, align 4
%temp4 = getelementptr %struct.ss, ptr %S, i32 0, i32 1
store i64 2, ptr %temp4, align 8
call void @f(ptr byval(ptr) align 4 %S) nounwind
call void @g(ptr byval(ptr) align 4 %S) nounwind
call void @h(ptr byval(ptr) align 4 %S) nounwind
call void @k(ptr byval(ptr) align 4 %S) nounwind
call void @l(ptr byval(ptr) align 4 %S) nounwind
ret i32 0
}