This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Ensure CountReg definition dominates InsertPt when creating t2DoLoopStartTP
ClosedPublic

Authored by dmgreen on Nov 11 2020, 11:23 AM.

Details

Summary

Of course there was something missing, in this case a check that the def of the count register we are adding to a t2DoLoopStartTP would dominate the insertion point.

In the future, when we remove some of these COPY's in between, the t2DoLoopStartTP will always become the last instruction in the block, preventing this from happening. In the meantime we need to check they are created in a sensible order.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 11 2020, 11:23 AM
dmgreen requested review of this revision.Nov 11 2020, 11:23 AM
samparker added inline comments.Nov 12 2020, 1:59 AM
llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp
233

If it doesn't dominate, we're saying that the def is actually the last instruction in the block, right? So can't we make InsertPt = MBB->end()?

dmgreen added inline comments.Nov 12 2020, 2:05 AM
llvm/lib/Target/ARM/MVEVPTOptimisationsPass.cpp
233

The code above it has needed to move the insertion point backwards from the end.

(That will hopefully get cleaned up in a later patch like I said above. It will eventually just become a terminator but at this point there may be copies between that need to use the correct value).

dmgreen updated this revision to Diff 304771.Nov 12 2020, 3:37 AM

Add a check that the InsertPt isn't end() still.

samparker accepted this revision.Nov 12 2020, 3:51 AM

Ok, cheers! LGTM

This revision is now accepted and ready to land.Nov 12 2020, 3:51 AM