summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-02-22 03:44:46 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-02-22 03:44:46 +0000
commit337cfaf75734ebef1ac1d400399eacbbb866ac4d (patch)
treeffd3cbf98f1bbe2bfc32ec243e0a0e053221bc30 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent0716b50db68e187b7f39844aeed0155280831d2d (diff)
downloadbcm5719-llvm-337cfaf75734ebef1ac1d400399eacbbb866ac4d.tar.gz
bcm5719-llvm-337cfaf75734ebef1ac1d400399eacbbb866ac4d.zip
Improve comment. Thanks for Andrew for the suggestion.
llvm-svn: 151127
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index a9473b4c49a..d5f3b745169 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -53,8 +53,9 @@ Value *SCEVExpander::ReuseOrCreateCast(Value *V, Type *Ty,
if (U->getType() == Ty)
if (CastInst *CI = dyn_cast<CastInst>(U))
if (CI->getOpcode() == Op) {
- // If the cast isn't where we want it or if it doesn't dominate
- // a use in BIP, fix it.
+ // If the cast isn't where we want it, create a new cast at IP.
+ // Likewise, do not reuse a cast at BIP because it must dominate
+ // instructions that might be inserted before BIP.
if (BasicBlock::iterator(CI) != IP || BIP == IP) {
// Create a new cast, and leave the old cast in place in case
// it is being used as an insert point. Clear its operand
OpenPOWER on IntegriCloud