[PATCH] D52000: Feedback/direction Review for cpu-dispatch emit stage into GlobalDecl

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 12 12:47:57 PDT 2018


erichkeane created this revision.
erichkeane added a reviewer: rsmith.
Herald added a subscriber: cfe-commits.

In the feedback in https://reviews.llvm.org/D51650 (https://reviews.llvm.org/D51650),
@rsmith points out an implementation detail of CPU-Dispatch
is improperly done.  I'd like to fix this here before rebasing
target_clones on the patch resulting from this feedback.  
This is a first-run at making the GlobalDecl contain the index
of the multiversion version.

The other suggestion @rsmith made was to make getting the MV-type
more streamlined.  I've been thinking of ways to do that, and will
likely attempt to fix it before target_clones goes in with a rebase.

There are two big points of feedback that I'd really appreciate:
1- I suspect that something serious needs to be done on GlobalDecl.
It currently holds a 2 bit value in a PointerIntPair, which obviously
won't work for the index.  I added an unsigned, but am open to
suggestions on how to store this better.

2- CodeGenModule::getFunctionFeatureMap takes a FunctionDecl, but the
features are dependent on the GlobalDecl now. I traced usages upwards,
and many cases don't have GlobalDecl in its call-tree (since it comes
from a callee).  I'm not sure it matters, since only the emit-call should
require this info, but any suggestions are greatly appreciated.


Repository:
  rC Clang

https://reviews.llvm.org/D52000

Files:
  include/clang/AST/GlobalDecl.h
  include/clang/Basic/Attr.td
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/CodeGenModule.h
  test/CodeGen/attr-cpuspecific.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52000.165131.patch
Type: text/x-patch
Size: 12420 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180912/f8d5afba/attachment.bin>


More information about the cfe-commits mailing list