search for: createicmpeq

Displaying 12 results from an estimated 12 matches for "createicmpeq".

2019 Jul 03
2
optimisation issue in an llvm IR pass
...v dl,BYTE PTR [rsi+rdi*1] mov ecx,edx // <- not needed add cl,0x1 // <- should be done to 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.CreateBina...
2020 Feb 27
3
How to set DebugLoc when using IRBuilder's CreateCall ?
Hi I want to insert some functions into the llvm bitcode ir files. So I use IRBuilder and CreateCall(). But it how error : inlinable function call in a function with debug info must have a !dbg location. I don't know what DebugLoc should I give the new CallInst to setDebugLoc. I Create this CallInst , so this CallInst doesn't hava so-called "DebugLoc" mapping to the source
2018 Sep 05
3
How to get return address at llvm ir level?
Hi I want to write a FunctionPass to insert some code before return. Funcion: .. .. .. mov eax,[esp] cmp eax,0x12345678 je 0x12345678 ret (maybe stack will not balance) I wonder that can I get the return address at llvm ir level? I use IRBuilder to CreateICmpEQ and CreateCondBr. but I don't how to get the value of return addrss. I have found there is a Intrinsic::returnaddress. Is Intrinsic::returnaddress can help me? I don't konw how to use Intrinsic::returnaddress because few files use this intrinsic. Thanks -------------- next part ------...
2019 Jul 03
3
optimisation issue in an llvm IR pass
... add    cl,0x1  // <- should be done to 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 &g...
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
...::get_name(symbol->var_name)->value; alloc = locals[varName]; return (void *)alloc; } void *visit(equ_expression_c *symbol) { Value *lValue; Value *rValue; lValue = (Value *)symbol->l_exp->accept(*this); rValue = (Value *)symbol->r_exp->accept(*this); return Builder.CreateICmpEQ (lValue, rValue, "cond"); } Cheers, Manuele
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
...t; > void *visit(equ_expression_c *symbol) { > Value *lValue; > Value *rValue; > > lValue = (Value *)symbol->l_exp->accept(*this); > rValue = (Value *)symbol->r_exp->accept(*this); > > return Builder.CreateICmpEQ (lValue, rValue, "cond"); > > } > > Cheers, > Manuele > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> > http://llvm.c...
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
...d *)alloc; > } > > void *visit(equ_expression_c *symbol) { > Value *lValue; > Value *rValue; > > lValue = (Value *)symbol->l_exp->accept(*this)**; > rValue = (Value *)symbol->r_exp->accept(*this)**; > > return Builder.CreateICmpEQ (lValue, rValue, "cond"); > > } > > Cheers, > Manuele > > > > > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/l...
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
...gt; void *visit(equ_expression_c *symbol) { >> Value *lValue; >> Value *rValue; >> >> lValue = (Value *)symbol->l_exp->accept(*this); >> rValue = (Value *)symbol->r_exp->accept(*this); >> >> return Builder.CreateICmpEQ (lValue, rValue, "cond"); >> >> } >> >> Cheers, >> Manuele >> >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >...
2013 Nov 26
0
[LLVMdev] Help needed with a pass
...), foo); BasicBlock* True = BasicBlock::Create(getGlobalContext(),new Twine("True"), foo); const char* pPath; pPath = getenv("<SOME_ENV_VAR>"); Twine temp=new Twine("tmp"); IRBuilder<> builder(Entry); Value* envVarDoesntExist = builder.CreateICmpEQ(new StringRef(pPath),Constant::getNullValue(StringRef),temp); builder.CreateCondBr(envVarDoesntExist, False, True); builder.SetInsertPoint(True); builder.CreateCall3(strncpy_func,buf,new StringRef(pPath),29,temp); builder.SetInsertPoint(False); builder.CreateCall(printf_func,&qu...
2010 Feb 27
3
[LLVMdev] Object layout bug for C++ derived class with long long integer
...fourth; } I generate JIT code to access 'fourth' from a Foo * as follows: BarPtr = CreateBitCast(FooPtr, BarPtrTy); FourthPtr = CreateConstGEP2_32(BarPtr, 0, 3); FourthValue = CreateLoad(FourthPtr); ConstantValue = ConstantInt::get(FourthValue->getType(), 0x2A4); ComparisonValue = CreateICmpEQ(FourthValue, ConstantValue); This appears to work on Linux and MacOSX with LLVM 2.6 and LLVM 2.7. On Windows, however, where I only have LLVM 2.6 with MINGW/MSYS, the generated code looks like this: 0x13df70b3: mov $0x2a4,%ecx 0x13df70b8: xor 0xc(%edi),%ecx 0x13df70bb: or 0x10(%edi),...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...= BasicBlock::Create(Context, "cond_false", gcd); BasicBlock* cond_true = BasicBlock::Create(Context, "cond_true", gcd); BasicBlock* cond_false_2 = BasicBlock::Create(Context, "cond_false", 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_fals...
2014 Mar 07
3
[LLVMdev] [RFC] Add second "failure" AtomicOrdering to cmpxchg instruction
...Value *OldVal = Args[1]; Value *PrevVal = Builder.CreateAtomicCmpXchg(Args[0], Args[1], Args[2], + llvm::SequentiallyConsistent, llvm::SequentiallyConsistent); Value *Result = Builder.CreateICmpEQ(PrevVal, OldVal); // zext bool to int. @@ -1504,6 +1506,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, EmitScalarExpr(E->getArg(0)), EmitScalarExpr(E->getArg(2)), EmitScalarExpr(E->getArg(1)), + SequentiallyConsistent, S...