Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/InstCombine/fmul.ll
Show First 20 Lines • Show All 1,051 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
; Avoid infinite looping by moving negation out of a constant expression. | ; Avoid infinite looping by moving negation out of a constant expression. | ||||
@g = external global {[2 x i8*]}, align 1 | @g = external global {[2 x i8*]}, align 1 | ||||
define double @fmul_negated_constant_expression(double %x) { | define double @fmul_negated_constant_expression(double %x) { | ||||
; CHECK-LABEL: @fmul_negated_constant_expression( | ; CHECK-LABEL: @fmul_negated_constant_expression( | ||||
; CHECK-NEXT: [[R:%.*]] = fmul double [[X:%.*]], fsub (double -0.000000e+00, double bitcast (i64 ptrtoint (i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i64 0, inrange i32 0, i64 2) to i64) to double)) | ; CHECK-NEXT: [[R:%.*]] = fmul double [[X:%.*]], fneg (double bitcast (i64 ptrtoint (i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i64 0, inrange i32 0, i64 2) to i64) to double)) | ||||
; CHECK-NEXT: ret double [[R]] | ; CHECK-NEXT: ret double [[R]] | ||||
; | ; | ||||
%r = fmul double %x, fsub (double -0.000000e+00, double bitcast (i64 ptrtoint (i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i64 0, inrange i32 0, i64 2) to i64) to double)) | %fsub = fsub double -0.000000e+00, bitcast (i64 ptrtoint (i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i64 0, inrange i32 0, i64 2) to i64) to double) | ||||
%r = fmul double %x, %fsub | |||||
ret double %r | ret double %r | ||||
} | } | ||||
define float @negate_if_true(float %x, i1 %cond) { | define float @negate_if_true(float %x, i1 %cond) { | ||||
; CHECK-LABEL: @negate_if_true( | ; CHECK-LABEL: @negate_if_true( | ||||
; CHECK-NEXT: [[TMP1:%.*]] = fneg float [[X:%.*]] | ; CHECK-NEXT: [[TMP1:%.*]] = fneg float [[X:%.*]] | ||||
; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[COND:%.*]], float [[TMP1]], float [[X]] | ; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[COND:%.*]], float [[TMP1]], float [[X]] | ||||
; CHECK-NEXT: ret float [[TMP2]] | ; CHECK-NEXT: ret float [[TMP2]] | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |