[all-commits] [llvm/llvm-project] 7b922f: AMDGPU: Fix broken and permissive handling of prin...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Thu Jan 5 06:19:00 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b922fc0c3f1e12a1e34508f50c1c52dad762916
      https://github.com/llvm/llvm-project/commit/7b922fc0c3f1e12a1e34508f50c1c52dad762916
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-01-05 (Thu, 05 Jan 2023)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
    A llvm/test/CodeGen/AMDGPU/opencl-printf-unsupported.ll
    M llvm/test/CodeGen/AMDGPU/opencl-printf.ll

  Log Message:
  -----------
  AMDGPU: Fix broken and permissive handling of printf format strings

This was completely broken with opaque pointers because it was
specifically looking for a constant expression with the global
variable as the first operand. Strip casts like normal, and properly
validate all of the restrictions rather than silently ignoring any
unhandled cases. Also be stricter that we aren't calling into some
unresolved or non-constant format string.

Also converts the test to opaque pointers and generated tests. There's
more broken initializer handling for strings inside the format string
processing too, but there's just no test coverage for this at all.




More information about the All-commits mailing list