[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-07-10 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. LGTM. CC1 -mlink-bitcode-file is an interesting option from 2011: f1d76db466b2a50781c0754b86ac994dd07b5041 I wonder what the original use case is... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-20 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8784b6a8540f: [Clang] Allow bitcode linking when the input is LLVM-IR (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 __

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-19 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a subscriber: ronlieb. jhuber6 added a comment. ping @ronlieb Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 ___ cfe-commits mailing list cfe-com

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2001 -void CodeGenModule::getDefaultFunctionAttributes(StringRef Name, - bool HasOptnone, - bool AttrOnCallSit

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2001 -void CodeGenModule::getDefaultFunctionAttributes(StringRef Name, - bool HasOptnone, - bool AttrO

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 530946. jhuber6 added a comment. Format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 Files: clang/include/clang/CodeGen/CodeGenAction.h clang/lib/CodeGen/CGCal

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 530944. jhuber6 added a comment. Removing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 Files: clang/include/clang/CodeGen/CodeGenAction.h clang/lib/CodeGen/CGC

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2105-2106 + llvm::AttrBuilder FuncAttrs(F.getContext()); + GetCPUAndFeaturesAttributes(GlobalDecl(), FuncAttrs, + /*AddTargetFeatures=*/false); + jhuber6 wrote:

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as not done. jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2105-2106 + llvm::AttrBuilder FuncAttrs(F.getContext()); + GetCPUAndFeaturesAttributes(GlobalDecl(), FuncAttrs, + /*AddTargetFeatur

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2105-2106 + llvm::AttrBuilder FuncAttrs(F.getContext()); + GetCPUAndFeaturesAttributes(GlobalDecl(), FuncAttrs, + /*AddTargetFeatures=*/false); + should this be

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 marked an inline comment as not done. jhuber6 added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2052-2106 +void clang::CodeGen::mergeDefaultFunctionDefinitionAttributes( +llvm::Function &F, const CodeGenOptions CodeGenOpts, +const LangOptions &LangOp

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 530919. jhuber6 marked 2 inline comments as done. jhuber6 added a comment. Addressing comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 Files: clang/include

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2052-2106 +void clang::CodeGen::mergeDefaultFunctionDefinitionAttributes( +llvm::Function &F, const CodeGenOptions CodeGenOpts, +const LangOptions &LangOpts, const TargetOptions &TargetOpts, +bool

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-12 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-08 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 529557. jhuber6 added a comment. Add a better test to show that attributes are replaced and default attributes are added. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 529490. jhuber6 added a comment. Updating, in order to do this starting with bitcode I had to expose a helper that performs this operation using the options directly rather than through the `CodeGenModule`. This should keep the existing interfaces intact by sh

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Scratch that, `ASTContext::getFunctionFeatureMap` is used. I wonder if we could forgo that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152391/new/ https://reviews.llvm.org/D152391 __

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Just realized this is probably going to be a bit more painful. the attribute propagation pass requires a `CodeGenModule` which isn't built without an `ASTContext` so it's not available here. Nothing those functions do explicitly requires the full `CGM`, they only use th

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D152391#4404106 , @tra wrote: >> clang in.bc -Xclang -mlink-builtin-bitcode -Xclang libdevice.10.bc > > If that's something we intend to expose to the user, should we consider > promoting it to a top-level driver option? I'm

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > clang in.bc -Xclang -mlink-builtin-bitcode -Xclang libdevice.10.bc If that's something we intend to expose to the user, should we consider promoting it to a top-level driver option? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. That's cleaner than I expected, thanks. Might be reasonable to factor out the method as an initial NFC then insert the call to it along with the new test case as the functional change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D152391: [Clang] Allow bitcode linking when the input is LLVM-IR

2023-06-07 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: tra, yaxunl, jdoerfert, tianshilei1992, MaskRay, JonChesterfield, phosek. Herald added a project: All. jhuber6 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Clang provides the `-mli