[LLVMdev] Useless check in TailDuplication
dpatel at apple.com
Thu May 15 13:04:34 CDT 2008
On May 14, 2008, at 7:26 AM, Matthijs Kooijman wrote:
> while reading the TailDuplication pass, I found a check that looks
> TailDuplication looks at an unconditional branch instruction, BI. It
> a number of checks on the successor of this branch instruction,
> Dest. One of
> this checks is counting the number of predecessor. If this count is
> zero, Dest
> is regarded as dead and no tail duplication happens.
> However, as far as I can see, there is no way that Dest can have zero
> predecessors. By definition, it has at least one: The block
> containing BI. Is
> there a point I am missing here, or is this really a useless check?
> In particular, I'm talking about the following piece of code from
> pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
> if (PI == PE && Dest != Dest->getParent()->begin())
> return false; // It's just a dead block, ignore it...
> The attached patch removes this check. I can't find any problems
> with it, it
> causes no tests to fail.
Committed revision 51154.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the LLVMdev