git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312685
91177308-0d34-0410-b5e6-
96231b3b80d8
case Intrinsic::rint:
case Intrinsic::nearbyint:
case Intrinsic::round:
case Intrinsic::rint:
case Intrinsic::nearbyint:
case Intrinsic::round:
+ case Intrinsic::canonicalize:
declare float @llvm.trunc.f32(float) nounwind readnone
declare float @llvm.rint.f32(float) nounwind readnone
declare float @llvm.nearbyint.f32(float) nounwind readnone
declare float @llvm.trunc.f32(float) nounwind readnone
declare float @llvm.rint.f32(float) nounwind readnone
declare float @llvm.nearbyint.f32(float) nounwind readnone
+declare float @llvm.canonicalize.f32(float) nounwind readnone
; Test idempotent intrinsics
define float @test_idempotence(float %a) {
; Test idempotent intrinsics
define float @test_idempotence(float %a) {
; CHECK-NEXT: [[D0:%.*]] = call float @llvm.trunc.f32(float [[A]])
; CHECK-NEXT: [[E0:%.*]] = call float @llvm.rint.f32(float [[A]])
; CHECK-NEXT: [[F0:%.*]] = call float @llvm.nearbyint.f32(float [[A]])
; CHECK-NEXT: [[D0:%.*]] = call float @llvm.trunc.f32(float [[A]])
; CHECK-NEXT: [[E0:%.*]] = call float @llvm.rint.f32(float [[A]])
; CHECK-NEXT: [[F0:%.*]] = call float @llvm.nearbyint.f32(float [[A]])
+; CHECK-NEXT: [[G0:%.*]] = call float @llvm.canonicalize.f32(float [[A]])
; CHECK-NEXT: [[R0:%.*]] = fadd float [[A0]], [[B0]]
; CHECK-NEXT: [[R1:%.*]] = fadd float [[R0]], [[C0]]
; CHECK-NEXT: [[R2:%.*]] = fadd float [[R1]], [[D0]]
; CHECK-NEXT: [[R3:%.*]] = fadd float [[R2]], [[E0]]
; CHECK-NEXT: [[R4:%.*]] = fadd float [[R3]], [[F0]]
; CHECK-NEXT: [[R0:%.*]] = fadd float [[A0]], [[B0]]
; CHECK-NEXT: [[R1:%.*]] = fadd float [[R0]], [[C0]]
; CHECK-NEXT: [[R2:%.*]] = fadd float [[R1]], [[D0]]
; CHECK-NEXT: [[R3:%.*]] = fadd float [[R2]], [[E0]]
; CHECK-NEXT: [[R4:%.*]] = fadd float [[R3]], [[F0]]
-; CHECK-NEXT: ret float [[R4]]
+; CHECK-NEXT: [[R5:%.*]] = fadd float [[R4]], [[G0]]
+; CHECK-NEXT: ret float [[R5]]
;
%a0 = call float @llvm.fabs.f32(float %a)
;
%a0 = call float @llvm.fabs.f32(float %a)
%f0 = call float @llvm.nearbyint.f32(float %a)
%f1 = call float @llvm.nearbyint.f32(float %f0)
%f0 = call float @llvm.nearbyint.f32(float %a)
%f1 = call float @llvm.nearbyint.f32(float %f0)
+ %g0 = call float @llvm.canonicalize.f32(float %a)
+ %g1 = call float @llvm.canonicalize.f32(float %g0)
+
%r0 = fadd float %a1, %b1
%r1 = fadd float %r0, %c1
%r2 = fadd float %r1, %d1
%r3 = fadd float %r2, %e1
%r4 = fadd float %r3, %f1
%r0 = fadd float %a1, %b1
%r1 = fadd float %r0, %c1
%r2 = fadd float %r1, %d1
%r3 = fadd float %r2, %e1
%r4 = fadd float %r3, %f1
+ %r5 = fadd float %r4, %g1
}
define i8* @operator_new() {
}
define i8* @operator_new() {