Page MenuHomePhabricator

shenhan (Han Shen)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 5 2016, 3:55 PM (376 w, 20 h)

Recent Activity

Feb 16 2023

shenhan added a reviewer for D143841: [Propeller] Make decoding BBAddrMaps trace through relocations: shenhan.
Feb 16 2023, 6:24 PM · Restricted Project, Restricted Project
shenhan added a comment to D143841: [Propeller] Make decoding BBAddrMaps trace through relocations.

Thanks for working on this. You mentioned

This patch changes the behavior of decodeBBAddrMap to trace through relocations to get correct function addresses if it is going through a relocatable object file."

How is this achieved? Each BBAddrMap section has a corresponding .rela section, but that .rela section does not contain real address information (the addresses are only known at linker time). (Most of the time) It has entries of <offset_into_bbaddrmap_section, ".text", addend>. Are you computing function addresses as ".text address as exhibited in the object file + addend"?

Feb 16 2023, 6:24 PM · Restricted Project, Restricted Project

Feb 8 2023

shenhan added a comment to D139799: [Propeller] Change SHT_LLVM_BB_ADDR_MAP version to 2..

LGTM

Feb 8 2023, 11:33 AM · Restricted Project, Restricted Project

May 23 2022

shenhan added a comment to D122930: [Propeller] Promote functions with propeller profiles to .text.hot..

LGTM

May 23 2022, 10:37 AM · Restricted Project, Restricted Project

May 13 2022

shenhan added a comment to D125426: Add a new flavor "BBLabels" to LLVM_BUILD_INSTRUMENTED.

Here is the proposed workflow to build a propeller optimized clang binary (similar to PGO build).

  1. Build instrumented clang binary:

cmake -G Ninja ... -DLLVM_BUILD_INSTRUMENTED=BBLabels ... llvm-project/llvm
ninja build

  1. Using the above built binary in day-to-day routine and collect perf.data file and then convert it to propeller profiles.
  1. Build the optimized clang binary:

cmake -G Ninja ... -DLLVM_PROPELLER_PROFILES=<profile> ... llvm-project/llvm

The experiment data show propeller optimized clang has a 5% compiler time improvement over PGO build.

Thanks! Please move this to the description.

May 13 2022, 10:04 AM · Restricted Project, Restricted Project
shenhan updated the summary of D125426: Add a new flavor "BBLabels" to LLVM_BUILD_INSTRUMENTED.
May 13 2022, 10:03 AM · Restricted Project, Restricted Project

May 12 2022

shenhan added a comment to D122930: [Propeller] Promote functions with propeller profiles to .text.hot..

This looks good to me. One question, do we have a rough idea, what is the percentage of functions that pgo and propeller disagree about their hotness?

Yes. For one example we have
31% of Propeller functions in .text.hot,
57% in .text
11% in .text.unlikely

May 12 2022, 11:50 AM · Restricted Project, Restricted Project
shenhan added a comment to D125426: Add a new flavor "BBLabels" to LLVM_BUILD_INSTRUMENTED.

Here is the proposed workflow to build a propeller optimized clang binary (similar to PGO build).

  1. Build instrumented clang binary:

cmake -G Ninja ... -DLLVM_BUILD_INSTRUMENTED=BBLabels ... llvm-project/llvm
ninja build

May 12 2022, 11:23 AM · Restricted Project, Restricted Project

May 11 2022

shenhan requested review of D125426: Add a new flavor "BBLabels" to LLVM_BUILD_INSTRUMENTED.
May 11 2022, 3:21 PM · Restricted Project, Restricted Project

May 4 2022

shenhan added a comment to D122930: [Propeller] Promote functions with propeller profiles to .text.hot..

This looks good to me. One question, do we have a rough idea, what is the percentage of functions that pgo and propeller disagree about their hotness?

May 4 2022, 6:19 PM · Restricted Project, Restricted Project

Oct 28 2021

shenhan added a comment to D112679: Make the BBAddrMap struct binary-format-agnostic..

One question, is "BBAddrMap" (or "ELF_BBAddrMap" in the origin code) only used to carry return values? You mentioned the section size won't change (for both ELF32 and ELF64), is it because you do not use this structure for writing out to ELF section?

Correct. BBAddrMap is only used in the return type for decodeBBAddrMap. This is completely independent from how the entries are written out to the ELF section.

Oct 28 2021, 2:18 PM · Restricted Project
shenhan added a comment to D112679: Make the BBAddrMap struct binary-format-agnostic..

