search for: allocatedsize

Displaying 4 results from an estimated 4 matches for "allocatedsize".

2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...); if (arg3) params.push_back(arg3); if (arg4) params.push_back(arg4); return Builder.CreateCall(printfFn, params); } return I; } void InstructionVisitor::visitCallInst(CallInst &CI) { if (isAllocationFn(&CI, &TLI)) { Value* allocatedAddress = &CI; Instruction* I = &CI; Value* allocatedSize = I->getOperand(0); Instruction* next = incrementGlobalKey(I); GlobalVariable* key = I->getModule()->getNamedGlobal("globalKey"); const char* message = "Allocated address: 0x%p, size: %d, key: %lld\n"; print(next, message, allocatedAddress, allocatedSize, key->getOpe...
2016 Aug 02
2
RFC: We should stop merging allocas in the inliner
...gt;> Thoughts? The code changes are easy and mechanical. My plan would be: >> > > There is one caveat: stop doing stack merging in inliner will change the > inliner cost analysis which may have affect inlining decisions and > performance in an unexpected way. For instance, the allocatedSize estimate > won't be as accurate due to double counting. > There is the possibility of this, but I think it is relatively unlikely for a few reasons. The first is that I don't think the alloca merging is helping that much here. Specifically, we only merge certain kinds of allocas and...
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
Hi Everyone, I'm quite new to LLVM and I want to update value of global variable in LLVM IR. I created new global variable in ModulePass: bool runOnModule(llvm::Module &M) { IRBuilder<> Builder(M.getContext()); Instruction *I = &*inst_begin(M.getFunction("main")); Builder.SetInsertPoint(I); M.getOrInsertGlobal("globalKey",
2016 Aug 01
16
RFC: We should stop merging allocas in the inliner
Chris added alloca merging in the inliner a looooong time ago, 2009. The reason he added it was because at the time we didn't do stack coloring and without it we had serious stack size problems in LLVM. Since then, a few rather important things have changed: - We have reasonably powerful stack coloring support in the backend based on lifetime markers - Clang (the primary frontend I'm