- SI_END_CF, a MBB prologue instruction, should not take any source from PHI. But, LCSSA pass may insert one.
- Teach PHIElim to handle such case by providing target-specific hook to get the insert point for PHI lowering (replace PHI with COPY). So that, the target could canonicalize any MBB prologue instructions.
How about the following simpler logic:
- if the PHI is used by any basic-block prologue instruction (except other PHIs), then insert the COPY at the top of the basic block
- otherwise, insert the COPY after the basic-block prologue