[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-13 Thread Limin Zhang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGef33d6cbfc2d: [XRay] Add initial support for loongarch64 (authored by SixWeining, committed by Ami-zhang). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 539836. Ami-zhang added a comment. Remove unnecessary '\' symbol in xray-attribute-instrumentation.ll Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/ https://reviews.llvm.org/D140727 Files:

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 539818. Ami-zhang added a comment. Make xray-attribute-instrumentation.ll less sensitive to .Ltmp/.Lxray_fn_idx label changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang added inline comments. Comment at: llvm/test/CodeGen/LoongArch/xray-attribute-instrumentation.ll:24 +; CHECK-NEXT: .Lxray_sleds_start0: +; CHECK-NEXT: .Ltmp0: +; CHECK-NEXT: .dword .Lxray_sled_begin0-.Ltmp0 MaskRay wrote: > See

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. One nit about the test. Comment at: llvm/test/CodeGen/LoongArch/xray-attribute-instrumentation.ll:24 +; CHECK-NEXT: .Lxray_sleds_start0: +; CHECK-NEXT: .Ltmp0: +;

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 539465. Ami-zhang added a comment. Hide some symbols and using some macros in asm. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/ https://reviews.llvm.org/D140727 Files:

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-12 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:30 +// are 2RI12-type and 2RI16-type. +inline static uint32_t +encodeInstruction2RIx(uint32_t Opcode, uint32_t Rd, uint32_t Rj, MaskRay wrote: > Early xray code unfortunately

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:30 +// are 2RI12-type and 2RI16-type. +inline static uint32_t +encodeInstruction2RIx(uint32_t Opcode, uint32_t Rd, uint32_t Rj, Early xray code unfortunately does not respect

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision. MaskRay added inline comments. This revision now requires changes to proceed. Comment at: compiler-rt/lib/xray/xray_trampoline_loongarch64.S:20 + .type __xray_FunctionEntry,@function +__xray_FunctionEntry: + .cfi_startproc

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread WÁNG Xuěruì via Phabricator via cfe-commits
xen0n added a comment. Ah, the patch summary probably needs some update as well. We no longer care about version 0 and the backend changes for `R_LARCH_64_PCREL` are already in, for example. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread WÁNG Xuěruì via Phabricator via cfe-commits
xen0n accepted this revision. xen0n added a comment. This revision is now accepted and ready to land. Thanks for following up with the suggestions. This now looks mostly okay to me; let's wait for more people to chip in! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 538948. Ami-zhang added a comment. Addressed @xen0n's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/ https://reviews.llvm.org/D140727 Files: clang/lib/Driver/XRayArgs.cpp

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-11 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:22-25 + RN_T0 = 0xC, + RN_T1 = 0xD, + RN_RA = 0x1, + RN_SP = 0x3, xen0n wrote: > I think people usually just declare the register ABI names with decimal > numbers for

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-07 Thread WÁNG Xuěruì via Phabricator via cfe-commits
xen0n added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:22-25 + RN_T0 = 0xC, + RN_T1 = 0xD, + RN_RA = 0x1, + RN_SP = 0x3, I think people usually just declare the register ABI names with decimal numbers for readability? This is

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-07 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 538022. Ami-zhang added a comment. Rebase and make some improvements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/ https://reviews.llvm.org/D140727 Files: clang/lib/Driver/XRayArgs.cpp

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-07 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:23 +enum PatchOpcodes : uint32_t { + PO_ADDID = 0x02c0, // addi.d rd, rj, imm + PO_SD = 0x29c0, // st.d rd, base, offset MaskRay wrote: > I think the `PO_`

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-07 Thread Lu Weining via Phabricator via cfe-commits
SixWeining added a comment. Since `R_LARCH_64_PCREL` has been supported, we can use version 2 xray and the patch summary should be modified accordingly. Comment at: llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp:187 + OutStreamer->emitLabel(EndOfSled); +

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:23 +enum PatchOpcodes : uint32_t { + PO_ADDID = 0x02c0, // addi.d rd, rj, imm + PO_SD = 0x29c0, // st.d rd, base, offset I think the `PO_` style actually harms

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: compiler-rt/lib/xray/xray_loongarch64.cpp:153 + const XRaySledEntry ) XRAY_NEVER_INSTRUMENT { + // FIXME: In the future we'd need to distinguish between non-tail exits and + // tail exits for better

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-07-05 Thread Limin Zhang via Phabricator via cfe-commits
Ami-zhang updated this revision to Diff 537564. Ami-zhang added a comment. (1) Rebase (2) Make some minor changes to xray-attribute-instrumentation.ll Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140727/new/ https://reviews.llvm.org/D140727

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-06-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: llvm/test/CodeGen/LoongArch/xray-attribute-instrumentation.ll:1 +; RUN: llc --mtriple=loongarch64 %s -o - | FileCheck %s +; RUN: llc --mtriple=loongarch64 -filetype=obj %s -o %t I think you want to read my recent

[PATCH] D140727: [XRay] Add initial support for loongarch64

2023-06-28 Thread Lu Weining via Phabricator via cfe-commits
SixWeining added a comment. In D140727#4019019 , @SixWeining wrote: > D140725 is abandoned. Let me defer this > change until we support 64bit PC-relative relocation for `SymA - SymB`. Update: R_LARCH_64_PCREL can be

[PATCH] D140727: [XRay] Add initial support for loongarch64

2022-12-28 Thread Lu Weining via Phabricator via cfe-commits
SixWeining planned changes to this revision. SixWeining added a comment. D140725 is abandoned. Let me defer this change until we support 64bit PC-relative relocation for `SymA - SymB`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140727: [XRay] Add initial support for loongarch64

2022-12-28 Thread Lu Weining via Phabricator via cfe-commits
SixWeining created this revision. SixWeining added reviewers: MaskRay, xen0n, xry111. Herald added subscribers: Enna1, StephenFan, hiraditya, dberris. Herald added a project: All. SixWeining requested review of this revision. Herald added projects: clang, Sanitizers, LLVM. Herald added