Since SCEV can cache information about location of an instruction, it should be invalidated when the instruction is moved.
There should be similar bug in code sinking part of LICM, it will be fixed in a follow-up change.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thank you for the patch! This LGTM as is.
AFAICT, this issue should not occur in sinking, because instructions are not moved there, they are cloned and ScEv will simply not know about the new instructions.
There are a few deletes that may need updating in a follow up, as I'm not sure if the forgetLoop call addresses these.
- In eraseInstruction.
- In LoopPromoter.
- Potential updates in ControlFlowHoister.