Page MenuHomePhabricator

Keep CodeGenPrepare from preserving the dominator tree
ClosedPublic

Authored by george.burgess.iv on Feb 4 2016, 11:39 AM.

Details

Summary

CodeGenPrepare may invalidate the domtree. At the moment, there's no way to selectively preserve passes, so we need to be conservative and never preserve it.

Diff Detail

Repository
rL LLVM

Event Timeline

george.burgess.iv retitled this revision from to Keep CodeGenPrepare from preserving the dominator tree.
george.burgess.iv updated this object.
george.burgess.iv added a subscriber: llvm-commits.
junbuml added a subscriber: junbuml.Feb 5 2016, 8:00 AM
tjablin added a subscriber: tjablin.Feb 6 2016, 8:40 AM

Note: D16984 incorporates this into a slightly larger/more complete change. I'll abandon this when that goes in.

jmolloy accepted this revision.Feb 15 2016, 7:11 AM
jmolloy edited edge metadata.

LGTM.

As CGP is the last pass run before SDAG, how exactly did you find this bug out of interest?

James

This revision is now accepted and ready to land.Feb 15 2016, 7:11 AM

LGTM.

Thank you! :) Like said, D16984 seems to absorb this change, so I'll commit this if we decide to abandon that.

As CGP is the last pass run before SDAG, how exactly did you find this bug out of interest?

I wrote a script that more or less appends -basicaa -verify-memoryssa to all opt runlines in our test suite. This caused a CGP test that was originally just running -loop-unroll -codegenprepare to segfault, because the domtree was pointing to deleted basic blocks when it was handed to MemorySSA.

This revision was automatically updated to reflect the committed changes.