[llvm-dev] virtual subregister liveness?

Jesper Antonsson via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 30 08:31:53 PDT 2019


Hi,

After dead-mi-elimination I'm experiencing a machine verifier failure 
at this virtual subregister write:

  %5.sub1 = COPY undef %11

The machine verifier essentially complains that the rest of the
register is undefined (a subregister write implies a "read" of the
other parts).

So the problem is that dead-mi-elimination has removed the previously
existing defines of %5.sub0. Yet I'm unsure where the actual fault lies
and I can't seem to find any documentation or list email that explains
the modeling in detail. A few ideas:

Are there some restrictions on where dead-mi-elimination can be run?
(I'm working with an out-of-tree target and we've put this failing
dead-mi-elimination pass pretty soon after register coalescing.)

Or is the use-list for %5 in MRI incorrectly constructed as it doesn't
contain the remaining instruction? (These use-lists are what dead-mi-
elimination is using to decide if an instruction is dead or not.)

Or is the fault that there is no MO spelling out an implicit use
%5.sub0?


The actual verifier error is:

*** Bad machine code: Virtual register defs don't dominate all uses.
***
- function:    f
- v. register: %5
LLVM ERROR: Found 1 machine code errors.


Thanks,
Jesper


More information about the llvm-dev mailing list