aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/TargetTransformInfo.cpp
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2015-04-10 05:03:50 +0000
committerJingyue Wu <jingyue@google.com>2015-04-10 05:03:50 +0000
commit5da831cc3109ff1fc5c8f43be2cf1a1f52e030da (patch)
treebc580cdb0efc9fce2e03473d920d295c31a16e78 /llvm/lib/Analysis/TargetTransformInfo.cpp
parent5c65f58f6487dd5d9dec43d927dd9842e8b72ba2 (diff)
downloadllvm-5da831cc3109ff1fc5c8f43be2cf1a1f52e030da.zip
llvm-5da831cc3109ff1fc5c8f43be2cf1a1f52e030da.tar.gz
llvm-5da831cc3109ff1fc5c8f43be2cf1a1f52e030da.tar.bz2
Divergence analysis for GPU programs
Summary: Some optimizations such as jump threading and loop unswitching can negatively affect performance when applied to divergent branches. The divergence analysis added in this patch conservatively estimates which branches in a GPU program can diverge. This information can then help LLVM to run certain optimizations selectively. Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll Reviewers: resistor, hfinkel, eliben, meheff, jholewinski Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D8576 llvm-svn: 234567
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 f51c7f5..a1519de 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -76,6 +76,10 @@ bool TargetTransformInfo::hasBranchDivergence() const {
return TTIImpl->hasBranchDivergence();
}
+bool TargetTransformInfo::isSourceOfDivergence(const Value *V) const {
+ return TTIImpl->isSourceOfDivergence(V);
+}
+
bool TargetTransformInfo::isLoweredToCall(const Function *F) const {
return TTIImpl->isLoweredToCall(F);
}