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

185 lines
20 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
; RUN: llc < %s -mtriple=riscv32 -verify-machineinstrs -stop-after=prologepilog \
; RUN: | FileCheck %s -check-prefix=RV32I
; RUN: llc < %s -mtriple=riscv32 -mattr=+zilsd -verify-machineinstrs -stop-after=prologepilog \
; RUN: | FileCheck %s -check-prefix=RV32I-ZILSD
; RUN: llc < %s -mtriple=riscv32 -mattr=+zilsd,+unaligned-scalar-mem -verify-machineinstrs -stop-after=prologepilog \
; RUN: | FileCheck %s -check-prefix=RV32I-ZILSD-UNALIGNED
; RUN: llc < %s -mtriple=riscv32 -mattr=+zilsd,+zilsd-4byte-align -verify-machineinstrs -stop-after=prologepilog \
; RUN: | FileCheck %s -check-prefix=RV32I-ZILSD-4BYTEALIGN
define i64 @cmpxchg_i64_monotonic_monotonic(ptr %ptr, i64 %cmp, i64 %val) nounwind {
; RV32I-LABEL: name: cmpxchg_i64_monotonic_monotonic
; RV32I: bb.0 (%ir-block.0):
; RV32I-NEXT: liveins: $x10, $x11, $x12, $x13, $x14, $x1, $x8, $x9, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27
; RV32I-NEXT: {{ $}}
; RV32I-NEXT: $x2 = frame-setup ADDI $x2, -64
; RV32I-NEXT: frame-setup SW killed $x1, $x2, 60 :: (store (s32) into %stack.1)
; RV32I-NEXT: frame-setup SW killed $x8, $x2, 56 :: (store (s32) into %stack.2)
; RV32I-NEXT: frame-setup SW killed $x9, $x2, 52 :: (store (s32) into %stack.3)
; RV32I-NEXT: frame-setup SW killed $x18, $x2, 48 :: (store (s32) into %stack.4)
; RV32I-NEXT: frame-setup SW killed $x19, $x2, 44 :: (store (s32) into %stack.5)
; RV32I-NEXT: frame-setup SW killed $x20, $x2, 40 :: (store (s32) into %stack.6)
; RV32I-NEXT: frame-setup SW killed $x21, $x2, 36 :: (store (s32) into %stack.7)
; RV32I-NEXT: frame-setup SW killed $x22, $x2, 32 :: (store (s32) into %stack.8)
; RV32I-NEXT: frame-setup SW killed $x23, $x2, 28 :: (store (s32) into %stack.9)
; RV32I-NEXT: frame-setup SW killed $x24, $x2, 24 :: (store (s32) into %stack.10)
; RV32I-NEXT: frame-setup SW killed $x25, $x2, 20 :: (store (s32) into %stack.11)
; RV32I-NEXT: frame-setup SW killed $x26, $x2, 16 :: (store (s32) into %stack.12)
; RV32I-NEXT: frame-setup SW killed $x27, $x2, 12 :: (store (s32) into %stack.13)
; RV32I-NEXT: SW killed renamable $x11, $x2, 0 :: (store (s32) into %ir.1, align 8)
; RV32I-NEXT: SW killed renamable $x12, $x2, 4 :: (store (s32) into %ir.1 + 4, basealign 8)
; RV32I-NEXT: $x11 = ADDI $x2, 0
; RV32I-NEXT: $x12 = COPY killed renamable $x13
; RV32I-NEXT: $x13 = COPY killed renamable $x14
; RV32I-NEXT: $x14 = COPY $x0
; RV32I-NEXT: $x15 = COPY $x0
; RV32I-NEXT: PseudoCALL target-flags(riscv-call) @__atomic_compare_exchange_8, csr_ilp32_lp64, implicit-def dead $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit-def $x2, implicit-def dead $x10
; RV32I-NEXT: renamable $x10 = LW $x2, 0 :: (dereferenceable load (s32) from %ir.1, align 8)
; RV32I-NEXT: renamable $x11 = LW $x2, 4 :: (dereferenceable load (s32) from %ir.1 + 4, basealign 8)
; RV32I-NEXT: renamable $x5 = ADD renamable $x10, renamable $x10
; RV32I-NEXT: renamable $x11 = ADD killed renamable $x11, renamable $x11
; RV32I-NEXT: renamable $x30 = SLTU renamable $x5, killed renamable $x10
; RV32I-NEXT: renamable $x30 = ADD killed renamable $x11, killed renamable $x30
; RV32I-NEXT: INLINEASM &"", sideeffect attdialect, clobber, implicit-def dead early-clobber $x6, clobber, implicit-def dead early-clobber $x7, clobber, implicit-def dead early-clobber $x8, clobber, implicit-def dead early-clobber $x9, clobber, implicit-def dead early-clobber $x10, clobber, implicit-def dead early-clobber $x11, clobber, implicit-def dead early-clobber $x12, clobber, implicit-def dead early-clobber $x13, clobber, implicit-def dead early-clobber $x14, clobber, implicit-def dead early-clobber $x15, clobber, implicit-def dead early-clobber $x16, clobber, implicit-def dead early-clobber $x17, clobber, implicit-def dead early-clobber $x18, clobber, implicit-def dead early-clobber $x19, clobber, implicit-def dead early-clobber $x20, clobber, implicit-def dead early-clobber $x21, clobber, implicit-def dead early-clobber $x22, clobber, implicit-def dead early-clobber $x23, clobber, implicit-def dead early-clobber $x24, clobber, implicit-def dead early-clobber $x25, clobber, implicit-def dead early-clobber $x26, clobber, implicit-def dead early-clobber $x27, clobber, implicit-def dead early-clobber $x28, clobber, implicit-def dead early-clobber $x29, clobber, implicit-def dead early-clobber $x31
; RV32I-NEXT: $x10 = COPY killed renamable $x5
; RV32I-NEXT: $x11 = COPY killed renamable $x30
; RV32I-NEXT: $x1 = frame-destroy LW $x2, 60 :: (load (s32) from %stack.1)
; RV32I-NEXT: $x8 = frame-destroy LW $x2, 56 :: (load (s32) from %stack.2)
; RV32I-NEXT: $x9 = frame-destroy LW $x2, 52 :: (load (s32) from %stack.3)
; RV32I-NEXT: $x18 = frame-destroy LW $x2, 48 :: (load (s32) from %stack.4)
; RV32I-NEXT: $x19 = frame-destroy LW $x2, 44 :: (load (s32) from %stack.5)
; RV32I-NEXT: $x20 = frame-destroy LW $x2, 40 :: (load (s32) from %stack.6)
; RV32I-NEXT: $x21 = frame-destroy LW $x2, 36 :: (load (s32) from %stack.7)
; RV32I-NEXT: $x22 = frame-destroy LW $x2, 32 :: (load (s32) from %stack.8)
; RV32I-NEXT: $x23 = frame-destroy LW $x2, 28 :: (load (s32) from %stack.9)
; RV32I-NEXT: $x24 = frame-destroy LW $x2, 24 :: (load (s32) from %stack.10)
; RV32I-NEXT: $x25 = frame-destroy LW $x2, 20 :: (load (s32) from %stack.11)
; RV32I-NEXT: $x26 = frame-destroy LW $x2, 16 :: (load (s32) from %stack.12)
; RV32I-NEXT: $x27 = frame-destroy LW $x2, 12 :: (load (s32) from %stack.13)
; RV32I-NEXT: $x2 = frame-destroy ADDI $x2, 64
; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11
;
; RV32I-ZILSD-LABEL: name: cmpxchg_i64_monotonic_monotonic
; RV32I-ZILSD: bb.0 (%ir-block.0):
; RV32I-ZILSD-NEXT: liveins: $x10, $x11, $x12, $x13, $x14, $x1, $x8_x9, $x18_x19, $x20_x21, $x22_x23, $x24_x25, $x26_x27
; RV32I-ZILSD-NEXT: {{ $}}
; RV32I-ZILSD-NEXT: $x2 = frame-setup ADDI $x2, -80
; RV32I-ZILSD-NEXT: frame-setup SW killed $x1, $x2, 76 :: (store (s32) into %stack.2)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x8_x9, $x2, 64 :: (store (s64) into %stack.3)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x18_x19, $x2, 56 :: (store (s64) into %stack.4)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x20_x21, $x2, 48 :: (store (s64) into %stack.5)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x22_x23, $x2, 40 :: (store (s64) into %stack.6)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x24_x25, $x2, 32 :: (store (s64) into %stack.7)
; RV32I-ZILSD-NEXT: frame-setup SD_RV32 killed $x26_x27, $x2, 24 :: (store (s64) into %stack.8)
; RV32I-ZILSD-NEXT: renamable $x17 = COPY $x12
; RV32I-ZILSD-NEXT: renamable $x16 = COPY $x11
; RV32I-ZILSD-NEXT: SD_RV32 killed renamable $x16_x17, $x2, 16 :: (store (s64) into %ir.1)
; RV32I-ZILSD-NEXT: $x11 = ADDI $x2, 16
; RV32I-ZILSD-NEXT: $x12 = COPY killed renamable $x13
; RV32I-ZILSD-NEXT: $x13 = COPY killed renamable $x14
; RV32I-ZILSD-NEXT: $x14 = COPY $x0
; RV32I-ZILSD-NEXT: $x15 = COPY $x0
; RV32I-ZILSD-NEXT: PseudoCALL target-flags(riscv-call) @__atomic_compare_exchange_8, csr_ilp32_lp64, implicit-def dead $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit-def $x2, implicit-def dead $x10
; RV32I-ZILSD-NEXT: renamable $x10_x11 = LD_RV32 $x2, 16 :: (dereferenceable load (s64) from %ir.1)
; RV32I-ZILSD-NEXT: PseudoRV32ZdinxSD killed renamable $x10_x11, $x2, 8 :: (store (s64) into %stack.1, align 4)
; RV32I-ZILSD-NEXT: INLINEASM &"", sideeffect attdialect, clobber, implicit-def dead early-clobber $x6, clobber, implicit-def dead early-clobber $x7, clobber, implicit-def dead early-clobber $x8, clobber, implicit-def dead early-clobber $x9, clobber, implicit-def dead early-clobber $x10, clobber, implicit-def dead early-clobber $x11, clobber, implicit-def dead early-clobber $x12, clobber, implicit-def dead early-clobber $x13, clobber, implicit-def dead early-clobber $x14, clobber, implicit-def dead early-clobber $x15, clobber, implicit-def dead early-clobber $x16, clobber, implicit-def dead early-clobber $x17, clobber, implicit-def dead early-clobber $x18, clobber, implicit-def dead early-clobber $x19, clobber, implicit-def dead early-clobber $x20, clobber, implicit-def dead early-clobber $x21, clobber, implicit-def dead early-clobber $x22, clobber, implicit-def dead early-clobber $x23, clobber, implicit-def dead early-clobber $x24, clobber, implicit-def dead early-clobber $x25, clobber, implicit-def dead early-clobber $x26, clobber, implicit-def dead early-clobber $x27, clobber, implicit-def dead early-clobber $x28, clobber, implicit-def dead early-clobber $x29, clobber, implicit-def dead early-clobber $x31
; RV32I-ZILSD-NEXT: renamable $x12_x13 = PseudoRV32ZdinxLD $x2, 8 :: (load (s64) from %stack.1, align 4)
; RV32I-ZILSD-NEXT: renamable $x10 = ADD renamable $x12, renamable $x12
; RV32I-ZILSD-NEXT: renamable $x11 = SLTU renamable $x10, renamable $x12
; RV32I-ZILSD-NEXT: renamable $x12 = ADD killed renamable $x13, renamable $x13
; RV32I-ZILSD-NEXT: renamable $x11 = ADD killed renamable $x12, killed renamable $x11
; RV32I-ZILSD-NEXT: $x1 = frame-destroy LW $x2, 76 :: (load (s32) from %stack.2)
; RV32I-ZILSD-NEXT: $x8_x9 = frame-destroy LD_RV32 $x2, 64 :: (load (s64) from %stack.3)
; RV32I-ZILSD-NEXT: $x18_x19 = frame-destroy LD_RV32 $x2, 56 :: (load (s64) from %stack.4)
; RV32I-ZILSD-NEXT: $x20_x21 = frame-destroy LD_RV32 $x2, 48 :: (load (s64) from %stack.5)
; RV32I-ZILSD-NEXT: $x22_x23 = frame-destroy LD_RV32 $x2, 40 :: (load (s64) from %stack.6)
; RV32I-ZILSD-NEXT: $x24_x25 = frame-destroy LD_RV32 $x2, 32 :: (load (s64) from %stack.7)
; RV32I-ZILSD-NEXT: $x26_x27 = frame-destroy LD_RV32 $x2, 24 :: (load (s64) from %stack.8)
; RV32I-ZILSD-NEXT: $x2 = frame-destroy ADDI $x2, 80
; RV32I-ZILSD-NEXT: PseudoRET implicit $x10, implicit $x11
;
; RV32I-ZILSD-UNALIGNED-LABEL: name: cmpxchg_i64_monotonic_monotonic
; RV32I-ZILSD-UNALIGNED: bb.0 (%ir-block.0):
; RV32I-ZILSD-UNALIGNED-NEXT: liveins: $x10, $x11, $x12, $x13, $x14, $x1, $x8_x9, $x18_x19, $x20_x21, $x22_x23, $x24_x25, $x26_x27
; RV32I-ZILSD-UNALIGNED-NEXT: {{ $}}
; RV32I-ZILSD-UNALIGNED-NEXT: $x2 = frame-setup ADDI $x2, -80
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SW killed $x1, $x2, 76 :: (store (s32) into %stack.2)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x8_x9, $x2, 68 :: (store (s64) into %stack.3, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x18_x19, $x2, 60 :: (store (s64) into %stack.4, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x20_x21, $x2, 52 :: (store (s64) into %stack.5, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x22_x23, $x2, 44 :: (store (s64) into %stack.6, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x24_x25, $x2, 36 :: (store (s64) into %stack.7, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: frame-setup SD_RV32 killed $x26_x27, $x2, 28 :: (store (s64) into %stack.8, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x17 = COPY $x12
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x16 = COPY $x11
; RV32I-ZILSD-UNALIGNED-NEXT: SD_RV32 killed renamable $x16_x17, $x2, 16 :: (store (s64) into %ir.1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x11 = ADDI $x2, 16
; RV32I-ZILSD-UNALIGNED-NEXT: $x12 = COPY killed renamable $x13
; RV32I-ZILSD-UNALIGNED-NEXT: $x13 = COPY killed renamable $x14
; RV32I-ZILSD-UNALIGNED-NEXT: $x14 = COPY $x0
; RV32I-ZILSD-UNALIGNED-NEXT: $x15 = COPY $x0
; RV32I-ZILSD-UNALIGNED-NEXT: PseudoCALL target-flags(riscv-call) @__atomic_compare_exchange_8, csr_ilp32_lp64, implicit-def dead $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit-def $x2, implicit-def dead $x10
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x10_x11 = LD_RV32 $x2, 16 :: (dereferenceable load (s64) from %ir.1)
; RV32I-ZILSD-UNALIGNED-NEXT: SD_RV32 killed renamable $x10_x11, $x2, 8 :: (store (s64) into %stack.1, align 4)
; RV32I-ZILSD-UNALIGNED-NEXT: INLINEASM &"", sideeffect attdialect, clobber, implicit-def dead early-clobber $x6, clobber, implicit-def dead early-clobber $x7, clobber, implicit-def dead early-clobber $x8, clobber, implicit-def dead early-clobber $x9, clobber, implicit-def dead early-clobber $x10, clobber, implicit-def dead early-clobber $x11, clobber, implicit-def dead early-clobber $x12, clobber, implicit-def dead early-clobber $x13, clobber, implicit-def dead early-clobber $x14, clobber, implicit-def dead early-clobber $x15, clobber, implicit-def dead early-clobber $x16, clobber, implicit-def dead early-clobber $x17, clobber, implicit-def dead early-clobber $x18, clobber, implicit-def dead early-clobber $x19, clobber, implicit-def dead early-clobber $x20, clobber, implicit-def dead early-clobber $x21, clobber, implicit-def dead early-clobber $x22, clobber, implicit-def dead early-clobber $x23, clobber, implicit-def dead early-clobber $x24, clobber, implicit-def dead early-clobber $x25, clobber, implicit-def dead early-clobber $x26, clobber, implicit-def dead early-clobber $x27, clobber, implicit-def dead early-clobber $x28, clobber, implicit-def dead early-clobber $x29, clobber, implicit-def dead early-clobber $x31
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x12_x13 = LD_RV32 $x2, 8 :: (load (s64) from %stack.1, align 4)
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x10 = ADD renamable $x12, renamable $x12
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x11 = SLTU renamable $x10, renamable $x12
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x12 = ADD killed renamable $x13, renamable $x13
; RV32I-ZILSD-UNALIGNED-NEXT: renamable $x11 = ADD killed renamable $x12, killed renamable $x11
; RV32I-ZILSD-UNALIGNED-NEXT: $x1 = frame-destroy LW $x2, 76 :: (load (s32) from %stack.2)
; RV32I-ZILSD-UNALIGNED-NEXT: $x8_x9 = frame-destroy LD_RV32 $x2, 68 :: (load (s64) from %stack.3, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x18_x19 = frame-destroy LD_RV32 $x2, 60 :: (load (s64) from %stack.4, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x20_x21 = frame-destroy LD_RV32 $x2, 52 :: (load (s64) from %stack.5, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x22_x23 = frame-destroy LD_RV32 $x2, 44 :: (load (s64) from %stack.6, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x24_x25 = frame-destroy LD_RV32 $x2, 36 :: (load (s64) from %stack.7, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x26_x27 = frame-destroy LD_RV32 $x2, 28 :: (load (s64) from %stack.8, align 1)
; RV32I-ZILSD-UNALIGNED-NEXT: $x2 = frame-destroy ADDI $x2, 80
; RV32I-ZILSD-UNALIGNED-NEXT: PseudoRET implicit $x10, implicit $x11
;
; RV32I-ZILSD-4BYTEALIGN-LABEL: name: cmpxchg_i64_monotonic_monotonic
; RV32I-ZILSD-4BYTEALIGN: bb.0 (%ir-block.0):
; RV32I-ZILSD-4BYTEALIGN-NEXT: liveins: $x10, $x11, $x12, $x13, $x14, $x1, $x8_x9, $x18_x19, $x20_x21, $x22_x23, $x24_x25, $x26_x27
; RV32I-ZILSD-4BYTEALIGN-NEXT: {{ $}}
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x2 = frame-setup ADDI $x2, -80
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SW killed $x1, $x2, 76 :: (store (s32) into %stack.2)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x8_x9, $x2, 68 :: (store (s64) into %stack.3, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x18_x19, $x2, 60 :: (store (s64) into %stack.4, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x20_x21, $x2, 52 :: (store (s64) into %stack.5, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x22_x23, $x2, 44 :: (store (s64) into %stack.6, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x24_x25, $x2, 36 :: (store (s64) into %stack.7, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: frame-setup SD_RV32 killed $x26_x27, $x2, 28 :: (store (s64) into %stack.8, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x17 = COPY $x12
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x16 = COPY $x11
; RV32I-ZILSD-4BYTEALIGN-NEXT: SD_RV32 killed renamable $x16_x17, $x2, 16 :: (store (s64) into %ir.1)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x11 = ADDI $x2, 16
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x12 = COPY killed renamable $x13
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x13 = COPY killed renamable $x14
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x14 = COPY $x0
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x15 = COPY $x0
; RV32I-ZILSD-4BYTEALIGN-NEXT: PseudoCALL target-flags(riscv-call) @__atomic_compare_exchange_8, csr_ilp32_lp64, implicit-def dead $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit-def $x2, implicit-def dead $x10
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x10_x11 = LD_RV32 $x2, 16 :: (dereferenceable load (s64) from %ir.1)
; RV32I-ZILSD-4BYTEALIGN-NEXT: SD_RV32 killed renamable $x10_x11, $x2, 8 :: (store (s64) into %stack.1, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: INLINEASM &"", sideeffect attdialect, clobber, implicit-def dead early-clobber $x6, clobber, implicit-def dead early-clobber $x7, clobber, implicit-def dead early-clobber $x8, clobber, implicit-def dead early-clobber $x9, clobber, implicit-def dead early-clobber $x10, clobber, implicit-def dead early-clobber $x11, clobber, implicit-def dead early-clobber $x12, clobber, implicit-def dead early-clobber $x13, clobber, implicit-def dead early-clobber $x14, clobber, implicit-def dead early-clobber $x15, clobber, implicit-def dead early-clobber $x16, clobber, implicit-def dead early-clobber $x17, clobber, implicit-def dead early-clobber $x18, clobber, implicit-def dead early-clobber $x19, clobber, implicit-def dead early-clobber $x20, clobber, implicit-def dead early-clobber $x21, clobber, implicit-def dead early-clobber $x22, clobber, implicit-def dead early-clobber $x23, clobber, implicit-def dead early-clobber $x24, clobber, implicit-def dead early-clobber $x25, clobber, implicit-def dead early-clobber $x26, clobber, implicit-def dead early-clobber $x27, clobber, implicit-def dead early-clobber $x28, clobber, implicit-def dead early-clobber $x29, clobber, implicit-def dead early-clobber $x31
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x12_x13 = LD_RV32 $x2, 8 :: (load (s64) from %stack.1, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x10 = ADD renamable $x12, renamable $x12
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x11 = SLTU renamable $x10, renamable $x12
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x12 = ADD killed renamable $x13, renamable $x13
; RV32I-ZILSD-4BYTEALIGN-NEXT: renamable $x11 = ADD killed renamable $x12, killed renamable $x11
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x1 = frame-destroy LW $x2, 76 :: (load (s32) from %stack.2)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x8_x9 = frame-destroy LD_RV32 $x2, 68 :: (load (s64) from %stack.3, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x18_x19 = frame-destroy LD_RV32 $x2, 60 :: (load (s64) from %stack.4, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x20_x21 = frame-destroy LD_RV32 $x2, 52 :: (load (s64) from %stack.5, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x22_x23 = frame-destroy LD_RV32 $x2, 44 :: (load (s64) from %stack.6, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x24_x25 = frame-destroy LD_RV32 $x2, 36 :: (load (s64) from %stack.7, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x26_x27 = frame-destroy LD_RV32 $x2, 28 :: (load (s64) from %stack.8, align 4)
; RV32I-ZILSD-4BYTEALIGN-NEXT: $x2 = frame-destroy ADDI $x2, 80
; RV32I-ZILSD-4BYTEALIGN-NEXT: PseudoRET implicit $x10, implicit $x11
%res = cmpxchg ptr %ptr, i64 %cmp, i64 %val monotonic monotonic
%1 = extractvalue { i64, i1 } %res, 0
%2 = add i64 %1, %1
call void asm sideeffect "", "~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{x29},~{xr0},~{x31}"()
ret i64 %2
}