This is an archive of the discontinued LLVM Phabricator instance.

Feedback/direction Review for cpu-dispatch emit stage into GlobalDecl
AbandonedPublic

Authored by erichkeane on Sep 12 2018, 12:45 PM.

Details

Reviewers
rsmith
Summary

In the feedback in 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.

Diff Detail

Event Timeline

erichkeane created this revision.Sep 12 2018, 12:45 PM

@aaron.ballman or @rsmith any chance you guys could give me a hand on the direction here? I'm growing GlobalDecl by quite a bit, so I want to make sure this is both permissible and the right way to go. Additionally, feedback on how to get a GlobalDecl down to getFunctionFeatureMap would be appreciated.

Thanks!
-Erich

erichkeane abandoned this revision.Oct 16 2018, 2:15 PM

Superseding with a version that seems to work

nhaehnle removed a subscriber: nhaehnle.Oct 17 2018, 3:20 AM