File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4580,3 +4580,29 @@ define i32 @sequence_select_with_same_cond_extra_use(i1 %c1, i1 %c2){
4580
4580
%s3 = select i1 %c1 , i32 789 , i32 %s2
4581
4581
ret i32 %s3
4582
4582
}
4583
+
4584
+ define i8 @test_replace_freeze_multiuse (i1 %x , i8 %y ) {
4585
+ ; CHECK-LABEL: @test_replace_freeze_multiuse(
4586
+ ; CHECK-NEXT: [[EXT:%.*]] = zext i1 [[X:%.*]] to i8
4587
+ ; CHECK-NEXT: [[SHL:%.*]] = shl nuw i8 [[EXT]], [[Y:%.*]]
4588
+ ; CHECK-NEXT: [[SHL_FR:%.*]] = freeze i8 [[SHL]]
4589
+ ; CHECK-NEXT: ret i8 [[SHL_FR]]
4590
+ ;
4591
+ %ext = zext i1 %x to i8
4592
+ %shl = shl nuw i8 %ext , %y
4593
+ %shl.fr = freeze i8 %shl
4594
+ %sel = select i1 %x , i8 0 , i8 %shl.fr
4595
+ %add = add i8 %shl.fr , %sel
4596
+ ret i8 %add
4597
+ }
4598
+
4599
+ define i8 @test_replace_freeze_oneuse (i1 %x , i8 %y ) {
4600
+ ; CHECK-LABEL: @test_replace_freeze_oneuse(
4601
+ ; CHECK-NEXT: ret i8 0
4602
+ ;
4603
+ %ext = zext i1 %x to i8
4604
+ %shl = shl nuw i8 %ext , %y
4605
+ %shl.fr = freeze i8 %shl
4606
+ %sel = select i1 %x , i8 0 , i8 %shl.fr
4607
+ ret i8 %sel
4608
+ }
You can’t perform that action at this time.
0 commit comments