Displaying 8 results from an estimated 8 matches for "createextractvalue".
2019 Jul 03
3
optimisation issue in an llvm IR pass
...w.i8 intrinsic?
we have tried this:
CallInst *AddOv =
IRB.CreateBinaryIntrinsic(Intrinsic::uadd_with_overflow, Counter,
ConstantInt::get(Int8Ty, 1));
AddOv->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
Value *SumWithOverflowBit = AddOv;
Incr = IRB.CreateAdd(IRB.CreateExtractValue(SumWithOverflowBit, 0),
IRB.CreateZExt(IRB.CreateExtractValue(SumWithOverflowBit, 1), Int8Ty));
but that generated exactly the same as
auto cf = IRB.CreateICmpULT(Incr, ConstantInt::get(Int8Ty, 1));
Incr = IRB.CreateAdd(Incr, cf);
All the above create (with llvm 6.0, 7 and 8):
mov dl,BY...
2019 Jul 03
2
optimisation issue in an llvm IR pass
...reates the same
instructions as variant2
CallInst *AddOv = IRB.CreateBinaryIntrinsic(Intrinsic::uadd_with_over
flow, Counter, ConstantInt::get(Int8Ty, 1));
AddOv->setMetadata(M.getMDKindID("nosanitize"), MDNode::get(C, None));
Value *SumWithOverflowBit = AddOv;
Incr = IRB.CreateAdd(IRB.CreateExtractValue(SumWithOverflowBit, 0),
IRB.CreateZExt(IRB.CreateExtractValue(SumWithOverflowBit, 1), Int8Ty));
So - How do I have to write the code that the target code has a chance
of being generated?
For me its the same result on LLVM 6.0 and 7.
Alternatively
add BYTE PTR [rsi+rdi*1],0x1
adc BYTE PT...
2020 May 07
2
Cast between struct
> On May 6, 2020, at 21:53, Krzysztof Parzyszek <kparzysz at quicinc.com> wrote:
>
> You can
> 1. extract individual elements of {i8*, i64},
> 2. bitcast the first to some_struct*,
> 3. insert them into a new struct of type {some_struct*, i64}.
Thanks for the help. I’m thinking the same way. Now I’m stuck with
how to create a struct; I know how to create a
2017 Jun 05
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...uot; << endl;
ty->dump();
cout << "ptr type:" << endl;
ptr->getType()->dump();
// Print memory
ctx.EmitCall1("debugPointer", ptr);
// Set class pointer
auto c = ctx.bld.CreateExtractValue(val, 0, "class");
auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
ctx.EmitCall1("debugInt", cx);
ctx.bld.CreateStore(c, cp);
// Set datum
auto d =...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...; cout << "ptr type:" << endl;
>> ptr->getType()->dump();
>> // Print memory
>> ctx.EmitCall1("debugPointer", ptr);
>> // Set class pointer
>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>> ctx.EmitCall1("debugInt", cx);
>> ctx.bld.CreateStore(c, cp);
>>...
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works
fine, and does the right thing.
%Any = type { i8*, i32 }
define dllexport void @setGlobal(%Any* %ptr, %Any %value) {
store %Any %value, %Any* %ptr
ret void
}
define dllexport %Any @getGlobal(%Any* %ptr) {
%val = load %Any, %Any* %ptr
ret %Any %val
}
Trying to replace the setGlobal call with what should be
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...pe:" << endl;
>>>> ptr->getType()->dump();
>>>> // Print memory
>>>> ctx.EmitCall1("debugPointer", ptr);
>>>> // Set class pointer
>>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>>>> ctx.EmitCall1("debugInt", cx);
>>>> ctx.bl...
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...;>> ptr->getType()->dump();
>>>>>> // Print memory
>>>>>> ctx.EmitCall1("debugPointer", ptr);
>>>>>> // Set class pointer
>>>>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>>>>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>>>>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>>>>>> ctx.EmitCall1("debugInt", cx);
>>>...