Hi I use the IRBuilder to invoke the createload API to try to create load instructions. However, I come across the below assert exception: clang-4.0: /home/jmh/Downloads/llvm-4/llvm/lib/IR/Instructions.cpp:1355: llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const char*, bool, llvm::Instruction*): Assertion `Ty =cast<PointerType>(Ptr->getType())->getElementType()' failed. Does anyone have the same experience? Many Thanks Regards Muhui -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180915/765132d4/attachment.html>
Seems like the pointer you are loading from isn’t a correct pointer. Try print out the types of the values you passed into CreateLoad and see how that goes Zhang> 在 2018年9月14日,17:21,Muhui Jiang via llvm-dev <llvm-dev at lists.llvm.org> 写道: > > Hi > > I use the IRBuilder to invoke the createload API to try to create load instructions. > > However, I come across the below assert exception: > > clang-4.0: /home/jmh/Downloads/llvm-4/llvm/lib/IR/Instructions.cpp:1355: llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const char*, bool, llvm::Instruction*): Assertion `Ty == cast<PointerType>(Ptr->getType())->getElementType()' failed. > > Does anyone have the same experience? Many Thanks > > Regards > Muhui > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev