Closed Quuxplusone closed 4 years ago
Please attach tc_ctime_elimphi_gvn.i.
Attached tc.tar.gz
(224308 bytes, application/gzip): tarball with testcase
Attached Z_phielim.tar.gz
(563159 bytes, application/gzip): reduced testcases in compressed tar file
If BitVector is used instead of DenseSet
Not sure why BitVector isn't used already, or if it would be a good idea - does anyone know?
Still not sure why there still is such a slowdown for SystemZ (x10). Comparing to X86, the functions seem to be very similar - the same number of basic blocks and PHI instructions. The structure of the PHIs are also the same - there are no PHI users of PHI definitions for either target...
The reason that the SystemZ backend is slower seems to be because it uses
nearly twice as many virtual registers / instructions than when X-compiling to
x86 (both on SystemZ). This is due to a lot of IMPLICIT_DEFs and
INSERT_SUBREGs, that the SystemZ backend emits (in a seemingly sensible way).
Even in the partially reduced test case (tc_creduce_partial.i), this function
has ~67000 registers in ~1900 blocks and 875 blocks created during critical
edge splitting (SystemZ backend).
PHIElimination suffers from a severe slow down with this huge function. The
reason is apparently that when SplitCriticalEdge() updates LiveVariables by
calling
addNewBlock(), all the registers are iterated over every single time.
The only way to fully remedy this seems to be to pre-compute the live-in
registers for each MBB in an efficient way in PHIElimination.cpp and then pass
that information along to LiveVariabless::addNewBlock(). I have made a patch
for this: https://reviews.llvm.org/D73152.
(The original idea of using a BitVector in addNewBlock() only removed part of
the regression, but was still a good speedup. Since this is reached by other
passes I would assume that this improvement would still be desired, or? That
would be a separate patch...)
Handled with https://reviews.llvm.org/D73152 (committed as 96ea377).
tc.tar.gz
(224308 bytes, application/gzip)Z_phielim.tar.gz
(563159 bytes, application/gzip)