[DebugInfo][CSInfo] Avoid crash when defining super-regs
authorJeremy Morse <jeremy.morse@sony.com>
Tue, 25 Apr 2023 13:04:41 +0000 (14:04 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Tue, 25 Apr 2023 13:15:33 +0000 (14:15 +0100)
commit7561f9cd5c841096c8c2f7b10b33d505c1a21b17
tree35d2ae3a5b1ccf477e810d0733baade5b865ceb1
parent1e6fe677f8aa98518e05218affa16e468819f5ed
[DebugInfo][CSInfo] Avoid crash when defining super-regs

In rare situations involving AVX intrinsics, it seems LLVM can be coaxed
into generating copies to arguments that look like this:

    $xmm0 = VMOVAPSrr $xmm1, implicit-def $ymm0
    CALL64 @something ymm0

This particular form of copy implicitly zeros the upper lanes of ymm0,
hence there's an implicit-def for the register in the copy. The X86
implementation of describeLoadedValue doesn't attempt to describe this sort
of copy which causes the generic implementation in
TargetInstrInfo::describeLoadedValue to fire an assertion saying it
expected the target hook to handle it.

Play it safe in the generic implementation and return the "no location /
value" return value, rather than asserting.

Differential Revision: https://reviews.llvm.org/D148626
llvm/lib/CodeGen/TargetInstrInfo.cpp
llvm/test/DebugInfo/MIR/X86/dbgcall-site-partial-describe-subreg.mir [new file with mode: 0644]