search for: createicmpult

Displaying 3 results from an estimated 3 matches for "createicmpult".

2019 Jul 03
3
optimisation issue in an llvm IR pass
Hi Craig, On 03.07.19 17:33, Craig Topper wrote: > Don't the CreateICmp calls return a Value* with an i1 type? But then > they are added to an i8 type? Not sure that works.  I had that initially: auto cf = IRB.CreateICmpULT(Incr, ConstantInt::get(Int8Ty, 1)); auto carry = IRB.CreateZExt(cf, Int8Ty); Incr = IRB.CreateAdd(Incr, carry); it makes no difference to the generated assembly > Have you tried using the llvm.uadd.with.overflow.i8 intrinsic? we have tried this: CallInst *AddOv = IRB.CreateBinaryIntrinsic...
2019 Jul 03
2
optimisation issue in an llvm IR pass
...dl instead adc dl,0x1 mov BYTE PTR [rsi+rdi*1],dl Far below are both variants with the full code around it, however the difference in both variants is this: //variant1 auto cf = IRB.CreateICmpEQ(Incr, ConstantInt::get(Int8Ty, 0)); Incr = IRB.CreateAdd(Incr, cf); //variant2 auto cf = IRB.CreateICmpULT(Incr, ConstantInt::get(Int8Ty, 1)); Incr = IRB.CreateAdd(Incr, cf); //interestingly this totally different approach creates the same instructions as variant2 CallInst *AddOv = IRB.CreateBinaryIntrinsic(Intrinsic::uadd_with_over flow, Counter, ConstantInt::get(Int8Ty, 1)); AddOv->setMetadata(M.g...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...", gcd); IRBuilder<> builder(entry); Value* xEqualsY = builder.CreateICmpEQ(x, y, "tmp"); builder.CreateCondBr(xEqualsY, ret, cond_false); builder.SetInsertPoint(ret); builder.CreateRet(x); builder.SetInsertPoint(cond_false); Value* xLessThanY = builder.CreateICmpULT(x, y, "tmp"); builder.CreateCondBr(xLessThanY, cond_true, cond_false_2); builder.SetInsertPoint(cond_true); Value* yMinusX = builder.CreateSub(y, x, "tmp"); std::vector<Value*> args1; args1.push_back(x); args1.push_back(yMinusX); Value* recur_1 = buil...