search for: visitmalloc

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

Did you mean: visitalloca
2010 Jul 13
1
[LLVMdev] Promoting malloc to alloca
...: > > declare noalias i8* @malloc() nounwind > define i8 @test() { > %A = call i8* @malloc() > %B = load i8* %A > ret i8 %B > } > > either, though that's fixable by inserting llvm.lifetime.start right > after the malloc. Take a look at: Instruction *InstCombiner::visitMalloc(Instruction &MI) { // If we have a malloc call which is only used in any amount of comparisons // to null and free calls, delete the calls and replace the comparisons with // true or false as appropriate. if (IsOnlyNullComparedAndFreed(MI)) { ... Ciao, Duncan.
2010 Jul 13
0
[LLVMdev] Promoting malloc to alloca
Duncan Sands wrote: > Hi Nick, > >> The attribute you're looking for, "delete if result is unused" doesn't >> exist in LLVM. I've considered it in the past, but the truth is that >> most of the time I want to eliminate dead malloc's, they *do* have a >> use: the matching free. At some point I expect I'm going to teach LLVM >> to
2010 Jul 13
2
[LLVMdev] Promoting malloc to alloca
Hi Nick, > The attribute you're looking for, "delete if result is unused" doesn't > exist in LLVM. I've considered it in the past, but the truth is that > most of the time I want to eliminate dead malloc's, they *do* have a > use: the matching free. At some point I expect I'm going to teach LLVM > to remove dead malloc+free / new+delete /