One question, is "BBAddrMap" (or "ELF_BBAddrMap" in the origin code) only used to carry return values? You mentioned the section size won't change (for both ELF32 and ELF64), is it because you do not use this structure for writing out to ELF section?

Oct 28 2021, 2:07 PM · Restricted Project

Mar 11 2021

shenhan added a comment to D96918: [llvm-readelf, propeller] Add fallthrough bit to basic block metadata in BB-Address-Map section..

Thanks for making the change.

Mar 11 2021, 1:40 PM · Restricted Project

Oct 29 2020

shenhan added inline comments to D89707: [CSSPGO][llvm-profgen] Parse mmap events from perf script.
Oct 29 2020, 9:50 AM · Restricted Project

Oct 22 2020

shenhan added a reverting change for rGadfb5415010f: [MBP] Add whole chain to BlockFilterSet instead of individual BB: rGe42f6c0ac05b: Revert "[MBP] Add whole chain to BlockFilterSet instead of individual BB".
Oct 22 2020, 5:37 PM
shenhan committed rGe42f6c0ac05b: Revert "[MBP] Add whole chain to BlockFilterSet instead of individual BB" (authored by shenhan).
Revert "[MBP] Add whole chain to BlockFilterSet instead of individual BB"
Oct 22 2020, 5:37 PM
shenhan added a reverting change for D89088: [MBP] Add whole chain to BlockFilterSet instead of individual BB: rGe42f6c0ac05b: Revert "[MBP] Add whole chain to BlockFilterSet instead of individual BB".
Oct 22 2020, 5:37 PM · Restricted Project

Oct 21 2020

shenhan added inline comments to D89707: [CSSPGO][llvm-profgen] Parse mmap events from perf script.
Oct 21 2020, 2:54 PM · Restricted Project

Sep 8 2020

shenhan added a comment to D87121: LLD symbol ordering file binary name tag.

Hi Maskray, thanks for the fix. Another latent concern is that apply the symbol ordering file unconditionally might cause unintentional consequence to the final binary to the extent that the binary might be corrupted or less optimized, in this sense, this patch might still be warranted (orthogonal to your CL), what do you think?

I think it is important for the user to specify the appropriate linker flags. None of the other flags (even similar ones, e.g. --dynamic-list, -T, --version-script) should have such an exclusion mechanism (one concern is that changing -o can change the behavior, which is not great). There may be someway for the mysql build system to not apply the linker options at config stage, or you should just hook the final link. For your case --no-warn-symbol-ordering can essentially nullify the time increase caused by --symbol-ordering-file.

Sep 8 2020, 9:59 AM
shenhan added a comment to D87121: LLD symbol ordering file binary name tag.

Hi Maskray, thanks for the fix. Another latent concern is that apply the symbol ordering file unconditionally might cause unintentional consequence to the final binary to the extent that the binary might be corrupted or less optimized, in this sense, this patch might still be warranted (orthogonal to your CL), what do you think?

Sep 8 2020, 8:29 AM

Sep 4 2020

shenhan added a comment to D87121: LLD symbol ordering file binary name tag.

Hi Fangrui, I've put up a reproduce case for mysql here. These are steps:

Sep 4 2020, 9:00 AM

Sep 3 2020

shenhan requested review of D87121: LLD symbol ordering file binary name tag.
Sep 3 2020, 6:03 PM

Sep 2 2020

shenhan added a comment to D85408: Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols..

I am still reading the patch, but I have noticed one thing worth discussing. .bb_addr_map is a non-SHF_ALLOC section (meaning that it is not part of the memory image). An absolute relocation type (.quad .Lfunc_begin0) works but the value is a link-time address, not taking account of the load base (PIE/shared object)). (If .bb_addr_map has the SHF_ALLOC flag, linkers will report a text relocation) How do you intend to use .bb_addr_map at runtime?

Sep 2 2020, 1:15 PM · Restricted Project, Restricted Project

Jul 20 2020

shenhan added inline comments to D83885: [Propeller]: Use a descriptive temporary symbol name for the end of the basic block..
Jul 20 2020, 10:07 AM · Restricted Project

May 5 2020

shenhan added inline comments to D68049: Propeller: Clang options for basic block sections .
May 5 2020, 5:17 PM · Restricted Project, Restricted Project

Feb 18 2020

shenhan added a comment to D73497: lld: Propeller framework part I.

Hi, would you to take another look? Thanks, -Han

Feb 18 2020, 10:07 AM · Restricted Project

Feb 7 2020

