commit | 93e64dd9a1e2ed5e31881994cdde5e6ef94ddc79 | [log] [tgz] |
---|---|---|
author | Sanjay Patel <spatel@rotateright.com> | Sun Mar 25 21:16:33 2018 +0000 |
committer | Sanjay Patel <spatel@rotateright.com> | Sun Mar 25 21:16:33 2018 +0000 |
tree | 5867bafd5f56667416d68c5575768f8f61f58c67 | |
parent | 68a8fbc1021cd612bb69bb6d50bcb9763ad00f00 [diff] [blame] |
[PatternMatch] allow undef elements when matching vector FP +0.0 This continues the FP constant pattern matching improvements from: https://reviews.llvm.org/rL327627 https://reviews.llvm.org/rL327339 https://reviews.llvm.org/rL327307 Several integer constant matchers also have this ability. I'm separating matching of integer/pointer null from FP positive zero and renaming/commenting to make the functionality clearer. llvm-svn: 328461
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index b37b201..1f04a8b 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -1700,7 +1700,7 @@ // Subtraction from -0.0 is the canonical form of fneg. // fsub nsz 0, X ==> fsub nsz -0.0, X - if (I.getFastMathFlags().noSignedZeros() && match(Op0, m_Zero())) + if (I.getFastMathFlags().noSignedZeros() && match(Op0, m_PosZeroFP())) return BinaryOperator::CreateFNegFMF(Op1, &I); if (isa<Constant>(Op0))