summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-15 15:07:12 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-15 15:07:12 +0000
commit339b4d338da3d76a064d6c4263c5791b3dd68fcb (patch)
tree64b7a78f84fd5d44ae3fd7e63e33becd399f3e8d /llvm/lib/Transforms
parent62b0c5bb880754230440dcdfcf193aa6aa217b8a (diff)
downloadbcm5719-llvm-339b4d338da3d76a064d6c4263c5791b3dd68fcb.tar.gz
bcm5719-llvm-339b4d338da3d76a064d6c4263c5791b3dd68fcb.zip
[InstCombine] allow sin/cos transforms with 'reassoc'
The variable name 'AllowReassociate' is a lie at this point because it's set to 'isFast()' which is more than the 'reassoc' FMF after rL317488. In D41286, we showed that this transform may be valid even with strict math by brute force checking every 32-bit float result. There's a potential problem here because we're replacing with a tan() libcall rather than a hypothetical LLVM tan intrinsic. So we might set errno when we should be guaranteed not to do that. But that's independent of this change. llvm-svn: 325247
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 57a30558a98..04a52af2d0e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1461,8 +1461,7 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
}
}
- if (AllowReassociate &&
- Op0->hasOneUse() && Op1->hasOneUse()) {
+ if (I.hasAllowReassoc() && Op0->hasOneUse() && Op1->hasOneUse()) {
Value *A;
// sin(a) / cos(a) -> tan(a)
if (match(Op0, m_Intrinsic<Intrinsic::sin>(m_Value(A))) &&
OpenPOWER on IntegriCloud