1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu | FileCheck %s
3 ; RUN: llc < %s -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s
5 ; This is good - eliminate an op by hoisting logic.
7 define i32 @lshr_or(i32 %x, i32 %y, i32 %z, ptr %p1, ptr %p2) {
8 ; CHECK-LABEL: lshr_or:
10 ; CHECK-NEXT: or 3, 3, 4
11 ; CHECK-NEXT: srw 3, 3, 5
19 ; This is questionable - hoisting doesn't eliminate anything.
20 ; It might result in an extra register move.
22 define i32 @lshr_or_multiuse1(i32 %x, i32 %y, i32 %z, ptr %p1, ptr %p2) {
23 ; CHECK-LABEL: lshr_or_multiuse1:
25 ; CHECK-NEXT: srw 7, 3, 5
26 ; CHECK-NEXT: srw 3, 4, 5
27 ; CHECK-NEXT: or 3, 7, 3
28 ; CHECK-NEXT: stw 7, 0(6)
32 store i32 %xt, ptr %p1
37 ; This is questionable - hoisting doesn't eliminate anything.
39 define i32 @lshr_multiuse2(i32 %x, i32 %y, i32 %z, ptr %p1, ptr %p2) {
40 ; CHECK-LABEL: lshr_multiuse2:
42 ; CHECK-NEXT: srw 3, 3, 5
43 ; CHECK-NEXT: srw 4, 4, 5
44 ; CHECK-NEXT: or 3, 3, 4
45 ; CHECK-NEXT: stw 4, 0(7)
49 store i32 %yt, ptr %p2
54 ; This is not profitable to hoist. We need an extra shift instruction.
56 define i32 @lshr_multiuse3(i32 %x, i32 %y, i32 %z, ptr %p1, ptr %p2) {
57 ; CHECK-LABEL: lshr_multiuse3:
59 ; CHECK-NEXT: srw 3, 3, 5
60 ; CHECK-NEXT: srw 4, 4, 5
61 ; CHECK-NEXT: stw 3, 0(6)
62 ; CHECK-NEXT: or 3, 3, 4
63 ; CHECK-NEXT: stw 4, 0(7)
67 store i32 %xt, ptr %p1
68 store i32 %yt, ptr %p2