[PATCH] D103549: [POC] Put annotation strings into debuginfo.

2021-06-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a project: debug-info. Herald added subscribers: dexonsmith, pengfei, JDevlieghere, hiraditya, kristof.beyls, mgorny. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits

[PATCH] D103549: [POC] Put annotation strings into debuginfo.

2021-06-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > As for supporting it in DWARF, probably with a custom attribute > (DW_AT_BTF_annotation? (or "LLVM" instead of "BTF" perhaps, I'm not sure)) > with a standard form (DW_FORM_strp/strxN/etc - the usual way we emit strings). This is a good idea. Could you give some

[PATCH] D103549: [POC] Put annotation strings into debuginfo.

2021-06-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie Thanks for the pointer! I will work on the new patch, starting with DW_AT_BTF_annotation (to limit the scope where annotations will be processed) and post a new patch soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

2021-09-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: aaron.ballman. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently, linux kernel has a __user attribute ([1]) defined as __attribute__((noderef, add

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: aaron.ballman. Herald added a subscriber: jdoerfert. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously, btf_tag attribute supports record, field, gl

[PATCH] D110129: [DebugInfo] Support typedef with btf_tag attributes

2021-09-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: dblaikie. yonghong-song added a project: debug-info. Herald added subscribers: dexonsmith, ormris, hiraditya. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-comm

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The corresponding clang codegen and llvm implementation: https://reviews.llvm.org/D110129 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110127/new/ https://reviews.llvm.org/D110127 __

[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

2021-09-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 374057. yonghong-song added a comment. - change to use DeclOrTypeAttr in Attr.td to indicate the attribute can be used for declarations or type qualifier. - add explanation of why the change in AttrDocs.td and the test. Repository: rG LLVM Github Mo

[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

2021-09-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman Addressed your comments, please take a look. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110116/new/ https://reviews.llvm.org/D110116 ___ cfe-commi

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D110127#3012215 , @aaron.ballman wrote: >> First, to build linux kernel with btf_tag annotated user pointer, we have >> >> #define __user __attribute__((btf_tag("user"))) >> and the linux kernel contains code like below

[PATCH] D110129: [DebugInfo] Support typedef with btf_tag attributes

2021-09-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 374073. yonghong-song added a comment. - updated tests based on @probinson suggestions. - The only thing left is for llvm/test/DebugInfo/X86/attr-btf_tag-typedef.ll for which I didn't use `%itanium_abi_triple` as it seems only available for %clang ...

[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

2021-09-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 374358. yonghong-song added a comment. - to adjust some wording in AttrDocs.td based on Aaron's suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110116/new/ https://reviews.llvm.org/D110116 File

[PATCH] D110116: [Clang] Ignore BTFTag attr if used as a type attribute

2021-09-22 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb875343873a5: [Clang] Ignore BTFTag attr if used as a type attribute (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D110127#3016371 , @aaron.ballman wrote: > In D110127#3013876 , @yonghong-song > wrote: > >> You can see that it doesn't matter where the attribute is placed, the >> attribute i

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 374388. yonghong-song added a comment. - use -std=c2x attribute syntax `[[]]` in test to more precisely specify the location of the attribute. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110127/new/ ht

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman ping. Hi, Aaron, did you get time looking at this patch again? I made some adjustments in test and explained overloadable attribute use case in comments. thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D110127: [Clang] Support typedef with btf_tag attributes

2021-09-29 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Thanks @aaron.ballman Let me think about how to deal with the typedef situation you mentioned and get back to you once I got some possible idea for discussion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110127/new/

[PATCH] D103667: [WIP] BPF: add support for DWARF_AT_LLVM_annotations attribute

2021-06-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: dblaikie. yonghong-song added a project: debug-info. Herald added subscribers: dexonsmith, dang, ormris, hiraditya. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llv

[PATCH] D103667: [WIP] BPF: add support for DWARF_AT_LLVM_annotations attribute

2021-06-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D103667#2798165 , @dblaikie wrote: > Is the C source syntax already fixed? Could it use a more specific name - > then maybe wouldn't need the flag to opt-in if the only places the attribute > appears is where it should

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 363480. yonghong-song edited the summary of this revision. yonghong-song added a comment. address Aaron and Andrii's comments: - warned and ignored if a btf_tag attribute is added to record forward declaration. - warned and ignored if a btf_tag attribu

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6841 + if (auto *Rec = dyn_cast(D)) { +if (!Rec->isCompleteDefinition()) { + S.Diag(AL.getLoc(), diag::warn_btftag_attribute_fwd_decl_ignored) << Str; aaron.ballman wrote:

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/test/Sema/attr-btf_tag.c:31 + +int __tag2 foo(struct t1 *arg); // expected-warning {{attribute 'btf_tag("tag2")' ignored as not in later redeclaration or definition}} +int __tag foo(struct t1 *arg); aaron.ba

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 363915. yonghong-song edited the summary of this revision. yonghong-song added a comment. - for redeclarations, use additive approach to accumulate all btf_tag attributes and apply accumulated attributes to the redeclaration. Repository: rG LLVM Git

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 363919. yonghong-song added a comment. - add more cases in clang attr-btf_tag-dicomposite.c test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106615/new/ https://reviews.llvm.org/D106615 Files: clang

[PATCH] D106618: [Clang][LLVM] generate btf_tag annotations for DISubprogram types

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 363920. yonghong-song added a comment. - add more cases in clang test attr-btf_tag-disubprogram.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106618/new/ https://reviews.llvm.org/D106618 Files: clang

[PATCH] D106619: [Clang][LLVM] generate btf_tag annotations for DIGlobalVariable

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 363923. yonghong-song added a comment. - add more cases in clang test attr-btf_tag-diglobalvariable.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106619/new/ https://reviews.llvm.org/D106619 Files: c

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. besides the clang test in this patch, there are more clang tests in the following patches (involving codegen): https://reviews.llvm.org/D106615 (for struct/union types) https://reviews.llvm.org/D106618 (for functions) https://reviews.llvm.org/D106619 (for glo

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6846-6847 +return; + if (hasBTFTagAttr(D, Str)) +return; + aaron.ballman wrote: > This should diagnose that the attribute is being ignored due to the mismatch > in tags (an

[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-08-10 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: rsmith. Herald added a subscriber: dexonsmith. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Paul Chaignon reported a bpf verifier failur

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Assuming I have that correct now, this approach looks correct to me (without > diagnosing the ignored duplicates). I agree that we don't need to diagnose the ignored duplicates. The following is an example, $ cat t.c int g __attribute__((section("a"))) __attrib

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 365882. yonghong-song added a comment. - fix a few nits in AttrDocs.td Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106614/new/ https://reviews.llvm.org/D106614 Files: clang/include/clang/Basic/Attr.t

[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-08-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 365893. yonghong-song added a comment. - fix clant-format warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107882/new/ https://reviews.llvm.org/D107882 Files: clang/lib/Sema/SemaType.cpp clang

[PATCH] D106614: [Clang] add btf_tag attribute

2021-08-12 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1b194ef1ab3b: [Clang] add btf_tag attribute (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-12 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 366156. yonghong-song added a comment. - fix clang-format warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106615/new/ https://reviews.llvm.org/D106615 Files: clang/lib/CodeGen/CGDebugInfo.cpp

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-12 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie The clang attr handling patch (D106614 ). Could you help review this patch which handles IR/BitCode Read/Write for btf_tag attributes? This patch contains a common function which will be used by other DItypes, so this pa

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie ping. Could you help take a look at the patch? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106615/new/ https://reviews.llvm.org/D106615 ___ cfe-commits mailing

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:3478-3479 + if (D->hasAttr()) +RealDecl->replaceAnnotations(CollectBTFTagAnnotations(D)); + dblaikie wrote: > Any reason this has to be done with a replace-style API, rather

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The attributes should be revolved during semantic analysis stage. So looks like replace-style attribute setting is not really needed. I will change to add attribute parameter during creation time. Thanks for suggestion. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D106615#2951101 , @dblaikie wrote: > In D106615#2950964 , @yonghong-song > wrote: > >> The attributes should be revolved during semantic analysis stage. So looks >> like replace

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 367109. yonghong-song edited the summary of this revision. yonghong-song added a comment. - do not use replacement-style API to set annotations. use creation-time parameter instead. - add a test case to show forward declaration doesn't generate btf_tag

[PATCH] D107882: BPF: Enable frontend constant folding for VLA size

2021-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. ping. @rsmith could you help take a look at the patch? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107882/new/ https://reviews.llvm.org/D107882 ___ cfe-commits ma

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D106615#2955622 , @dblaikie wrote: > Looks alright - please commit the LLVM and Clang portions of this separately. > (LLVM first, shouldn't require any changes to clang/should be standalone, > then committing the clang

[PATCH] D106615: [Clang][LLVM] generate btf_tag annotations for DIComposite types

2021-08-19 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2fded193e7a8: [DebugInfo] generate btf_tag annotations for DIComposite types (authored by yonghong-song). Changed prior to commit: https://reviews

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-10-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. All other comments make sense. Will fix them in the next revision. Comment at: clang/lib/Sema/SemaType.cpp:6526 + } + + ASTContext &Ctx = S.Context; aaron.ballman wrote: > Should you also validate that the type is a pointer type

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-10-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 382518. yonghong-song added a comment. - fix various clang-format and coding style issue suggested by @aaron.ballman Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https://reviews.llvm.org/D111

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-10-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Agreed. If after semantic analysis for a declaration we can check declaration's typeloc chain again, we might be able to give proper warnings. I am happy to implement this as a followup as you suggested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-10-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Ah, yeah, I see what you mean - that does seem sort of unfortunate. Is it > possible these attributes could only appear on typedefs and they'd be more > readily carried through that without needing extra typeloc tracking? (sorry > for not having read back throug

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Just to be sure my understanding is correct. Given an AttributedType node, we do have a way to get the corresponding Attr, is it right? @aaron.ballman Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https:/

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman I checked the source. Looks like we can easily get TypeLoc from TypeSourceInfo, but not from TypeSourceInfo to TypeLoc. But We need TypeLoc so we can get attr information and also traverse TypeLoc's.. We might be able to pass TypeSourceInfo in a few

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > That sounds reasonable to me, but one possibility would be to change > createType() and getOrCreateType() to take a TypeSourceInfo * rather than a > QualType (because you can go from the TypeSourceInfo * back to the QualType > by calling getType() on it). Howeve

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1426 + TypeLoc RetTL; + if (!TL.isNull()) { +if (auto FTL = TL.getAs()) dblaikie wrote: > I'm /guessing/ this can be rewritten as: > ``` > if (TL) > ``` > ? (similarly elsewh

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 384843. yonghong-song added a comment. - Change TypeLoc.isNull() check to !TypeLoc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https://reviews.llvm.org/D99 Files: clang/include/clang/

[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute

2021-11-04 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeb0fa8bfa356: [Clang][Attr] Support btf_type_tag attribute (authored by yonghong-song). Changed prior to commit: https://reviews.llvm.org/D99?

[PATCH] D97659: BPF: fix enum value 0 issue for __builtin_preserve_enum_value()

2021-02-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Lorenz Bauer reported that the following code will have compilation error for bpf target: e

[PATCH] D97659: BPF: fix enum value 0 issue for __builtin_preserve_enum_value()

2021-03-01 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG283db5f0837d: BPF: fix enum value 0 issue for __builtin_preserve_enum_value() (authored by yonghong-song). Repository: rG LLVM Github Monorepo CH

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-10-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: aaron.ballman, dblaikie. yonghong-song added a project: clang. Herald added a project: All. yonghong-song requested review of this revision. Herald added a subscriber: cfe-commits. For the following program, $ cat t.c struct

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-10-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D136807#3888317 , @aaron.ballman wrote: > The changes generally look good to me, but can you add a release note for the > fix as well? Yes, will add the bug fix brief description to clang/docs/ReleaseNotes.rst =

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-10-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 471216. yonghong-song added a comment. - Add the bug fix description in Release Note - Actually compare debuginfo btf_type_tag output instead of marking 'expected-no-diagnostics'. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D136041: [clang][DebugInfo] Emit DISubprogram for extern functions with reserved names

2022-10-28 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG524c640090a8: [clang][DebugInfo] Emit DISubprogram for extern functions with reserved names (authored by eddyz87, committed by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-10-31 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman or @dblaikie I have addressed the comments, could you take a look again? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136807/new/ https://reviews.llvm.org/D136807

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-11-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 472305. yonghong-song added a comment. - improve the bug description in release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136807/new/ https://reviews.llvm.org/D136807 Files: clang/docs/Releas

[PATCH] D136807: [clang][Sema] Fix a clang crash with btf_type_tag

2022-11-01 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2f047b56ba0e: [clang][Sema] Fix a clang crash with btf_type_tag (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D131598: [Clang][BPF]: Force sign/zero extension for return values in caller

2022-08-16 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd9198f64d9be: [Clang][BPF]: Force sign/zero extension for return values in caller (authored by yonghong-song). Repository: rG LLVM Github Monorepo

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: ast. Herald added subscribers: pengfei, kristof.beyls. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently, record argumen

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D132144#3732685 , @anakryiko wrote: > Are there any restrictions about number of struct arguments that can be > passed in? Kernel changes were assuming at most 2, should we have a test that > tests passing 3 structs tha

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The compiler only counted the total number of registers won't exceed 5. You could have 5 struct arguments (each one register), or 2 struct arguments (with two registers each) and one integer register. Whether to pass by value or by reference is a ABI issue, not rel

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Kernel changes were assuming at most 2 My new version code allows all 5 parameters to be a structure argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/ https://reviews.llvm.org/D132144 ___

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > but if the function is always_inline it can have more than 5 arguments, > right? That is correct. Will add a test case for this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/ https://reviews.llvm.org

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 453835. yonghong-song added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. add two llvm/test/CodeGen/BPF tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG481d67d310a7: [Clang][BPF] Support record argument with direct values (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D134705: [clang][DebugInfo] Emit debuginfo for non-constant case value

2022-09-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: dblaikie. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently, clang does not emit debuginfo for the switch stmt case valu

[PATCH] D134705: [clang][DebugInfo] Emit debuginfo for non-constant case value

2022-09-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D134705#3818657 , @dblaikie wrote: > SGTM - could you also add some CHECKs in the test that show the enumeration > was added to the enumerators list on the CU (& you can probably test with > just one enumerator - don't

[PATCH] D134705: [clang][DebugInfo] Emit debuginfo for non-constant case value

2022-09-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 463643. yonghong-song added a comment. - simplify test case, add more CHECK's and add comments to explain the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134705/new/ https://reviews.llvm.org/D1347

[PATCH] D134705: [clang][DebugInfo] Emit debuginfo for non-constant case value

2022-09-28 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG75be0482a2e2: [clang][DebugInfo] Emit debuginfo for non-constant case value (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D136041: [clang][DebugInfo] Emit DISubprogram for extern functions with reserved names

2022-10-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aprantl The following example shows the difference between gcc and clang w.r.t. reserved names. [$ ~/tmp3] cat t.c extern void *__bpf_kptr_new(int, int, void *) __attribute__((section(".ksyms"))); #define bpf_kptr_new(x) __bpf_kptr_new(x, 0, 0) struct

[PATCH] D136041: [clang][DebugInfo] Emit DISubprogram for extern functions with reserved names

2022-10-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D136041#3863748 , @dblaikie wrote: > Hmm - this does mean linking IR can produce invalid code, though, right (you > link in a definition of the function, so what was valid is now invalid - > because it now has a definit

[PATCH] D140929: [BPF] Support for "btf_decl_tag" annotations for arguments of extern functions

2023-01-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Please separate the patch to clang and llvm part. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4218 + // DISubprogram's retainedNodes in the subsequent finalizeSubprogram call. + if (IsDeclForCallSite && CGM.getTarget().getTriple().isBPF()) { +

[PATCH] D140929: [BPF] Support for "btf_decl_tag" annotations for arguments of extern functions

2023-01-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4218 + // DISubprogram's retainedNodes in the subsequent finalizeSubprogram call. + if (IsDeclForCallSite && CGM.getTarget().getTriple().isBPF()) { +if (auto *FD = dyn_cast(D)) {

[PATCH] D140970: [BPF] preserve btf_decl_tag for parameters of extern functions

2023-01-06 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song accepted this revision. yonghong-song added a comment. This revision is now accepted and ready to land. LGTM. I will add `// REQUIRES: bpf-registered-target` in the test to ensure it only executed with bpf target. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140970: [BPF] preserve btf_decl_tag for parameters of extern functions

2023-01-06 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG58bdf8f9a8c3: [BPF] preserve btf_decl_tag for parameters of extern functions (authored by eddyz87, committed by yonghong-song). Changed prior to commit: https://reviews.llvm.org/D140970?vs=486295&id=487

[PATCH] D141424: [clang][Sema] Fix uninitialized `SourceLocation` for types with multiple attributes and macros.

2023-01-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song accepted this revision. yonghong-song 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/D141424/new/ https://reviews.llvm.org/D141424

[PATCH] D142046: [BPF][clang] Ignore stack protector options for BPF target

2023-01-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @compnerd could you also take a look at this patch? First, some background about this patch. The reason of this patch is due to: https://lore.kernel.org/bpf/CAOFdcFPnHEc2qd-=c+hdk4ntjjfbhsf4r-g7pdjtrbat6mu...@mail.gmail.com/ Further the following link has deta

[PATCH] D142046: [BPF][clang] Ignore stack protector options for BPF target

2023-01-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @ast With this patch, gentoo clang compilation will hit the warning even if people appends -fno-stack-protector. Is this okay? In general, if the option is '-fstack-protector -fno-stack-protector', we should not issue warning, right? Repository: rG LLVM Github

[PATCH] D142046: [BPF][clang] Ignore stack protector options for BPF target

2023-01-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Sorry, I double checked. '-fstack-protector -fno-stack-protector' will not result in warnings. So the patch LGTM. So gentoo people can add -fno-stack-protector to suppress warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D142046: [BPF][clang] Ignore stack protector options for BPF target

2023-01-20 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG56b038f887f3: [BPF][clang] Ignore stack protector options for BPF target (authored by eddyz87, committed by yonghong-song). Repository: rG LLVM Gi

[PATCH] D142046: [BPF][clang] Ignore stack protector options for BPF target

2023-01-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dyung I just pushed the fix to the 'main' branch (https://github.com/llvm/llvm-project/commit/183d075055c591dedead7ece972f1bdea611aa3b). Please check it out. Thanks for reporting! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D126839: [clang][BPF] Update comment to include TYPE_MATCH

2022-06-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. LGTM. But add the reference (https://reviews.llvm.org/D126838) to the commit message to indicate which 'earlier change'. Also let us merge it unti kernel side change is in reasonable shape. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D126839: [clang][BPF] Update comment to include TYPE_MATCH

2022-06-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D126839#3554474 , @d-e-s-o wrote: > In D126839#3554125 , @yonghong-song > wrote: > >> Also let us merge it unti kernel side change is in reasonable shape. > > From what I underst

[PATCH] D144829: [WIP][BPF] Add a few new insns under cpu=v4

2023-07-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 541265. yonghong-song edited the summary of this revision. yonghong-song added a comment. - Dropping 'CPUv4' in some variable/function names and also in debug flags. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D144829: [WIP][BPF] Add a few new insns under cpu=v4

2023-07-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 542245. yonghong-song added a comment. - remove a copy-paste comment from s390 arch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/ https://reviews.llvm.org/D144829 Files: clang/lib/Basic/Tar

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D144829#4519036 , @eddyz87 wrote: > I tried adding a test similar to `assemble-disassemble.ll`: > > // RUN: llvm-mc -triple bpfel --mcpu=v4 --assemble --filetype=obj %s \ > // RUN: | llvm-objdump -d --mattr=+alu32 -

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:379 + "$dst = (s8)$src", + [(set GPR:$dst, (sra (shl GPR:$src, (i64 56)), (i64 56)))]>; + def MOVSX_rr_16 : ALU_RR I think it is possible to avoid matc

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Could you please also add a few tests for `gotol`? Will do! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/ https://reviews.llvm.org/D144829 ___ cfe-commits ma

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 543709. yonghong-song added a comment. Three major changes in this patch: - for ldsx insns, remove 32bit ldsx insns (1-byte and 2-byte sign extension) since the ldsx insn expects to sign extension all the way up to 8-byte and normal 32bit insn (e.g. B

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 544055. yonghong-song added a comment. - Add more tests in assembler-disassembler-v4.s and gotol.ll. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/ https://reviews.llvm.org/D144829 Files: cl

[PATCH] D144829: [BPF] Add a few new insns under cpu=v4

2023-07-26 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6c412b6c6faa: [BPF] Add a few new insns under cpu=v4 (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D156726: Make globals with mutable members non-constant, even in custom sections

2023-08-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D156726#4593671 , @dblaikie wrote: > Fixed in 19c216b5ab7c34c297b4c3c4da64b49b3c830a3a Hi, @dblaikie I cannot find the above commit in llvm-project and with latest llvm-project 'main' branch, the problem seems still exi

[PATCH] D156726: Make globals with mutable members non-constant, even in custom sections

2023-08-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Ah, right right - sorry, failed to push. Here it is: > 2993243c45abdb4f2bc3979336d054be165b1134 > Thanks! I tested and the problem with bpf backend is resolved! Repository: rG LLVM Github

[PATCH] D144829: [WIP][BPF] Add a few new insns under cpu=v4

2023-07-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D144829#4465193 , @eddyz87 wrote: > Hi Yonghong, > > What is the current plan for these changes? > I'd like to refresh D140804 to make BPF_ST > instruction available for cpu v4. > I see

[PATCH] D144829: [WIP][BPF] Add a few new insns under cpu=v4

2023-07-12 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 539842. yonghong-song edited the summary of this revision. yonghong-song added a comment. - rename some insn names or mode names (movs -> movsx, lds -> ldsx, MEMS -> MEMSX) etc to be consistent with kernel. - add 5 llc flags to control on/off for each k

<    1   2   3   4   5   >