Fix regression introduced in https://reviews.llvm.org/D50982 where the MDT was not kept up-to-date when new MachineBasicBlocks were added.
Details
Diff Detail
Event Timeline
The regression was caught by the expensive_checks build, if that is sufficient for testing? I am actually not sure how to write a lit test for this, because opt -analyze will just re-calculate the DT; I don't know how to just print the DT after the legalize pass runs.
Update existing tests RUN lines with -verify-machine-dom-info. This replicates what the expensive tests enabled.
lib/Target/AMDGPU/SIInstrInfo.cpp | ||
---|---|---|
3708 | Braces | |
3709–3711 | I think this is right, but does the new dominator tree update API support MachineDominatorTrees yet? | |
3857 | Braces | |
4043 | This should be an optional operand since we could want to use this in the future from a pass that doesn't require the dominator tree |
Address feedback: make MDT optional, add braces, run clang-format.
I was not aware of the new DT update API, but as far as I can tell it doesn't support MDT yet. MDT contains a DT, but it is not a subclass. It maintains some state on top of the DT which is resolved in batches, so directly updating the contained DT underneath it doesn't seem correct.
Braces