File: factorize-again.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 (45 lines) | stat: -rw-r--r-- 1,685 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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=reassociate < %s | FileCheck %s

define void @main(float, float) {
; CHECK-LABEL: @main(
; CHECK-NEXT:  wrapper_entry:
; CHECK-NEXT:    [[TMP2:%.*]] = fsub float undef, [[TMP0:%.*]]
; CHECK-NEXT:    [[TMP3:%.*]] = fsub float undef, [[TMP1:%.*]]
; CHECK-NEXT:    [[TMP4:%.*]] = call float @llvm.rsqrt.f32(float undef)
; CHECK-NEXT:    [[REASS_ADD2:%.*]] = fadd fast float [[TMP3]], [[TMP2]]
; CHECK-NEXT:    [[REASS_MUL3:%.*]] = fmul fast float [[TMP4]], [[REASS_ADD2]]
; CHECK-NEXT:    [[REASS_ADD1:%.*]] = fadd fast float [[REASS_MUL3]], [[TMP4]]
; CHECK-NEXT:    [[REASS_MUL:%.*]] = fmul fast float [[REASS_ADD1]], undef
; CHECK-NEXT:    [[TMP5:%.*]] = call float @foo2(float [[REASS_MUL]], float 0.000000e+00)
; CHECK-NEXT:    [[MUL36:%.*]] = fmul fast float [[TMP5]], 1.500000e+00
; CHECK-NEXT:    call void @foo1(i32 4, float [[MUL36]])
; CHECK-NEXT:    ret void
;
wrapper_entry:
  %2 = fsub float undef, %0
  %3 = fsub float undef, %1
  %4 = call float @llvm.rsqrt.f32(float undef)
  %5 = fmul fast float undef, %4
  %6 = fmul fast float %2, %4
  %7 = fmul fast float %3, %4
  %8 = fmul fast float %5, undef
  %9 = fmul fast float %6, undef
  %10 = fmul fast float %7, undef
  %11 = fadd fast float %8, %9
  %12 = fadd fast float %11, %10
  %13 = call float @foo2(float %12, float 0.000000e+00)
  %mul36 = fmul fast float %13, 1.500000e+00
  call void @foo1(i32 4, float %mul36)
  ret void
}

declare void @foo1(i32, float)

declare float @foo2(float, float) #1

declare float @llvm.rsqrt.f32(float) #1

attributes #0 = { argmemonly nounwind }
attributes #1 = { nounwind readnone }