File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +30
-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 UTC_ARGS: --version 2
2+ ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3+
4+ define i32 @trunc_shl_zext_32 (i32 %a ) {
5+ ; CHECK-LABEL: define i32 @trunc_shl_zext_32
6+ ; CHECK-SAME: (i32 [[A:%.*]]) {
7+ ; CHECK-NEXT: [[TRUNC:%.*]] = trunc i32 [[A]] to i16
8+ ; CHECK-NEXT: [[SHL:%.*]] = shl i16 [[TRUNC]], 4
9+ ; CHECK-NEXT: [[EXT:%.*]] = zext i16 [[SHL]] to i32
10+ ; CHECK-NEXT: ret i32 [[EXT]]
11+ ;
12+ %trunc = trunc i32 %a to i16
13+ %shl = shl i16 %trunc , 4
14+ %ext = zext i16 %shl to i32
15+ ret i32 %ext
16+ }
17+
18+ define i64 @trunc_shl_zext_64 (i64 %a ) {
19+ ; CHECK-LABEL: define i64 @trunc_shl_zext_64
20+ ; CHECK-SAME: (i64 [[A:%.*]]) {
21+ ; CHECK-NEXT: [[TRUNC:%.*]] = trunc i64 [[A]] to i8
22+ ; CHECK-NEXT: [[SHL:%.*]] = shl i8 [[TRUNC]], 7
23+ ; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[SHL]] to i64
24+ ; CHECK-NEXT: ret i64 [[EXT]]
25+ ;
26+ %trunc = trunc i64 %a to i8
27+ %shl = shl i8 %trunc , 7
28+ %ext = zext i8 %shl to i64
29+ ret i64 %ext
30+ }
You can’t perform that action at this time.
0 commit comments