SimplifyCFG

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SimplifyCFG

Andre Tavares
Hello,

in the description of SimplifyCFG, it says that it can "Eliminates PHI
nodes for basic blocks with a single predecessor."

I tested this pass with a program that has phi nodes with a single
predecessor and it did not remove it. I also looked in the code and
found nothing to remove it. I'm I missing something, or it does not
remove phis with a single predecessor?

My sample is attached.

--
Andre Tavares
Master Student in Computer Science - UFMG - Brasil
http://dcc.ufmg.br/~andrelct


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

test.o (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SimplifyCFG

Nick Lewycky-2
2009/8/28 Andre Tavares <[hidden email]>
Hello,

in the description of SimplifyCFG, it says that it can "Eliminates PHI nodes for basic blocks with a single predecessor."

I tested this pass with a program that has phi nodes with a single predecessor and it did not remove it. I also looked in the code and found nothing to remove it. I'm I missing something, or it does not remove phis with a single predecessor?

This is probably better discussed in a bug report. I only took a brief look, but it looks like the problem is triggered by the CFG being diamond-shaped. The attached x.bc is a simpler testcase that also demonstrates the missed-optimization.

Nick


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

x.bc (388 bytes) Download Attachment