blob: 86801dbc71f18b60c13ec4af5769dc25a2258656 [file] [log] [blame]
Krzysztof Parzyszeka7c5f042015-10-16 20:38:54 +00001; RUN: llc -march=hexagon -mcpu=hexagonv5 -O3 -disable-hsdr < %s | FileCheck %s
Jyotsna Verma803e5062013-05-14 18:54:06 +00002
3; Check that we combine TFRs and TFRIs into COMBINEs.
4
5@a = external global i16
6@b = external global i16
7@c = external global i16
8
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +00009declare void @test0a(i32, i32) #0
10declare void @test0b(i32, i32, i32, i32) #0
11
12; CHECK-LABEL: test1:
Krzysztof Parzyszeka72fad92017-02-10 15:33:13 +000013; CHECK: combine(#10,#0)
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000014define i32 @test1() #0 {
Jyotsna Verma803e5062013-05-14 18:54:06 +000015entry:
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000016 call void @test0a(i32 0, i32 10) #0
17 ret i32 10
Jyotsna Verma803e5062013-05-14 18:54:06 +000018}
19
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000020; CHECK-LABEL: test2:
Krzysztof Parzyszeka72fad92017-02-10 15:33:13 +000021; CHECK: combine(#0,r{{[0-9]+}})
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000022define i32 @test2() #0 {
Jyotsna Verma803e5062013-05-14 18:54:06 +000023entry:
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000024 %t0 = load i16, i16* @c, align 2
25 %t1 = zext i16 %t0 to i32
26 call void @test0b(i32 %t1, i32 0, i32 %t1, i32 0)
27 ret i32 0
Jyotsna Verma803e5062013-05-14 18:54:06 +000028}
29
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000030; CHECK-LABEL: test3:
Krzysztof Parzyszeka72fad92017-02-10 15:33:13 +000031; CHECK: combine(#0,#100)
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000032define i32 @test3() #0 {
Jyotsna Verma803e5062013-05-14 18:54:06 +000033entry:
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000034 call void @test0a(i32 100, i32 0)
35 ret i32 0
Jyotsna Verma803e5062013-05-14 18:54:06 +000036}
Krzysztof Parzyszek64e5d7d2017-10-20 19:33:12 +000037
38attributes #0 = { nounwind }