[llvm-commits] [patch] Convert uses of getPhysicalRegisterRegClass in VirtRegRewriter.cpp

Rafael Espindola espindola at google.com
Sun Jul 11 19:22:51 PDT 2010


> Your other patch removing the virtual specifier on getPhysicalRegisterRegClass is also OK to commit now, but you might just want to go ahead and remove the method entirely instead.

Now there is one last use. It is in AggressiveAntiDepBreaker.cpp, but
I am not sure how to replace it.

If I understand the code correctly, it is trying to replace a hard
register and assumes that any register in the class returned by
getPhysicalRegisterRegClass can be used. This looks like a bug: an
instruction might be using the current register and only accept a
subclass of the one returned by getPhysicalRegisterRegClass.

Using getMinimalPhysRegClass should be correct, but very conservative.
It is possible that the current register is used only in instructions
that would accept registers from a larger classes. Unfortunately "make
check-lit" found no such cases :-(

The correct solution is probably to look at every instruction using
that particular register and get the largest class that can be used in
all those contexts.

Is the analysis correct or am I misunderstanding how
AggressiveAntiDepBreaker works?

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list