Duncan Sands | fecc642 | 2010-12-21 15:03:43 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -instsimplify -S | FileCheck %s |
2 | |||||
3 | define i1 @add(i1 %x) { | ||||
Stephen Lin | c1c7a13 | 2013-07-14 01:42:54 +0000 | [diff] [blame] | 4 | ; CHECK-LABEL: @add( |
Duncan Sands | fecc642 | 2010-12-21 15:03:43 +0000 | [diff] [blame] | 5 | %z = add i1 %x, %x |
6 | ret i1 %z | ||||
7 | ; CHECK: ret i1 false | ||||
8 | } | ||||
9 | |||||
10 | define i1 @sub(i1 %x) { | ||||
Stephen Lin | c1c7a13 | 2013-07-14 01:42:54 +0000 | [diff] [blame] | 11 | ; CHECK-LABEL: @sub( |
Duncan Sands | fecc642 | 2010-12-21 15:03:43 +0000 | [diff] [blame] | 12 | %z = sub i1 false, %x |
13 | ret i1 %z | ||||
14 | ; CHECK: ret i1 %x | ||||
15 | } | ||||
16 | |||||
17 | define i1 @mul(i1 %x) { | ||||
Stephen Lin | c1c7a13 | 2013-07-14 01:42:54 +0000 | [diff] [blame] | 18 | ; CHECK-LABEL: @mul( |
Duncan Sands | fecc642 | 2010-12-21 15:03:43 +0000 | [diff] [blame] | 19 | %z = mul i1 %x, %x |
20 | ret i1 %z | ||||
21 | ; CHECK: ret i1 %x | ||||
22 | } | ||||
Duncan Sands | 8d25a7c | 2011-01-13 08:56:29 +0000 | [diff] [blame] | 23 | |
24 | define i1 @ne(i1 %x) { | ||||
Stephen Lin | c1c7a13 | 2013-07-14 01:42:54 +0000 | [diff] [blame] | 25 | ; CHECK-LABEL: @ne( |
Duncan Sands | 8d25a7c | 2011-01-13 08:56:29 +0000 | [diff] [blame] | 26 | %z = icmp ne i1 %x, 0 |
27 | ret i1 %z | ||||
28 | ; CHECK: ret i1 %x | ||||
29 | } |