File: sitofp-minbitwidth-node.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (57 lines) | stat: -rw-r--r-- 2,315 bytes parent folder | download | duplicates (6)
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 UTC_ARGS: --version 4
; RUN: opt -passes=slp-vectorizer -mtriple=x86_64 -mcpu=k8 -mattr=+sse4.1 -S < %s | FileCheck %s

define void @foo(ptr %ptr) {
; CHECK-LABEL: define void @foo(
; CHECK-SAME: ptr [[PTR:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:    [[GEP0:%.*]] = getelementptr inbounds i8, ptr [[PTR]], i64 328
; CHECK-NEXT:    [[GEP3:%.*]] = getelementptr inbounds i8, ptr [[PTR]], i64 334
; CHECK-NEXT:    [[TMP1:%.*]] = load <2 x i16>, ptr [[GEP0]], align 8
; CHECK-NEXT:    [[TMP3:%.*]] = xor <2 x i16> [[TMP1]], splat (i16 -1)
; CHECK-NEXT:    [[TMP4:%.*]] = uitofp <2 x i16> [[TMP3]] to <2 x double>
; CHECK-NEXT:    [[TMP5:%.*]] = load <2 x i16>, ptr [[GEP3]], align 2
; CHECK-NEXT:    [[TMP6:%.*]] = zext <2 x i16> [[TMP5]] to <2 x i32>
; CHECK-NEXT:    [[TMP2:%.*]] = zext <2 x i16> [[TMP1]] to <2 x i32>
; CHECK-NEXT:    [[TMP7:%.*]] = sub nsw <2 x i32> [[TMP6]], [[TMP2]]
; CHECK-NEXT:    [[TMP8:%.*]] = sitofp <2 x i32> [[TMP7]] to <2 x double>
; CHECK-NEXT:    [[TMP9:%.*]] = fdiv <2 x double> [[TMP4]], [[TMP8]]
; CHECK-NEXT:    [[TMP10:%.*]] = extractelement <2 x double> [[TMP9]], i32 0
; CHECK-NEXT:    [[TMP11:%.*]] = extractelement <2 x double> [[TMP9]], i32 1
; CHECK-NEXT:    [[FCMP:%.*]] = fcmp olt double [[TMP11]], [[TMP10]]
; CHECK-NEXT:    ret void
;
  %gep0 = getelementptr inbounds i8, ptr %ptr, i64 328
  %gep1 = getelementptr inbounds i8, ptr %ptr, i64 330

  %gep3 = getelementptr inbounds i8, ptr %ptr, i64 334
  %gep4 = getelementptr inbounds i8, ptr %ptr, i64 336

  %ld0 = load i16, ptr %gep0, align 8
  %ld1 = load i16, ptr %gep1, align 2

  %zext0 = zext i16 %ld0 to i32
  %zext1 = zext i16 %ld1 to i32

  %xor0 = xor i32 %zext0, 65535
  %xor1 = xor i32 %zext1, 65535

  %sitofp0 = sitofp i32 %xor0 to double
  %sitofp1 = sitofp i32 %xor1 to double

  %ld3 = load i16, ptr %gep3, align 2
  %ld4 = load i16, ptr %gep4, align 8

  %zext3 = zext i16 %ld3 to i32
  %zext4 = zext i16 %ld4 to i32

  %sub30 = sub nsw i32 %zext3, %zext0
  %sub41 = sub nsw i32 %zext4, %zext1

  %sitofp30 = sitofp i32 %sub30 to double
  %sitofp41 = sitofp i32 %sub41 to double

  %fdiv030 = fdiv double %sitofp0, %sitofp30
  %fdiv141 = fdiv double %sitofp1, %sitofp41
  %fcmp = fcmp olt double %fdiv141, %fdiv030
  ret void
}