In r322972/r323136, the iteration here was changed to catch cases at the beginning of a basic block... but we accidentally deleted an important safety check. Restore that check to the way it was.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM, thanks for putting the fix together.
If I understand correctly, if cpsr was not used between the TST and the AND, this would be OK to remove. Do you know if the isSafe loop could/should catch this? This whole function mostly expects the CmpMI to be after MI, so I think this fix is a good one in any case.
Comment Actions
if cpsr was not used between the TST and the AND, this would be OK to remove
Yes. But rescheduling would be more general and simpler to implement, I think. Given the conditions here, it should be easy to prove the ANDri is safe to hoist.