[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:2844 + auto *Fn = + dyn_cast(LV.getPointer(*this)->stripPointerCasts()); + if (DI && !Fn->getSubprogram()) dblaikie wrote: > Oh, please change this to cast, rather th

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

2021-04-26 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa2a3ca8d9796: BPF: emit debuginfo for Function of DeclRefExpr if requested (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/

[PATCH] D102118: [BPF] add support for 32 bit registers in inline asm

2021-05-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Generally looks good. One suggestion and a few nits. Thanks! Comment at: clang/lib/Basic/Targets/BPF.cpp:54 +if (Feature == "+alu32") { + HasAlu32 = true; +} -mcpu=v3 also enables alu32. See below llvm code ``` void B

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: dblaikie. yonghong-song added projects: debug-info, clang. yonghong-song requested review of this revision. Herald added a subscriber: cfe-commits. Commit e3d8ee35e4ad

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The corresponding clang patch is here: https://reviews.llvm.org/D100567 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 ___ cfe-c

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Yes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. For the first example, actually clang is smart enough to remove all dead code, so nothing generated. [yhs@devbig003.ftw2 ~/tmp/ext_func_var]$ cat t1.c extern void f1(); void f2(void *); inline void f3() { f2(f1); } [yhs@devbig003.ftw2 ~/tmp/ext_func_var]$ clang

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:2840 +// Emit debuginfo for the function declaration if the target wants to. +if (getContext().getTargetInfo().allowDebugInfoForExternalVar()) { + CGDebugInfo *DI = CGM.getModuleDebugInfo()

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 337948. yonghong-song edited the summary of this revision. yonghong-song added a comment. Rename TargetInfo.allowDebugInfoForExternalVar to TargetInfo.allowDebugInfoForExternalRef. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 337988. yonghong-song added a comment. check FD->isDefined() as well before emit debuginfo for the declaration. It is okay to emit a declaration subprogram and later refined to be with definition. But it is not okay to refine a definition to a declarat

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 337993. yonghong-song added a comment. - check Fn->getSubprogram() before emit debuginfo. This is consistent with EmitFuncDeclForCallSite() and is better than checking FD->isDefined() as we may hit multiple DeclRefExpr and all of them will go through e

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

2021-04-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 338002. yonghong-song added a comment. - checked both !FD->isDefined() and !Fn->getSubprogram() before emitting debuginfo for the declaration - added additional tests to mix DeclRefExpr and actual function definition. Repository: rG LLVM Github Mono

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

2021-04-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 338202. yonghong-song added a comment. fix a clang-format warning Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 Files: clang/include/clang/Basic/TargetInfo.

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

2021-04-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie I renamed the variable, added a few guards to ensure safety and avoid unnecessary attempt to generate duplicated debuginfo, and enhanced the test case to cover mix of declaration, accessing extern func address and definition of the function. Could you ta

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

2021-04-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D100567#2695827 , @dblaikie wrote: > Generally looks OK, but could you explain more about the problems > with/motivation for the declaration/definition issue? (probably worth noting > in the patch description maybe comm

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

2021-04-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Sorry, I know what is the segfault now after some debugging. It is because `auto *Fn = dyn_cast(LV.getPointer(*this));` is a NULL pointer after there is a definition before this. Will pose another patch but with test case remains to cover mix of declaration, point

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

2021-04-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 338252. yonghong-song added a comment. - isDefined() is not necessary, segfault is caused by a nullptr by causing a LV.getPointer(). Check nullptr instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10

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

2021-04-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 338323. yonghong-song added a comment. - add checking CGDebugInfo pointer. In my original patch but got lost in the revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llv

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

2021-04-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I did some debugging on why DeclRefExpr evaluated not to be a Function pointer. Here is what I got. I made the following clang change to dump out the pointer to the emited value ('&foo'): diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp ind

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

2021-04-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D100567#2697412 , @dblaikie wrote: > In D100567#2696095 , @yonghong-song > wrote: > >> Sorry, I know what is the segfault now after some debugging. It is because >> `auto *Fn =

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

2021-04-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. To answer one of your questions above, if there is a function definition before, dyn_cast(...) will return nullptr. I tried starting from "Value" class and found dyn_cast to llvm::ConstantExpr will result in a non-null object, but I did not trace down further with

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

2021-04-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Did some further investigation, the following is the callchain: EmitFunctionDeclLValue EmitFunctionDeclPointer GetAddrOfFunction GetOrCreateLLVMFunction The GetOrCreateLLVMFunction has the following comments: /// GetOrCreateLLVMFunct

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

2021-04-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie I did some investigation, found the root cause and provided an alternative solution. Could you check whether you are okay with either approach? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ http

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

2021-04-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. ping @dblaikie could you take a look of my new investigation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100567/new/ https://reviews.llvm.org/D100567 ___ cfe-commits mai

[PATCH] D111199: [POC][BTF] support btf_type_tag attribute

2021-10-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: aaron.ballman. Herald added subscribers: dexonsmith, hiraditya. yonghong-song requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Commit [1] introduced btf_t

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

2021-10-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman We discussed internally and I think your concern of mixing type attribute and decl attribute is valid. In the long run, having two separate attributes, one for type (btf_type_tag) and another for decl (btf_decl_tag) seems clean and better. I have cr

[PATCH] D111199: [POC][BTF] support btf_type_tag attribute

2021-10-06 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 377727. yonghong-song added a comment. - Instead of piggyback on existing AttributedType, create a new child class AttributedBTFType. The code is reorganized to avoid intrusive to existing AttributedType. - Hack: the AttributedBTFType still not trivial

[PATCH] D111199: [POC][BTF] support btf_type_tag attribute

2021-10-10 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman Ping. This is to address your concern in D110127 , could you take a look whether my proposal for a new attribute btf_type_tag will be okay for you or not? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINC

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

2021-10-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman ping. To address your concerns, I intend to create another type attribute btf_type_tag (https://reviews.llvm.org/D99), could you comment on this new approach? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D111199: [POC][BTF] support btf_type_tag attribute

2021-10-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D99#3055928 , @aaron.ballman wrote: > In D99#3054126 , @yonghong-song > wrote: > >> @aaron.ballman Ping. This is to address your concern in D110127 >>

[PATCH] D111199: [POC][BTF] support btf_type_tag attribute

2021-10-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/AST/Type.h:4768 +private: + std::string BTFTypeTag; + aaron.ballman wrote: > I think we should be able to use a `StringRef` instead, rather than have to > worry about allocations. StringRef in

[PATCH] D111588: [Clang][Attr] rename btf_tag to btf_decl_tag

2021-10-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: aaron.ballman, ast, anakryiko. Herald added a subscriber: jdoerfert. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Current btf_tag is applied to declaration

[PATCH] D111588: [Clang][Attr] rename btf_tag to btf_decl_tag

2021-10-11 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 rGa162b67c9806: [Clang][Attr] rename btf_tag to btf_decl_tag (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

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

2021-10-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 379772. yonghong-song retitled this revision from "[POC][BTF] support btf_type_tag attribute" to "[Clang][LLVM][Attr] support btf_type_tag attribute". yonghong-song edited the summary of this revision. yonghong-song added a comment. Herald added subscrib

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

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

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

2021-10-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @pchaigno as @efriedma suggested, we can add some transformation in BPF target IR passes to ignore @llvm.stacksave() and @llvm.stackrestore(). I should have a patch ready soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

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

2021-10-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @pchaigno @efriedma I added an IR pass in BPF backend to remove these stacksave/stackrestore intrinsics. https://reviews.llvm.org/D111897 @pchaigno Could you test with https://reviews.llvm.org/D111897 instead? Repository: rG LLVM Github Monorepo CHANGES SINCE L

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

2021-10-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 380049. yonghong-song added a subscriber: urnathan. yonghong-song added a comment. - fix a few clang-format issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https://reviews.llvm.org/D

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

2021-10-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 380275. yonghong-song retitled this revision from "[Clang] Support typedef with btf_tag attributes" to "[Clang] Support typedef with btf_decl_tag attributes". yonghong-song edited the summary of this revision. yonghong-song added a comment. - rebase bas

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

2021-10-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 380276. yonghong-song retitled this revision from "[DebugInfo] Support typedef with btf_tag attributes" to "[DebugInfo] Support typedef with btf_decl_tag attributes". yonghong-song edited the summary of this revision. yonghong-song added a comment. - u

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

2021-10-20 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? Esp. any comments on this approach with a subclass AttributedBTF vs. putting a StringRef directly in Attributed? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

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

2021-10-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman ping. This patch just implemented a btf_decl_tag for typedef. There is no type attribute involved here. Could you take a look? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110127/new/ https://reviews.

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

2021-10-21 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb396010240cd: [Clang] Support typedef with btf_decl_tag attributes (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110127/new/ ht

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

2021-10-21 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 rGf6811cec8421: [DebugInfo] Support typedef with btf_decl_tag attributes (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES S

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

2021-10-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D99#3078184 , @aaron.ballman wrote: > I reviewed this a bit, but I think it might be heading in a slightly wrong > direction. I think you should be using an `AttributedType` but I don't think > we need to add `Attr

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

2021-10-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 382088. yonghong-song added a comment. - removed AttributedBTFType subclass. Instead of using corresponding *TypeLoc to retrieve string argument for btf_type_tag attribute. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

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

2021-10-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 382143. yonghong-song added a comment. - fix clang-format warnings Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https://reviews.llvm.org/D99 Files: clang/include/clang/Basic/Attr.td

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

2021-08-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 367709. yonghong-song added a comment. - use creation-parameters for annotations instead of replacement-style APIs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106616/new/ https://reviews.llvm.org/D1066

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

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

[PATCH] D106620: [Clang][LLVM] generate btf_tag annotations for func parameters

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

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

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

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

2021-08-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie could you take a look at this patch? The same as previous DIComposite patch (D106615 ), if the patch is accepted, I will break into llvm part and clang part and commit them separately. Repository: rG LLVM Github Monor

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

2021-08-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. For > (any chance have you measured/could you measure how much larger the bitcode > for, say, an LLVM self-host Debug build gets with all these btf patches? > (even without targeting/using btf, this is adding an extra field to lots of > the debug info metadata, a

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

2021-08-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 367846. yonghong-song added a comment. - put checking btf_tag existence condition in function CollectBTFTagAnnotations Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106616/new/ https://reviews.llvm.org/D1

[PATCH] D106616: [Clang][LLVM] generate btf_tag annotations for DIDerived types

2021-08-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 rG430e22388173: [DebugInfo] generate btf_tag annotations for DIDerived types (authored by yonghong-song). Changed prior to commit: https://reviews.l

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

2021-08-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 368015. yonghong-song added a comment. - simplify clang code due to https://reviews.llvm.org/D106616 - fix a couple of clang-format warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106618/new/ http

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

2021-08-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie could you take a look at this patch? Similar to a couple of previous similar patches, if accepted, I will break the patch into two pieces, one for clang and another for llvm, and commit them separately. Repository: rG LLVM Github Monorepo CHANGES SIN

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

2021-08-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D106618#2965546 , @dblaikie wrote: > The clang side might benefit from a test with a function declaration, a call > to that function, but no definition of it - with optimizations enabled, clang > should emit the DISubpr

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

2021-08-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 368789. yonghong-song added a comment. - add annotations to DISubprogram generated for extern functions called in the current cu and add a test for that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1066

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

2021-08-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/test/CodeGen/attr-btf_tag-disubprogram-2.c:5-14 +#define __tag2 __attribute__((btf_tag("tag2"))) + +struct t1 { + int a; +}; + +extern int __tag1 __tag2 foo(struct t1 *); dblaikie wrote: > Any particular rea

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

2021-08-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 368805. yonghong-song added a comment. - rename test file names properly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106618/new/ https://reviews.llvm.org/D106618 Files: clang/lib/CodeGen/CGDebugInfo.

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

2021-08-25 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. We have llvm::DINode::DIFlags CGDebugInfo::getCallSiteRelatedAttrs() const { // Call site-related attributes are only useful in optimized programs, and // when there's a possibility of debugging backtraces. if (!CGM.getLangOpts().Optimize || DebugKind

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

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

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

2021-08-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 rGd383df32c0d5: [DebugInfo] generate btf_tag annotations for DISubprogram types (authored by yonghong-song). Changed prior to commit: https://review

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

2021-08-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 rG30c288489ae5: [DebugInfo] generate btf_tag annotations for DIGlobalVariable (authored by yonghong-song). Changed prior to commit: https://reviews.

[PATCH] D106620: [Clang][LLVM] generate btf_tag annotations for func parameters

2021-08-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 rG1bebc31c617d: [DebugInfo] generate btf_tag annotations for func parameters (authored by yonghong-song). Changed prior to commit: https://reviews.l

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

2021-09-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @rsmith ping again, did you get a time to take a look? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107882/new/ https://reviews.llvm.org/D107882 ___ cfe-commits mailing li

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

2021-09-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @efriedma Thanks for suggestion! Let me look at CodeGenFunction::EmitAutoVarAlloca() call instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107882/new/ https://reviews.llvm.org/D107882 _

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

2021-09-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I checked EmitAutoVarAlloca(). It emits the llvm.stacksave() due to // If the type is variably-modified, emit all the VLA sizes for it. if (Ty->isVariablyModifiedType()) EmitVariablyModifiedType(Ty); Here, in order not to generate llvm.stacksave(), we need

<    1   2   3   4   5