PIM-3196: rework the compiler pass to register view elements