[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-08 Thread Erich Keane via Phabricator via cfe-commits
erichkeane closed this revision. erichkeane marked 2 inline comments as done. erichkeane added a comment. Closed with revision 322028 https://reviews.llvm.org/D40819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-08 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. Looks good to me with just a few more tweaks (assuming these comments don't uncover any new issues). Thank you! Comment at: lib/AST/ASTContext.cpp:9490 + assert(FD->isMultiVersion() && "Only valid for multiversioned

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-08 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 128950. erichkeane marked 2 inline comments as done. erichkeane added a comment. All of @rsmith 's comments on the last patch. 1 "open" item on the duplicate discover in the resolver generation, but hopefully this otherwise acceptable.

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-08 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 7 inline comments as done. erichkeane added a comment. patch incoming! Comment at: include/clang/AST/ASTContext.h:2643-2648 +for (auto *CurDecl : + FD->getDeclContext()->getRedeclContext()->lookup(FD->getDeclName())) { + FunctionDecl *CurFD =

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. One other test I'd like to see is what happens if you declare a version before the first use, and define it afterwards, particularly if the version is an inline function: inline __attribute__((target("default"))) void f(); inline __attribute__((target("foo"))) void

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 128792. erichkeane added a comment. This revision is now accepted and ready to land. Added test for friend functions. https://reviews.llvm.org/D40819 Files: include/clang/AST/ASTContext.h include/clang/AST/Decl.h include/clang/Basic/Attr.td

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane planned changes to this revision. erichkeane added a comment. Forgot friend functions, Working on it now, sorry about that. https://reviews.llvm.org/D40819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 128782. erichkeane marked 7 inline comments as done. erichkeane added a comment. Fixes for all @echristo and @rsmith s comments. https://reviews.llvm.org/D40819 Files: include/clang/AST/ASTContext.h include/clang/AST/Decl.h

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 34 inline comments as done. erichkeane added a comment. Patch incoming, sorry it took so long! Comment at: lib/CodeGen/CGBuiltin.cpp:7673 -Value *CodeGenFunction::EmitX86CpuInit() { +Value *CodeGenFunction::EmitX86CpuInit(CGBuilderTy ) {

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-03 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Lots of comments, but no high-level design concerns. I think this is very close to being ready to go. Comment at: include/clang/AST/Decl.h:2162-2168 + /// Sets the multiversion state for this declaration and all of its + /// redeclarations. + void

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-03 Thread Eric Christopher via Phabricator via cfe-commits
echristo accepted this revision. echristo added a comment. This revision is now accepted and ready to land. Couple of inline comments, otherwise I'm pretty happy. I'd wait for an ack by Richard for this though. -eric Comment at: lib/CodeGen/CGBuiltin.cpp:7673 -Value

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2018-01-03 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Hi all-- I'm intending to miss the branch for 6.0, but I'd love to get this in soon after. Can anyone take another look? Thanks, Erich https://reviews.llvm.org/D40819 ___ cfe-commits mailing list

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. I'm sure most of you have taken off for the year, but if anyone had time, *ping* :D https://reviews.llvm.org/D40819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 127005. erichkeane added a comment. Fix error message per @aaron.ballman s suggestion. https://reviews.llvm.org/D40819 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:9333 +def err_multiversion_duplicate : Error< + "multiversion function duplicate declarations require identical target " + "attributes">; aaron.ballman wrote: > instead of

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:9333-9335 + "multiversion function would have identical mangling to a previous " + "definition. Duplicate declarations must have identical target attribute " + "values">;

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 126829. erichkeane added a comment. @aaron.ballman reminded me that this should only work on ELF targets, so this patch enforces that constraint. https://reviews.llvm.org/D40819 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 126781. erichkeane marked 2 inline comments as done. erichkeane added a comment. Fixed all of @aaron.ballman comments. https://reviews.llvm.org/D40819 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 17 inline comments as done. erichkeane added a comment. Patch incoming, Thank you very much for the review @aaron.ballman Comment at: include/clang/Basic/DiagnosticSemaKinds.td:9333-9335 + "multiversion function would have identical mangling to a previous "

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:1809 bool DuplicateArchitecture = false; + bool operator==(const ParsedTargetAttr ) { +return DuplicateArchitecture == Other.DuplicateArchitecture && This function

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-12 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Herald added a subscriber: mgrang. Ping! Anyone have time to take a look for me? https://reviews.llvm.org/D40819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-06 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 125779. erichkeane marked 3 inline comments as done. erichkeane added a comment. Fix all rsmith's and craig's fixes, AFAIK. https://reviews.llvm.org/D40819 Files: include/clang/AST/Decl.h include/clang/Basic/Attr.td

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-06 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 14 inline comments as done. erichkeane added a comment. Incoming patch! Comment at: include/clang/Basic/Attr.td:1809 bool DuplicateArchitecture = false; + bool operator ==(const ParsedTargetAttr ) { +return DuplicateArchitecture ==

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-04 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I expect there are more places that need to be changed, but this is looking surprisingly clean. You will need to teach the modules merging code that it needs to check this attribute in addition to checking that types match when considering merging declaration chains

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-04 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: include/clang/Basic/X86Target.def:148 /// Cannonlake client microarchitecture based processors. PROC(Cannonlake, "cannonlake", PROC_64_BIT) Cannonlake can prioritize off of VBMI or IFMA.

[PATCH] D40819: Implement Attribute Target MultiVersioning (Improved edition!)

2017-12-04 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. GCC's attribute 'target', in addition to being an optimization hint, also allows function multiversioning. We currently have the former implemented, this is the latter's implementation. This works by enabling functions with the same name/signature to coexist, so