[LLVMdev] Unreachable code executed crash

Adarsh Yoga ayoga at umail.iu.edu
Fri May 7 02:22:48 PDT 2010


Initially, tt was not a problem with the verifier, we were just inserting a
wrong instruction in our pass. Also we were able to figure out the error you
pointed out and our pass is running as intended!!! Thanks a lot.

On Fri, May 7, 2010 at 12:02 AM, Nick Lewycky <nicholas at mxc.ca> wrote:

> Adarsh Yoga wrote:
>
>> I was able to solve that
>>
>
> What was wrong? I wasn't able to reproduce it and would still like to teach
> the verifier whatever it missed.
>
>
>  but still crashing with the same error saying
>
>> "Unreachable executed". I have attached the output with this mail.
>>
>
> This time you've got:
>
>  %1 = load i32** getelementptr inbounds ({ i32* }* @structobj, i64 0, i32
> 0)
>
> in @temp0 but @structobj is nowhere in the file, which implies that you
> created the GlobalValue but never inserted it.
>
> You can figure this out for yourself by taking the module dump (be sure to
> remove "The Module: " from the beginning) and running llvm-as on it. It
> finds these errors.
>
> Nick
>
>
>> Thanks in advance.
>>
>> On Thu, May 6, 2010 at 2:38 AM, Nick Lewycky <nicholas at mxc.ca
>> <mailto:nicholas at mxc.ca>> wrote:
>>
>>    Adarsh Yoga wrote:
>>
>>        Yes. Intially the pass was crashing when the module when the module
>>        verifier was running. I was able to solve that and now it is
>>        crashing
>>        when the bit writer pass is running.
>>
>>
>>    The output is wrong in @thread_pool_init:
>>
>>    <stdin>:44:27: error: '%4' defined with type 'i1'
>>      %5 = getelementptr i32* %4, i64 %indvar         ; <i32*> [#uses=1]
>>                              ^
>>    where
>>
>>      %4 = icmp slt i32 %threadnumber, 1              ; <i1> [#uses=2]
>>
>>    meaning that %4 is an i1 not an i32*. I'm not sure how you managed
>>    to do this, and how the verifier didn't catch it. Maybe the %4
>>    operand is actually an instruction in another function?
>>
>>    I'll try to reproduce this and fix the verifier to catch it.
>>
>>    Nick
>>
>>        On Wed, May 5, 2010 at 8:39 PM, Nick Lewycky
>>        <nlewycky at google.com <mailto:nlewycky at google.com>
>>        <mailto:nlewycky at google.com <mailto:nlewycky at google.com>>> wrote:
>>
>>            On 5 May 2010 17:12, Adarsh Yoga <ayoga at umail.iu.edu
>>        <mailto:ayoga at umail.iu.edu>
>>        <mailto:ayoga at umail.iu.edu <mailto:ayoga at umail.iu.edu>>> wrote:
>>
>>                Hi,
>>
>>                   I've written a pass that basically does some code
>>                transformations to enable parallel execution of loops.
>>        After the
>>                transformation llvm runs BitCode Writer pass , which is
>>        aborting
>>                with Unreachable Executed error.
>>                I have attached the input llvm code and the output llvm
>>        code for
>>                reference. I am stuck at this problem for a few days
>>        now. Please
>>                let me know if you are able to find anything unusual.
>>
>>
>>            Have you tried running the module verifier after your
>> transform,
>>            before writing out to bitcode?
>>
>>            Nick
>>
>>                Regards,
>>                Adarsh
>>
>>                --
>>                Adarsh Yoga
>>                Graduate Student, Computer Science
>>                Indiana University, Bloomington
>>
>>                _______________________________________________
>>                LLVM Developers mailing list
>>        LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>>        <mailto:LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>>
>>
>>
>>        http://llvm.cs.uiuc.edu
>>        http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>>
>>
>>
>>        --
>>        Adarsh Yoga
>>        Graduate Student, Computer Science
>>        Indiana University, Bloomington
>>
>>
>>
>>        _______________________________________________
>>        LLVM Developers mailing list
>>        LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>>        http://llvm.cs.uiuc.edu
>>        http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>>
>>
>>
>> --
>> Adarsh Yoga
>> Graduate Student, Computer Science
>> Indiana University, Bloomington
>>
>
>


-- 
Adarsh Yoga
Graduate Student, Computer Science
Indiana University, Bloomington
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100507/3deb26cf/attachment.html>


More information about the llvm-dev mailing list