[llvm-commits] [llvm] r94112 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Chris Lattner clattner at apple.com
Thu Jan 21 15:58:29 PST 2010


On Jan 21, 2010, at 3:07 PM, Victor Hernandez wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=94112&view=rev
> Log:
> No need to look through bitcasts for DbgInfoIntrinsic

Nice, thanks for cleaning this stuff up.

> +++ llvm/trunk/lib/Transforms/InstCombine/ 
> InstCombineLoadStoreAlloca.cpp Thu Jan 21 17:07:15 2010
> @@ -406,12 +406,8 @@
>   for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() &&  
> ScanInsts;
>        --ScanInsts) {
>     --BBI;
> -    // Don't count debug info directives, lest they affect codegen,
> -    // and we skip pointer-to-pointer bitcasts, which are NOPs.
> -    // It is necessary for correctness to skip those that feed into a
> -    // llvm.dbg.declare, as these are not present when debugging is  
> off.
> -    if (isa<DbgInfoIntrinsic>(BBI) ||
> -        (isa<BitCastInst>(BBI) && isa<PointerType>(BBI- 
> >getType()))) {
> +    // Don't count debug info directives, lest they affect codegen
> +    if (isa<DbgInfoIntrinsic>(BBI)) {

i think this should stay, but the comment should remove reference to  
dbg.declare.  Pointer bitcast is still a noop.

>       ScanInsts++;
>       continue;
>     }
> @@ -475,14 +471,12 @@
>
>
>   // If this store is the last instruction in the basic block  
> (possibly
> -  // excepting debug info instructions and the pointer bitcasts  
> that feed
> -  // into them), and if the block ends with an unconditional  
> branch, try
> -  // to move it to the successor block.
> +  // excepting debug info instructions), and if the block ends with  
> an
> +  // unconditional branch, try to move it to the successor block.
>   BBI = &SI;
>   do {
>     ++BBI;
> -  } while (isa<DbgInfoIntrinsic>(BBI) ||
> -           (isa<BitCastInst>(BBI) && isa<PointerType>(BBI- 
> >getType())));
> +  } while (isa<DbgInfoIntrinsic>(BBI));
>   if (BranchInst *BI = dyn_cast<BranchInst>(BBI))
>     if (BI->isUnconditional())
>       if (SimplifyStoreAtEndOfBlock(SI))
> @@ -542,8 +536,7 @@
>   if (OtherBr->isUnconditional()) {
>     --BBI;
>     // Skip over debugging info.
> -    while (isa<DbgInfoIntrinsic>(BBI) ||
> -           (isa<BitCastInst>(BBI) && isa<PointerType>(BBI- 
> >getType()))) {
> +    while (isa<DbgInfoIntrinsic>(BBI)) {

This part of the change is still good to keep.

-Chris




More information about the llvm-commits mailing list