[llvm-commits] [llvm] r132805 - /llvm/trunk/lib/CodeGen/TailDuplication.cpp

Bob Wilson bob.wilson at apple.com
Fri Jun 10 13:48:46 PDT 2011


I'd really like to see a testcase for this, because I can't figure out how this could matter.

We explicitly rule out tail-duplication for single-block loops, i.e., when the tail block is its own successor.  You're checking here to exclude a PHI that uses a register defined in the same basic block, but wouldn't that always fail the single-block loop check?

On Jun 9, 2011, at 1:55 PM, Rafael Espindola wrote:

> Author: rafael
> Date: Thu Jun  9 15:55:41 2011
> New Revision: 132805
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=132805&view=rev
> Log:
> A PHI in this basic block is a use in another basic block.
> 
> Modified:
>    llvm/trunk/lib/CodeGen/TailDuplication.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=132805&r1=132804&r2=132805&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original)
> +++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Thu Jun  9 15:55:41 2011
> @@ -239,7 +239,7 @@
>             MachineOperand &UseMO = UI.getOperand();
>             MachineInstr *UseMI = &*UI;
>             ++UI;
> -            if (UseMI->getParent() == DefBB)
> +            if (UseMI->getParent() == DefBB && !UseMI->isPHI())
>               continue;
>             SSAUpdate.RewriteUse(UseMO);
>           }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list