Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/branchfolding-debug-invariant.mir
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

136 lines
3.6 KiB
YAML

# RUN: llc -mtriple=x86_64-- -run-pass branch-folder -O3 -o - %s | FileCheck %s
---
name: test1a
body: |
; CHECK-LABEL: name: test1a
; CHECK: bb.0:
; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
; CHECK: JCC_1 %bb.2, 5, implicit $eflags
; CHECK: bb.1:
; CHECK: successors: %bb.2(0x80000000)
; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
; CHECK-NOT: RET
; CHECK: bb.2:
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
bb.0:
TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
JCC_1 %bb.2, 5, implicit killed $eflags
bb.1:
MOV8mi $r12, 1, $noreg, 0, $noreg, 0
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
bb.2:
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
...
---
name: test1b
body: |
; Verify that we get the same rewrites as in test1a when adding some
; DBG_VALUE instructions in the mix.
;
; CHECK-LABEL: name: test1b
; CHECK: bb.0:
; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
; CHECK: JCC_1 %bb.2, 5, implicit $eflags
; CHECK: bb.1:
; CHECK: successors: %bb.2(0x80000000)
; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
; CHECK-NOT: RET
; CHECK: bb.2:
; CHECK: DBG_VALUE
; CHECK: DBG_VALUE
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
bb.0:
TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
JCC_1 %bb.2, 5, implicit killed $eflags
bb.1:
MOV8mi $r12, 1, $noreg, 0, $noreg, 0
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
bb.2:
DBG_VALUE
DBG_VALUE
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
...
---
name: test2a
body: |
; CFI instruction currently prevents the rewrite here (although technically
; I suppose that branch folding could let bb.1 fallthrough into bb.2 here).
;
; CHECK-LABEL: name: test2a
; CHECK: bb.0:
; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
; CHECK: JCC_1 %bb.2, 5, implicit killed $eflags
; CHECK: bb.1:
; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
; CHECK: bb.2:
; CHECK: CFI_INSTRUCTION def_cfa_offset 8
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
bb.0:
TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
JCC_1 %bb.2, 5, implicit killed $eflags
bb.1:
MOV8mi $r12, 1, $noreg, 0, $noreg, 0
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
bb.2:
CFI_INSTRUCTION def_cfa_offset 8
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
...
---
name: test2b
body: |
; Verify that we get the same rewrites as in test1a when adding some
; DBG_VALUE instructions in the mix.
;
; CHECK-LABEL: name: test2b
; CHECK: bb.0:
; CHECK: TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
; CHECK: JCC_1 %bb.2, 5, implicit killed $eflags
; CHECK: bb.1:
; CHECK: MOV8mi $r12, 1, $noreg, 0, $noreg, 0
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
; CHECK: bb.2:
; CHECK: DBG_VALUE
; CHECK: CFI_INSTRUCTION def_cfa_offset 8
; CHECK: DBG_VALUE
; CHECK: MOV8mi $r13, 1, $noreg, 0, $noreg, 0
; CHECK: RET 0
bb.0:
TEST8rr killed renamable $al, renamable $al, implicit-def $eflags
JCC_1 %bb.2, 5, implicit killed $eflags
bb.1:
MOV8mi $r12, 1, $noreg, 0, $noreg, 0
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
bb.2:
DBG_VALUE
CFI_INSTRUCTION def_cfa_offset 8
DBG_VALUE
MOV8mi $r13, 1, $noreg, 0, $noreg, 0
RET 0
...