Loop simplify skips exit-block insertion when exits contain indirectbr instructions. This
leads to an assertion in LICM when trying to sink stores out of non-dedicated loop exits
containing indirectbr instructions. This patch fix this issue by re-checking for dedicated
exits in LICM prior to store sink attempts.
Details
Details
- Reviewers
atrick hfinkel - Commits
- rG46d5bf298205: [LICM] Store sink and indirectbr instructions
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM, thanks!
Maybe LoopSimplify should create a dedicated exit block for loops like this, but that's another matter, and this seems like a reasonable change regardless (we shouldn't be sinking stores into non-dedicated exit blocks).
Comment Actions
Hi Hal,
Agreed. As a side note, this all happens because LoopSimplify avoids dealing with indirectbr instructions at all and therefore won't create dedicated exit blocks nor pre-headers in their presence. Haven't check yet but it's likey a similar crash will happen for loads when indirectbr is involved since there won't be a preheader to hoist out.
Thanks for the review!