Add function to gather all phi instructions