• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s
2; Check that we are able to predicate instructions.
3
4; CHECK: if ({{!?}}p{{[0-3]}}{{(.new)?}}) r{{[0-9]+}} = {{and|aslh}}
5; CHECK: if ({{!?}}p{{[0-3]}}{{(.new)?}}) r{{[0-9]+}} = {{and|aslh}}
6@a = external global i32
7@d = external global i32
8
9; Function Attrs: nounwind
10define i32 @test1(i8 zeroext %la, i8 zeroext %lb) {
11entry:
12  %cmp = icmp eq i8 %la, %lb
13  br i1 %cmp, label %if.then, label %if.else
14
15if.then:                                          ; preds = %entry
16  %conv1 = zext i8 %la to i32
17  %shl = shl nuw nsw i32 %conv1, 16
18  br label %if.end
19
20if.else:                                          ; preds = %entry
21  %and8 = and i8 %lb, %la
22  %and = zext i8 %and8 to i32
23  br label %if.end
24
25if.end:                                           ; preds = %if.else, %if.then
26  %storemerge = phi i32 [ %and, %if.else ], [ %shl, %if.then ]
27  store i32 %storemerge, i32* @a, align 4
28  %0 = load i32, i32* @d, align 4
29  ret i32 %0
30}
31