Page MenuHomePhabricator

CodeGen: BlockPlacement: Clear ComputedEdges between functions.

Authored by iteratee on Apr 11 2017, 5:26 PM.



Not clearing was causing non-deterministic compiles for large files. Addresses
for MachineBasicBlocks would end up colliding and we would lay out a block that
we assumed had been pre-computed when it had not been.

Diff Detail

Event Timeline

iteratee created this revision.Apr 11 2017, 5:26 PM
chandlerc accepted this revision.Apr 11 2017, 6:29 PM

LGTM. Also, this is clearly correct, feel free to land this simple of bug fix directly. =]

It'd be great if you can come up with a test with a pile of functions that will trigger this, but I understand why that might be hard. The assert seems likely enough.

This revision is now accepted and ready to land.Apr 11 2017, 6:29 PM
Gerolf requested changes to this revision.Apr 12 2017, 3:51 PM
Gerolf added a subscriber: Gerolf.

Please double check your code one more time. Thank you!


2675 ↗(On Diff #94910)

I think you need to clear ComptedEdges here for the same reason you clear BlockToChain.

This revision now requires changes to proceed.Apr 12 2017, 3:51 PM
iteratee accepted this revision.May 2 2017, 4:39 PM

I found the bugs mentioned via my own testing.

iteratee updated this revision to Diff 97524.May 2 2017, 4:41 PM
iteratee edited edge metadata.

Already committed in rL300022

iteratee marked an inline comment as done.May 2 2017, 4:42 PM

Gerolf if you could accept this so I can close it, I would appreciate it.

iteratee removed a reviewer: Gerolf.May 2 2017, 4:43 PM
This revision is now accepted and ready to land.May 2 2017, 4:43 PM
iteratee resigned from this revision.May 2 2017, 4:43 PM
iteratee closed this revision.

Committed in rL300022. The committed version contained a fix for the error Gerolf spotted.

Thanks, Kyle!

echristo added inline comments.May 4 2017, 9:42 PM

Drive-by nit: Typically we like to have some text in the assert as well to explain why we're checking for such a thing, e.g. assert(BlockToChain.empty() && "Forgot to clear BlockToChain between functions!") or something.