Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/InstCombine/fdiv.ll
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | |||||
; CHECK-NEXT: ret float [[DIV2]] | ; CHECK-NEXT: ret float [[DIV2]] | ||||
; | ; | ||||
%div1 = fdiv float %x, %y | %div1 = fdiv float %x, %y | ||||
%div2 = fdiv fast float %z, %div1 | %div2 = fdiv fast float %z, %div1 | ||||
call void @use_f32(float %div1) | call void @use_f32(float %div1) | ||||
ret float %div2 | ret float %div2 | ||||
} | } | ||||
; Z / (1.0 / Y) | ; Z / (1.0 / Y) ==> Y * Z | ||||
define float @div_with_div_denominator_with_one_as_numerator_extra_use(float %x, float %y, float %z) { | define float @div_with_div_denominator_with_one_as_numerator_extra_use(float %x, float %y, float %z) { | ||||
; CHECK-LABEL: @div_with_div_denominator_with_one_as_numerator_extra_use( | ; CHECK-LABEL: @div_with_div_denominator_with_one_as_numerator_extra_use( | ||||
; CHECK-NEXT: [[DIV1:%.*]] = fdiv float 1.000000e+00, [[Y:%.*]] | ; CHECK-NEXT: [[DIV1:%.*]] = fdiv float 1.000000e+00, [[Y:%.*]] | ||||
; CHECK-NEXT: [[DIV2:%.*]] = fdiv reassoc arcp float [[Z:%.*]], [[DIV1]] | ; CHECK-NEXT: [[DIV2:%.*]] = fmul reassoc arcp float [[Y]], [[Z:%.*]] | ||||
; CHECK-NEXT: call void @use_f32(float [[DIV1]]) | ; CHECK-NEXT: call void @use_f32(float [[DIV1]]) | ||||
; CHECK-NEXT: ret float [[DIV2]] | ; CHECK-NEXT: ret float [[DIV2]] | ||||
; | ; | ||||
%div1 = fdiv float 1.0, %y | %div1 = fdiv float 1.0, %y | ||||
%div2 = fdiv reassoc arcp float %z, %div1 | %div2 = fdiv reassoc arcp float %z, %div1 | ||||
call void @use_f32(float %div1) | call void @use_f32(float %div1) | ||||
ret float %div2 | ret float %div2 | ||||
} | } | ||||
▲ Show 20 Lines • Show All 369 Lines • Show Last 20 Lines |