mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
InstCombine: fsub nsz 0, X ==> fsub nsz -0.0, X
Some day the backend may handle instruction-level fast math flags and make this transform unnecessary, but it's still better practice to use the canonical representation of fneg when possible (use a -0.0). This is a partial fix for PR20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 ). See also http://reviews.llvm.org/D6723. Differential Revision: http://reviews.llvm.org/D6731 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -322,6 +322,14 @@ define float @fneg1(float %f1, float %f2) {
|
||||
; CHECK: fmul float %f1, %f2
|
||||
}
|
||||
|
||||
define float @fneg2(float %x) {
|
||||
%sub = fsub nsz float 0.0, %x
|
||||
ret float %sub
|
||||
; CHECK-LABEL: @fneg2(
|
||||
; CHECK-NEXT: fsub nsz float -0.000000e+00, %x
|
||||
; CHECK-NEXT: ret float
|
||||
}
|
||||
|
||||
; =========================================================================
|
||||
;
|
||||
; Testing-cases about div
|
||||
|
Reference in New Issue
Block a user