This is an archive of the discontinued LLVM Phabricator instance.

[DAG] More aggressively Inline TokenFactors
AbandonedPublic

Authored by niravd on Feb 28 2017, 5:23 PM.

Details

Summary

Now the anti-aliasing in SelectionDAG is on by default, fold in TokenFactors of
TokenFactors with multiple uses for TFs with relatively small number of chains.

This marginally improves DAG analysis.

Event Timeline

niravd created this revision.Feb 28 2017, 5:23 PM
hfinkel added inline comments.Feb 28 2017, 6:18 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
1599

Are these lines too long?

1599

Please add a cl::opt instead of embedding 32 in the code.

1599

Also, please add a comment that explains the limit here. The issue is that, if the TF operand is a large TF, then doing this will "duplicate" it (by folding it into other TFs) many times. In that light, it seems like Ops.size()*Ops.use_size() is really the relevant thing to bound.

test/CodeGen/PowerPC/complex-return.ll
12–13

Why is this changing?

niravd updated this revision to Diff 90207.Mar 1 2017, 10:48 AM
  • [DAG] Prevent Stale nodes from entering worklist
efriedma edited edge metadata.Mar 1 2017, 11:23 AM

I'm vaguely worried this is going to hurt compile-time without really being helpful in general; you can't really do much useful with multiple overlapping TokenFactors, and blindly inlining TokenFactors is going to hit the limit quickly on large basic blocks. Is it possible some more targeted fix could handle the interesting cases?

niravd updated this revision to Diff 90216.Mar 1 2017, 11:42 AM

Remove erroneous update and address hal's comments

RKSimon added a subscriber: RKSimon.Mar 1 2017, 1:27 PM
niravd abandoned this revision.Mar 2 2017, 7:48 AM

I've been planning this patch waiting for D14834 to land. Looking closer I can no longer find any cases where this improves code quality, so dropping it seems like the thing to do.