[PATCH] D62653: [Mips][DSP] Fix physregs incorrectly marked as dead.

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 07:03:39 PDT 2019


mbrkusanin added a comment.

> I would like to avoid having "undead" registers, which are marked dead but are semantically necessary, at any point.  That means never calling `setIsDead(false);` as part of instruction selection, even if the flags are eventually correct after post-isel hooks run.

The idea was to remove `setIsDead(false);` which was already in LiveVariables.cpp. This way flags are corrected earlier.
Other possible solution would be to mark them as always live. Another solution would be to leave rL272647 <https://reviews.llvm.org/rL272647> as is, which lets the test CodeGen/Mips/dsp-r1.ll pass with -verify-machineinstrs flag, but then we have wrong dead flags.

> The reason for this is that otherwise it's very confusing for anyone reading the code, or MIR dumps, to understand how it's supposed to work.
>  Why aren't these registers modeled precisely during isel?

That is the main issue. Because some registers for **rddsp** or **wrdsp** are added in post isel hook, the previous check which looks at uses in glue chain does not see it. As for modeling the instruction, I don't see any possible way of adding these registers to .td for these instructions. Is there some other place that you know of or have any suggestion where that could be done? I would prefer that too.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62653/new/

https://reviews.llvm.org/D62653





More information about the llvm-commits mailing list