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

2023-07-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:56 def BPFNoALU32 : Predicate<"!Subtarget->getHasAlu32()">; +def BPFHasCPUv4_ldsx : Predicate<"Subtarget->getCPUv4_ldsx()">; +def BPFHasCPUv4_movsx : Predicate<"Subtarget->getCPUv4_movsx()">; --

[PATCH] D133361: [BPF] Attribute btf_decl_tag("ctx") for structs

2023-08-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:2432 ImmArg>]>; +def int_context_marker_bpf : DefaultAttrsIntrinsic<[llvm_ptr_ty], + [llvm_ptr_

[PATCH] D133361: [BPF] Attribute btf_decl_tag("ctx") for structs

2023-08-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I will try to review other parts of code in the next few days. Comment at: llvm/include/llvm/IR/Intrinsics.td:2432 ImmArg>]>; +def int_context_marker_bpf : DefaultAttrsIntrinsic<[llvm_ptr_ty], +

[PATCH] D133361: [BPF] Attribute btf_decl_tag("ctx") for structs

2023-08-29 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > I can rename these things, but tbh I don't think this functionality would be > useful anywhere outside BPF, thus such renaming would be kind-of deceptive > (and in case it would be useful, the renaming could be done at the time of > second use). Then let us kee

[PATCH] D76587: [BPF] support 128bit int explicitly in layout spec

