File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
llvm/test/Analysis/ValueTracking Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
+ ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
3
+
4
+ define i8 @simplify_lshr_with_exact (i8 %x ) {
5
+ ; CHECK-LABEL: @simplify_lshr_with_exact(
6
+ ; CHECK-NEXT: [[SHR:%.*]] = lshr exact i8 6, [[X:%.*]]
7
+ ; CHECK-NEXT: [[R:%.*]] = and i8 [[SHR]], 2
8
+ ; CHECK-NEXT: ret i8 [[R]]
9
+ ;
10
+ %shr = lshr exact i8 6 , %x
11
+ %r = and i8 %shr , 2
12
+ ret i8 %r
13
+ }
14
+
15
+ define i8 @simplify_ashr_with_exact (i8 %x ) {
16
+ ; CHECK-LABEL: @simplify_ashr_with_exact(
17
+ ; CHECK-NEXT: [[SHR:%.*]] = ashr exact i8 -122, [[X:%.*]]
18
+ ; CHECK-NEXT: [[R:%.*]] = and i8 [[SHR]], 2
19
+ ; CHECK-NEXT: ret i8 [[R]]
20
+ ;
21
+ %shr = ashr exact i8 -122 , %x
22
+ %r = and i8 %shr , 2
23
+ ret i8 %r
24
+ }
You can’t perform that action at this time.
0 commit comments