This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Add the option of disabling generic combines.
ClosedPublic

Authored by kariddi on Apr 29 2020, 12:09 PM.

Details

Summary

For some targets generic combines don't really do much and they
consume a disproportionate amount of time.
There's not really a mechanism in SDISel to tactically disable
combines, but we can have a switch to disable all of them and
let the targets just implement what they specifically need.

Tested compile time performance on LNT Nightly and didn't make any effect.

Diff Detail

Event Timeline

kariddi created this revision.Apr 29 2020, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2020, 12:09 PM
kariddi edited the summary of this revision. (Show Details)Apr 29 2020, 12:18 PM
kariddi added reviewers: bogner, RKSimon, ThomasRaoux.
kariddi updated this revision to Diff 260991.Apr 29 2020, 12:35 PM

Changing to a disable flag.

arsenm added a subscriber: arsenm.Apr 29 2020, 1:15 PM
arsenm added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
1654

Why call this for every node? Why not just once when the combiner is constructed?

kariddi updated this revision to Diff 261014.Apr 29 2020, 1:32 PM

Adding an attribute in DAGCombiner that caches disableGenericCombines() calls.

kariddi marked an inline comment as done.Apr 29 2020, 1:33 PM
kariddi added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
1654

That is a very good idea :) Done.

kariddi updated this revision to Diff 261019.Apr 29 2020, 1:46 PM

Inverted condition for error.

Harbormaster completed remote builds in B55177: Diff 261019.
arsenm added inline comments.May 20 2020, 9:38 AM
llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
164–165

This isn't a machine combiner, also should specify DAG combiner?

kariddi updated this revision to Diff 265289.May 20 2020, 9:54 AM
kariddi marked an inline comment as done.

Changed comment

llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
164–165

I used the same naming other functions (used in DAG combiner) , but I agree is kind of a weird naming honestly, considering the GlobalISel effort (probably the previous naming was pre-GISel itself). I'll change the comment to explicitly mention the DAG combiner.

nit: s/ didn't make any effect./ didn't have any effect./

hgreving accepted this revision.May 20 2020, 2:54 PM

LGTM!

This revision is now accepted and ready to land.May 20 2020, 2:54 PM

Thanks for having a look Hendrik. I'm gonna push this considering there has been no push back for a month. If somebody wants to further comment on this or pitch for a revert please let me know.

This revision was automatically updated to reflect the committed changes.