shenhan updated the diff for D73497: lld: Propeller framework part I.

Thanks Rui. Uploaded the patch: 1) removed PropellerConfig 2). Removed PropellerCommon.h from patch (and moved it into llvm realm).

Feb 7 2020, 5:26 PM · Restricted Project

Feb 6 2020

shenhan updated the diff for D73497: lld: Propeller framework part I.
Feb 6 2020, 3:02 PM · Restricted Project

Feb 4 2020

shenhan updated the diff for D73497: lld: Propeller framework part I.
Feb 4 2020, 4:22 PM · Restricted Project
shenhan updated the diff for D73497: lld: Propeller framework part I.

Fixed all variable names to comply with lld naming convention.

Feb 4 2020, 10:30 AM · Restricted Project

Jan 31 2020

shenhan added inline comments to D73497: lld: Propeller framework part I.
Jan 31 2020, 5:11 PM · Restricted Project
shenhan updated the diff for D73497: lld: Propeller framework part I.

Hi Markray, thanks for the review.

Jan 31 2020, 5:11 PM · Restricted Project

Jan 30 2020

shenhan updated the diff for D73497: lld: Propeller framework part I.
Jan 30 2020, 2:55 PM · Restricted Project

Jan 27 2020

shenhan retitled D73497: lld: Propeller framework part I from Propeller to lld: Propeller framework part I.
Jan 27 2020, 12:24 PM · Restricted Project
shenhan created D73497: lld: Propeller framework part I.
Jan 27 2020, 12:24 PM · Restricted Project

Jan 17 2020

shenhan added a comment to D68062: Propeller lld framework for basicblock sections.

Hello, over the past 2 months since our first draft of Propeller, we've made huge changes/improvements and this describes what happens -http://lists.llvm.org/pipermail/llvm-dev/2020-January/138426.html

Jan 17 2020, 4:55 PM · Restricted Project

Jan 16 2020

shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Jan 16 2020, 4:31 PM · Restricted Project

Nov 21 2019

shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.

Added lld/ELF/Propeller/README.md. Moved some of file comments into README.md.

Nov 21 2019, 5:32 PM · Restricted Project

Nov 12 2019

shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.

Hi, we've refactored propeller and cleaned up dependencies and interfaces. Here are the change summaries:

Nov 12 2019, 12:19 PM · Restricted Project

Oct 8 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Oct 8 2019, 12:12 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Oct 8 2019, 12:12 PM · Restricted Project

Oct 4 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Oct 4 2019, 11:29 AM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Oct 4 2019, 11:29 AM · Restricted Project

Oct 3 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Oct 3 2019, 5:02 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Oct 3 2019, 5:02 PM · Restricted Project

Oct 2 2019

shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Oct 2 2019, 6:18 PM · Restricted Project

Oct 1 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Oct 1 2019, 5:13 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Oct 1 2019, 5:10 PM · Restricted Project

Sep 30 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Sep 30 2019, 5:28 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Sep 30 2019, 5:26 PM · Restricted Project

Sep 27 2019

shenhan added inline comments to D68062: Propeller lld framework for basicblock sections.
Sep 27 2019, 5:27 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.

Updated header file description. Also changed local variable names to lower case camel.

Sep 27 2019, 5:21 PM · Restricted Project

Sep 26 2019

shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.
Sep 26 2019, 5:52 PM · Restricted Project
shenhan added a comment to D68062: Propeller lld framework for basicblock sections.

Let me start from very high-level review comments before getting into the details of the actual code:

  • First and foremost, can you add a file comments to each file to explain what you are doing in the file? It doesn't have to be detailed, but giving an overview at the beginning of a file is generally very useful.
Sep 26 2019, 5:06 PM · Restricted Project
shenhan updated the diff for D68062: Propeller lld framework for basicblock sections.

Addressed maskray's comments.

Sep 26 2019, 4:58 PM · Restricted Project

Sep 25 2019

shenhan updated subscribers of D68062: Propeller lld framework for basicblock sections.
Sep 25 2019, 5:08 PM · Restricted Project
shenhan created D68062: Propeller lld framework for basicblock sections.
Sep 25 2019, 5:02 PM · Restricted Project

Jun 6 2018

