[llvm-commits] [llvm] r151125 - in /llvm/trunk: lib/Analysis/ScalarEvolutionExpander.cpp test/Transforms/LoopStrengthReduce/pr12048.ll

Andrew Trick atrick at apple.com
Tue Feb 21 19:40:01 PST 2012


On Feb 21, 2012, at 7:21 PM, Rafael Espindola <rafael.espindola at gmail.com> wrote:
> 
> -          // If the cast isn't where we want it, fix it.
> -          if (BasicBlock::iterator(CI) != IP) {
> +          // If the cast isn't where we want it or if it doesn't dominate
> +          // a use in BIP, fix it.
> +          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
>             // so that it doesn't hold anything live.

Great!

Given the amount of time I spent during review trying to remember why I originally added that check. We should probably be more explicit in the comments. Something like:

"If the cast isn't where we want it, create a new, earlier cast at IP. Likewise, do not reuse a cast at BIP because it must dominate instructions that will be inserted before BIP."

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120221/6ee19b67/attachment.html>


More information about the llvm-commits mailing list