This is an archive of the discontinued LLVM Phabricator instance.

ScheduleDAGInstrs: Bug fix for missed memory dependency.
ClosedPublic

Authored by gberry on Jan 6 2016, 8:30 AM.

Details

Summary

In buildSchedGraph(), when adding memory dependencies for loads, move
the call to adjustChainDeps() after the call to
addChainDependency(AliasChain) to handle the case where
addChainDependency(AliasChain) ends up not adding a dependency and
instead putting the SU on the RejectMemNodes list. The call to
adjustChainDeps() must be done after the call to addChainDependency() in
order to process the SU added to the RejectMemNodes list to create
memory dependencies for it.

Diff Detail

Repository
rL LLVM

Event Timeline

gberry updated this revision to Diff 44125.Jan 6 2016, 8:30 AM
gberry retitled this revision from to ScheduleDAGInstrs: Bug fix for missed memory dependency..
gberry updated this object.
gberry added reviewers: hfinkel, atrick, jonpa, resistor.
gberry added subscribers: llvm-commits, mcrosier.

@atrick @resistor: Andy/Owen, It would be great if either of you could take a look at this fix! Thanks, Chad.

junbuml added a subscriber: junbuml.Jan 6 2016, 9:07 AM
atrick accepted this revision.Jan 6 2016, 9:19 AM
atrick edited edge metadata.

LGTM with my suggestion for a comment.

lib/CodeGen/ScheduleDAGInstrs.cpp
1140 ↗(On Diff #44125)

I would be nice to add a short comment explaining why addChainDependency and adjustChainDeps need to be called in this order.

This revision is now accepted and ready to land.Jan 6 2016, 9:19 AM
This revision was automatically updated to reflect the committed changes.