similar to: [LLVMdev] Cast error

Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] Cast error"

2012 Feb 24
0
[LLVMdev] Intrinsic annotation doesn't work with C++ files
Hello again, I really need to know how to make llvm understand the annotate in C++ code or to write a new Intrinsic by myself. I tried to add a new Intrinsic corresponding to the ExtendingLLVM doc instructions, but it is too opaque and I faild. Please, advise me if you can. Sincerely, Hripsime. On Wed, Feb 22, 2012 at 6:35 PM, Hripsime Matevosyan <hripsime.m at gmail.com>wrote: > Hi
2012 Feb 22
2
[LLVMdev] Intrinsic annotation doesn't work with C++ files
Hi all, I need to use annotate inside the C++ code and want to know why doesn't it work? How can I modify my sources to use annotate inside the C++ code too? Thanks in advance. Sincerely, Hripsime. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120222/21e75ec8/attachment.html>
2019 Mar 09
2
Cast a function parameter to GEP
Hi all, I'm still working on the Interpreter class and I would like to understand why an operand cannot be cast to GetElementPtrInst. My code is something like: void MyInterpreter::visitCallInst(CallInst& I) { for(int i = 0; i < I.getNumArgOperands(); i++) { operand = I.getOperand(i); if(GetElementPtrInst* CI = dyn_cast<GetElementPtrInst>(operand)) {
2012 Feb 15
2
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
Just want to test out the LLVM's AliasAnalysis::getModRefInfo API. The input C code is very simple: void foo(int *a, int *b) { for(int i=0; i<10; i++) b[i] = a[i]*a[i]; } int main() { int a[10]; int b[10]; for(int i=0; i<10; i++) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array
2016 Aug 31
2
Check if getElementPtr Operand
Thanks Ryan, I'm able to retrieved the type using the following code: Type *type=getElementPtrInst->getSourceElementType(); On Fri, Aug 12, 2016 at 7:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > Take a look at visitGetElementPtrInst in InstructionCombining.cpp for some > examples about how to iterate over GEP and check for type. > >
2008 Apr 12
0
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Duncan Sands wrote: > + GetElementPtrInst *CreateStructGEP(Value *Ptr, unsigned Idx, > + const char *Name = "") { > + llvm::Value *Idxs[] = { > + ConstantInt::get(llvm::Type::Int32Ty, 0), > + ConstantInt::get(llvm::Type::Int32Ty, Idx) > + }; > + return Insert(GetElementPtrInst::Create(Ptr, Idxs, Idxs+2, Name));
2013 Feb 02
0
[LLVMdev] Join my network on LinkedIn
LinkedIn ------------ Hripsime Matevosyan requested to add you as a connection on LinkedIn: ------------------------------------------ Jian, I'd like to add you to my professional network on LinkedIn. - Hripsime Accept invitation from Hripsime Matevosyan
2012 Feb 16
0
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
Something must be wrong, more probable on my side. So the C source code is unchanged, I just did another experiment to first extract all the GEPs in the code, and call AliasAnalysis::alias on each pair of GEPs. Here is the code: AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); TargetData &TD = getAnalysis<TargetData>(); for (Module::iterator it = M.begin();
2008 Apr 11
4
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Hi Dominic, +//===-- llvm/Support/IRBuilder.h - Builder for LLVM Instrs -----*- C++ -*-===// is this line the right length? It seems shorter than the similar lines below like this one: +//===----------------------------------------------------------------------===// + GetElementPtrInst *CreateStructGEP(Value *Ptr, unsigned Idx, + const char *Name =
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha, Thanks for your answer I was doing this: ======================== BasicBlock *BBlock = new BasicBlock("entry", MyFunc); ... Value *Zero = ConstantSInt::get(Type::IntTy, 0); Value *UZero = ConstantUInt::get(Type::UIntTy, 0); MallocInst* mi = new MallocInst( STyStru ); mi->setName("tmp.0"); BBlock->getInstList().push_back( mi );
2016 Aug 12
2
Check if getElementPtr Operand
Hello, consider the following IR code : %count4 = getelementptr inbounds %struct.r32, %struct.r32* %cur.087, i64 0, i32 4 How to check in the instruction, whether the operand is a structure or not if(isa<GetElementPtrInst>(instruction)) { GetElementPtrInst *getElementPtrInst=dyn_cast<GetElementPtrInst>(&instruction); //check if getElemetPtrInst operands structure or array. }
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =
2008 Jul 21
2
[LLVMdev] Casting between address spaces and address space semantics
Hi all, > If I read the standard correctly, the properties of these address spaces can > be fully captured by defining the relationship between every pair of address > spaces (disjoint, identical, subset/superset). > > I think it would make sense to make these relationships backend/platform > specific, but for clang and the optimization passes to properly work with > address
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
On 1/21/2011 10:46 PM, Surinder wrote: > John, > > I have looked at the SAFECode and thought following sould work > > if (isa<Constant>(I.getOperand(0))) > { Out<< "*** operand 0 is a constant ******"; > if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) > { Out<<
2019 Mar 09
2
Cast a function parameter to GEP
Thanks Tim, I'll try to solve my problem ASAP, if I cannot maybe I'll some other clarifications. Thanks again On Sat, Mar 9, 2019, 06:03 Tim Northover <t.p.northover at gmail.com> wrote: > Hi Alberto, > > On Sat, 9 Mar 2019 at 05:50, Alberto Barbaro via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > i8* getelementptr inbounds ([7 x i8], [7 x i8]*
2005 Feb 02
1
[LLVMdev] RE: Question about Global Variable
Thanks for your reply. After I change Cstr to gI, it compiled successfully. Thanks again. Another question is for constructing getelementpt. // C code char gStrA[10] = "test str"; // here is Global variable,gStrA and initializer "test str" char gStrB[10]= "test str2"; main(){ int = i; char *pGVars[20]; // here, the pGVar is for storing the address of each
2008 Jul 23
0
[LLVMdev] GEP::getIndexValid() with other iterators
Hi Chris, > What flavor of iterators do you want to pass in? vector or > smallvector? If so, a pointer to the first element + extents is fine. I was passing a std::vector in. And you are quite right, first element + size works like a charm. Since I am using a vector of uint64_t's instead of Value*, I did need to add an extra version of getIndexedType(), taking a uint64_t* instead
2012 Jan 22
2
[LLVMdev] CreateGlobalStringPtr giving linker errors
Hi, I am trying to use some LLVM API in my C++ code, and I end up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for the compile. It is the CreateGlobalStringPtr which is throwing the error. This is LLVM 3.0. Here's the codeI am trying to use some LLVM API in my C++ code, and I end up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for the compile. It
2009 Apr 30
2
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
Hmm... if I do a print() on the result of getFileName(), I get i8 * getelementptr ([9 x i8]* @.str, i32 0, i32 0) back, but if I try to dyn_cast this to GetElementPtrInst it fails (returning null), so presumably I'm seeing a GetElementPtrConstantExpr... so how can I get at that constant i8 array without casting to a GetElementPtrInst, and with GetElementPtrConstantExpr being
2010 May 05
2
[LLVMdev] How to cast an integer array to an integer pointer? (user question)
I am new to LLVM and couldn't find any llvm-user list, so I am posting my user question here, sorry. I am trying to create a simple "puts" call accepting the static string, with the code below. The last line (CallInst::Create) fails with an assert: "Calling a function with a bad signature!" Because the type of function is void(u8*) and the argument supplied is: