summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetTransformInfo.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2017-12-22 18:54:04 +0000
committerGuozhi Wei <carrot@google.com>2017-12-22 18:54:04 +0000
commit33250340f4dc4446ddacc74dc0c89cb629820901 (patch)
treec732ef7085c311a785a797d9d20af302601db715 /llvm/lib/Analysis/TargetTransformInfo.cpp
parentbb534b15a9959cdb6dc03a64151f68f1293f7a28 (diff)
downloadbcm5719-llvm-33250340f4dc4446ddacc74dc0c89cb629820901.tar.gz
bcm5719-llvm-33250340f4dc4446ddacc74dc0c89cb629820901.zip
[SimplifyCFG] Don't do if-conversion if there is a long dependence chain
If after if-conversion, most of the instructions in this new BB construct a long and slow dependence chain, it may be slower than cmp/branch, even if the branch has a high miss rate, because the control dependence is transformed into data dependence, and control dependence can be speculated, and thus, the second part can execute in parallel with the first part on modern OOO processor. This patch checks for the long dependence chain, and give up if-conversion if find one. Differential Revision: https://reviews.llvm.org/D39352 llvm-svn: 321377
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index b744cae51ed..c9e9c6d1a41 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -314,6 +314,10 @@ int TargetTransformInfo::getIntImmCost(Intrinsic::ID IID, unsigned Idx,
return Cost;
}
+bool TargetTransformInfo::isOutOfOrder() const {
+ return TTIImpl->isOutOfOrder();
+}
+
unsigned TargetTransformInfo::getNumberOfRegisters(bool Vector) const {
return TTIImpl->getNumberOfRegisters(Vector);
}
OpenPOWER on IntegriCloud