Monday, July 03, 2006

I hate Critical Edges!

I finished coding the algorithm to destroy phi-functions. Actually, I had finished this algorithm two days ago, but I could not test it properly, because the control flow graphs that I was getting from LLVM still have critical edges. Well, I tried to use the LLVM pass to remove critical edges (lib/Transforms/Utils/BreakCriticalEdges.cpp), but I could not. For some reason, this pass conflicts with other passes, and it turns out that it does not work simply to call this pass in my register allocator. I end up adapting it to be used as an analysis pass, and I think the code is all right (I did not write comments and update the file, because it is not working, and I think I will have to throw it away). The only problem is that it does not work. The changes that it performs in the control flow graph are not reflected in the final code :( I really wish I could understand what is going on here... but I also discovered that the code in lib/Transforms/Utils/BreakCriticalEdges.cpp is indeed called by the compiler. I will try to modify it, because there is still two pesky critical edges in the final loop.

0 Comments:

Post a Comment

<< Home