File: round-inseltpoison.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (56 lines) | stat: -rw-r--r-- 2,595 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
; 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> poison, 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> poison, 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> poison, 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> poison, 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 }