shenhan committed rL334155: ClangTidy fix - 'clang::Sema::checkAllowedCUDAInitializer' has a definition….
ClangTidy fix - 'clang::Sema::checkAllowedCUDAInitializer' has a definition…
Jun 6 2018, 6:00 PM
shenhan committed rC334155: ClangTidy fix - 'clang::Sema::checkAllowedCUDAInitializer' has a definition….
ClangTidy fix - 'clang::Sema::checkAllowedCUDAInitializer' has a definition…
Jun 6 2018, 6:00 PM
shenhan committed rLLD334135: Correct aligment computation for shared object symbols..
Correct aligment computation for shared object symbols.
Jun 6 2018, 2:48 PM
shenhan committed rL334135: Correct aligment computation for shared object symbols..
Correct aligment computation for shared object symbols.
Jun 6 2018, 2:48 PM
shenhan closed D47602: Correct aligment computation for shared object symbols.
Jun 6 2018, 2:48 PM
shenhan committed rL334114: Fix the test case that places intermediate in source directory..
Fix the test case that places intermediate in source directory.
Jun 6 2018, 12:00 PM
shenhan closed D47839: Fix the test case that places intermediate in source directory.
Jun 6 2018, 11:59 AM
shenhan created D47839: Fix the test case that places intermediate in source directory.
Jun 6 2018, 11:45 AM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

@ruiu whatś your opinion on this?

Jun 6 2018, 9:41 AM

Jun 5 2018

shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
Jun 5 2018, 3:17 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 5 2018, 3:16 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

Re-write the getAlignment function, keep the original logic but with the 3 additional tests:

Jun 5 2018, 1:56 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 5 2018, 1:56 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

Mind take another look?

Jun 5 2018, 9:24 AM

Jun 1 2018

shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 5:33 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 5:32 PM
shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 2:25 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 2:25 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 2:14 PM
shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 2:09 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 2:09 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.

@pcc thanks for the review. Updated the patch -

  1. if getAlignment sees a ABS symbols, returns 0
  2. initialize Ret to UINT64_MAX
  3. in "addCopyRelSymbol", errors out if alignment is 0.
  4. unit test case that tests for proper handling of ABS symbols.
Jun 1 2018, 1:44 PM
shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
Jun 1 2018, 10:36 AM

May 31 2018

shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
May 31 2018, 4:41 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

Thanks @ruiu Updated the patch, also attached a test case.

May 31 2018, 3:50 PM
shenhan updated the summary of D47602: Correct aligment computation for shared object symbols.
May 31 2018, 3:49 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
May 31 2018, 3:43 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

@pcc do you agree with initializing Ret to uint64-1?

May 31 2018, 2:35 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

@pcc

May 31 2018, 2:02 PM
shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
May 31 2018, 1:51 PM
shenhan added inline comments to D47602: Correct aligment computation for shared object symbols.
May 31 2018, 1:32 PM
shenhan added a comment to D47602: Correct aligment computation for shared object symbols.

Thanks Rui. I just updated the patch a little bit, that - st_value is only valid for alignment when symbol shndx is set to SHN_COMMON.

May 31 2018, 1:25 PM
shenhan updated the diff for D47602: Correct aligment computation for shared object symbols.
May 31 2018, 1:22 PM
shenhan updated the summary of D47602: Correct aligment computation for shared object symbols.
May 31 2018, 1:21 PM
shenhan added a reviewer for D47602: Correct aligment computation for shared object symbols: ruiu.
May 31 2018, 12:32 PM
shenhan created D47602: Correct aligment computation for shared object symbols.
May 31 2018, 12:31 PM

May 25 2018

shenhan added a comment to D47396: [LLD] Place .nv_fatbin section at the beginning of the executable..

+Han Shen <shenhan@google.com>

Han, did you try that idea before?

May 25 2018, 4:45 PM

May 17 2018

shenhan committed rL332688: Mitigate relocation overflow [part 2 of 2].
Mitigate relocation overflow [part 2 of 2]
May 17 2018, 8:05 PM
shenhan committed rLLD332688: Mitigate relocation overflow [part 2 of 2].
Mitigate relocation overflow [part 2 of 2]
May 17 2018, 8:05 PM
shenhan added a comment to D46200: Mitigate relocation overflow [part 2 of 2].

Thanks. (Comments revised and DefaoutOutSec -> Default)

May 17 2018, 2:11 PM
shenhan updated the diff for D46200: Mitigate relocation overflow [part 2 of 2].
May 17 2018, 2:10 PM
shenhan added inline comments to D46200: Mitigate relocation overflow [part 2 of 2].
May 17 2018, 9:30 AM
shenhan updated the diff for D46200: Mitigate relocation overflow [part 2 of 2].
May 17 2018, 9:30 AM