summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
diff options
context:
space:
mode:
authorHao Liu <Hao.Liu@arm.com>2014-11-21 06:39:58 +0000
committerHao Liu <Hao.Liu@arm.com>2014-11-21 06:39:58 +0000
commit44e5d7a131d300ce6ba023551e3658e714db0a5a (patch)
tree6319cd5c7f7bb31e15ed85afdb7144051b53d7eb /llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
parent61e88f44f9e32262df7d7465451f47fc8fc48472 (diff)
downloadbcm5719-llvm-44e5d7a131d300ce6ba023551e3658e714db0a5a.tar.gz
bcm5719-llvm-44e5d7a131d300ce6ba023551e3658e714db0a5a.zip
DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor info FMULs by the reciprocal.
E.g., ( a / D; b / D ) -> ( recip = 1.0 / D; a * recip; b * recip) A hook is added to allow the target to control whether it needs to do such combine. Reviewed in http://reviews.llvm.org/D6334 llvm-svn: 222510
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 7c94d831cba..70cf7599a39 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -8732,6 +8732,12 @@ bool AArch64TargetLowering::useLoadStackGuardNode() const {
return true;
}
+bool AArch64TargetLowering::combineRepeatedFPDivisors(unsigned NumUsers) const {
+ // Combine multiple FDIVs with the same divisor into multiple FMULs by the
+ // reciprocal if there are three or more FDIVs.
+ return NumUsers > 2;
+}
+
TargetLoweringBase::LegalizeTypeAction
AArch64TargetLowering::getPreferredVectorAction(EVT VT) const {
MVT SVT = VT.getSimpleVT();
OpenPOWER on IntegriCloud