[llvm-dev] When can the dominator tree not contain a node for a basic block?

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 21 09:43:27 PDT 2015


On 9/21/2015 11:26 AM, Philip Reames via llvm-dev wrote:
> When looking into https://llvm.org/bugs/show_bug.cgi?id=24866, I
> discovered that the root cause of the crash is that I was expecting
> every basic block to have a corresponding Node in the dominator tree.
> Apparently, the "while.end" basic block in the example does not have a
> Node in the Dominator Tree.  Can anyone tell me if this is expected? If
> so, under what circumstances?

This happens when the block is not reachable.  In such cases, there is 
no way to connect this block into the dominator tree (and keep it as a 
tree, not a forest).


> Interestingly, the crash in question appears to be fairly recently
> introduced.  A checkout from week before last didn't crash, whereas a
> checkout from this morning does.  I have yet tried to isolate the change
> in question; before doing so, I wanted to determine if this was a newly
> introduced problem (i.e. every BB should have a Node), or merely a newly
> exposed problem (i.e. not every BB does).

Given that the predecessor has a branch with the condition being undef, 
I suppose this may be caused by treating undef as "true" in conditional 
branches.

-Krzysztof

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation


More information about the llvm-dev mailing list