File: round.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (38 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (2)
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
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX7 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -slp-vectorizer %s | FileCheck -check-prefixes=GCN,GFX8 %s

; GCN-LABEL: @round_v2f16(
; GFX7: call half @llvm.round.f16(
; GFX7: call half @llvm.round.f16(

; GFX8: call <2 x half> @llvm.round.v2f16(
define <2 x half> @round_v2f16(<2 x half> %arg) {
bb:
  %tmp = extractelement <2 x half> %arg, i64 0
  %tmp1 = tail call half @llvm.round.half(half %tmp)
  %tmp2 = insertelement <2 x half> undef, half %tmp1, i64 0
  %tmp3 = extractelement <2 x half> %arg, i64 1
  %tmp4 = tail call half @llvm.round.half(half %tmp3)
  %tmp5 = insertelement <2 x half> %tmp2, half %tmp4, i64 1
  ret <2 x half> %tmp5
}

; TODO: Should probably not really be vectorizing this
; GCN-LABEL: @round_v2f32(
; GCN: call <2 x float> @llvm.round.v2f32
define <2 x float> @round_v2f32(<2 x float> %arg) {
bb:
  %tmp = extractelement <2 x float> %arg, i64 0
  %tmp1 = tail call float @llvm.round.f32(float %tmp)
  %tmp2 = insertelement <2 x float> undef, float %tmp1, i64 0
  %tmp3 = extractelement <2 x float> %arg, i64 1
  %tmp4 = tail call float @llvm.round.f32(float %tmp3)
  %tmp5 = insertelement <2 x float> %tmp2, float %tmp4, i64 1
  ret <2 x float> %tmp5
}

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

attributes #0 = { nounwind readnone speculatable willreturn }