Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/Hexagon/sched-timing-classes.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

79 lines
1.9 KiB
LLVM

; RUN: llc -mtriple=hexagon -o - %s | FileCheck %s
; Test coverage for HexagonDepTimingClasses and HexagonInstrInfo::isComplex.
; Exercise multiply instructions (TC3x/TC4x) and ALU instructions
; (TC1/TC2) so the timing-class classification functions get invoked
; during scheduling.
; TC3x: multiply instructions
; CHECK-LABEL: test_multiply_timing:
; CHECK: mpyi
define i32 @test_multiply_timing(i32 %a, i32 %b, i32 %c) {
entry:
%m1 = mul i32 %a, %b
%m2 = mul i32 %m1, %c
%m3 = mul i32 %m2, %a
ret i32 %m3
}
; TC4x: multiply-accumulate instructions
; CHECK-LABEL: test_mac_timing:
; CHECK: mpyi
define i32 @test_mac_timing(i32 %a, i32 %b, i32 %c, i32 %d) {
entry:
%m1 = mul i32 %a, %b
%add1 = add i32 %m1, %c
%m2 = mul i32 %add1, %d
%add2 = add i32 %m2, %a
ret i32 %add2
}
; TC1: simple ALU operations mixed with TC3x multiplies to force
; scheduling decisions that query timing classes.
; CHECK-LABEL: test_alu_mix:
; CHECK: add
define i32 @test_alu_mix(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) {
entry:
%add1 = add i32 %a, %b
%mul1 = mul i32 %c, %d
%add2 = add i32 %add1, %mul1
%xor1 = xor i32 %add2, %e
%and1 = and i32 %xor1, %a
%mul2 = mul i32 %and1, %b
%or1 = or i32 %mul2, %c
ret i32 %or1
}
; TC2early: compare + jump patterns that exercise early-timing predicates.
; CHECK-LABEL: test_cmp_jump:
; CHECK: cmp
define i32 @test_cmp_jump(i32 %a, i32 %b, i32 %c) {
entry:
%cmp = icmp sgt i32 %a, %b
br i1 %cmp, label %if.then, label %if.else
if.then:
%mul = mul i32 %a, %c
br label %if.end
if.else:
%add = add i32 %b, %c
br label %if.end
if.end:
%result = phi i32 [ %mul, %if.then ], [ %add, %if.else ]
ret i32 %result
}
; Exercise 64-bit operations that may use different timing classes.
; CHECK-LABEL: test_64bit_ops:
; CHECK: add
define i64 @test_64bit_ops(i64 %a, i64 %b, i32 %c) {
entry:
%add = add i64 %a, %b
%ext = zext i32 %c to i64
%mul = mul i64 %add, %ext
ret i64 %mul
}