[PATCH] D74918: Add method to TargetInfo to get CPU cache line size

Kristof Beyls via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 17 00:52:15 PDT 2020


kristof.beyls added a comment.

In D74918#1923151 <https://reviews.llvm.org/D74918#1923151>, @zoecarver wrote:

> There are a lot of different ways we could implement the feature. We may want to only enable it when `-march=native`, or maybe only in the unstable ABI, and maybe we want to support aligned pairs on some architectures. I think that's an important discussion to have but I'm not sure _this_ patch is the best place to have that discussion.
>
> Even if we don't use this patch in the implementation I think it would still be a good utility to have. Here's what I suggest: I commit this, create another patch to add a builtin that exposes this API, and then open a libc++ patch with a _possible_ implementation. In that patch, we can discuss how we should actually implement the feature and after we have a consensus I can do the work to implement it. Any objections to that plan?


Discussing the implementation strategy for std::hardware_{constructive,destructive}_interference_size on a libc++ thread rather than here makes sense.
I'm afraid I don't have a good view on all the ways the API and associated intrinsic proposed here will or could be used in practice.
My only thought on it is that we cannot guarantee that different versions of LLVM will keep on reporting the same number, even for identical targets.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74918/new/

https://reviews.llvm.org/D74918





More information about the cfe-commits mailing list