Here is the error that I get: Assertion failed: (i >= FTy->getNumParams() || FTy->getParamType(i) =Params[i]->getType()) && "Calling a function with a bad signature!" Yakov On Mon, Nov 14, 2011 at 9:05 PM, Eric Christopher <echristo at apple.com>wrote:> You'll probably need to dump both the source and the dest and show the > code that's being generated. A lot of guessing here that's not getting us > very far very fast. > > -eric > > > On Nov 14, 2011, at 10:56 AM, Yakov Malinkovich wrote: > > yes - i checked that the src->getType()->isFloatTy() is true > Yakov > > > On Mon, Nov 14, 2011 at 8:24 PM, Duncan Sands <baldrick at free.fr> wrote: > >> On 14/11/11 19:20, Yakov Malinkovich wrote: >> >>> I sure that is. >>> >> >> Did you test it? Can you do: src->getType()->isFloatTy() >> >> >> What could be other reasons for such error? >> >> The only other possibility I can think of is that src was created >> using a different context. >> >> Ciao, Duncan. >> >> Yakov >>> >>> >>> On Mon, Nov 14, 2011 at 5:44 PM, Duncan Sands <baldrick at free.fr >>> <mailto:baldrick at free.fr>> wrote: >>> >>> On 14/11/11 16:39, Yakov Malinkovich wrote: >>> >>> It doesnt work it fails with assertation that cast is invalid >>> .What >>> could be done? >>> >>> >>> Maybe src doesn't have Float type? >>> >>> Ciao, Duncan. >>> >>> >>> >>> >>> On 11/14/11, Duncan Sands<baldrick at free.fr <mailto: >>> baldrick at free.fr>> >>> >>> wrote: >>> >>> Hi Yakov, that looks correct to me. You can also use >>> CreateFPExt >>> which is >>> slightly simpler. >>> >>> Ciao, Duncan. >>> >>> >>> I want to transfer value (Value* src) of the type >>> `FloatTyID` to >>> `DoubleTyID`(I >>> need all floats to be saved as 8 bytes).I have tried: >>> >>> builder.CreateCast(llvm:: Instruction::FPExt, src, >>> llvm::Type::getDoubleTy( llvmContext),””) >>> >>> >>> I don`t know if I use CreateCast correctly and if this >>> approach is >>> correct at all. >>> >>> Thank you. >>> >>> Yakov >>> >>> >>> >>> ______________________________ _________________ >>> 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 >>> <http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> > >>> >>> >>> ______________________________ _________________ >>> 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 >>> <http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> > >>> >>> >>> >>> >>> >>> >> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111114/1880e473/attachment.html>
On 14/11/11 21:11, Yakov Malinkovich wrote:> Here is the error that I get: > Assertion failed: (i >= FTy->getNumParams() || FTy->getParamType(i) => Params[i]->getType()) && "Calling a function with a bad signature!"That's not being generated by the CreateCast, so it looks like your description of the problem was quite misleading. Ciao, Duncan.> Yakov > > > On Mon, Nov 14, 2011 at 9:05 PM, Eric Christopher <echristo at apple.com > <mailto:echristo at apple.com>> wrote: > > You'll probably need to dump both the source and the dest and show the code > that's being generated. A lot of guessing here that's not getting us very > far very fast. > > -eric > > > On Nov 14, 2011, at 10:56 AM, Yakov Malinkovich wrote: > >> yes - i checked that the src->getType()->isFloatTy() is true >> Yakov >> >> >> On Mon, Nov 14, 2011 at 8:24 PM, Duncan Sands <baldrick at free.fr >> <mailto:baldrick at free.fr>> wrote: >> >> On 14/11/11 19:20, Yakov Malinkovich wrote: >> >> I sure that is. >> >> >> Did you test it? Can you do: src->getType()->isFloatTy() >> >> >> What could be other reasons for such error? >> >> The only other possibility I can think of is that src was created >> using a different context. >> >> Ciao, Duncan. >> >> Yakov >> >> >> On Mon, Nov 14, 2011 at 5:44 PM, Duncan Sands <baldrick at free.fr >> <mailto:baldrick at free.fr> >> <mailto:baldrick at free.fr <mailto:baldrick at free.fr>>> wrote: >> >> On 14/11/11 16:39, Yakov Malinkovich wrote: >> >> It doesnt work it fails with assertation that cast is >> invalid .What >> could be done? >> >> >> Maybe src doesn't have Float type? >> >> Ciao, Duncan. >> >> >> >> >> On 11/14/11, Duncan Sands<baldrick at free.fr >> <mailto:baldrick at free.fr> <mailto:baldrick at free.fr >> <mailto:baldrick at free.fr>>> >> >> wrote: >> >> Hi Yakov, that looks correct to me. You can also use >> CreateFPExt >> which is >> slightly simpler. >> >> Ciao, Duncan. >> >> >> I want to transfer value (Value* src) of the type >> `FloatTyID` to >> `DoubleTyID`(I >> need all floats to be saved as 8 bytes).I have tried: >> >> builder.CreateCast(llvm:: Instruction::FPExt, >> src, >> llvm::Type::getDoubleTy( llvmContext),””) >> >> >> I don`t know if I use CreateCast correctly and if >> this approach is >> correct at all. >> >> Thank you. >> >> Yakov >> >> >> >> ______________________________ _________________ >> 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://llvm.cs.uiuc.edu/> >> http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >> <http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >> <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>> >> >> >> ______________________________ _________________ >> 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://llvm.cs.uiuc.edu/> >> http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >> <http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >> <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>> >> >> >> >> >> >> >> >> _______________________________________________ >> 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 > >
So what do you think the problem is? Thank you. Yakov On Mon, Nov 14, 2011 at 10:20 PM, Duncan Sands <baldrick at free.fr> wrote:> On 14/11/11 21:11, Yakov Malinkovich wrote: > >> Here is the error that I get: >> Assertion failed: (i >= FTy->getNumParams() || FTy->getParamType(i) =>> Params[i]->getType()) && "Calling a function with a bad signature!" >> > > That's not being generated by the CreateCast, so it looks like your > description > of the problem was quite misleading. > > Ciao, Duncan. > > Yakov >> >> >> On Mon, Nov 14, 2011 at 9:05 PM, Eric Christopher <echristo at apple.com >> <mailto:echristo at apple.com>> wrote: >> >> You'll probably need to dump both the source and the dest and show the >> code >> that's being generated. A lot of guessing here that's not getting us >> very >> far very fast. >> >> -eric >> >> >> On Nov 14, 2011, at 10:56 AM, Yakov Malinkovich wrote: >> >> yes - i checked that the src->getType()->isFloatTy() is true >>> Yakov >>> >>> >>> On Mon, Nov 14, 2011 at 8:24 PM, Duncan Sands <baldrick at free.fr >>> <mailto:baldrick at free.fr>> wrote: >>> >>> On 14/11/11 19:20, Yakov Malinkovich wrote: >>> >>> I sure that is. >>> >>> >>> Did you test it? Can you do: src->getType()->isFloatTy() >>> >>> >>> What could be other reasons for such error? >>> >>> The only other possibility I can think of is that src was created >>> using a different context. >>> >>> Ciao, Duncan. >>> >>> Yakov >>> >>> >>> On Mon, Nov 14, 2011 at 5:44 PM, Duncan Sands < >>> baldrick at free.fr >>> <mailto:baldrick at free.fr> >>> <mailto:baldrick at free.fr <mailto:baldrick at free.fr>>> wrote: >>> >>> On 14/11/11 16:39, Yakov Malinkovich wrote: >>> >>> It doesnt work it fails with assertation that cast is >>> invalid .What >>> could be done? >>> >>> >>> Maybe src doesn't have Float type? >>> >>> Ciao, Duncan. >>> >>> >>> >>> >>> On 11/14/11, Duncan Sands<baldrick at free.fr >>> <mailto:baldrick at free.fr> <mailto:baldrick at free.fr >>> >>> <mailto:baldrick at free.fr>>> >>> >>> wrote: >>> >>> Hi Yakov, that looks correct to me. You can also >>> use >>> CreateFPExt >>> which is >>> slightly simpler. >>> >>> Ciao, Duncan. >>> >>> >>> I want to transfer value (Value* src) of the >>> type >>> `FloatTyID` to >>> `DoubleTyID`(I >>> need all floats to be saved as 8 bytes).I have >>> tried: >>> >>> builder.CreateCast(llvm:: >>> Instruction::FPExt, >>> src, >>> llvm::Type::getDoubleTy( llvmContext),””) >>> >>> >>> I don`t know if I use CreateCast correctly >>> and if >>> this approach is >>> correct at all. >>> >>> Thank you. >>> >>> Yakov >>> >>> >>> >>> ______________________________ >>> _________________ >>> 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://llvm.cs.uiuc.edu/> >>> http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >>> >>> <http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >>> <http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> >> >>> >>> >>> ______________________________ _________________ >>> 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://llvm.cs.uiuc.edu/> >>> http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >>> >>> <http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev >>> <http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> >> >>> >>> >>> >>> >>> >>> >>> >>> ______________________________**_________________ >>> 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<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >>> >> >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111114/ceba0d22/attachment.html>