diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-02-12 23:51:23 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-12 23:51:23 +0000 |
commit | 246d769232df3f987a44aa705fbbd6898dfb4723 (patch) | |
tree | ffb7c0db532a9713e772338b28bd99afab2da2f8 /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | 02eed775c033bd9b73decf72aecab94cb45e5d8f (diff) | |
download | bcm5719-llvm-246d769232df3f987a44aa705fbbd6898dfb4723.tar.gz bcm5719-llvm-246d769232df3f987a44aa705fbbd6898dfb4723.zip |
[InstSimplify] allow exp/log simplifications with only 'reassoc' FMF
These intrinsic folds were added with D41381, but only allowed with isFast().
That's more than necessary because FMF has 'reassoc' to apply to these
kinds of folds after D39304, and that's all we need in these cases.
Differential Revision: https://reviews.llvm.org/D43160
llvm-svn: 324967
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index b81ecc83c05..43fbeb88ea2 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -4571,28 +4571,28 @@ static Value *SimplifyIntrinsic(Function *F, IterTy ArgBegin, IterTy ArgEnd, } case Intrinsic::exp: { // exp(log(x)) -> x - if (Q.CxtI->isFast() && + if (Q.CxtI->hasAllowReassoc() && match(IIOperand, m_Intrinsic<Intrinsic::log>(m_Value(X)))) return X; return nullptr; } case Intrinsic::exp2: { // exp2(log2(x)) -> x - if (Q.CxtI->isFast() && + if (Q.CxtI->hasAllowReassoc() && match(IIOperand, m_Intrinsic<Intrinsic::log2>(m_Value(X)))) return X; return nullptr; } case Intrinsic::log: { // log(exp(x)) -> x - if (Q.CxtI->isFast() && + if (Q.CxtI->hasAllowReassoc() && match(IIOperand, m_Intrinsic<Intrinsic::exp>(m_Value(X)))) return X; return nullptr; } case Intrinsic::log2: { // log2(exp2(x)) -> x - if (Q.CxtI->isFast() && + if (Q.CxtI->hasAllowReassoc() && match(IIOperand, m_Intrinsic<Intrinsic::exp2>(m_Value(X)))) { return X; } |