[all-commits] [llvm/llvm-project] fcd32d: [AMDGPU] Fix function pointer argument bug in AMDG...

Sebastian Neubauer via All-commits all-commits at lists.llvm.org
Wed May 26 07:40:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fcd32d62c0675abccac7b7f919bb0df52b6c4262
      https://github.com/llvm/llvm-project/commit/fcd32d62c0675abccac7b7f919bb0df52b6c4262
  Author: jweightma <jacob.weightman at hpe.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp
    A llvm/test/CodeGen/AMDGPU/propagate-attributes-function-pointer-argument.ll

  Log Message:
  -----------
  [AMDGPU] Fix function pointer argument bug in AMDGPU Propagate Attributes pass.

This patch fixes a bug in the AMDGPU Propagate Attributes pass where a call
instruction with a function pointer argument is identified as a user of the
passed function, and illegally replaces the called function of the
instruction with the function argument.

For example, given functions f and g with appropriate types, the following
illegal transformation could occur without this fix:
call void @f(void ()* @g)
-->
call void @g(void ()* @g.1)

The solution introduced in this patch is to prevent the cloning and
substitution if the instruction's called function and the function which
might be cloned do not match.

Reviewed By: arsenm, madhur13490

Differential Revision: https://reviews.llvm.org/D101847




More information about the All-commits mailing list