File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 22; RUN: opt -passes=instcombine -S < %s | FileCheck %s
33
44declare void @use (i32 )
5+ declare void @usef32 (float )
56
67declare i32 @llvm.ctlz.i32 (i32 , i1 )
78declare <3 x i17 > @llvm.ctlz.v3i17 (<3 x i17 >, i1 )
@@ -344,3 +345,17 @@ define double @test_fabs_select_fmf2(i1 %cond, double %a) {
344345 %fabs = call nnan ninf nsz double @llvm.fabs.f64 (double %sel1 )
345346 ret double %fabs
346347}
348+
349+ define float @test_fabs_select_multiuse (i1 %cond , float %x ) {
350+ ; CHECK-LABEL: @test_fabs_select_multiuse(
351+ ; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[COND:%.*]], float [[X:%.*]], float 0x7FF0000000000000
352+ ; CHECK-NEXT: call void @usef32(float [[SELECT]])
353+ ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[X]])
354+ ; CHECK-NEXT: [[FABS:%.*]] = select i1 [[COND]], float [[TMP1]], float 0x7FF0000000000000
355+ ; CHECK-NEXT: ret float [[FABS]]
356+ ;
357+ %select = select i1 %cond , float %x , float 0x7FF0000000000000
358+ call void @usef32 (float %select )
359+ %fabs = call float @llvm.fabs.f32 (float %select )
360+ ret float %fabs
361+ }
You can’t perform that action at this time.
0 commit comments