2020-03-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: ast. Herald added subscribers: cfe-commits, danielkiss, hiraditya, kristof.beyls. Herald added a project: clang. Currently, bpf does not specify 128bit alignment in its layout spec. So for a structure like struct ipv6_key_t {

[PATCH] D76587: [BPF] support 128bit int explicitly in layout spec

2020-03-28 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGced0d1f42b39: [BPF] support 128bit int explicitly in layout spec (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76587/new/ https

[PATCH] D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id()

2020-02-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked an inline comment as done. yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFPreserveDIType.cpp:95 + + std::string BaseName = "llvm.bpf_pdit."; + int Count = 0; ast wrote: > may be "llvm.btf_type_id." instead? > Oh, y

[PATCH] D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id()

2020-02-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 245574. yonghong-song added a comment. change llvm.bpf_pdit to llvm.btf_type_id variable name to make it easy to understand. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74572/new/ https://reviews.llvm.

[PATCH] D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id()

2020-02-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 245582. yonghong-song added a comment. fix a typo (BPFPreserveType.cpp => BPFPreserveDIType.cpp) in the comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74572/new/ https://reviews.llvm.org/D74572

[PATCH] D69393: [RFC][DebugInfo] emit user specified address_space in dwarf

2019-10-31 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 227400. yonghong-song edited the summary of this revision. yonghong-song added a comment. minor update to only support address_space 1 for user pointer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69393/n

[PATCH] D69393: [RFC][DebugInfo] emit user specified address_space in dwarf

2019-10-31 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. During experimenting with linux kernel codes, I found that clang does not allow address_space attribute for function pointers, specifically, in `clang/lib/Sema/SemaType.cpp`, // ISO/IEC TR 18037 S5.3 (amending C99 6.7.3): "A function type shall not be // quali

[PATCH] D69759: [RFC][BPF] Add preserve_access_index attribute to record definition

2019-11-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. This patch introduced a new bpf specific attribute which can be added to struct or union definition. For example, struct s { ... }

[PATCH] D69759: [RFC][BPF] Add preserve_access_index attribute to record definition

2019-11-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Discussed with Martin last Friday that it would be easier for CO-RE programming if we can annotate the structure itself. This is the RFC patch. Please let me whether this sounds a reasonable approach. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 228474. yonghong-song retitled this revision from "[RFC][BPF] Add preserve_access_index attribute to record definition" to "[BPF] Add preserve_access_index attribute for record definition". yonghong-song edited the summary of this revision. yonghong-son

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. For the below: struct s1 { int foo; }; struct s2 { struct s1 *ptr; } __reloc__ *s2; s2->ptr->foo -- will both deref be relocatable or only first? Only s2->ptr is relocated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Is the attribute sticky with forward delcarations? forward declaration is not a record type, so an error will be emited if you have attribute on a forward declaration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. For question > Is there a use case to apply that attribute to inner types automatically ? It is possible, but I feel make attribute per record is better. For example, struct s1 { int foo; }; struct s2 { struct s1 *ptr; } __reloc__ *s2; If we impl

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. But it does not work for inner structs any more. -bash-4.4$ cat t.c #define __reloc__ __attribute__((preserve_access_index)) struct __reloc__ p; struct p { int a; struct { int b; }; }; int test(struct p *arg) { return arg->b; } -bash-4.4$ In onl

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Yes, in the above, all three of them will be relocatable. -bash-4.4$ cat t2.c #define __reloc__ __attribute__((preserve_access_index)) struct S1; struct S2 { struct S1 *f; } __reloc__; struct S1 { int i; } __reloc__; // access s2->f

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Let me take a look whether this is a *relatively easy way* to support sticky forward declaration (w.r.t. applying to inner structures). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69759/new/ https://reviews.llvm.or

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 228538. yonghong-song edited the summary of this revision. yonghong-song added a comment. handle forward declaration correctly, i.e., not losing its attribute/action. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4a5aa1a7bf8b: [BPF] Add preserve_access_index attribute for record definition (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D6975

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Thanks, @aaron.ballman, I will fix the issue and address all you comments. I will re-open this commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69759/new/ https://reviews.llvm.org/D69759 _

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 228583. yonghong-song added a comment. The Decl "D" could be a nullptr in ProcessDeclAttributeDelayed, which will cause segfault. Handle this properly. Also addressed most of Aaron's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 228588. yonghong-song added a comment. use implicit attr to annotate records or fields not explicitly marked by users. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69759/new/ https://reviews.llvm.org/D69

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked 2 inline comments as done. yonghong-song added a comment. Hi, @aaron.ballman I think I addressed all your comments, could you take a look again? I tested all failed tests as exposed by the buildbot here (http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Regarding to this one "This is missing a bunch of C++ tests that show what happens in the case of inheritance, template instantiations, etc." Could you give me some example tests which I can take a look in order to add support. FYI, BPF backend publicly only suppor

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman BTW, I indeed tested C-style inheritance. An attribute for the forward declaration successfully inherited by a later actual declaration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69759/new/ https:/

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-12 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman just ping, could you let me know if you have any further comments? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69759/new/ https://reviews.llvm.org/D69759 __

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-13 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4e2ce228ae79: [BPF] Add preserve_access_index attribute for record definition (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D6975

[PATCH] D70257: [BPF] Restrict preserve_access_index attribute to C only

2019-11-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. yonghong-song retitled this revision from "[BPF] Restrict preserve_access_index to C only" to "[BPF] Restrict preserve_access_index at

[PATCH] D69759: [BPF] Add preserve_access_index attribute for record definition

2019-11-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked 7 inline comments as done. yonghong-song added a comment. Sorry about the committing. I thought all the review questions are addressed. Definitely will be more patient next time until getting review confirmation and also adhering to llvm review policy. Thanks for the detailed

[PATCH] D70257: [BPF] Restrict preserve_access_index attribute to C only

2019-11-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked an inline comment as done. yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:3431 -const auto *RecT = dyn_cast(ElaborateT->desugar().getTypePtr()); -if (!RecT) - return false; - -return RecT->getDecl()->hasAttr(

[PATCH] D70257: [BPF] Restrict preserve_access_index attribute to C only

2019-11-14 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdd16b3fe2559: [BPF] Restrict preserve_access_index attribute to C only (authored by yonghong-song). Changed prior to commit: https://reviews.llvm.org/D70257?vs=229355&id=229406#toc Repository: rG LLV

[PATCH] D70625: [DebugInfo][BPF] Support to emit debugInfo for extern variables

2019-11-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: aprantl, dblaikie, RKSimon, ast. yonghong-song added a project: debug-info. Herald added subscribers: llvm-commits, cfe-commits, ormris, hiraditya. Herald added projects: clang, LLVM. extern variable usage in BPF is different from

[PATCH] D70625: [DebugInfo][BPF] Support to emit debugInfo for extern variables

2019-11-23 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie Thanks for the review. To address your comments below: > the title talks about global variables > the description talks about extern types (guessing that's just a typo?) The title is "Support to emit debugInfo for extern variables". In the description,

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-11-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, aprantl, RKSimon. yonghong-song added a project: debug-info. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Extern variable usage in BPF is different from traditional

[PATCH] D70625: [DebugInfo][BPF] Support to emit debugInfo for extern variables

2019-11-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song abandoned this revision. yonghong-song added a comment. @dblaikie As suggested, just submitted two separate patches: - https://reviews.llvm.org/D70696 for clang/llvm change to generate debuginfo for extern variables - https://reviews.llvm.org/D70697 for BPF backend to consume such

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-11-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The corresponding BPF patch to consume the debuginfo https://reviews.llvm.org/D70697. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70696/new/ https://reviews.llvm.org/D70696 __

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-11-29 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @SouraVX Currently, I filtered all external globals if they are not used. See for (auto D: ExternalDeclarations) { if (!D || D->isInvalidDecl() || D->getPreviousDecl() || !D->isUsed()) continue; Consumer.CompleteExternalDeclaration(D); } If I r

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked an inline comment as done. yonghong-song added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1140 + for (auto D: ExternalDeclarations) { +if (!D || D->isInvalidDecl() || D->getPreviousDecl() || !D->isUsed()) aprantl wrote: > cla

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @probinson for the question, > Does bpf require debug info for the declaration of global_var in noref.c ? No, bpf only cares the referenced external global variables. So my current implementation does not emit debug info for external global_var in noref.c. It is

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie Good points. I will guard external variable debug info generation under `-fstandalone-debug` flag. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70696/new/ https://reviews.llvm.org/D70696 ___

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie The concern for that users using -fstandalone-debug may suddenly see a bloat of external var debug info is totally valid. Let me just stick to BPF use case for now. If somebody else ever wants this information with `-fstandalone-debug`, the restriction

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 231786. yonghong-song edited the summary of this revision. yonghong-song added a comment. clang-format change (from @aprantl) , add a little details into summary related to recent discussion, move tests from CodeGenCXX to CodeGen as they are all C tests

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D70696#1767616 , @dblaikie wrote: > Many of the test cases could be collapsed into one file - using different > variables that are used, unused, locally or globally declared, etc. Okay. Will try to consolidate into one

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 232426. yonghong-song added a comment. consolidated into less test files, added more test cases along the way. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70696/new/ https://reviews.llvm.org/D70696 Fil

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie I consolidated test cases as you suggested. Along the way, I also added some more tests. I already answered some of your questions earlier. Please let me know what you think. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @Jac1494 Based on early discussion, we cannot just issue debuginfo for externs when -g is specified as this may cause debuginfo (and final binary) size bloat. One possible way is to enable it when `-fstandalone-debug` is specified. @dblaikie can you comment on thi

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked an inline comment as done. yonghong-song added inline comments. Comment at: clang/test/CodeGen/debug-info-extern-basic.c:14-23 +extern int (*foo)(int); +int test3() { + return foo(0); +} + +int test4() { + extern int (*foo2)(int); dblaikie

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 232980. yonghong-song added a comment. remove some redundant test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70696/new/ https://reviews.llvm.org/D70696 Files: clang/include/clang/AST/ASTConsum

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-10 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd77ae1552fc2: [DebugInfo] Support to emit debugInfo for extern variables (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70696/new

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: rnk. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[D

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I cannot remove BPF target requirement as only BPF target can trigger debug info generation for extern variables. This is by design as discussed in D70696 due to concerns it may blow up debug info binary size for existing applicat

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @rnk I just submitted a patch https://reviews.llvm.org/D71818 to use `%clang_cc1` instead of `%clang` in the test. Could you check whether this fixed your issue or not? I cannot remove BPF target requirement as only BPF target can trigger debug info generation fo

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song marked an inline comment as done. yonghong-song added inline comments. Comment at: clang/test/CodeGen/debug-info-extern-basic.c:1 +// REQUIRES: bpf-registered-target +// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCh

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 235078. yonghong-song added a comment. Removed `REQUIRES: bpf-registered-target`. This is not needed any more if using `%clang_cc1`. Tested by build clang with and without BPF target. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe3d8ee35e4ad: reland "[DebugInfo] Support to emit debugInfo for extern variables" (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @rnk I somehow cannot reproduce the issue locally. If you can let me know how to exactly reproduce the issue, I might be able to also help with some kind of solution, although frankly speaking, I am not a clang expert. Repository: rG LLVM Github Monorepo CHANG

[PATCH] D71818: reland "[DebugInfo] Support to emit debugInfo for extern variables"

2019-12-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @rnk Great to know the reason. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71818/new/ https://reviews.llvm.org/D71818 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-23 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Could you link to particular bots that have logs showing they ran this test? > (perhaps the logs have been retired by now, though - since this patch was > reverted :/ - but then at least seeing which bots run BPF tests would be > helpful) @dblaikie Actually, I

[PATCH] D70696: [DebugInfo] Support to emit debugInfo for extern variables

2019-12-23 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie The root cause has been identified by @rnk . A clang plugin is used which requires the following patch: https://github.com/llvm/llvm-project/commit/5128026467cbc17bfc796d94bc8e40e52a9b0752 which has been merged. The original extern variable debug info

[PATCH] D73900: [BPF] use base lvalue type for preserve_{struct,union}_access_index metadata

2020-02-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. Linux commit https://github.com/torvalds/linux/commit/1cf5b23988ea0086a252a5c8b005b075f1e9b030#diff-289313b9fec99c6f0acfea19d9cfd9

[PATCH] D73900: [BPF] use base lvalue type for preserve_{struct,union}_access_index metadata

2020-02-04 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9271cab270a5: [BPF] use base lvalue type for preserve_{struct,union}_access_index metadata (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D74572: [WIP][BPF] implement intrinsic function __builtin__btf_type_id()

2020-02-13 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. Herald added subscribers: llvm-commits, cfe-commits, hiraditya, mgorny. Herald added projects: clang, LLVM. The builtin signature looks like: unsigned type_id = __builtin_btf_type_id(expression); The "expressio

[PATCH] D74572: [WIP][BPF] implement intrinsic function __builtin__btf_type_id()

2020-02-13 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 244529. yonghong-song edited the summary of this revision. yonghong-song added a comment. Herald added a subscriber: ormris. add the type_id assignment to FieldInfo relocation .btf.ext ELF section. Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D74572: [WIP][BPF] implement intrinsic function __builtin__btf_type_id()

2020-02-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 244709. yonghong-song edited the summary of this revision. yonghong-song added a comment. Addressing some Alexei's comments: Change comments in clang CGBuiltin.cpp to make it easier to understand. Remove BPFMIPreserveDIType.cpp and fold into existin

[PATCH] D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id()

2020-02-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 244826. yonghong-song retitled this revision from "[WIP][BPF] implement intrinsic function __builtin__btf_type_id()" to "[BPF] preserve debuginfo types for builtin __builtin__btf_type_id()". yonghong-song edited the summary of this revision. yonghong-so

[PATCH] D74668: [Clang][BPF] implement __builtin_btf_type_id() builtin function

2020-02-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The corresponding LLVM side of change is https://reviews.llvm.org/D74572 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74668/new/ https://reviews.llvm.org/D74668 ___ cfe-

[PATCH] D74668: [Clang][BPF] implement __builtin_btf_type_id() builtin function

2020-02-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. yonghong-song added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. yonghong-song added a comment. The corresponding LLVM side of change is https://reviews.llvm.org/D74572 Such a built

[PATCH] D74572: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id()

2020-02-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The corresponding clang side of change is https://reviews.llvm.org/D74668 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74572/new/ https://reviews.llvm.org/D74572 ___ cfe

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

2023-02-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. Herald added a subscriber: hiraditya. Herald added a project: All. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. In [1], a few new insns are proposed to exgend BPF ISA t

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

2023-06-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 534361. yonghong-song added a comment. - added support of new instructions in inline assembly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/ https://reviews.llvm.org/D144829 Files: clang/li

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

2023-06-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 534801. yonghong-song added a comment. - avoid changing conditions during JMP -> JMPL conversion. Otherwise, verification may fail in some cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/

[PATCH] D153898: [DebugInfo] Enable debug info emission for extern variables in C++

2023-06-29 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song accepted this revision. yonghong-song added a comment. I am okay with this change. Once you used this patch and implemented the mechanism inside Google. Could you send a follow-up summary on what the implementation looks like in Google? This will give people a sense why this is us

[PATCH] D150017: [Clang][BPF] Type print btf_type_tag properly

2023-05-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, aaron.ballman. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When running bcc tool execsnoop ([1]) which is built with lat

[PATCH] D150017: [Clang][BPF] Type print btf_type_tag properly

2023-05-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D150017#4326665 , @aaron.ballman wrote: > LGTM, but please also add a release note about the fix. Thanks @aaron.ballman. I intend to backport this patch to llvm16 and adding a release note about the fix will have backp

[PATCH] D150017: [Clang][BPF] Type print btf_type_tag properly

2023-05-08 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 rG3060304906f0: [Clang][BPF] Type print btf_type_tag properly (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D143967: [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF

2023-05-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie could you help take a look at this patch? Similar to https://reviews.llvm.org/D143966, this patch is the clang frontend change to support new btf_type_tag format, as we discussed and agreed with gcc community (https://lore.kernel.org/bpf/87r0w9jjoq@o

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

2023-05-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 523253. yonghong-song added a comment. - Fixed issues reported by Eduard - llvm-objdump issue (as stated in 'Summary') is not resolved yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144829/new/ https:

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

2023-05-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 523569. yonghong-song edited the summary of this revision. yonghong-song added a comment. - Fixed previous llvm-objdump issue for '> 16bit' 'gotol' insns. - Now basic functionality for cpu=v4 should be complete for llvm, further work will focus on kerne

[PATCH] D143967: [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF

2023-05-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Related to `btf_type_is_modifier()` issue, Not that depending on call site, sometimes typedef is skipped and sometimes are not. So we could keep btf_type_is_modifier() as is and modify the call size to not skip typedef in specific places. Or we could remove typede

[PATCH] D143967: [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF

2023-05-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I see the following in the Summary: Type tag for CVR modifier type C: volatile int __attribute__((btf_type_tag("__b"))) b; DWARF: 0x31: DW_TAG_variable DW_AT_name ("b") DW_AT_type (0x3c "volatile int") 0

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-02-21 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. Current ASTContext.getAttributedType() takes attribute kind, ModifiedType and EquivType as the

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-02-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 411182. yonghong-song added a comment. fix clang-format issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: clang/include/clang/AST/ASTContext.h

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-02-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman ping, did you get time to look at this patch? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 ___ cfe-commits mai

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-02-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman Thanks for suggestion. Agree that Having a new Type is a better idea. I guess, I will add BTFTagAttributeType which extends AttributeType to see whether it works or not. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-02-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @erichkeane Thanks for suggestion. I will add as an independent type then. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 ___ cf

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 413219. yonghong-song edited the summary of this revision. yonghong-song added a comment. Herald added subscribers: dexonsmith, arphaman, martong. Herald added a project: All. - Create a separate type BTFTagAttributed instead of using Attributed type ba

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman @erichkeane Just updated the patch with a new implementation, which added a new BTFTagAttributedType instead of reusing existing AttributedType. It is quite complicated and various parts of clang are touched. I mostly just followed what AttributedTy

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-07 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/AST/Type.h:4793 + + QualType ModifiedType; + QualType EquivalentType; erichkeane wrote: > I suspect both of these aren't necessary. If the intent here is to just wrap > a single type, I thin

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-07 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @erichkeane Thanks for the review. I will try to address your comments as soon as possible. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 413861. yonghong-song added a comment. - address @erichkeane comments - further TODO: add more tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: cl

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @erichkeane Just posted a patch to address your comments. Could you take a look? I will try to add more tests, esp. serialization and libclang. If you have any suggestions in these two areas (as I am not familiar with them), it would be great! Repository: rG L

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie ping. Did you get a chance of looking at it? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 ___ cfe-commits mailing li

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 340606. yonghong-song added a comment. - somehow previous test case didn't trigger nullptr for Fn. Replaced it with a working test case. With the following change, diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index a784

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:2843-2844 + CGDebugInfo *DI = CGM.getModuleDebugInfo(); + auto *Fn = dyn_cast(LV.getPointer(*this)); + if (DI && Fn && !Fn->getSubprogram()) +DI->EmitFunctionDecl(FD, FD->getLocat

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Looks like stripPointerCasts() is enough to make it work (no null Function pointer any more). This is consistent with llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( StringRef MangledName, llvm::Type *Ty, GlobalDecl GD, bool ForVTable, bool Do

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 340650. yonghong-song added a comment. - use stripPointerCasts() to remove the cast of DeclRefExpr pointer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 Files

[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 340675. yonghong-song added a comment. formatting to mode "DI = CGM.getModuleDebugInfo()" and use cast<...> instead of dyn_cast<...> since there should be no possibility of null ptr. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

<    1   2   3   4   5   >