Open vfdff opened 4 months ago
some smarter case, https://gcc.godbolt.org/z/Ej9Ker6v1
Note the improvement for GCC comes from GCC's Predictive commoning pass which can be read up about via IBM's slides from 2004 on their XLC compiler implementation: http://www.cs.ualberta.ca/~amaral/cascon/CDP04/slides/tal.pdf.
https://lists.llvm.org/pipermail/llvm-dev/2012-December/056550.html was the last reference I saw mentioned for LLVM.
I have removed the "[AArch64]" tag as I don't think this is target specific.
The first test case testsuite/gcc.dg/tree-ssa/predcom-1.c from GCC's test suite nicely illustrates the missed opportunity with a simple fibonacci example:
https://godbolt.org/z/zTf9YMzbo
There is another example of dead store elimination in testsuite/gcc.dg/tree-ssa/predcom-dse-1.c:
Is anyone (except @sjoerdmeijer) planning to work on this?