Skip to content
  • Cameron Zwarich's avatar
    Land a first cut at StrongPHIElimination. There are only 5 new test failures · 25d046ce
    Cameron Zwarich authored
    when running without the verifier, and I have not yet checked them to see if
    the new results are still correct. There are more verifier failures, but they
    all seem to be additional occurrences of verifier failures that occur with the
    existing PHIElimination pass. There are a few obvious issues with the code:
    
    1) It doesn't properly update the register equivalence classes during copy
    insertion, and instead recomputes them before merging live intervals and
    renaming registers. I wanted to keep this first patch simple for debugging
    purposes, but it shouldn't be very hard to do this.
    
    2) It doesn't mix the renaming and live interval merging with the copy insertion
    process, which leads to a lot of virtual register churn. Virtual registers and
    live intervals are created, only to later be merged into others. The code should
    be smarter and only create a new virtual register if there is no existing
    register in the same congruence class.
    
    3) In one place the code uses a DenseMap per basic block, which is unnecessary
    heap allocation. There should be an inline storage version of DenseMap.
    
    I did a quick compile-time test of running llc on 403.gcc with and without
    StrongPHIElimination. It is slightly slower with StrongPHIElimination, because
    the small decrease in the coalescer runtime can't beat the increase in phi
    elimination runtime. Perhaps fixing the above performance issues will narrow
    the gap.
    
    I also haven't yet run any tests of the quality of the generated code.
    
    llvm-svn: 122582
    25d046ce
Loading