diff options
author | Cameron McInally <cameron.mcinally@nyu.edu> | 2018-10-09 21:48:00 +0000 |
---|---|---|
committer | Cameron McInally <cameron.mcinally@nyu.edu> | 2018-10-09 21:48:00 +0000 |
commit | bea5967e8ce465734d59823d5b3d24453ae949b0 (patch) | |
tree | e72378ac957cf339a3271130604002bba255697a /llvm/lib/Analysis | |
parent | 2b53b4bea611824a933123780357b5a2cbe2ed0f (diff) | |
download | bcm5719-llvm-bea5967e8ce465734d59823d5b3d24453ae949b0.tar.gz bcm5719-llvm-bea5967e8ce465734d59823d5b3d24453ae949b0.zip |
[FPEnv] PatternMatcher support for checking FNEG ignoring signed zeros
https://reviews.llvm.org/D52934
llvm-svn: 344084
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index f14de66a62c..86f5652f830 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -4508,10 +4508,8 @@ static Value *SimplifyFDivInst(Value *Op0, Value *Op1, FastMathFlags FMF, // -X / X -> -1.0 and // X / -X -> -1.0 are legal when NaNs are ignored. // We can ignore signed zeros because +-0.0/+-0.0 is NaN and ignored. - if ((BinaryOperator::isFNeg(Op0, /*IgnoreZeroSign=*/true) && - BinaryOperator::getFNegArgument(Op0) == Op1) || - (BinaryOperator::isFNeg(Op1, /*IgnoreZeroSign=*/true) && - BinaryOperator::getFNegArgument(Op1) == Op0)) + if (match(Op0, m_FNegNSZ(m_Specific(Op1))) || + match(Op1, m_FNegNSZ(m_Specific(Op0)))) return ConstantFP::get(Op0->getType(), -1.0); } |