[all-commits] [llvm/llvm-project] a6cdac: Eliminate extra set of simd variant function attri...

jyu2-git via All-commits all-commits at lists.llvm.org
Thu Mar 24 13:46:11 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6cdac48ffaf1aba9c2055db0ea92f8d25e629d8
      https://github.com/llvm/llvm-project/commit/a6cdac48ffaf1aba9c2055db0ea92f8d25e629d8
  Author: Jennifer Yu <jennifer.yu at intel.com>
  Date:   2022-03-24 (Thu, 24 Mar 2022)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/test/OpenMP/declare_simd_codegen.cpp

  Log Message:
  -----------
  Eliminate extra set of simd variant function attribute.

Current clang generates extra set of simd variant function attribute
with extra 'v' encoding.
For example:
_ZGVbN2v__Z5add_1Pf vs _ZGVbN2vv__Z5add_1Pf
The problem is due to declaration of ParamAttrs following:
    llvm::SmallVector<ParamAttrTy, 8> ParamAttrs(ParamPositions.size());
where ParamPositions.size() is grown after following assignment:
    Pos = ParamPositions[PVD];
So the PVD is not find in ParamPositions.

The problem is ParamPositions need to set for each FD decl. To fix this

Move ParamPositions's init inside while loop for each FD.

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




More information about the All-commits mailing list