This is an archive of the discontinued LLVM Phabricator instance.

UniformityAnalysis: Skip computation with no branch divergence
ClosedPublic

Authored by arsenm on Jun 2 2023, 4:21 AM.

Details

Summary

Check TTI before bothering to run the computation. Everything
will be assumed uniform by default.

Diff Detail

Event Timeline

arsenm created this revision.Jun 2 2023, 4:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 4:21 AM
arsenm requested review of this revision.Jun 2 2023, 4:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 4:21 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 527809.Jun 2 2023, 5:04 AM

Machine uniformity tests are broken, TTI seems to not work with -run-pass

arsenm updated this revision to Diff 527814.Jun 2 2023, 5:23 AM

Move initialize

sameerds added inline comments.Jun 3 2023, 3:24 AM
llvm/lib/CodeGen/MachineUniformityAnalysis.cpp
225

Perhaps this magic constant "true" can be the result of calling NoTTI::hasBranchDivergence()?

yassingh added inline comments.Jun 5 2023, 4:48 AM
llvm/lib/CodeGen/MachineUniformityAnalysis.cpp
223

Can this issue be related to the compiler's inability to construct a Target object when the target is specified using "-march"? This was causing UA to produce incorrect results. https://godbolt.org/z/hqeGovefe

225

That will return false I think.

sameerds accepted this revision.Jun 5 2023, 5:38 AM
This revision is now accepted and ready to land.Jun 5 2023, 5:38 AM
arsenm added inline comments.Jun 5 2023, 5:39 AM
llvm/lib/CodeGen/MachineUniformityAnalysis.cpp
223

I think this is more of a pass manager issue with -run-pass. It's probably not dealing with IR pass dependencies

foad added inline comments.Jun 5 2023, 11:36 PM
llvm/include/llvm/ADT/GenericUniformityImpl.h
46

I don't see why this is needed here. It's already included in lib/Analysis/UniformityAnalysis.cpp.