File: round.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (57 lines) | stat: -rw-r--r-- 2,592 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -passes=slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX7 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -passes=slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s

define <2 x half> @round_v2f16(<2 x half> %arg) {
; GFX7-LABEL: @round_v2f16(
; GFX7-NEXT:  bb:
; GFX7-NEXT:    [[T:%.*]] = extractelement <2 x half> [[ARG:%.*]], i64 0
; GFX7-NEXT:    [[T1:%.*]] = tail call half @llvm.round.f16(half [[T]])
; GFX7-NEXT:    [[T2:%.*]] = insertelement <2 x half> undef, half [[T1]], i64 0
; GFX7-NEXT:    [[T3:%.*]] = extractelement <2 x half> [[ARG]], i64 1
; GFX7-NEXT:    [[T4:%.*]] = tail call half @llvm.round.f16(half [[T3]])
; GFX7-NEXT:    [[T5:%.*]] = insertelement <2 x half> [[T2]], half [[T4]], i64 1
; GFX7-NEXT:    ret <2 x half> [[T5]]
;
; GFX8-LABEL: @round_v2f16(
; GFX8-NEXT:  bb:
; GFX8-NEXT:    [[TMP0:%.*]] = call <2 x half> @llvm.round.v2f16(<2 x half> [[ARG:%.*]])
; GFX8-NEXT:    ret <2 x half> [[TMP0]]
;
bb:
  %t = extractelement <2 x half> %arg, i64 0
  %t1 = tail call half @llvm.round.half(half %t)
  %t2 = insertelement <2 x half> undef, half %t1, i64 0
  %t3 = extractelement <2 x half> %arg, i64 1
  %t4 = tail call half @llvm.round.half(half %t3)
  %t5 = insertelement <2 x half> %t2, half %t4, i64 1
  ret <2 x half> %t5
}


define <2 x float> @round_v2f32(<2 x float> %arg) {
; GCN-LABEL: @round_v2f32(
; GCN-NEXT:  bb:
; GCN-NEXT:    [[T:%.*]] = extractelement <2 x float> [[ARG:%.*]], i64 0
; GCN-NEXT:    [[T1:%.*]] = tail call float @llvm.round.f32(float [[T]])
; GCN-NEXT:    [[T2:%.*]] = insertelement <2 x float> undef, float [[T1]], i64 0
; GCN-NEXT:    [[T3:%.*]] = extractelement <2 x float> [[ARG]], i64 1
; GCN-NEXT:    [[T4:%.*]] = tail call float @llvm.round.f32(float [[T3]])
; GCN-NEXT:    [[T5:%.*]] = insertelement <2 x float> [[T2]], float [[T4]], i64 1
; GCN-NEXT:    ret <2 x float> [[T5]]
;
bb:
  %t = extractelement <2 x float> %arg, i64 0
  %t1 = tail call float @llvm.round.f32(float %t)
  %t2 = insertelement <2 x float> undef, float %t1, i64 0
  %t3 = extractelement <2 x float> %arg, i64 1
  %t4 = tail call float @llvm.round.f32(float %t3)
  %t5 = insertelement <2 x float> %t2, float %t4, i64 1
  ret <2 x float> %t5
}

declare half @llvm.round.half(half) #0
declare float @llvm.round.f32(float) #0

attributes #0 = { nounwind readnone speculatable willreturn }