This is an archive of the discontinued LLVM Phabricator instance.

[SCCPSolver] Speed up SCCPSolver by avoiding repeated work list elements
ClosedPublic

Authored by tdanyluk on Jun 22 2023, 8:28 AM.

Details

Summary

If a value is already the last element of the worklist, then I think that we don't have to add it again, it is not needed to process it repeatedly.

For some long Triton-generated LLVM IR, this can cause a ~100x speedup.

Diff Detail

Event Timeline

tdanyluk created this revision.Jun 22 2023, 8:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2023, 8:28 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
tdanyluk requested review of this revision.Jun 22 2023, 8:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2023, 8:28 AM
fhahn accepted this revision.Jun 22 2023, 8:34 AM
fhahn added a reviewer: nikic.
fhahn added a subscriber: fhahn.

LGTM, but please a bit before landing in case there are additional comments.

This revision is now accepted and ready to land.Jun 22 2023, 8:34 AM
bkramer accepted this revision.Jun 22 2023, 8:38 AM
nikic added inline comments.Jun 22 2023, 9:06 AM
llvm/lib/Transforms/Utils/SCCPSolver.cpp
850

Redundant braces here and above.