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
4 ; This is good - eliminate an op by hoisting logic.
6 define i32 @lshr_or(i32 %x, i32 %y, i32 %z, i32* %p1, i32* %p2) {
7 ; CHECK-LABEL: lshr_or:
9 ; CHECK-NEXT: or 3, 3, 4
10 ; CHECK-NEXT: srw 3, 3, 5
18 ; This is questionable - hoisting doesn't eliminate anything.
19 ; It might result in an extra register move.
21 define i32 @lshr_or_multiuse1(i32 %x, i32 %y, i32 %z, i32* %p1, i32* %p2) {
22 ; CHECK-LABEL: lshr_or_multiuse1:
24 ; CHECK-NEXT: srw 7, 3, 5
25 ; CHECK-NEXT: srw 3, 4, 5
26 ; CHECK-NEXT: or 3, 7, 3
27 ; CHECK-NEXT: stw 7, 0(6)
31 store i32 %xt, i32* %p1
36 ; This is questionable - hoisting doesn't eliminate anything.
38 define i32 @lshr_multiuse2(i32 %x, i32 %y, i32 %z, i32* %p1, i32* %p2) {
39 ; CHECK-LABEL: lshr_multiuse2:
41 ; CHECK-NEXT: srw 3, 3, 5
42 ; CHECK-NEXT: srw 4, 4, 5
43 ; CHECK-NEXT: or 3, 3, 4
44 ; CHECK-NEXT: stw 4, 0(7)
48 store i32 %yt, i32* %p2
53 ; This is not profitable to hoist. We need an extra shift instruction.
55 define i32 @lshr_multiuse3(i32 %x, i32 %y, i32 %z, i32* %p1, i32* %p2) {
56 ; CHECK-LABEL: lshr_multiuse3:
58 ; CHECK-NEXT: srw 3, 3, 5
59 ; CHECK-NEXT: srw 4, 4, 5
60 ; CHECK-NEXT: stw 3, 0(6)
61 ; CHECK-NEXT: or 3, 3, 4
62 ; CHECK-NEXT: stw 4, 0(7)
66 store i32 %xt, i32* %p1
67 store i32 %yt, i32* %p2