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