[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"

Xinfinity xinfinity_a at yahoo.com
Tue Oct 12 05:24:55 PDT 2010


Hi, I tried adding the PHI nodes in BB_unique, and it works for the simple
case described here, but in case the nodes were declared in some
predecessors of ExitBB1 and used in ExitBB1_redirect and its successors, it
won't work, unless I create entries for all of them in BB_unique.

B1 (declares PHI_1)                        B3
 |                                                     |   
B2                                                   |
|                                                      |
ExitBB1                                        ExitBB2
 |
Succ1 (uses PHI_1)

becomes:

B1 (declares PHI_1)                        B3
 |                                                     |   
B2                                                   |
|                                                      |
ExitBB1                                        ExitBB2
  |                                                    |
 -------------------------------------------------------
                           |
                  BB_unique
                   /            \
 ExitBB1_redirect     ExitBB2_redirect
             |
Succ1 (uses PHI_1)


 


Devang Patel wrote:
> 
> 
> 
> One approach is to use insert PHI nodes in BB_unique for values defined in
> ExitBB1 and use these phi nodes in ExitBB1_redirect.
> 
> 
> 
> Devang
> 
> 
> 

I will use the pass -reg2mem, as suggested by ether, to avoid to PHI nodes
altogether.

Thanks,
Alexandra
-

-- 
View this message in context: http://old.nabble.com/Specify-dominator-for-BasicBlock-to-avoid-%22Instruction-does-not-dominate-all-uses%21%22-tp29935454p29942642.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list