search for: getvectorelements

Displaying 4 results from an estimated 4 matches for "getvectorelements".

2009 Apr 01
1
[LLVMdev] Mutating the elements of a ConstantArray
Thanks, Just one question more: why does Constant::getVectorElements() operate on a SmallVector<T>, while ConstantArray::get() operate on a std::vector<T> ? What is the distinction between these uses? Thanks! Nick On Tue, Mar 31, 2009 at 7:49 PM, Chris Lattner <clattner at apple.com> wrote: > > On Mar 31, 2009, at 4:42 PM, Nick Johnson wr...
2012 Apr 12
0
[LLVMdev] detection of constant diagonal matrix * vector
...c void getIntVector(Value* value, SmallVector<int, 8>& values) { if (llvm::ConstantVector* constantVector = llvm::dyn_cast<llvm::ConstantVector>(value)) { // get components llvm::SmallVector<llvm::Constant*, 8> elements; constantVector->getVectorElements(elements); int numElements = int(elements.size()); for (int i = 0; i < numElements; ++i) { if (llvm::ConstantInt* element = llvm::dyn_cast<llvm::ConstantInt>(elements[i])) values[i] = int(element->getZExtValue()); }...
2009 Mar 31
2
[LLVMdev] Mutating the elements of a ConstantArray
Hello, I need to append something to the global "llvm.global_ctors". This variable may or may not already be declared within the current module. If I lookup the global variable, I see that it supports a getOperand(i) and setOperand(i,c), but does not support any way that I can enlarge that array to add a new record. Any suggestions? -- Nick Johnson
2009 Mar 31
0
[LLVMdev] Mutating the elements of a ConstantArray
On Mar 31, 2009, at 4:42 PM, Nick Johnson wrote: > Hello, > > I need to append something to the global "llvm.global_ctors". This > variable may or may not already be declared within the current module. > > If I lookup the global variable, I see that it supports a > getOperand(i) and setOperand(i,c), but does not support any way that I > can enlarge that array to