The RDF now supports regmasks, which was the major missing feature preventing it from being used on other targets besides Hexagon.
[More tests have been done since the first patch was posted. See below for more details.]
This move includes the data-flow graph construction and recalculation of block live-ins. I have tested 3 targets: ARM, PowerPC and X86 using this scaffold, usually placed in post-RA pseudo-instruction expansion:
- Construct the DFG.
- Recalculate the block live-ins using the DFG.
- Replace the existing live-ins with the calculated ones.
- Carry on with the rest of the pass.
Then I checked each target via make check-llvm-codegen-<target>.
All tests on ARM and PowerPC pass, the X86 backend has 14 failures. At the first glance, about half of them are caused by the issue with EAX and AX having the same set of register units (in general E_X and _X). The remaining half seems to be caused by (as of yet) undetermined issues related to exception handling on Windows.
This patch does not introduce any functional changes, the only changes are in the locations of the files. Putting the files in CodeGen will make it easier to further test it and enable any potentially interested users to try it out.
New round of tests:
Implemented a target-independent RDF-optimization pass similar to Hexagon's RDF optimizations, i.e.:
- copy propagation
- dead code elimination
- liveness recomputation
Not surprisingly, many tests failed in "make check-llvm-codegen". I have manually checked the differences for AArch64, ARM and PowerPC, and the final code appeared to be correct, and the differences seemed to have been caused by the optimizations taking effect.
These tests also involved RDFCopy.cpp and RDFDeadCode.cpp, but these files are not included in this patch (for no other reason than that they were not included in the original patch).