Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; Reassociation should apply to Add, Mul, And, Or, & Xor |
| 2 | ; |
| 3 | ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12 |
| 4 | |
| 5 | int "test_mul"(int %arg) { |
| 6 | %tmp1 = mul int 12, %arg |
| 7 | %tmp2 = mul int %tmp1, 12 |
| 8 | ret int %tmp2 |
| 9 | } |
| 10 | |
| 11 | int "test_and"(int %arg) { |
| 12 | %tmp1 = and int 14, %arg |
| 13 | %tmp2 = and int %tmp1, 14 |
| 14 | ret int %tmp2 |
| 15 | } |
| 16 | |
| 17 | int "test_or"(int %arg) { |
| 18 | %tmp1 = or int 14, %arg |
| 19 | %tmp2 = or int %tmp1, 14 |
| 20 | ret int %tmp2 |
| 21 | } |
| 22 | |
| 23 | int "test_xor"(int %arg) { |
| 24 | %tmp1 = xor int 12, %arg |
| 25 | %tmp2 = xor int %tmp1, 12 |
| 26 | ret int %tmp2 |
| 27 | } |
| 28 | |