[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. In D76525#1942825 , @zoecarver wrote: > @craig.topper I'm not sure what should happen. It should probably just use > that CPU (although that's not a great solution). Is there a way to detect if > an attribute was used to

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver updated this revision to Diff 252742. zoecarver added a comment. - Diff from master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76525/new/ https://reviews.llvm.org/D76525 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver updated this revision to Diff 252741. zoecarver added a comment. - Fix based on review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76525/new/ https://reviews.llvm.org/D76525 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver added a comment. @craig.topper I'm not sure what should happen. It should probably just use that CPU (although that's not a great solution). Is there a way to detect if an attribute was used to change the target in which case we could error? What do you think should happen?

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver added a comment. @jyknight yes, the current plan is to use it in libc++'s implementation. I can put that implementation (which uses this builtin) up for review before this lands. That way we can discuss the implementation before adding a (possibly unneeded) builtin. Sound good?

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread James Y Knight via Phabricator via cfe-commits
jyknight added a comment. I don't think there's a particularly good reason to expose this as a builtin, unless it's to be used by the standard library implementation. (Which again I do not think we should implement.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-25 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver added a comment. @craig.topper thanks for the comments! I'm going to hold off on updating this until we figure out what's happening with D74918 , though. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-21 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. What should the behavior of the builtin be if the calling function has its own target cpu like __attribute__((target("arch=sandybridge"))) and that CPU has a different size than the CPU that was passed on the command line? Comment at:

[PATCH] D76525: Expose cache line size in __builtin_get_cpu_cache_line_size

2020-03-20 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. zoecarver added reviewers: jfb, EricWF, efriedma, jyknight, echristo, __simt__. Herald added a subscriber: dexonsmith. This patch creates the __builtin_get_cpu_cache_line_size to wrap the cpu