Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/shrink-wrap-chkstk-x86_64.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

54 lines
1.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-windows-gnu -exception-model=dwarf < %s | FileCheck %s
%struct.A = type { [4096 x i8] }
@a = common global i32 0, align 4
@b = common global i32 0, align 4
define void @fn1() nounwind uwtable {
; CHECK-LABEL: fn1:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl a(%rip), %eax
; CHECK-NEXT: testl %eax, %eax
; CHECK-NEXT: jne .LBB0_2
; CHECK-NEXT: # %bb.1: # %select.true.sink
; CHECK-NEXT: cltq
; CHECK-NEXT: imulq $715827883, %rax, %rax # imm = 0x2AAAAAAB
; CHECK-NEXT: movq %rax, %rcx
; CHECK-NEXT: shrq $63, %rcx
; CHECK-NEXT: shrq $32, %rax
; CHECK-NEXT: addl %ecx, %eax
; CHECK-NEXT: .LBB0_2: # %select.end
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: movl $4128, %eax # imm = 0x1020
; CHECK-NEXT: callq ___chkstk_ms
; CHECK-NEXT: subq %rax, %rsp
; CHECK-NEXT: movq {{[0-9]+}}(%rsp), %rax
; CHECK-NEXT: .cfi_def_cfa_offset 4144
; CHECK-NEXT: movl %eax, b(%rip)
; CHECK-NEXT: leaq {{[0-9]+}}(%rsp), %rcx
; CHECK-NEXT: # kill: def $ecx killed $ecx killed $rcx
; CHECK-NEXT: callq fn2
; CHECK-NEXT: addq $4136, %rsp # imm = 0x1028
; CHECK-NEXT: retq
entry:
%ctx = alloca %struct.A, align 1
%0 = load i32, ptr @a, align 4
%tobool = icmp eq i32 %0, 0
%div = sdiv i32 %0, 6
%cond = select i1 %tobool, i32 %div, i32 %0
store i32 %cond, ptr @b, align 4
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %ctx)
%1 = ptrtoint ptr %ctx to i64
%2 = trunc i64 %1 to i32
call void @fn2(i32 %2)
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %ctx)
ret void
}
declare void @fn2(i32)
declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)