[llvm-commits] [llvm] r151127 - /llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Feb 21 19:44:46 PST 2012
Author: rafael
Date: Tue Feb 21 21:44:46 2012
New Revision: 151127
URL: http://llvm.org/viewvc/llvm-project?rev=151127&view=rev
Log:
Improve comment. Thanks for Andrew for the suggestion.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=151127&r1=151126&r2=151127&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Tue Feb 21 21:44:46 2012
@@ -53,8 +53,9 @@
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
More information about the llvm-commits
mailing list