search for: getinsertblock

Displaying 7 results from an estimated 7 matches for "getinsertblock".

2015 Jul 13
2
[LLVMdev] Problem with InsertPointGuard ABI?
...s set. It happens on OSX system only, trunk version of the LLVM built with brew. I suspect it is the ABI problem. InsertPointGuard uses AssertingVT for debug builds. LLDB gets confused also. The first listing shows that the instance of InsertPointGuard is messed up: 96 auto check = _builder.GetInsertBlock(); 97 { 98 llvm::IRBuilderBase::InsertPointGuard guard{_builder}; -> 99 _builder.SetInsertPoint(checkBB); 100 } 101 102 if (_builder.GetInsertBlock() != check) (lldb) p _builder (llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >)...
2020 Apr 15
2
question on the signature of malloc
Hi all, consider the following function from Core.cpp in LLVM 9.0.0: LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name) { Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), ITy, unwrap(Ty), AllocSize,...
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...ls.cpp (working copy) @@ -52,6 +52,28 @@ return CI; } +Value *llvm::emitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B, + const DataLayout &DL, const TargetLibraryInfo *TLI) { + if (!TLI->has(LibFunc::strlen)) + return nullptr; + + Module *M = B.GetInsertBlock()->getModule(); + AttributeSet AS[2]; + AS[0] = AttributeSet::get(M->getContext(), 1, Attribute::NoCapture); + Attribute::AttrKind AVs[2] = { Attribute::ReadOnly, Attribute::NoUnwind }; + AS[1] = AttributeSet::get(M->getContext(), AttributeSet::FunctionIndex, AVs); + + LLVMContext &am...
2015 Sep 25
2
Error compiling libc++ for ARMv6
...Balance() function is the culprit. Does this seem like a resaonable fix, or do I need to do something different for v6 and earlier? void ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance( IRBuilder<> &Builder) const { if (Subtarget->hasV7Ops()) { Module *M = Builder.GetInsertBlock()->getParent()->getParent(); Builder.CreateCall(llvm::Intrinsic::getDeclaration(M, Intrinsic::arm_clrex)); } } -Rich
2018 Apr 04
1
Call printf with new args
Hello, My code: (CallInst *CI, IRBuilder<> &B) SmallVector<Value *, 8> args; Value *v = B.CreateGlobalString("hi", "str"); args.push_back(v); SmallVector<Type*, 8> params; params.push_back(v->getType()); Module *M = B.GetInsertBlock()->getParent()->getParent(); FunctionType *printfType = FunctionType::get(B.getInt32Ty(), params, true); Constant* const_printf = M->getOrInsertFunction("printf", printfType); Function *F = cast<Function>(const_printf); F->dump(); CallInst * opInst...
2015 Sep 26
2
Error compiling libc++ for ARMv6
...em like a resaonable fix, or do I need >> to do something different for v6 and earlier? >> >> void ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance( >> IRBuilder<> &Builder) const { >> if (Subtarget->hasV7Ops()) { >> Module *M = Builder.GetInsertBlock()->getParent()->getParent(); >> Builder.CreateCall(llvm::Intrinsic::getDeclaration(M, >> Intrinsic::arm_clrex)); >> } >> } For v6, I guess we could do a fake strex to some dummy global? Anyway, r248640, sorry about that! -Ahmed >> -Rich >> _______...
2014 Mar 07
3
[LLVMdev] [RFC] Add second "failure" AtomicOrdering to cmpxchg instruction
...Scalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 580cb15..5f932b0 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1735,8 +1735,9 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, if (atomicPHI) { llvm::BasicBlock *opBB = Builder.GetInsertBlock(); llvm::BasicBlock *contBB = CGF.createBasicBlock("atomic_cont", CGF.CurFn); - llvm::Value *old = Builder.CreateAtomicCmpXchg(LV.getAddress(), atomicPHI, - CGF.EmitToMemory(value, type), llvm::SequentiallyConsistent); + llvm::Value *old = Builder.CreateAtomicCmpXchg( +...