On Thu, Feb 13, 2014 at 1:04 PM, Alon Zakai <notifications@github.com>wrote:

> In lib/Transforms/NaCl/ExpandI64.cpp:
>
> > @@ -1031,6 +1032,11 @@ bool ExpandI64::runOnModule(Module &M) {
> >        Instruction *D = Dead.pop_back_val();
> >        D->eraseFromParent();
> >      }
> > +
> > +    // We only visited blocks found by a DFS walk from the entry, so we haven't
> > +    // visited any unreachable blocks, and they may still contain illegal
> > +    // instructions at this point. Being unreachable, they can simply be deleted.
> > +    removeUnreachableBlocks(*Func);
>
> Could we perhaps do this only if !Dead.empty(), that is, if something was
> legalized? That would avoid calling it on functions which were not modified
> at all, which is probably most of them.
>
No, this is removing blocks that we didn't see during the walk; they could
contain illegal instructions even if we don't do anything in the blocks
that we do see.

Dan