This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] When splitting scatter nodes during DAGCombine, create a serial chain dependency.
ClosedPublic

Authored by craig.topper on Aug 7 2018, 12:16 AM.

Details

Summary

Scatter could have multiple identical indices. We need to maintain sequential order. We get this right in LegalizeVectorTypes, but not in this code.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 7 2018, 12:16 AM
craig.topper added inline comments.Aug 7 2018, 12:19 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
7426 ↗(On Diff #159457)

I removed the AddToWorklist calls because the worklist code in the DAGCombiner ensure all operands of visited nodes have been added to worklist. So we return Hi, which should get added to the worklist and then visited. Lo is an operand of Hi due to the chain so it should get added to the worklist then.

delena accepted this revision.Aug 7 2018, 12:50 AM

Yes. The scatter operation should be in-order after split.

This revision is now accepted and ready to land.Aug 7 2018, 12:50 AM
This revision was automatically updated to reflect the committed changes.