This is an archive of the discontinued LLVM Phabricator instance.

[llvm][Uniformity] provide overloads for Instruction* and Value*
ClosedPublic

Authored by sameerds on Feb 23 2023, 10:42 PM.

Details

Summary

Uniformity analysis is mainly concerned with the uniformity of values. But it is
sometimes useful to ask if an instruction is uniform, for example, if the
instruction is a terminator. On LLVM IR, every Instruction is a Value, so the
queries like isUniform() need to be overloaded so that the most derived class
always wins.

Diff Detail

Event Timeline

sameerds created this revision.Feb 23 2023, 10:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 10:42 PM
sameerds requested review of this revision.Feb 23 2023, 10:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 10:42 PM
sameerds added a subscriber: gandhi21299.
ruiling accepted this revision.Feb 27 2023, 6:07 PM

Thank you for the fix! LGTM

This revision is now accepted and ready to land.Feb 27 2023, 6:07 PM
This revision was landed with ongoing or failed builds.Feb 27 2023, 9:59 PM
This revision was automatically updated to reflect the committed changes.
foad added a comment.Feb 28 2023, 2:27 AM

I'm fine with the patch but I don't particularly like the fact that DA has an isDivergent(Instruction *) in the first place, because it's really unclear what it means - for non-void instructions I guess it's the same as isDivergent(Value *), and for conditional branches it means something specific, and for other instructions...? I'd much prefer for have a more specific isDivergentBranch(BranchInst *).