1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 ; Check if S4_subi_asl_ri is being generated correctly.
5 ; CHECK-LABEL: yes_sub_asl
6 ; FIXME: We no longer get subi_asl here.
7 ; XCHECK: [[REG1:(r[0-9]+)]] = sub(#0,asl([[REG1]],#1))
8 ; CHECK: [[REG1:(r[0-9]+)]] = asl([[REG1]],#1)
9 ; CHECK: = sub(#0,[[REG1]])
11 ; CHECK-LABEL: no_sub_asl
12 ; CHECK: [[REG2:(r[0-9]+)]] = asl(r{{[0-9]+}},#1)
13 ; CHECK: r{{[0-9]+}} = sub([[REG2]],r{{[0-9]+}})
15 %struct.rtx_def = type { i16, i8 }
17 @this_insn_number = external global i32, align 4
19 ; Function Attrs: nounwind
20 define void @yes_sub_asl(ptr %reg, ptr nocapture readonly %setter) #0 {
22 %0 = load i16, ptr %reg, align 4
23 switch i16 %0, label %return [
29 %1 = load i16, ptr %setter, align 4
30 %cmp8 = icmp eq i16 %1, 56
31 %conv9 = zext i1 %cmp8 to i32
32 %2 = load i32, ptr @this_insn_number, align 4
34 %sub = add nsw i32 %conv9, %3
35 tail call void @reg_is_born(ptr nonnull %reg, i32 %sub) #2
42 declare void @reg_is_born(ptr, i32) #1
44 ; Function Attrs: nounwind
45 define void @no_sub_asl(ptr %reg, ptr nocapture readonly %setter) #0 {
47 %0 = load i16, ptr %reg, align 4
48 switch i16 %0, label %return [
54 %1 = load i32, ptr @this_insn_number, align 4
55 %mul = mul nsw i32 %1, 2
56 %2 = load i16, ptr %setter, align 4
57 %cmp8 = icmp eq i16 %2, 56
58 %conv9 = zext i1 %cmp8 to i32
59 %sub = sub nsw i32 %mul, %conv9
60 tail call void @reg_is_born(ptr nonnull %reg, i32 %sub) #2
67 attributes #0 = { nounwind "target-cpu"="hexagonv5" }
68 attributes #1 = { "target-cpu"="hexagonv5" }
69 attributes #2 = { nounwind }