aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/TargetTransformInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r--lib/Analysis/TargetTransformInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/TargetTransformInfo.cpp b/lib/Analysis/TargetTransformInfo.cpp
index 16ee6eb35c..99720d4d03 100644
--- a/lib/Analysis/TargetTransformInfo.cpp
+++ b/lib/Analysis/TargetTransformInfo.cpp
@@ -258,6 +258,9 @@ struct NoTTI : ImmutablePass, TargetTransformInfo {
}
unsigned getUserCost(const User *U) const {
+ if (isa<PHINode>(U))
+ return TCC_Free; // Model all PHI nodes as free.
+
if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U))
// In the basic model we just assume that all-constant GEPs will be
// folded into their uses via addressing modes.