This patch allows iterating over PHI uses of an alloca whendds on to the functionality implemented
determining whether an alloca is only ever modified by ain rG42ab5dc5a5dd6c79476104bdc921afa2a18559cf,
copy from global constant. Since PHI does not modify thewhere PHI nodes are supported in the use-def traversal
memory allocated by thealgorithm to determine if an alloca instruction in question,ever overwritten
we can safely add the incoming values of the PHI to thein addition to a memmove/memcpy. This patch implements
worklist for replacement and furthermore, the PHI itselfthe support needed by the PointerReplacer to collect
as well. Define a new PHI as a copy ofall (indirect) users of the alloca in the old PHI exceptcase where a PHI
with its operands replaced according the WorkMapis involved. Finally, a new PHI is defined in the replace
method which takes in replaced incoming values and
updates the WorkMap accordingly.