1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
4 define i64 @testOptimizeLiAddToAddi(i64 %a) {
5 ; CHECK-LABEL: testOptimizeLiAddToAddi:
6 ; CHECK: addi 3, 3, 2444
8 ; CHECK: addi 3, 30, 234
12 %cmp = icmp sgt i64 %a, 33
13 br i1 %cmp, label %if.then, label %if.end
16 tail call void bitcast (void (...)* @callv to void ()*)()
20 %add.0 = phi i64 [ 234, %if.then ], [ 2444, %entry ]
21 %add2 = add nsw i64 %add.0, %a
22 %call = tail call i64 @call(i64 %add2)
26 define i64 @testThreePhiIncomings(i64 %a) {
27 ; CHECK-LABEL: testThreePhiIncomings:
29 ; CHECK: addi 3, 30, 234
30 ; CHECK: addi 3, 30, 2444
32 ; CHECK: addi 3, 30, 345
36 %cmp = icmp slt i64 %a, 33
37 br i1 %cmp, label %if.then, label %if.else
40 tail call void bitcast (void (...)* @callv to void ()*)()
44 %cmp1 = icmp slt i64 %a, 55
45 br i1 %cmp1, label %if.then2, label %if.end4
48 tail call void bitcast (void (...)* @callv to void ()*)()
52 %add.0 = phi i64 [ 234, %if.then ], [ 345, %if.then2 ], [ 2444, %if.else ]
53 %add5 = add nsw i64 %add.0, %a
54 %call = tail call i64 @call(i64 %add5)
58 declare void @callv(...)
60 declare i64 @call(i64)