This is an archive of the discontinued LLVM Phabricator instance.

[TwoAddressInstruction] Handle pointer compare sunk past statepoint.
ClosedPublic

Authored by dantrushin on Aug 19 2022, 11:22 AM.

Details

Summary
CodeGenPrepare pass can sink pointer comparison across statepoint
to the point of use (see comment in IR/SafepointIRVerifier.cpp)
Due to specifics of statepoints, it is still legal to have tied
def and use rewritten to the same register in TwoAddress pass.
However, properly updating LiveIntervals and LiveVariables becomes
complicated. For simplicity, let's fall back to generic handling of
tied registers when we detect such case.

Diff Detail

Event Timeline

dantrushin created this revision.Aug 19 2022, 11:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2022, 11:22 AM
dantrushin requested review of this revision.Aug 19 2022, 11:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2022, 11:22 AM

Rebase on top of precommitted test

thakis added a subscriber: thakis.Aug 19 2022, 12:29 PM

The precommitted test breaks tests on mac: http://45.33.8.238/macm1/42841/step_11.txt

Please take a look and revert for now if it takes a while to fix. (Looks like the check looks for "Assertion ... failed" while the mac runtime apparently prints "Assertion failed: ...")

dyung added a subscriber: dyung.Aug 19 2022, 12:48 PM

The precommitted test also appears to break on Windows: https://lab.llvm.org/buildbot/#/builders/216/builds/8547

dantrushin edited the summary of this revision. (Show Details)

Rebase on top of relanded test.
Added TODO about recomputation of live range/liveness instead of bailing out.

skatkov accepted this revision.Aug 22 2022, 8:05 PM

lgtm as correctness fix. It would b good still to find a way to recompute analysis and revert this back.

This revision is now accepted and ready to land.Aug 22 2022, 8:05 PM