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

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Dec 10 18:11:14 PST 2024


  Branch: refs/heads/users/arsenm/diagnostic-info-cleanup-dk-inlineasm
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a7e57a800ff74a1226fd9a35423f6899446772c
      https://github.com/llvm/llvm-project/commit/6a7e57a800ff74a1226fd9a35423f6899446772c
  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

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