1. 18
  1. 6

    It’s pretty cool that Brian found it easy to add an additional stage to the pipeline in cproc. I think it’s better to implement these sort of optimizations in QBE itself, but it’s a neat exercise nonetheless.

    At one point in time, the author of cproc sent me a diff for QBE that did make the optimization but I guess it was never applied to the QBE repository.

    This is actually the last commit in my qbe branch compared to upstream (Quentin has done some great work recently merging various patches and finishing up riscv64 support).

    The patch is available here, and is based on one proposed by Érico Nogueira: https://github.com/oasislinux/oasis/blob/master/pkg/qbe/patch/0001-amd64-optimize-loading-0-into-registers.patch

    Motivated by this post, I just sent the updated patch to the mailing list.