This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Skip DAG hack passes on selected functions
ClosedPublic

Authored by arsenm on Dec 24 2019, 6:12 AM.

Details

Summary

The way fallback to SelectionDAG works is somewhat surprising to
me. When the fallback path is enabled, the entire set of SelectionDAG
selector passes is added to the pass pipeline, and each one needs to
check if the function was selected. This results in the surprising
behavior of running SIFixSGPRCopies for example, but only if
-global-isel-abort=2 is used.

SIAddIMGInitPass is also added in addInstSelector, but I'm not sure
why we have this pass or if it should be added somewhere else for
GlobalISel.

Diff Detail

Event Timeline

arsenm created this revision.Dec 24 2019, 6:12 AM
arsenm added a comment.Feb 5 2020, 5:51 AM

test?

I'm not sure this can be meaningfully tested. These passes ideally would end up being no-ops anyway. I think I noticed this from one of these crashing on invalid MIR, or some situation they don't handle correctly. In either case, there's not supposed to be a useful output to check

kerbowa accepted this revision.Feb 17 2020, 8:31 AM

LGTM

This revision is now accepted and ready to land.Feb 17 2020, 8:31 AM