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

2020-04-30 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 261427. yonghong-song added a comment. rebase on top of master. Fix build error due to a recent func name change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74572/new/ https://reviews.llvm.org/D74572

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

2020-05-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D74668#2015294 , @anakryiko wrote: > Let's extend __builtin_btf_type_id() to accept second argument specifying > whether it's local BTF ID (from program's BTF) or target BTF ID (from > kernel/module BTF)? We can probably

[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

2020-07-31 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 282325. yonghong-song edited the summary of this revision. yonghong-song added a comment. enum value relocation change: use ld_imm64 so we support 64bit enum value from day one. put enumerator name as the AccessString. Repository: rG LLVM Github Mon

[PATCH] D85174: BPF: simplify IR generation for __builtin_btf_type_id()

2020-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. yonghong-song added a project: clang. Herald added subscribers: llvm-commits, cfe-commits, JDevlieghere, hiraditya. Herald added a project: LLVM. yonghong-song requested review of this revision. This patch simplifi

[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

2020-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D83242#2192130 , @anakryiko wrote: > LGTM. One question: why didn't we run into the need for SeqNumVal trick with > field-based relocations? We seem to need it for all other types (including > type ID-based), but not for

[PATCH] D85174: BPF: simplify IR generation for __builtin_btf_type_id()

2020-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D85174#2192269 , @ast wrote: > Is it a cleanup or is it a fix for some bug? If latter there should be a new > test for it? This is also to fix the CSE issue where two builtins are CSE'ed if one has type "struct t" and t

[PATCH] D85174: BPF: simplify IR generation for __builtin_btf_type_id()

2020-08-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 282801. yonghong-song added a comment. add a test case in clang where testing type existence of a named struct and the typedef of that named struct will result in different IR intrinsic func arguments which will prevent CSE which may lose one of ditype

[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

2020-08-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 rG6d6750696400: [clang][BPF] support type exist/size and enum exist/value relocations (authored by yonghong-song). Repository: rG LLVM Github Monore

[PATCH] D85174: BPF: simplify IR generation for __builtin_btf_type_id()

2020-08-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 rG00602ee7ef0b: BPF: simplify IR generation for __builtin_btf_type_id() (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

2020-08-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D83242#2193989 , @anakryiko wrote: >> This is different than testing whether a type exists or not where we want to >> precisely test whether that type exists or not, so we want to preserve >> `typedef` type vs. `struct t

[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

2020-08-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Hm.. This root type is used by libbpf to find candidate in kernel BTF. Name > and kind of that type is what is used. When you have typedef t and struct t, > their names match, but their kinds don't. So it could lead to inability to > find a candidate. The inpro

[PATCH] D81479: [BPF] introduce __builtin_bpf_load_u32_to_ptr() intrinsic

2020-08-06 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song abandoned this revision. yonghong-song added a comment. inline asm can do the work, so abandon this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81479/new/ https://reviews.llvm.org/D81479 _

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

2020-05-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 261977. yonghong-song edited the summary of this revision. yonghong-song added a comment. add second argument to __builtin_btf_type_id(var, flag) to indicate whether a .BTF.ext relocation should be generated or not. flag == 0, no reloc, flag == 1, reloc

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

2020-05-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 261976. yonghong-song edited the summary of this revision. yonghong-song added a comment. Herald added subscribers: ormris, hiraditya, mgorny. add second argument to __builtin_btf_type_id() to indicate whether a relocation should be generated or not.

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

2020-05-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D74668#2019558 , @anakryiko wrote: > what's the use case for flag==0 (no relocation)? why using built-in at all in > such case? Also flag==1 means relocate to local BTF ID or remote (kernel) BTF > ID? Do you plan to add

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

2020-05-05 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 262140. yonghong-song edited the summary of this revision. yonghong-song added a comment. change buitin flag to the following spec: flag == 0: a local relocation against bpf_prog BTF change flag == 1: a remote relocation against kernel Repository:

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

2020-05-15 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6b01b465388b: [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() (authored by yonghong-song). Changed prior to commit: https://reviews.llvm.org/D74572?vs=262140&id=264256#toc Repositor

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

2020-05-15 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG072cde03aaa1: [Clang][BPF] implement __builtin_btf_type_id() builtin function (authored by yonghong-song). Changed prior to commit: https://reviews.llvm.org/D74668?vs=261976&id=264273#toc Repository:

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

2020-05-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @dblaikie I can revert but let me first understand the alternative way to do the work, at least in high level. [ I do believe my commit message, esp. the first couple of lines is badly inaccurate. I suspect this is the one causing your confusion as well. speciall

[PATCH] D133361: [BPF] Attribute preserve_static_offset for structs

2023-10-30 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I went through LLVM part of the change, mostly look good to me from high-level and I need to go through another pass with details. It would be great if you can post corresponding kernel patches which utilizes this functionality? Comment at: clan

[PATCH] D133361: [BPF] Attribute preserve_static_offset for structs

2023-10-30 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I tried a couple of examples with both preserve_access_index and preserve_static_offset (both '__preserve_access_index __preserve_static_offset' and '__preserve_static_offset __preserve_access_index'). Looks they cooperate with each other properly. __preserve_stat

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

2022-06-29 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 rG70557eb3938a: [clang][BPF] Update comment to include TYPE_MATCH (authored by d-e-s-o, committed by yonghong-song). Repository: rG LLVM Github Mono

[PATCH] D131468: [WIP][BPF]: Force truncation for arguments in callee and return values in caller

2022-08-08 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. Herald added a subscriber: pengfei. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For function arguments, curre

[PATCH] D131468: [WIP][BPF]: Force sign/zero extension for arguments in callee and return values in caller

2022-08-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D131468#3708977 , @pengfei wrote: > D124435 is going to change the assumption > :) Thanks for the pointer. So looks like there is an effort to always do sign/zero-extension in callee.

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

2022-08-10 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: ast, anakryiko. 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 bpf s

[PATCH] D106184: [BPF] Use elementtype attribute for preserve.array/struct.index intrinsics

2021-07-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. I just tested the patch with kernel bpf selftests and it works fine. The patch looks good to me too. Comment at: llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp:303 CInfo.RecordAlignment = DL->getABITypeAlign(CInfo.Base->getType()->

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman, ast. yonghong-song added a project: debug-info. Herald added a subscriber: jdoerfert. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subsc

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

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman, ast. yonghong-song added a project: debug-info. Herald added subscribers: dexonsmith, ormris, hiraditya. yonghong-song requested review of this revision. Herald added projects: clang, LL

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

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman. 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. H

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

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman. 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. H

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

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman. 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. H

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

2021-07-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: dblaikie, probinson, aprantl, aaron.ballman. 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. H

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-27 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:2019 +targets. This attribute may be attached to a struct/union, struct/union field, +function or variables declaration. If -g is specified, the ARGUMENT info will +be preserved in IR and be em

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > This currently has no codegen, so it only adds the attribute to the AST and > does nothing with it. Can you also add the codegen components to this patch? The code patches to generate IR are below: https://reviews.llvm.org/D106620 (generate btf_tag annotations

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-28 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1835 + let Args = [StringArgument<"BTFTag">]; + let Subjects = SubjectList<[Var, Function, Record, Field], ErrorDiag>; + let Documentation = [BTFTagDocs]; aaron.ballman wrote: >

[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 413995. yonghong-song added a comment. - add a pch test to test serialization with btf_type_tag. - simplify the code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120

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

2022-03-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman Thanks for the review! I will address all your comments and will also add tests with `_Generic` and `__attribute__((overloadable))`. Comment at: clang/include/clang/AST/Type.h:4797 + + BTFTagAttributedType(QualType canon, QualType

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

2022-03-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 414252. yonghong-song added a comment. - clang-format fix - change variable names to be llvm compliant. - remove Attr from BTFTagAttributedTypeLoc as it can be retrieved from the BTFTagAttributedType - Also transform the attribute in TreeTransform - add

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

2022-03-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 414263. yonghong-song added a comment. - further clang-format fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: clang/include/clang-c/Index.h cl

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

2022-03-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 414267. yonghong-song added a comment. - use BTFTypeTagAttr instead of Attr in PropertiesBase.td Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: clang/

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

2022-03-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @aaron.ballman @erichkeane Hopefully I addressed your comments. Could you take a look again? 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-11 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } aaron.ballman wrote: > Do we a

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

2022-03-12 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 414872. yonghong-song added a comment. - fix one 'auto' declaration issue - rework on the test with overloadable attribute. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: clang/include/clan

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

2022-03-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } aaron.ballman wrote: > yonghon

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

2022-03-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } yonghong-song wrote: > aaron.b

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

2022-03-14 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 415326. yonghong-song added a comment. - add one more _Generic test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296 Files: clang/include/clang-c/Index.h cl

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with compond assignment

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: eli.friedman. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For the following code, void test() { int j = 0; fo

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with compond assignment

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @eli.friedman Please feel free adding other reviewers if needed. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121715/new/ https://reviews.llvm.org/D121715 ___ cfe-

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

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/Sema/TreeTransform.h:6872 + const BTFTagAttributedType *oldType = TL.getTypePtr(); + StringRef Tag = oldType->getTag(); + QualType modifiedType = getDerived().TransformType(TLB, TL.getModifiedLoc()); a

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

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 415638. yonghong-song added a comment. - change TransformBTFTagAttributedType() implementation with a simple llvm_unreachable() message. I tested linux kernel and its selftests/bpf compilation with clang and found the only TreeTransformation function i

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 415665. yonghong-song retitled this revision from "[Clang] Fix an unused-but-set-variable warning with compond assignment" to "[Clang] Fix an unused-but-set-variable warning with volatile variable". yonghong-song edited the summary of this revision. yon

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/test/Sema/warn-unused-but-set-variables.c:66 + for (int i = 0; i < 1000; i++) +j += 1; + return; efriedma wrote: > The handling of this testcase without your patch seems fine. Even if the > value of j

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

2022-03-16 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3251ba2d0fcf: [Attr] Fix a btf_type_tag AST generation (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://review

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:2033 return; + unsigned DiagID = isa(VD) ? diag::warn_unused_but_set_parameter efriedma wrote: > (Accidental change?) Right. Thanks for catching this. This is a leftover from my

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D121715#3397407 , @efriedma wrote: > In D121715#3397215 , @xbolva00 > wrote: > >> If there is j = j + 1 .. do we warn ? > > > > In D121715#3397237

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-21 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 417060. yonghong-song added a comment. - fix typo - add a new test case with typedef of volatile type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121715/new/ https://reviews.llvm.org/D121715 Files:

[PATCH] D121715: [Clang] Fix an unused-but-set-variable warning with volatile variable

2022-03-21 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbdf69f63df2c: [Clang] Fix an unused-but-set-variable warning with volatile variable (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D122271: [Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators

2022-03-22 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. LGTM. Maybe @efriedma can look at this as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122271/new/ https://reviews.llvm.org/D122271 ___ cfe-commits mailing list cfe-

[PATCH] D124813: [HLSL] Add clang builtin for HLSL.

2022-05-04 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song resigned from this revision. yonghong-song added a comment. please having proper reviewers. Me, @anakryiko @ast are not the right persons to review this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124813/new/ https://review

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

2022-05-20 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. @compnerd Thanks for reporting. I will take a look as soon as possible. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99/new/ https://reviews.llvm.org/D99 ___ cfe-c

[PATCH] D126223: [Clang][Sema] Fix a SemaType/VisitTagTypeLoc assertion

2022-05-23 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added reviewers: compnerd, 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. Patch [1] added btf_type_tag attribute support. In parti

[PATCH] D126093: Sema: adjust assertion to account for deduced types

2022-05-24 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. Sorry. I missed this patch somehow and did another patch https://reviews.llvm.org/D126223. My patch skipped `TL.setNameLoc(DS.getTypeSpecTypeNameLoc());` which probably not corre

[PATCH] D126223: [Clang][Sema] Fix a SemaType/VisitTagTypeLoc assertion

2022-05-24 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song abandoned this revision. yonghong-song added a comment. @compnerd provided a better fix https://reviews.llvm.org/D126093, so I am going to close this one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126223/new/ https://reviews.llvm

[PATCH] D82112: [RFC][BPF] Implement getUserCost() for BPFTargetTransformInfo

2020-09-09 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song abandoned this revision. yonghong-song added a comment. Abandon this one. The current approach is to add "user barriers" in an IR phase before simplifyCFG/instrcombine to disable unfavorable speculative code motion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D93103: Enable the _ExtInt extension on the BPF Target

2020-12-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. We could enable ExtIntType in bpf backend. But we need some kernel changes related to BTF to accommodate the new types. Currently, the kernel uapi file (linux/include/uapi/linux/btf.h) defines #define BTF_INT_BITS(VAL) ((VAL) & 0x00ff) which means the

[PATCH] D72184: [BPF] support atomic instructions

2020-11-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 302617. yonghong-song retitled this revision from "[WIP][BPF] support exchange/compare-and-exchange instruction" to "[BPF] support atomic instructions". yonghong-song edited the summary of this revision. yonghong-song added a comment. - remove RFC tag.

[PATCH] D72184: [BPF] support atomic instructions

2020-11-03 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/BPFInstrInfo.td:830 + +let Predicates = [BPFHasAtomicExt] in { + def CMPXCHGD : CMPXCHG; ast wrote: > let Defs = [R0], Uses = [R0] > and

[PATCH] D72184: [BPF] support atomic instructions

2020-11-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/test/CodeGen/BPF/atomics_2.ll:124 +; CHECK: r0 = r2 +; CHECK: r0 = cmpxchg_64(r1 + 0, r0, r3) +; CHECK: encoding: [0xdb,0x01,0x00,0x00,0xf1,0x03,0x00,0x00] ast wrote: > Looks like it's generating correct code

[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

2020-11-14 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. Herald added projects: clang, LLVM. yonghong-song requested review of this revision. Linux kernel recently added support for kernel modules https:/

[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

2020-11-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BTFDebug.cpp:1230 +Reloc == BPFCoreSharedInfo::BTF_TYPE_ID_REMOTE) OutMI.setOpcode(BPF::LD_imm64); else ast wrote: > libbpf would need to support both (ld_imm64 a

[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

2020-11-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BTFDebug.cpp:1230 +Reloc == BPFCoreSharedInfo::BTF_TYPE_ID_REMOTE) OutMI.setOpcode(BPF::LD_imm64); else anakryiko wrote: > yonghong-song wrote: > > ast wrote: > >

[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

2020-11-15 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 305413. yonghong-song added a comment. fix clang-format warning Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91489/new/ https://reviews.llvm.org/D91489 Files: clang/include/clang/Basic/BuiltinsBPF.def

[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

2020-11-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 rG4369223ea73c: BPF: make __builtin_btf_type_id() return 64bit int (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D72184: [BPF] support atomic instructions

2020-11-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:666 +def XADDD : XADD; + } +} jackmanb wrote: > FYI - I just spotted some stray `\t` in here (is it helpful to point this > out? If not let me know, I will ignore in future

[PATCH] D72184: [BPF] support atomic instructions

2020-11-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 305895. yonghong-song added a comment. use the same register for dst and val for fetch-add, fetch-sub and xchg instructions. for fetch-sub, if it is deemed later using different registers for dst/val is preferred, I can make the change then. Reposito

[PATCH] D72184: [BPF] support atomic instructions

2020-11-17 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. make sense. will add and/or/xor support in the next revision. will also think about how to support hardware-level barrier. Totally agree that we should have adequate atomic op support in cpu=v4. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D72184: [BPF] support atomic instructions

2020-11-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:699 + let Inst{51-48} = addr{19-16}; // base reg + let Inst{55-52} = dst; + let Inst{47-32} = addr{15-0}; // offset jackmanb wrote: > There is another mismatch between what I

[PATCH] D72184: [BPF] support atomic instructions

2020-11-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 306146. yonghong-song edited the summary of this revision. yonghong-song added a comment. add fetch_and_{and,or,xor} support force cmpxchg insn return results in r0 like r0 = cmpxchg(addr, r0, new) Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D72184: [BPF] support atomic instructions

2020-11-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 306172. yonghong-song edited the summary of this revision. yonghong-song added a comment. add support for a barrier function. The correspond C code is __sync_synchronize(). If we want to have variant like barrier for read/write/rw, etc. we may need to

[PATCH] D72184: [BPF] support atomic instructions

2020-11-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrInfo.td:783 + let Inst{47-32} = addr{15-0}; // offset + let Inst{11-8} = new; + let Inst{7-4} = BPF_CMPXCHG.Value; ast wrote: > yonghong-song wrote: > > jackmanb wrote: > > > If we go

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Thanks. Somehow my build is successful. I kind of know what is the possible issue but wonder why I did not hit it. > Can we please keep barriers out of scope? I think there's a lot of design to > be done there and I'd rather just get the core atomics working first

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 306485. yonghong-song edited the summary of this revision. yonghong-song added a comment. - remove all char/short atomic operations - remove barrier instruction Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/test/CodeGen/BPF/atomics_2.ll:14 +; int test_xchg_64(long *p, long v) { +; return __sync_lock_test_and_set(p, v); +; } ast wrote: > test_and_set is not the same as xchg. > xchg doesn't do comparison. I

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 306592. yonghong-song edited the summary of this revision. yonghong-song added a comment. add proper comment in test and clarify in commit message for __sync_lock_test_and_set which actually means an atomic exchange operation. Repository: rG LLVM Gi

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D72184#2407264 , @ast wrote: > Looks like the test didn't change. Only commit log... that's fine. I think > the diff is ready to land, but let's wait for the kernel patches to be ready > as well. I added some comments i

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. okay, my fault. I must have uploaded an old version of the patch so comment is not in the test. will upload the new version tonight. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72184/new/ https://reviews.llvm.org/D

[PATCH] D72184: [BPF] support atomic instructions

2020-11-19 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 306598. yonghong-song added a comment. add some comments in test w.r.t. __sync_lock_test_and_set() Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72184/new/ https://reviews.llvm.org/D72184 Files: clang/

[PATCH] D72184: [BPF] support atomic instructions

2020-11-23 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Ya, the above llvm crash is expected as bpf backend does not handle AtomicStore. For kernel code, I can see: kvm/x86.c: vcpu->arch.nmi_pending += atomic_xchg(&vcpu->arch.nmi_queued, 0); ... kvm/x86.c: atomic_set(&kvm_guest_has_master_clock,

[PATCH] D72184: [BPF] support atomic instructions

2020-11-30 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 308517. yonghong-song edited the summary of this revision. yonghong-song added a comment. - remove atomic_fetch_sub which can be implemented with neg + atomic_fetch_add - add support for xand, xor, xxor (xadd already been supported) - for any given __syn

[PATCH] D72184: [BPF] support atomic instructions

2020-12-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFMIChecking.cpp:199 + unsigned newOpcode; + switch(MI.getOpcode()) { + case BPF::XFADDW32: newOpcode = BPF::XADDW32; break; ast wrote: > With this logic in place Andrii has a po

[PATCH] D72184: [BPF] support atomic instructions

2020-12-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFMIChecking.cpp:199 + unsigned newOpcode; + switch(MI.getOpcode()) { + case BPF::XFADDW32: newOpcode = BPF::XADDW32; break; yonghong-song wrote: > ast wrote: > > With this logic

[PATCH] D72184: [BPF] support atomic instructions

2020-12-01 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 308884. yonghong-song edited the summary of this revision. yonghong-song added a comment. - remove -mcpu=v4. - for new instructions (except xadd), for 32bit mode, only alu32 mode is supported. I chose this way since we have -mcpu=v3 for a while which ha

[PATCH] D72184: [BPF] support atomic instructions

2020-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 308891. yonghong-song added a comment. use llvm_unreachable() in default case of the switch statement Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72184/new/ https://reviews.llvm.org/D72184 Files: llv

[PATCH] D72184: [BPF] support atomic instructions

2020-12-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 309167. yonghong-song added a comment. fix clang-format warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72184/new/ https://reviews.llvm.org/D72184 Files: llvm/lib/Target/BPF/BPFInstrFormats.td

[PATCH] D72184: [BPF] support atomic instructions

2020-12-03 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 rG286daafd6512: [BPF] support atomic instructions (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D72184: [WIP][BPF] support exchange/compare-and-exchange instruction

2020-11-02 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 302478. yonghong-song edited the summary of this revision. yonghong-song added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits. changed encoding based on internal discussion on encoding add a test Repository: rG LLVM

[PATCH] D72184: [WIP][BPF] support exchange/compare-and-exchange instruction

2020-11-03 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added inline comments. Comment at: llvm/lib/Target/BPF/BPFInstrFormats.td:98 + +def BPF_ATOMIC_FETCH : BPFAtomicFlag<0x1>; jackmanb wrote: > Per Alexei's email comments let's call this BPF_FETCH? I can do this. Note naming in llvm may not be exact

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

2021-05-15 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 except one minor issue. Please do address the nit before merging. Thanks! Comment at: clang/test/CodeGen/bpf-inline-asm.c:5 + +long var; +

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

2021-05-16 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. Sure. I will merge the patch for you. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102118/new/ https://reviews.llvm.org/D102118 ___ cfe-commits mailing list cfe-commits@li

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

2021-05-16 Thread Yonghong Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG833e9b2ea7a7: [BPF] add support for 32 bit registers in inline asm (authored by alessandrod, committed by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

<    1   2   3   4   5   >