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.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
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.
Comment Actions
Please double check your code one more time. Thank you!
-Gerolf
lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
2675 ↗ | (On Diff #94910) | I think you need to clear ComptedEdges here for the same reason you clear BlockToChain. |
Comment Actions
Committed in rL300022. The committed version contained a fix for the error Gerolf spotted.
llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp | ||
---|---|---|
2643 | 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. |
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.