[all-commits] [llvm/llvm-project] 884f2a: DiagnosticInfo: Clean up usage of DiagnosticInfoIn...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Dec 11 00:16:29 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 884f2ad6f9e269407366622ac80e65a1bb1b4b2e
      https://github.com/llvm/llvm-project/commit/884f2ad6f9e269407366622ac80e65a1bb1b4b2e
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-12-11 (Wed, 11 Dec 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineInstr.h
    M llvm/include/llvm/IR/DiagnosticInfo.h
    M llvm/include/llvm/IR/LLVMContext.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
    M llvm/lib/CodeGen/MachineInstr.cpp
    M llvm/lib/CodeGen/RegAllocBase.cpp
    M llvm/lib/CodeGen/RegAllocFast.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/XRayInstrumentation.cpp
    M llvm/lib/IR/DiagnosticInfo.cpp
    M llvm/lib/IR/LLVMContext.cpp
    M llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
    M llvm/lib/Target/ARM/ARMMCInstLower.cpp
    M llvm/lib/Target/X86/X86FloatingPoint.cpp
    M llvm/test/CodeGen/AMDGPU/sgpr-spill-to-vmem-scc-clobber-unhandled.mir

  Log Message:
  -----------
  DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm (#119485)

Currently LLVMContext::emitError emits any error as an "inline asm"
error which does not make any sense. InlineAsm appears to be special,
in that it uses a "LocCookie" from srcloc metadata, which looks like
a parallel mechanism to ordinary source line locations. This meant
that other types of failures had degraded source information reported
when available.

Introduce some new generic error types, and only use inline asm
in the appropriate contexts. The DiagnosticInfo types are still
a bit of a mess, and I'm not sure why DiagnosticInfoWithLocationBase
exists instead of just having an optional DiagnosticLocation in the
base class.

DK_Generic is for any error that derives from an IR level instruction,
and thus can pull debug locations directly from it. DK_GenericWithLoc
is functionally the generic codegen error, since it does not depend
on the IR and instead can construct a DiagnosticLocation from the
MI debug location.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list