Home | History | Annotate | Download | only in IPO

Lines Matching refs:Malloc

396   // If Dead[n].first is the only use of a malloc result, we can delete its
1019 /// the specified malloc. Because it is always the result of the specified
1020 /// malloc, there is no reason to actually DO the malloc. Instead, turn the
1021 /// malloc into a global, and any loads of GV as uses of the new global.
1037 // Create the new global variable. The contents of the malloc'd memory is
1047 // If there are bitcast users of the malloc (which is typical, usually we have
1048 // a malloc + bitcast) then replace them with uses of the new global. Update
1138 // Now the GV is dead, nuke it and the malloc..
1221 // Must be bitcast between the malloc and store to initialize the global.
1231 // Must be bitcast GEP between the malloc and store to initialize
1239 // Insert a load from the global, and use it instead of the malloc.
1477 DEBUG(dbgs() << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *CI << '\n');
1481 // There is guaranteed to be at least one use of the malloc (storing
1487 // Okay, at this point, there are no users of the malloc. Insert N
1516 // The tricky aspect of this transformation is handling the case when malloc
1517 // fails. In the original code, malloc failing would set the result pointer
1518 // of malloc to null. In this case, some mallocs could succeed and others
1520 // F0 = malloc(field0)
1521 // F1 = malloc(field1)
1522 // F2 = malloc(field2)
1528 // The malloc can also fail if its argument is too large.
1539 // Split the basic block at the old malloc.
1589 // Okay, the malloc site is completely handled. All of the uses of GV are now
1660 /// pointer global variable with a single value stored it that is a malloc or
1661 /// cast of malloc.
1672 // If this is a malloc of an abstract type, don't touch it.
1677 // of the malloc value, not of the null initializer value (consider a use
1678 // that compares the global's value against zero to see if the malloc has
1681 // happen after the malloc.
1685 // We can't optimize this if the malloc itself is used in a complex way,
1687 // malloc to be stored into the specified global, loaded icmp'd, and
1694 // If we have a global that is only initialized with a fixed size malloc,
1695 // transform the program to use global memory instead of malloc'd memory.
1698 // We cannot optimize the malloc if we cannot determine malloc array size.
1713 // into multiple malloc'd arrays, one for each field. This is basically
1714 // SRoA for malloc'd memory.
1720 // variable size array. malloc [100 x struct],1 -> malloc struct, 100
1734 // If this is a fixed size array, transform the Malloc to be an alloc of
1735 // structs. malloc [100 x struct],1 -> malloc struct, 100
1741 Instruction *Malloc = CallInst::CreateMalloc(CI, IntPtrTy, AllocSTy,
1744 Instruction *Cast = new BitCastInst(Malloc, CI->getType(), "tmp", CI);
1747 if (BitCastInst *BCI = dyn_cast<BitCastInst>(Malloc))
1750 CI = cast<CallInst>(Malloc);