Make the mem2reg interface use an ArrayRef as it keeps a copy of these
to iterate over.