getnode(BB) = 0; block already in dominator tree

I run into an issue as part of splitting a critical edge during LICM. When a new basic block is created and needs to be added into the dominator tree, the block is already in the dominator tree. I print the dominator tree and I see it is added into the tree as child of node it is supposed to dominate.

How do I debug to find out why/when its getting added into the tree. ? Tips/suggestions on how to debug to find out how the densemap involved is getting updated will be great.


Are you calling splitCriticalEdge?
If so, it will take care of updating dominators for you.

yes, am just using the LICM that uses splitCriticalEdge I see the issue when the dominator tree is being updated

Er, LICM currently does not modify the CFG at all. Are you proposing to change that? And if so, why? What’s the motivating case?


Oh...its machine LICM the following lines...

  CurPreheader = Pred->SplitCriticalEdge(CurLoop->getHeader(), this);
01463 if (!CurPreheader) {
01464 CurPreheader = reinterpret_cast<MachineBasicBlock *>(-1);
01465 return nullptr;
01466 }