optimizeMemoryInst contains a vector AddrModeInsts.
The only use of this vector is to check that all instructions are in the same block as memory instruction.
This check is guarded by PhiSeen flag, so if we traversed through phi node then we do not need to keep information in AddrModeInsts.
AddModeInsts is set first time we found some addressing mode and updated if we found new one later.
We can find next addressing mode only if we traverse phi node so all code related to update of AddModeInsts can be safely removed.