xref: /llvm-project/llvm/test/CodeGen/Hexagon/inline-division-space.ll (revision 2208c97c1bec2512d4e47b6223db6d95a7037956)
1; Test for checking division is inlined or not in case of Os.
2; RUN: llc -O2 -mtriple=hexagon < %s | FileCheck %s
3
4; Function Attrs: optsize
5define dso_local i32 @testInt(i32 %a, i32 %b) local_unnamed_addr #0 {
6entry:
7;CHECK: call __hexagon_divsi3
8  %div = sdiv i32 %a, %b
9  %conv = sitofp i32 %div to float
10  %conv1 = fptosi float %conv to i32
11  ret i32 %conv1
12}
13
14; Function Attrs: optsize
15define dso_local float @testFloat(float %a, float %b) local_unnamed_addr #0 {
16entry:
17;CHECK: call __hexagon_divsf3
18  %div = fdiv float %a, %b
19  ret float %div
20}
21
22; Function Attrs: optsize
23define dso_local double @testDouble(double %a, double %b) local_unnamed_addr #0 {
24entry:
25;CHECK: call __hexagon_divdf3
26  %div = fdiv double %a, %b
27  ret double %div
28}
29
30attributes #0 = { optsize }
31