[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev

Daniel Berlin dberlin at dberlin.org
Wed Feb 25 07:58:01 PST 2015


On Wed, Feb 25, 2015 at 6:26 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> > Maybe.
> > My view is the ideal is either no-unreachable code, or unreachable blocks
> > only contain terminators.
>
> I am definitely happy with both. What worries me is introducing a
> special dominance rule for unreachable blocks.
>
> >> I don't think that rejecting
> >>
> >>   %a = getelementptr inbounds i8* %a, i64 1
> >>
> >> but accepting
> >>
> >>   %a = getelementptr inbounds i8* %b, i64 1
> >>   %b = getelementptr inbounds i8* %a, i64 1
> >>
> >
> > Does the verifier accept the latter right now?
>
> Yes. %a dominates %b and %b dominates %a, so it is valid.
>
>
So i'm confused.

How does %b dominate %a?

The use of %b in  %a is use-before-def

Even if the block dominates itself, definitions would still have to locally
dominate (IE appear before) the use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150225/e801ea3e/attachment.html>


More information about the llvm-dev mailing list