This is an archive of the discontinued LLVM Phabricator instance.

[RISCVRVVInitUndef] Remove implicit single use assumption for IMPLICIT_DEF
ClosedPublic

Authored by reames on Jul 27 2023, 12:19 PM.

Details

Summary

The code was written with the implicit assumption that each IMPLICIT_DEF either a) the tied operand, or b) an untied source, but not both. This is true right now, but an upcoming change may allow CSE of IMPLICIT_DEFs in some cases, so let's rewrite the code to handle that possibility.

I added an MIR case which demonstrates the multiple use IMPLICIT_DEF. To my knowledge, this is not a reachable configuration from IR right now.

As an aside, this makes the structure a much closer match with the sub-reg liveness case, and we can probably just merge these routines. (Future work.)

Diff Detail

Event Timeline

reames created this revision.Jul 27 2023, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 12:19 PM
reames requested review of this revision.Jul 27 2023, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 12:19 PM
This revision is now accepted and ready to land.Jul 27 2023, 12:36 PM
This revision was landed with ongoing or failed builds.Jul 27 2023, 4:31 PM
This revision was automatically updated to reflect the committed changes.
reames reopened this revision.Jul 31 2023, 8:54 AM
This revision is now accepted and ready to land.Jul 31 2023, 8:54 AM
reames updated this revision to Diff 545696.Jul 31 2023, 8:56 AM

Change was reverted due to a sanitizer failure - thanks!

It turns out the DeadLaneDetector does an out of bounds access if you query a vreg which didn't exist at population, and there's no clean interface to update it. For the moment, simply avoid querying newly inserted vregs.

This seems worthy of re-review. @craig.topper thoughts?

This revision is now accepted and ready to land.Jul 31 2023, 12:07 PM
This revision was landed with ongoing or failed builds.Aug 1 2023, 10:50 AM
This revision was automatically updated to reflect the committed changes.