[all-commits] [llvm/llvm-project] 7087ea: [SPIR-V] Look up printf format string type in the ...

Tim Besard via All-commits all-commits at lists.llvm.org
Wed Jun 10 02:02:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7087ea37449027cc4c73a375b542cdc397c4474b
      https://github.com/llvm/llvm-project/commit/7087ea37449027cc4c73a375b542cdc397c4474b
  Author: Tim Besard <tim.besard at gmail.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
    A llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_relaxed_printf_string_address_space/multi-function-printf.ll

  Log Message:
  -----------
  [SPIR-V] Look up printf format string type in the correct function (#201523)

addPrintfRequirements() resolved the SPIR-V type of the format string
operand via getSPIRVTypeForVReg() without passing the instruction's
parent MachineFunction, so the lookup defaulted to the registry's CurMF:
whichever function happened to be processed last. Virtual register
numbers are only unique within a function, so in multi-function modules
the check could inspect an unrelated function's type, misreading its
second operand as the format string's storage class (an OpTypeInt's
width immediate, in the added test). For a format string in the constant
address space this spuriously triggered the fatal
"SPV_EXT_relaxed_printf_string_address_space is required" error, or
silently added the unnecessary extension when it was available;
conversely, the requirement could be silently omitted when the colliding
vreg had no recorded type.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>



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