similar to: [LLVMdev] Accessing constant indexes in GetElementPtr

Displaying 20 results from an estimated 800 matches similar to: "[LLVMdev] Accessing constant indexes in GetElementPtr"

2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
> Also sprach Wojciech Stryjewski: > } Ok. Let's say I have a GetElementPtrInst that is used to access > structure > } elements. In this case the indexes will be constants and I want > to get the > } constant values as an a native C int. > } > } Now I can iterate over all the indexes with idx_begin(). I can cast > } all of the indexes to a ConstantIntegral. However,
2002 Sep 23
0
[LLVMdev] Accessing constant indexes in GetElementPtr
Also sprach Wojciech Stryjewski: } Ok. Let's say I have a GetElementPtrInst that is used to access structure } elements. In this case the indexes will be constants and I want to get the } constant values as an a native C int. } } Now I can iterate over all the indexes with idx_begin(). I can cast } all of the indexes to a ConstantIntegral. However, I cannot cast the } indexes to a
2002 Sep 25
3
[LLVMdev] question about GetElementPtr Instruction
I have a question about GetElementPtr. Suppose I have an GetElementPtr Instruction GI: %reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint 5, uint 13 I want to check if this is the reference of a component of a structure, how can I do that? Should I check which operand of this instruction is 'ubyte' type? How can I do that in code? should I use ubyte *a =
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 );
2004 Jun 17
2
[LLVMdev] ConstantInt::getRawValue
Is there are reason why ConstantInt::getRawValue method can't be moved one step into class hierarchy, into ConstantIntegral::getRawValue The reason I'd like this is that to handle both ConstantInt and ConstantBool, I need the following: if (ConstantInt* CI = dyn_cast<ConstantInt>(V)) { BuildMI(*MBB, IPt, NM::MOVE, 1, Reg).addImm(CI->getRawValue()); } if
2006 Nov 15
3
[LLVMdev] 1.9 Prerelease Available for Testing
> When building LLVM 1.9 on OSX 10.4.8, I get (after a while, see attachment): > > make[1]: *** No rule to make target `/path/to/llvm-build/Debug/bin/tblgen', > needed by `/path/to/llvm-build/lib/VMCore/Debug/Intrinsics.gen.tmp'. Stop. > make: *** [install] Error 1 > > when doing: > > $LLVM_SRC/configure --prefix=$LLVM_INSTALL --with-llvmgccdir=$LLVM_FRONT
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote: >>> The instructions seem to have one path wrong. It says to get: >> >> I'll put together a tarball today. That will be easier than dealing with >> a patch, and it will include a bunch of bugfixes since the previous email. > Further into process, I get this error: > In file included from
2004 Jun 17
0
[LLVMdev] ConstantInt::getRawValue
On Thu, 17 Jun 2004, Vladimir Prus wrote: > Is there are reason why ConstantInt::getRawValue method can't be moved one > step into class hierarchy, into ConstantIntegral::getRawValue > > The reason I'd like this is that to handle both ConstantInt and ConstantBool, > I need the following: > > if (ConstantInt* CI = dyn_cast<ConstantInt>(V)) { >
2002 Sep 17
1
[LLVMdev] Compile error in InstrSelectionSupport.cpp
ISSUE: line 474 of InstrSelectionSupport.cpp is a conditional expression of the form (<expr> ? (ConstantSInt*) : (ConstantUInt*)), which is an unholy mixture of pointer types. ACTION: Apply static_cast<Value*> to the two pointers, as the source intends. -- Casey Carter Casey at Carter.net ccarter at uiuc.edu AIM: cartec69 -------------- next part -------------- An embedded and
2006 Nov 15
0
[LLVMdev] 1.9 Prerelease Available for Testing
Hi, Op 15-nov-06, om 03:26 heeft Tanya M. Lattner het volgende geschreven: > I'm able to reproduce this if I skip doing a "make" and directly do a > "make install" after configuring. I believe we require people to do > a full > build before attempting to install. So I don't think its really a bug. > Could you try doing a make first and then install?
2004 Jul 14
1
[LLVMdev] Constants.cpp:368: error: `INT8_MAX' undeclared (first use this function)
Hi By manipulating a #define for G++ I've managed to compile int64_t type with ostream. Now, I'm stopped by some to me unknown constants: ----------------------------------- Compiling Constants.cpp Constants.cpp: In static member function `static bool llvm::ConstantSInt::isValueValidForType(const llvm::Type*, long long int)': Constants.cpp:368: error: `INT8_MAX' undeclared
2014 Nov 22
2
[LLVMdev] How to get the indices in an getelementptr Value?
Hi Michael, Thank you very much. But idx_begin/idx_end iterators can only be used through a getelementptr instruction, right? However, I think value "i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32 2)" itself is not a getelementptr instruction, so? Or could you tell me how can I get a getelementptr instruction first from this value?
2014 Nov 22
2
[LLVMdev] How to get the indices in an getelementptr Value?
Hi, all I am a LLVM user. I want to get every element in the next instruction: %0 = load i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32 2), align 4, !dbg !85, !clap !86 Now I can only get value "i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32 2)" through "getOperand(0)", but I can not get "%struct.Args* @globalArg", "i64
2014 Nov 22
3
[LLVMdev] How to get the indices in an getelementptr Value?
On Sat, Nov 22, 2014 at 11:09 AM, Sanjoy Das <sanjoy at playingwithpointers.com > wrote: > Hi Qiuping, > > If I'm reading the IR correctly, what you have is a > GetElementPtrConstantExpr [1]. It subclasses from llvm::Constant. > If you want the same code to handle GetElementPtrConstantExpr *and* GetElementPtrInst, you can use GEPOperator. > > Thanks, > --
2005 Mar 16
1
[LLVMdev] Dynamic Creation of a simple program
Hi, Given these C instructions: ============================== struct stru { struct stru *Next; }; struct list *NewStru = malloc ( sizeof ( struct stru ) ); struct list *tmp.3; ... tmp.3 = NewStru->Next; ============================== LLVM generates something like this: %tmp.0 = malloc %struct.stru ; <%struct.stru*> %tmp.3 = getelementptr %struct.stru* %tmp.0, int 0, uint 1 ;
2004 Apr 05
1
[LLVMdev] Two important changes to the getelementptr instruction
On Sun, 4 Apr 2004, Reid Spencer wrote: > Congrats on getting this taken care of finally. I know its something > you've wanted to do since 1.0. It certainly has been on the grand TODO list for a long time :) > I have one question. How does LLVM disambiguate between a uint used for > a structure and a uint used for an array? It depends on the operand number of the
2004 Jun 19
1
[LLVMdev] ConstantInt::getRawValue
Chris Lattner wrote: > > If getRawValue is moved to ConstantIntegral, I'd simply write > > > > if (ConstantIntegral* CI = dyn_cast<ConstantInt>(V)) { > > BuildMI(*MBB, IPt, NM::MOVE, 1, Reg).addImm(CI->getRawValue()); > > } ... > > > > which is a bit nicer. Of course, if you think it's a good idea, I can > > send a patch.
2006 May 01
2
[LLVMdev] printf decleration
I am writing a pass where I need to make a function deceleration for printf. Below is the code I'm trying to use. ----- bool MyPass::runOnModule(Module &m) { vector<const Type*> args; args.push_back(PointerType::get(Type::SByteTy)); Function* f = m.getOrInsertFunction("printf", FunctionType::get(Type::IntTy, args, true)); ----- When I insert a call
2005 Apr 11
2
[LLVMdev] JIT and array pointers
On Sun, 2005-04-10 at 19:47 -0500, Chris Lattner wrote: > On Mon, 11 Apr 2005, Paul wrote: > > I'm trying to pass an array pointer to my run-time generated module, and > > after a long time of searching for the answer, the only thing I got was > > a headache. Basically I have a few arrays (few megabytes which will > > sometimes be accessed as 8 / 16 / 32 / 64 bit
2004 Apr 04
0
[LLVMdev] Two important changes to the getelementptr instruction
Hi Chris, Congrats on getting this taken care of finally. I know its something you've wanted to do since 1.0. I have one question. How does LLVM disambiguate between a uint used for a structure and a uint used for an array? My assumption is that LLVM is aware of the type of the thing being indexed all the way through the dereference so it doesn't really matter what index type is being