Skip to content

Commit 4b87c01

Browse files
committed
[InstCombine] Add more tests. NFC.
1 parent b3a5672 commit 4b87c01

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/intrinsic-select.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,16 @@ define float @test_fabs_select_multiuse(i1 %cond, float %x) {
358358
%fabs = call float @llvm.fabs.f32(float %select)
359359
ret float %fabs
360360
}
361+
362+
define float @test_fabs_select_multiuse_both_constant(i1 %cond, float %x) {
363+
; CHECK-LABEL: @test_fabs_select_multiuse_both_constant(
364+
; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[COND:%.*]], float -1.000000e+00, float -2.000000e+00
365+
; CHECK-NEXT: call void @usef32(float [[SELECT]])
366+
; CHECK-NEXT: [[FABS:%.*]] = call float @llvm.fabs.f32(float [[SELECT]])
367+
; CHECK-NEXT: ret float [[FABS]]
368+
;
369+
%select = select i1 %cond, float -1.0, float -2.0
370+
call void @usef32(float %select)
371+
%fabs = call float @llvm.fabs.f32(float %select)
372+
ret float %fabs
373+
}

0 commit comments

Comments
 (0)