Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s |
Duncan P. N. Exon Smith | c8eccd1 | 2014-08-19 21:08:27 +0000 | [diff] [blame] | 2 | ; RUN: verify-uselistorder %s |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 3 | |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 4 | ; CHECK: @foo |
| 5 | ; CHECK: shl |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 6 | define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 7 | entry: |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 8 | %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 9 | ret <4 x i32> %cmp |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 10 | } |
| 11 | |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 12 | ; CHECK: @bar |
| 13 | ; CHECK: lshr |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 14 | define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 15 | entry: |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 16 | %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 17 | ret <4 x i32> %cmp |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 18 | } |
| 19 | |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 20 | ; CHECK: @baz |
| 21 | ; CHECK: ashr |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 22 | define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 23 | entry: |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 24 | %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 25 | ret <4 x i32> %cmp |
Nate Begeman | fecbc8c | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 26 | } |
Dan Gohman | 79975d5 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 27 | |
| 28 | ; Constant expressions: these should be folded. |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 29 | |
| 30 | ; CHECK: @foo_ce |
| 31 | ; CHECK: ret <2 x i64> <i64 40, i64 192> |
Dan Gohman | 79975d5 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 32 | define <2 x i64> @foo_ce() nounwind { |
| 33 | ret <2 x i64> shl (<2 x i64> <i64 5, i64 6>, <2 x i64> <i64 3, i64 5>) |
| 34 | } |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 35 | |
| 36 | ; CHECK: @bar_ce |
| 37 | ; CHECK: ret <2 x i64> <i64 42, i64 11> |
Dan Gohman | 79975d5 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 38 | define <2 x i64> @bar_ce() nounwind { |
| 39 | ret <2 x i64> lshr (<2 x i64> <i64 340, i64 380>, <2 x i64> <i64 3, i64 5>) |
| 40 | } |
Bill Wendling | 57f8e5e | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 41 | |
| 42 | ; CHECK: baz_ce |
| 43 | ; CHECK: ret <2 x i64> <i64 71, i64 12> |
Dan Gohman | 79975d5 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 44 | define <2 x i64> @baz_ce() nounwind { |
| 45 | ret <2 x i64> ashr (<2 x i64> <i64 573, i64 411>, <2 x i64> <i64 3, i64 5>) |
| 46 | } |