Steps to reproduce: $ llvm/Debug/bin/opt -etforest -break-crit-edges -domtree x.bc -disable-output Segmentation fault The backtrace shows an infinite loop #123147 0x085b20b7 in llvm::DominatorTree::getNodeForBlock (this=0x87191f8, BB=0x0) at Dominators.cpp:380 but before that, it seems that llvm::DominatorTree::calculate's "ImmDom", which is gets from ImmediateDominator is out of date: #174577 0x085b225f in llvm::DominatorTree::calculate (this=0x87191f8, ID=@0x871a1a8) at Dominators.cpp:399 399 Node *IDomNode = getNodeForBlock(ImmDom); (gdb) p ImmDom $2 = (class llvm::BasicBlock *) 0x8719838 (gdb) p ImmDom->getName() Cannot access memory at address 0xff75effc (gdb) down #174576 0x085b20b7 in llvm::DominatorTree::getNodeForBlock (this=0x87191f8, BB=0x8719838) at Dominators.cpp:380 380 Node *IDomNode = getNodeForBlock(IDom); (gdb) p IDom $3 = (class llvm::BasicBlock *) 0x0 and that's the start of the infinite loop.
Created attachment 560 [details] testcase
Actually, "-idom -break-crit-edges -domtree" is sufficient.
Created attachment 561 [details] testcase in asm form
segfault confirmed with TOT. Upgraded bytecode attached.
Created attachment 562 [details] Updated bytecode
Created attachment 563 [details] Updated source
It sounds like b-c-e isn't updating idom correctly. I'll take a look.
Fixed, testcase here: Analysis/Dominators/2007-01-14-BreakCritEdges.ll Patch here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070108/042657.html -Chris
Yup, all better. Thanks Chris!