[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' faile

bhavani krishnan bhavi63 at yahoo.com
Sun Nov 16 22:09:57 PST 2008


ok.. you are right. I had not inserted the AllocaInst in the function. Thanks a lot for solving my problem yet again :)

--- On Mon, 11/17/08, Eli Friedman <eli.friedman at gmail.com> wrote:

> From: Eli Friedman <eli.friedman at gmail.com>
> Subject: Re: Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' faile
> To: bhavi63 at yahoo.com
> Date: Monday, November 17, 2008, 6:04 AM
> On Sun, Nov 16, 2008 at 9:53 PM, bhavani krishnan
> <bhavi63 at yahoo.com> wrote:
> > Ah! I get it now.. thanks a lot Eli!
> >
> > I changed it to
> BitCastInst(AI,VoidPtrTy,"",j);
> >
> > And now I am getting the following error. I have been
> stuck with this error before also. I know I am missing out
> something silly. Please let me know how to fix it.
> >
> >
> /home/bhavani/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1130:
> llvm::SDOperand llvm::SelectionDAGLowering::getValue(const
> llvm::Value*): Assertion `InReg && "Value not
> in map!"' failed.
> >
> > Appreciate any help!
> 
> My guess is that you're somehow creating an instruction
> without
> inserting it into the function.
> 
> Using IRBuilder (some details in
> http://llvm.org/docs/tutorial/JITTutorial1.html) makes it
> more
> difficult to make errors like that.
> 
> -Eli


      



More information about the llvm-dev mailing list