search for: isonlynullcomparedandfreed

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

2010 Jul 13
1
[LLVMdev] Promoting malloc to alloca
...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 /