Nate Begeman | 8ec1817 | 2006-02-17 06:24:31 +0000 | [diff] [blame] | 1 | ; All of these should be codegen'd without loading immediates |
Reid Spencer | eb1d74e | 2007-04-16 17:36:08 +0000 | [diff] [blame] | 2 | ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f |
Dan Gohman | 28beeea | 2007-08-15 13:36:28 +0000 | [diff] [blame] | 3 | ; RUN: grep addc %t | count 1 |
| 4 | ; RUN: grep adde %t | count 1 |
| 5 | ; RUN: grep addze %t | count 1 |
| 6 | ; RUN: grep addme %t | count 1 |
| 7 | ; RUN: grep addic %t | count 2 |
Nate Begeman | b5fefc7 | 2006-02-17 06:16:56 +0000 | [diff] [blame] | 8 | |
| 9 | implementation ; Functions: |
| 10 | |
| 11 | long %add_ll(long %a, long %b) { |
| 12 | entry: |
| 13 | %tmp.2 = add long %b, %a ; <long> [#uses=1] |
| 14 | ret long %tmp.2 |
| 15 | } |
| 16 | |
| 17 | long %add_l_5(long %a) { |
| 18 | entry: |
| 19 | %tmp.1 = add long %a, 5 ; <long> [#uses=1] |
| 20 | ret long %tmp.1 |
| 21 | } |
| 22 | |
| 23 | long %add_l_m5(long %a) { |
| 24 | entry: |
| 25 | %tmp.1 = add long %a, -5 ; <long> [#uses=1] |
| 26 | ret long %tmp.1 |
| 27 | } |