Home | History | Annotate | Download | only in IPO

Lines Matching refs:Malloc

196   // If Dead[n].first is the only use of a malloc result, we can delete its
821 /// the specified malloc. Because it is always the result of the specified
822 /// malloc, there is no reason to actually DO the malloc. Instead, turn the
823 /// malloc into a global, and any loads of GV as uses of the new global.
839 // Create the new global variable. The contents of the malloc'd memory is
849 // If there are bitcast users of the malloc (which is typical, usually we have
850 // a malloc + bitcast) then replace them with uses of the new global. Update
940 // Now the GV is dead, nuke it and the malloc..
1022 // Must be bitcast between the malloc and store to initialize the global.
1032 // Must be bitcast GEP between the malloc and store to initialize
1040 // Insert a load from the global, and use it instead of the malloc.
1277 DEBUG(dbgs() << "SROA HEAP ALLOC: " << *GV << " MALLOC = " << *CI << '\n');
1281 // There is guaranteed to be at least one use of the malloc (storing
1287 // Okay, at this point, there are no users of the malloc. Insert N
1317 // The tricky aspect of this transformation is handling the case when malloc
1318 // fails. In the original code, malloc failing would set the result pointer
1319 // of malloc to null. In this case, some mallocs could succeed and others
1321 // F0 = malloc(field0)
1322 // F1 = malloc(field1)
1323 // F2 = malloc(field2)
1329 // The malloc can also fail if its argument is too large.
1340 // Split the basic block at the old malloc.
1390 // Okay, the malloc site is completely handled. All of the uses of GV are now
1461 /// pointer global variable with a single value stored it that is a malloc or
1462 /// cast of malloc.
1473 // If this is a malloc of an abstract type, don't touch it.
1478 // of the malloc value, not of the null initializer value (consider a use
1479 // that compares the global's value against zero to see if the malloc has
1482 // happen after the malloc.
1486 // We can't optimize this if the malloc itself is used in a complex way,
1488 // malloc to be stored into the specified global, loaded icmp'd, and
1495 // If we have a global that is only initialized with a fixed size malloc,
1496 // transform the program to use global memory instead of malloc'd memory.
1499 // We cannot optimize the malloc if we cannot determine malloc array size.
1514 // into multiple malloc'd arrays, one for each field. This is basically
1515 // SRoA for malloc'd memory.
1521 // variable size array. malloc [100 x struct],1 -> malloc struct, 100
1535 // If this is a fixed size array, transform the Malloc to be an alloc of
1536 // structs. malloc [100 x struct],1 -> malloc struct, 100
1542 Instruction *Malloc = CallInst::CreateMalloc(CI, IntPtrTy, AllocSTy,
1545 Instruction *Cast = new BitCastInst(Malloc, CI->getType(), "tmp", CI);
1548 if (BitCastInst *BCI = dyn_cast<BitCastInst>(Malloc))
1551 CI = cast<CallInst>(Malloc);