Displaying 16 results from an estimated 16 matches for "idx_begin".
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...
2014 Nov 22
3
[LLVMdev] How to get the indices in an getelementptr Value?
...Thanks,
> -- Sanjoy
>
> [1]:
> http://llvm.org/docs/doxygen/html/classllvm_1_1GetElementPtrConstantExpr.html
>
> On Sat, Nov 22, 2014 at 1:10 AM, Qiuping Yi <yiqiuping at gmail.com> wrote:
> > 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 ge...
2002 Sep 22
2
[LLVMdev] Accessing constant indexes in GetElementPtr
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 ConstantSInt or ConstantUInt (cast<> throws an assertion) and
these two classes are the ones that have the getValue() method I need.
Am I missing something here?
Wojciech
2012 Apr 23
0
[LLVMdev] SIV tests in LoopDependence Analysis, Sanjoy's patch
...op collects
pairs of subscripts from the source and destination refs.
* // Collect GEP operand pairs (FIXME: use GetGEPOperands from BasicAA),
adding*
* // trailing zeroes to the smaller GEP, if needed.*
* GEPOpdsTy destOpds, srcOpds;*
* for(GEPOperator::const_op_iterator destIdx = destGEP->idx_begin(),*
* destEnd = destGEP->idx_end(),*
* srcIdx = srcGEP->idx_begin(),*
* srcEnd = srcGEP->idx_end();*
* destIdx != destEnd && srcIdx != srcEnd;*
* destIdx += (destId...
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
2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
...ojciech 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 ConstantSInt or ConstantUInt (cast<> throws an
> assertion) and
> } these two classes are the ones that have the getValue() method I need.
> }
> } Am I missing something h...
2012 Apr 12
6
[LLVMdev] SIV tests in LoopDependence Analysis, Sanjoy's patch
Hi,
Here is a preliminary (monolithic) version you can comment on. This
is still buggy, however, and I'll be testing for and fixing bugs over
the next few days. I've used your version of the strong siv test.
Thanks!
--
Sanjoy Das.
http://playingwithpointers.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
2008 Jul 23
0
[LLVMdev] GEP::getIndexValid() with other iterators
...Value* const *Idx, unsigned NumIdx);
+
+ static const Type *getIndexedType(const Type *Ptr,
+ uint64_t const *Idx, unsigned NumIdx);
+
static const Type *getIndexedType(const Type *Ptr, Value *Idx);
inline op_iterator idx_begin() { return op_begin()+1; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080723/deee3d06/attachment.sig&g...
2008 Jul 23
2
[LLVMdev] GEP::getIndexValid() with other iterators
On Jul 22, 2008, at 11:54 PM, Matthijs Kooijman wrote:
> Hi Chris,
>
>
>> I'd prefer to not turn this into a template. Why not just define a
>> version that takes an array of uint64_t's or something like that?
> because I want to be able to pass in iterators. I could define a
> version that
> takes std<uint64_t>::iterators, but next thing we know, we
2013 Aug 25
1
[LLVMdev] Puzzles on DenseMap
I wrote some program using DensMap like this:
===============================
SmallDenseMap<Value*, StringRef, 4> OpResult;
Value *VP = GEP->getPointerOperand();
OpResult[VP] = parseVariable(VP);
for(User::op_iterator sId = GEP->idx_begin(), eId = GEP->idx_end(); sId
!= eId; ++sId) {
Value *VI = *sId;
if(dyn_cast<ConstantInt>(*sId)) OpResult[VI] = parseConstant(VI);
else OpResult[VI] = parseVariable(VI);
}
....
===============================
When I visit OpResult like this:
==================...
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 ConstantSInt or ConstantUInt (cast<> throws an assertion) and
} these two classes are the ones that have the getValue() method I need.
}
} Am I missing something here?
}
I'm not quite sur...
2008 Jul 21
2
[LLVMdev] Casting between address spaces and address space semantics
...GetElementPtrInst *GEP = NULL;
+ // Create a new instruction
+ if (isa<StoreInst>(*I))
+ NewInst = new StoreInst(I->getOperand(0), NewVal);
+ else if ((GEP = dyn_cast<GetElementPtrInst>(*I))) {
+ // Insert a new GEP
+ std::vector<Value*> Indices(GEP->idx_begin(), GEP->idx_end());
+ NewInst = GetElementPtrInst::Create(NewVal, Indices.begin(), Indices.end());
+ } else // Must be LoadInst
+ NewInst = new LoadInst(NewVal);
+
+ // Replace the old instruction
+ InsertNewInstBefore(NewInst, *OldInst);
+ NewInst->takeName(OldInst)...
2012 May 04
3
[LLVMdev] Extending GetElementPointer, or Premature Linearization Considered Harmful
...errs() << *inst << "\n";*
* if (StoreInst *SI = dyn_cast<StoreInst>(inst)) {*
* Value *operand = SI->getPointerOperand();*
* if (const GEPOperator *GEP = dyn_cast<GEPOperator>(operand)) {*
* for (GEPOperator::const_op_iterator idx = GEP->idx_begin(),*
* end = GEP->idx_end();*
* idx != end;** idx += 1) {*
* const SCEV *scev = SE->getSCEV(*idx);*
* errs() << *scev << "\n";*
* }*
* }*
* }*
* }*
* return false;*
}
Basically, it...
2008 Jul 21
0
[LLVMdev] Casting between address spaces and address space semantics
...;
> + // Create a new instruction
> + if (isa<StoreInst>(*I))
> + NewInst = new StoreInst(I->getOperand(0), NewVal);
> + else if ((GEP = dyn_cast<GetElementPtrInst>(*I))) {
> + // Insert a new GEP
> + std::vector<Value*> Indices(GEP->idx_begin(), GEP->idx_end());
> + NewInst = GetElementPtrInst::Create(NewVal, Indices.begin(),
> Indices.end());
> + } else // Must be LoadInst
> + NewInst = new LoadInst(NewVal);
> +
> + // Replace the old instruction
> + InsertNewInstBefore(NewInst, *OldInst);
&...
2008 Jul 18
0
[LLVMdev] Casting between address spaces and address space semantics
Hi Eli, Mon Ping,
> In ISO/IEC WG14 n1169 on the C extensions to support embedded
> processors, any two address spaces must be disjoint, must be
> equivalent, or must be nested.
Ah, that standard is a lot clearer on this subject than the DSP-C one I read
was.
> As Eli indicated, the actual relationship is platform specific depending on
> what makes the most sense for
2008 Jul 17
4
[LLVMdev] Casting between address spaces and address space semantics
In ISO/IEC WG14 n1169 on the C extensions to support embedded
processors, any two address spaces must be disjoint, must be
equivalent, or must be nested. As Eli indicated, the actual
relationship is platform specific depending on what makes the most
sense for your hardware and how the program will behave will depend on
that relationship.
-- Mon Ping
On Jul 17, 2008, at 7:25 AM, Eli