mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-02 23:27:16 +00:00
[InstSimplify] Restore fsub 0.0, (fsub 0.0, X) ==> X optzn
I accidentally removed this in r262212 but there was no test coverage to detect it. llvm-svn: 262215
This commit is contained in:
parent
76d76bb006
commit
6bb15021b3
@ -839,7 +839,7 @@ static Value *SimplifyFSubInst(Value *Op0, Value *Op1, FastMathFlags FMF,
|
|||||||
return X;
|
return X;
|
||||||
|
|
||||||
// fsub 0.0, (fsub 0.0, X) ==> X if signed zeros are ignored.
|
// fsub 0.0, (fsub 0.0, X) ==> X if signed zeros are ignored.
|
||||||
if (FMF.noSignedZeros() && match(Op0, m_NegZero()) &&
|
if (FMF.noSignedZeros() && match(Op0, m_AnyZero()) &&
|
||||||
match(Op1, m_FSub(m_AnyZero(), m_Value(X))))
|
match(Op1, m_FSub(m_AnyZero(), m_Value(X))))
|
||||||
return X;
|
return X;
|
||||||
|
|
||||||
|
@ -91,6 +91,16 @@ define float @fsub_x_x(float %a) {
|
|||||||
ret float %ret
|
ret float %ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; fsub nsz 0.0, (fsub 0.0, X) ==> X
|
||||||
|
; CHECK-LABEL: @fsub_0_0_x(
|
||||||
|
define float @fsub_0_0_x(float %a) {
|
||||||
|
%t1 = fsub float 0.0, %a
|
||||||
|
%ret = fsub nsz float 0.0, %t1
|
||||||
|
|
||||||
|
; CHECK: ret float %a
|
||||||
|
ret float %ret
|
||||||
|
}
|
||||||
|
|
||||||
; fadd nsz X, 0 ==> X
|
; fadd nsz X, 0 ==> X
|
||||||
; CHECK-LABEL: @nofold_fadd_x_0(
|
; CHECK-LABEL: @nofold_fadd_x_0(
|
||||||
define float @nofold_fadd_x_0(float %a) {
|
define float @nofold_fadd_x_0(float %a) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user