Home | History | Annotate | Download | only in IPO

Lines Matching refs:Malloc

397   // If Dead[n].first is the only use of a malloc result, we can delete its
1020 /// the specified malloc. Because it is always the result of the specified
1021 /// malloc, there is no reason to actually DO the malloc. Instead, turn the
1022 /// malloc into a global, and any loads of GV as uses of the new global.
1038 // Create the new global variable. The contents of the malloc'd memory is
1048 // If there are bitcast users of the malloc (which is typical, usually we have
1049 // a malloc + bitcast) then replace them with uses of the new global. Update
1139 // Now the GV is dead, nuke it and the malloc..
1222 // Must be bitcast between the malloc and store to initialize the global.
1232 // Must be bitcast GEP between the malloc and store to initialize
1240 // Insert a load from the global, and use it instead of the malloc.
1478 DEBUG(dbgs() << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *CI << '\n');
1482 // There is guaranteed to be at least one use of the malloc (storing
1488 // Okay, at this point, there are no users of the malloc. Insert N
1517 // The tricky aspect of this transformation is handling the case when malloc
1518 // fails. In the original code, malloc failing would set the result pointer
1519 // of malloc to null. In this case, some mallocs could succeed and others
1521 // F0 = malloc(field0)
1522 // F1 = malloc(field1)
1523 // F2 = malloc(field2)
1529 // The malloc can also fail if its argument is too large.
1540 // Split the basic block at the old malloc.
1590 // Okay, the malloc site is completely handled. All of the uses of GV are now
1661 /// pointer global variable with a single value stored it that is a malloc or
1662 /// cast of malloc.
1673 // If this is a malloc of an abstract type, don't touch it.
1678 // of the malloc value, not of the null initializer value (consider a use
1679 // that compares the global's value against zero to see if the malloc has
1682 // happen after the malloc.
1686 // We can't optimize this if the malloc itself is used in a complex way,
1688 // malloc to be stored into the specified global, loaded icmp'd, and
1695 // If we have a global that is only initialized with a fixed size malloc,
1696 // transform the program to use global memory instead of malloc'd memory.
1699 // We cannot optimize the malloc if we cannot determine malloc array size.
1714 // into multiple malloc'd arrays, one for each field. This is basically
1715 // SRoA for malloc'd memory.
1721 // variable size array. malloc [100 x struct],1 -> malloc struct, 100
1735 // If this is a fixed size array, transform the Malloc to be an alloc of
1736 // structs. malloc [100 x struct],1 -> malloc struct, 100
1742 Instruction *Malloc = CallInst::CreateMalloc(CI, IntPtrTy, AllocSTy,
1745 Instruction *Cast = new BitCastInst(Malloc, CI->getType(), "tmp", CI);
1748 if (BitCastInst *BCI = dyn_cast<BitCastInst>(Malloc))
1751 CI = cast<CallInst>(Malloc);