Displaying 6 results from an estimated 6 matches for "emptyvec".
2015 Apr 16
3
[LLVMdev] double* to <2 x double>*
...rrayidx1 to <2 x double>*
%2 = load <2 x double>* %1, align 4
what I right now doing is:
*Assume pInst is *%1 = load double* %arrayidx1, align 4, !tbaa !0
Value *loadValue = pInst->getOperand(0);
Type *vecTy = VectorType::get(Type::getDoublePtrTy(currF->getContext()), 2);
Value *emptyVec = UndefValue::get(vecTy);
Type* u32Ty = Type::getInt32Ty(currF->getContext());
Value *index0 = ConstantInt::get(u32Ty, 0);
Value *index1 = ConstantInt::get(u32Ty, 1);
Instruction *InsertVal = InsertElementInst::Create(emptyVec, loadValue,
index0, "");
InsertVal = InsertElementInst::...
2015 Apr 17
2
[LLVMdev] how to use "new instruction()"
...still only get the constant value not the
instruction. Could you please go over the following instruction and see
what wrong with it? Thanks for your time again.
Value *vecVal = NULL;
IRBuilder<> builder(&*pInst);
Type *vecTy = VectorType::get(Type::getDoubleTy(ctxt), 2);
Value *emptyVec = UndefValue::get(vecTy);
Type* u32Ty = Type::getInt32Ty(currF->getContext());
Value *index0 = ConstantInt::get(u32Ty, 0);
Value *index1 = ConstantInt::get(u32Ty, 1);
Instruction *InsertVal = InsertElementInst::Create(emptyVec, oprnd,
index0, "insert");
InsertVal = Inser...
2015 Apr 17
2
[LLVMdev] how to use "new instruction()"
...> *%2 = fadd <2 x double> undef, <2 x double> undef. *The following is the
>> way I used to create the vectorized FADD instruction:
>>
>> //pInst is a double type instruction
>>
>> Type *vecTy = VectorType::get(pInst->getType(), 2);
>> Value *emptyVec = UndefValue::get(vecTy);
>> IRBuilder<> builder(&*pInst);
>> Value *dupVal = builder.CreateFAdd(emptyVec, emptyVec, instName);
>> std::cout << " dupVal " << *dupVal << "\n";
>>
>> It outputs: dupVal <2 x dou...
2015 Apr 17
2
[LLVMdev] how to use "new instruction()"
...calar version FADD. I want to have an instruction like: *%2 = fadd <2
x double> undef, <2 x double> undef. *The following is the way I used to
create the vectorized FADD instruction:
//pInst is a double type instruction
Type *vecTy = VectorType::get(pInst->getType(), 2);
Value *emptyVec = UndefValue::get(vecTy);
IRBuilder<> builder(&*pInst);
Value *dupVal = builder.CreateFAdd(emptyVec, emptyVec, instName);
std::cout << " dupVal " << *dupVal << "\n";
It outputs: dupVal <2 x double> <double fadd (double undef, double...
2014 Jul 20
2
[LLVMdev] error in InsertElementInst
Hello everybody,
What I am trying to do is to create a vector <4 x i32> and save some values to initialize the vector.
However, I am using the insertElementInst() and the errors I get are the following;
error: within this context
Instruction *Insert = new InsertElementInst(instr, emptyVec, index0, "test");
and
error: ‘llvm::InsertElementInst::InsertElementInst(llvm::Value*, llvm::Value*, llvm::Value*, const llvm::Twine&, llvm::Instruction*)’ is private
The code I have used is the following:
Type *Instr_vector = VectorType::get(Int32, 4);
Value *emptyVec = UndefValue::...
2015 Apr 17
2
[LLVMdev] how to use "new instruction()"
Value * is the instruction.
use dyn_cast<Instruction> to get to it.
On Thu, Apr 16, 2015 at 11:39 PM zhi chen <zchenhn at gmail.com> wrote:
> But IRBuilder.CreateXYZ only returns a "VALUE" type. Can I get the
> instruction created by it? For example,
>
> IRBuilder<> builder(&*pinst);
> Value *val = builder.CreateFAdd(LV, RV, "");
>