[PATCH] D13297: [CGP] transform select instructions into branches and sink expensive operands

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 09:30:50 PDT 2015


joker.eph added a comment.

While I agree that it is something that seems to be done at the IR level "conceptually", I think you are underestimating the importance of the MI level: there are many things the DAG can fold if it has a view on it,  and something that seems costly at the IR level can become "free" in some cases with target knowledge. 
As mentioned previously, doing this at the IR level stresses a bit more a limitation of SelectionDAG, which does not mean it is not the right thing to do, but on the other side we should just make sure the MI level combine is able to cope with it (it becomes a target problem to deal with it). A global instruction selection instead of SelectionDAG wouldn't have such issue.
Now maybe x86 and/or ARM either does not have much DAG combine that would be lost in this process, or have a strong enough MI layer to recover, so my concern may not have any practical implication. In the end, let's just run a few benchmarks and see :)
I'll try to run the test-suite on Haswell and ARM64, hopefully this week.


http://reviews.llvm.org/D13297





More information about the llvm-commits mailing list