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
80 lines
2.5 KiB
LLVM
80 lines
2.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=riscv64 -mattr=+m -O2 < %s | FileCheck %s --check-prefix=CHECK-O2
|
|
; RUN: llc -mtriple=riscv64 -mattr=+m -O3 < %s | FileCheck %s --check-prefix=CHECK-O3
|
|
|
|
; RUN: llc -mtriple=riscv64 -mattr=+m -tail-dup-size=2 < %s | FileCheck %s --check-prefix=CHECK-O2
|
|
; RUN: llc -mtriple=riscv64 -mattr=+m -tail-dup-placement-threshold=2 < %s | FileCheck %s --check-prefix=CHECK-O2
|
|
; RUN: llc -mtriple=riscv64 -mattr=+m -tail-dup-placement-threshold=6 < %s | FileCheck %s --check-prefix=CHECK-O3
|
|
|
|
@a = external global i32
|
|
@b = external global i32
|
|
@c = external global i32
|
|
|
|
declare i32 @foo(i32)
|
|
|
|
define i32 @test(i32 %n) {
|
|
; CHECK-O2-LABEL: test:
|
|
; CHECK-O2: # %bb.0: # %entry
|
|
; CHECK-O2-NEXT: sext.w a1, a0
|
|
; CHECK-O2-NEXT: blez a1, .LBB0_2
|
|
; CHECK-O2-NEXT: # %bb.1: # %if.then
|
|
; CHECK-O2-NEXT: lui a1, %hi(a)
|
|
; CHECK-O2-NEXT: lw a1, %lo(a)(a1)
|
|
; CHECK-O2-NEXT: mul a0, a1, a0
|
|
; CHECK-O2-NEXT: j .LBB0_3
|
|
; CHECK-O2-NEXT: .LBB0_2: # %if.else
|
|
; CHECK-O2-NEXT: lui a1, %hi(b)
|
|
; CHECK-O2-NEXT: lw a1, %lo(b)(a1)
|
|
; CHECK-O2-NEXT: divw a0, a1, a0
|
|
; CHECK-O2-NEXT: .LBB0_3: # %if.end
|
|
; CHECK-O2-NEXT: lui a1, %hi(c)
|
|
; CHECK-O2-NEXT: lw a1, %lo(c)(a1)
|
|
; CHECK-O2-NEXT: addi a0, a0, -1
|
|
; CHECK-O2-NEXT: mulw a0, a0, a1
|
|
; CHECK-O2-NEXT: tail foo
|
|
;
|
|
; CHECK-O3-LABEL: test:
|
|
; CHECK-O3: # %bb.0: # %entry
|
|
; CHECK-O3-NEXT: sext.w a1, a0
|
|
; CHECK-O3-NEXT: blez a1, .LBB0_2
|
|
; CHECK-O3-NEXT: # %bb.1: # %if.then
|
|
; CHECK-O3-NEXT: lui a1, %hi(a)
|
|
; CHECK-O3-NEXT: lw a1, %lo(a)(a1)
|
|
; CHECK-O3-NEXT: mul a0, a1, a0
|
|
; CHECK-O3-NEXT: lui a1, %hi(c)
|
|
; CHECK-O3-NEXT: lw a1, %lo(c)(a1)
|
|
; CHECK-O3-NEXT: addi a0, a0, -1
|
|
; CHECK-O3-NEXT: mulw a0, a0, a1
|
|
; CHECK-O3-NEXT: tail foo
|
|
; CHECK-O3-NEXT: .LBB0_2: # %if.else
|
|
; CHECK-O3-NEXT: lui a1, %hi(b)
|
|
; CHECK-O3-NEXT: lw a1, %lo(b)(a1)
|
|
; CHECK-O3-NEXT: divw a0, a1, a0
|
|
; CHECK-O3-NEXT: lui a1, %hi(c)
|
|
; CHECK-O3-NEXT: lw a1, %lo(c)(a1)
|
|
; CHECK-O3-NEXT: addi a0, a0, -1
|
|
; CHECK-O3-NEXT: mulw a0, a0, a1
|
|
; CHECK-O3-NEXT: tail foo
|
|
entry:
|
|
%cmp = icmp sgt i32 %n, 0
|
|
br i1 %cmp, label %if.then, label %if.else
|
|
|
|
if.then:
|
|
%va = load i32, ptr @a
|
|
%mul = mul nsw i32 %va, %n
|
|
br label %if.end
|
|
|
|
if.else:
|
|
%vb = load i32, ptr @b
|
|
%div = sdiv i32 %vb, %n
|
|
br label %if.end
|
|
|
|
if.end:
|
|
%phi = phi i32 [ %mul, %if.then ], [ %div, %if.else ]
|
|
%vc = load i32, ptr @c
|
|
%add = add nsw i32 %phi, -1
|
|
%arg = mul i32 %add, %vc
|
|
%ret = tail call i32 @foo(i32 %arg)
|
|
ret i32 %ret
|
|
}
|