Page MenuHomePhabricator

wmi (Wei Mi)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 20 2015, 10:57 AM (330 w, 3 d)

Recent Activity

Today

wmi added inline comments to D104584: [SampleFDO] Make FSDiscriminator flag part of function parameters.
Mon, Jun 21, 8:38 AM · Restricted Project

Wed, Jun 16

wmi accepted D104129: [CSSPGO] Report zero-count probe in profile instead of dangling probes..

In "6. Be consistent with non-CS dwarf line number based profile", if you can mention how the compiler treat missing line number and missing pseudo in the description as a record, that will be helpful.

Wed, Jun 16, 11:19 AM · Restricted Project
wmi added a comment to D104129: [CSSPGO] Report zero-count probe in profile instead of dangling probes..

Be consistent with dwarf line number based profile.

This is not accurate, see earlier comments. What i meant was not about "non-probe profile -> dwarf line number profile".

Otherwise lgtm. Thanks.

It should be consistent with non-CS dwarf-based profile. CS dwarf-based profile doesn't have either zero or dangling reported, likely needs a fix. Is that what you meant?

Non-cs dwarf-based profile normally doesn't have zero counts in the profile. Any count below a certain threshold is omitted in the profile to save size. This is the default behavior for our production usage (I believe for google as well). This is why the current change that needs explicit zero is not consistent with afdo.

Wed, Jun 16, 10:57 AM · Restricted Project

Thu, Jun 3

wmi accepted D103550: [SampleFDO] New hierarchical discriminator for FS SampleFDO (llvm-profdata part).

LGTM.

Thu, Jun 3, 5:09 PM · Restricted Project
wmi accepted D103650: [CSSPGO][llvm-profgen] Make extended binary the default output format.

LGTM.

Thu, Jun 3, 3:10 PM · Restricted Project

Wed, Jun 2

wmi added inline comments to D103550: [SampleFDO] New hierarchical discriminator for FS SampleFDO (llvm-profdata part).
Wed, Jun 2, 5:21 PM · Restricted Project

Thu, May 27

wmi accepted D103041: [SampleFDO] New hierarchical discriminator for FS SampleFDO (ProfileData part).

LGTM.

Thu, May 27, 9:45 AM · Restricted Project

Tue, May 25

wmi accepted D103073: [LTT] Handle merged llvm.assume when dropping type tests.

LGTM.

Tue, May 25, 3:35 PM · Restricted Project
wmi added inline comments to D103041: [SampleFDO] New hierarchical discriminator for FS SampleFDO (ProfileData part).
Tue, May 25, 11:03 AM · Restricted Project
wmi accepted D103071: [CSSPGO][llvm-profgen] Change default cold threshold for context merging.

LGTM.

Tue, May 25, 9:42 AM · Restricted Project

May 18 2021

wmi accepted D102537: [CSSPGO] Overwrite branch weight annotated in previous pass..

LGTM.

May 18 2021, 1:27 PM · Restricted Project
wmi accepted D102246: [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO.

LGTM.

May 18 2021, 11:35 AM · Restricted Project

May 17 2021

wmi added a comment to D102537: [CSSPGO] Overwrite branch weight annotated in previous pass..

If we target AutoFDO as well, would be good to mention the impact on AutoFDO too.

I haven't tested for non-CS case. In theory it should help there but with a less-than-ideal counts quality, the change may not help in practice.

May 17 2021, 11:33 PM · Restricted Project

May 14 2021

wmi accepted D102429: [CSSPGO] Update pseudo probe distribution factor based on inline context..

LGTM.

May 14 2021, 6:30 PM · Restricted Project
wmi added inline comments to D102429: [CSSPGO] Update pseudo probe distribution factor based on inline context..
May 14 2021, 2:33 PM · Restricted Project
wmi added inline comments to D102429: [CSSPGO] Update pseudo probe distribution factor based on inline context..
May 14 2021, 9:30 AM · Restricted Project

May 13 2021

wmi added a comment to D102246: [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO.

Thanks for splitting the patches.

May 13 2021, 9:52 PM · Restricted Project

May 12 2021

wmi added a comment to D102246: [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO.

Can you split the changes under ProfileData into a separate patch?

May 12 2021, 7:49 AM · Restricted Project

May 7 2021

wmi added inline comments to D102007: [CSSPGO] Fix return value of getProbeWeight.
May 7 2021, 8:56 PM · Restricted Project

May 4 2021

wmi committed rG82956de05f9d: [SampleFDO] Fix a bug when appending function symbol into the Callees set of (authored by wmi).
[SampleFDO] Fix a bug when appending function symbol into the Callees set of
May 4 2021, 10:06 AM
wmi closed D101815: [SampleFDO] Fix a bug when appending function symbol into the Callees set of Root node in ProfiledCallGraph..
May 4 2021, 10:06 AM · Restricted Project

May 3 2021

wmi requested review of D101815: [SampleFDO] Fix a bug when appending function symbol into the Callees set of Root node in ProfiledCallGraph..
May 3 2021, 11:15 PM · Restricted Project

Apr 26 2021

wmi accepted D100075: [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2..

LGTM.

Apr 26 2021, 3:58 PM · Restricted Project

Apr 21 2021

wmi accepted D100528: [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles.

LGTM, thanks.

Apr 21 2021, 5:23 PM · Restricted Project
wmi added inline comments to D100528: [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles.
Apr 21 2021, 3:18 PM · Restricted Project

Apr 19 2021

wmi accepted D100332: [CSSPGO] Flip SkipPseudoOp to true for MIR APIs..

LGTM, thanks.

Apr 19 2021, 3:05 PM · Restricted Project

Apr 18 2021

wmi accepted D100334: [CSSPGO] Exclude pseudo probes from slot index.

LGTM.

Apr 18 2021, 10:11 PM · Restricted Project
wmi added inline comments to D100528: [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles.
Apr 18 2021, 9:08 PM · Restricted Project
wmi added inline comments to D100332: [CSSPGO] Flip SkipPseudoOp to true for MIR APIs..
Apr 18 2021, 1:11 PM · Restricted Project

Apr 7 2021

wmi accepted D100002: [CSSPGO] Move pseudo probes to the beginning of a block to unblock SelectionDAG combine..

LGTM.

Apr 7 2021, 8:32 PM · Restricted Project
wmi added inline comments to D100002: [CSSPGO] Move pseudo probes to the beginning of a block to unblock SelectionDAG combine..
Apr 7 2021, 5:10 PM · Restricted Project

Mar 30 2021

wmi committed rGd535a05ca1a6: [ThinLTO] During module importing, close one source module before open (authored by wmi).
[ThinLTO] During module importing, close one source module before open
Mar 30 2021, 2:42 PM
wmi closed D99554: [ThinLTO] During module importing, close one source module before open another one for distributed mode..
Mar 30 2021, 2:42 PM · Restricted Project, Restricted Project
wmi added inline comments to D99554: [ThinLTO] During module importing, close one source module before open another one for distributed mode..
Mar 30 2021, 11:38 AM · Restricted Project, Restricted Project
wmi updated the diff for D99554: [ThinLTO] During module importing, close one source module before open another one for distributed mode..

Address Teresa's comment.

Mar 30 2021, 11:37 AM · Restricted Project, Restricted Project
wmi accepted D99550: keeping prof metadata for IndirectBrInst.

LGTM.

Mar 30 2021, 10:32 AM · Restricted Project
wmi accepted D99351: [CSSPGO] Top-down processing order based on full profile..

LGTM.

Mar 30 2021, 9:31 AM · Restricted Project

Mar 29 2021

wmi added inline comments to D99351: [CSSPGO] Top-down processing order based on full profile..
Mar 29 2021, 8:35 PM · Restricted Project
wmi added a comment to D99351: [CSSPGO] Top-down processing order based on full profile..

The performance test result is neutral, so I think we can enable UseProfiledCallGraph by default.

Mar 29 2021, 5:25 PM · Restricted Project
wmi requested review of D99554: [ThinLTO] During module importing, close one source module before open another one for distributed mode..
Mar 29 2021, 5:13 PM · Restricted Project, Restricted Project
wmi added a comment to D99550: keeping prof metadata for IndirectBrInst.

Thanks for the change. Could you add a test for it?

Mar 29 2021, 4:26 PM · Restricted Project
wmi committed rG3cbf44190b59: [SampleFDO] Do not scale the magic number NOMORE_ICP_MAGICNUM in value profile (authored by wmi).
[SampleFDO] Do not scale the magic number NOMORE_ICP_MAGICNUM in value profile
Mar 29 2021, 9:35 AM
wmi closed D99394: [SampleFDO] Do not scale the magic number NOMORE_ICP_MAGICNUM in value profile during profile update..
Mar 29 2021, 9:34 AM · Restricted Project

Mar 28 2021

wmi added a comment to D99351: [CSSPGO] Top-down processing order based on full profile..

Seems there is still build error:

Mar 28 2021, 11:01 PM · Restricted Project
wmi added a comment to D99351: [CSSPGO] Top-down processing order based on full profile..
In D99351#2654236, @hoy wrote:
In D99351#2654048, @wmi wrote:

Just find ProfiledCallGraph.h is not included in the patch so the build failed after applying the patch.

Thanks for trying it. You’ll also need to apply Wenlei’s patch D99146.

Mar 28 2021, 2:45 PM · Restricted Project

Mar 26 2021

wmi added a comment to D99351: [CSSPGO] Top-down processing order based on full profile..

Just find ProfiledCallGraph.h is not included in the patch so the build failed after applying the patch.

Mar 26 2021, 11:30 PM · Restricted Project
wmi accepted D99146: [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner.

LGTM. Thanks.

Mar 26 2021, 5:08 PM · Restricted Project
wmi added a comment to D99351: [CSSPGO] Top-down processing order based on full profile..

The change is an enhancement to https://reviews.llvm.org/D95988 so it is better to mention D95988 in the description/commit log.

Mar 26 2021, 1:54 PM · Restricted Project
wmi added inline comments to D99146: [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner.
Mar 26 2021, 12:28 PM · Restricted Project
wmi added inline comments to D99146: [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner.
Mar 26 2021, 10:56 AM · Restricted Project
wmi added inline comments to D99146: [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner.
Mar 26 2021, 10:04 AM · Restricted Project

Mar 25 2021

wmi accepted D99370: [CSSPGO] Minor tweak for inline candidate priority tie breaker.

LGTM.

Mar 25 2021, 5:39 PM · Restricted Project
wmi requested review of D99394: [SampleFDO] Do not scale the magic number NOMORE_ICP_MAGICNUM in value profile during profile update..
Mar 25 2021, 5:30 PM · Restricted Project

Mar 24 2021

wmi added a comment to D99146: [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner.

ThinLTO is known to have issues related to profile update (cross module), so we were thinking something similar in ThinLink phase.

This is the exact problem we are trying to mitigate. We also considered doing this in ThinLink but adjusting profiles for thin-backends and communicating inline decisions to thin-backends would add quite a bit of complexity, which could also slow down ThinLink. With CSSPGO, doing it in profile generation and use adjusted profile to convey inline estimation/suggestion is much simpler and cheaper.

One of the issues is that the pre-inlining needs to make similar decisions as the compiler. How well is the preinliner doing in this regard?

Yes, this is a challenge. We don't have data yet, but I hope with some tuning we can get them to be close. One problem with doing pre-inlining is we don't have a lot of information that compiler can see from IR, though if needed some of that can be embedded into binary (some metadata in probe descriptor, etc.) for preinliner. I hope a more accurate view on machine code byte size for inline cost can offset some of the disadvantages due to lack of IR.

Mar 24 2021, 11:00 PM · Restricted Project

Mar 21 2021

wmi accepted D98921: [CSSPGO][llvm-profgen] Use profile summary based threshold for context trimming and merging.

LGTM.

Mar 21 2021, 10:29 PM · Restricted Project

Mar 19 2021

wmi added inline comments to D98921: [CSSPGO][llvm-profgen] Use profile summary based threshold for context trimming and merging.
Mar 19 2021, 1:53 PM · Restricted Project

Mar 18 2021

wmi added inline comments to D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining..
Mar 18 2021, 11:53 AM · Restricted Project
wmi committed rG14756b70eeba: [SampleFDO] Don't mix up the existing indirect call value profile with the new (authored by wmi).
[SampleFDO] Don't mix up the existing indirect call value profile with the new
Mar 18 2021, 9:55 AM
wmi closed D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining..
Mar 18 2021, 9:55 AM · Restricted Project

Mar 17 2021

wmi updated the diff for D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining..

Address David's comment.

Mar 17 2021, 10:47 PM · Restricted Project
wmi added inline comments to D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining..
Mar 17 2021, 10:47 PM · Restricted Project
wmi requested review of D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining..
Mar 17 2021, 6:26 PM · Restricted Project

Mar 15 2021

wmi accepted D98226: [CSSPGO][llvm-profgen] Fix getCanonicalFnName usage in llvm-profgen.

LGTM. Thanks.

Mar 15 2021, 5:20 PM · Restricted Project
wmi accepted D98590: [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list.

LGTM. Thanks!

Mar 15 2021, 11:56 AM · Restricted Project

Mar 14 2021

wmi added inline comments to D98226: [CSSPGO][llvm-profgen] Fix getCanonicalFnName usage in llvm-profgen.
Mar 14 2021, 10:40 PM · Restricted Project
wmi added inline comments to D98590: [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list.
Mar 14 2021, 12:57 PM · Restricted Project

Mar 12 2021

wmi added a comment to D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..
In D98389#2620729, @wmi wrote:

FWIW, I'm seeing errors like "Malformed instrumentation profile data" when building code for a i686-w64-mingw32 target after this commit. I've yet to reduce the actual trigger for it, but I thought I'd let you know...

Thanks Martin for reporting the error. I think the error is thrown in the call of addFuncName(OtherFuncName) here:
https://github.com/llvm/llvm-project/blob/b552adf8b388a4fbdaa6fb46bdedc83fc738fc2b/llvm/lib/ProfileData/InstrProf.cpp#L376

Could you help to get the "PGOFuncName" string before addFuncName throws the error? Then we can know what is wrong.

Ok, sure. Here's a full reproducer:

$ cat ../repro.c 
static void func(void) { }
void (*funcptr)(void) = func;
$ clang -target x86_64-linux-gnu -c ../repro.c -O2
PGOFuncName "../repro.c:func"
OtherFuncName ""
Program aborted due to an unhandled Error:
Malformed instrumentation profile data
Mar 12 2021, 1:55 PM · Restricted Project
wmi committed rGef9d7db72362: [IndirectCallPromotion] Recommit "Don't strip ".__uniq." suffix when it strips (authored by wmi).
[IndirectCallPromotion] Recommit "Don't strip ".__uniq." suffix when it strips
Mar 12 2021, 1:48 PM

Mar 11 2021

wmi added a comment to D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..

FWIW, I'm seeing errors like "Malformed instrumentation profile data" when building code for a i686-w64-mingw32 target after this commit. I've yet to reduce the actual trigger for it, but I thought I'd let you know...

Mar 11 2021, 2:58 PM · Restricted Project
wmi committed rG90dfbeef5982: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips (authored by wmi).
[IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips
Mar 11 2021, 11:09 AM
wmi closed D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..
Mar 11 2021, 11:09 AM · Restricted Project
wmi accepted D98187: [SamplePGO] Skip inlinee profile scaling for sample loader inlining.
In D98187#2618612, @wmi wrote:

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

That is a nice catch! I will definitely experiment it and expect some improvement from it. Will have the data tomorrow and get back.

Mar 11 2021, 9:31 AM · Restricted Project

Mar 10 2021

wmi updated the diff for D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..

Address reviewers' comments.

Mar 10 2021, 11:00 PM · Restricted Project
wmi added a comment to D98187: [SamplePGO] Skip inlinee profile scaling for sample loader inlining.

@wmi any concern with landing this change? I don't expect any issues, but just to be prudent do you want to experiment before this is landed?

Mar 10 2021, 9:59 PM · Restricted Project
wmi added inline comments to D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..
Mar 10 2021, 9:43 PM · Restricted Project
wmi added inline comments to D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..
Mar 10 2021, 9:23 PM · Restricted Project
wmi requested review of D98389: [IndirectCallPromotion] Don't strip ".__uniq." suffix when it strips ".llvm." suffix..
Mar 10 2021, 8:47 PM · Restricted Project

Mar 9 2021

wmi committed rGee35784a909b: [SampleFDO] Support enabling -funique-internal-linkage-name. (authored by wmi).
[SampleFDO] Support enabling -funique-internal-linkage-name.
Mar 9 2021, 9:42 PM
wmi closed D96932: [SampleFDO] Support enabling -funique-internal-linkage-name.
Mar 9 2021, 9:42 PM · Restricted Project

Mar 5 2021

wmi accepted D97998: [CSSPGO] llvm-profdata support for CS profile..

LGTM.

Mar 5 2021, 6:15 PM · Restricted Project
wmi added inline comments to D97998: [CSSPGO] llvm-profdata support for CS profile..
Mar 5 2021, 3:31 PM · Restricted Project

Mar 4 2021

wmi committed rG2357d29335f2: [SampleFDO] Another fix to prevent repeated indirect call promotion in (authored by wmi).
[SampleFDO] Another fix to prevent repeated indirect call promotion in
Mar 4 2021, 6:44 PM
wmi closed D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.
Mar 4 2021, 6:44 PM · Restricted Project
wmi updated the diff for D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.

Address Hongtao's comment.

Mar 4 2021, 1:24 PM · Restricted Project
wmi added inline comments to D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.
Mar 4 2021, 1:23 PM · Restricted Project

Mar 3 2021

wmi updated the diff for D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.

Address Hongtao's comment.

Mar 3 2021, 8:18 PM · Restricted Project
wmi added inline comments to D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.
Mar 3 2021, 7:34 PM · Restricted Project
wmi updated the diff for D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.

Address David, Wenlei and Hongtao's comments.

Mar 3 2021, 5:23 PM · Restricted Project
wmi added inline comments to D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.
Mar 3 2021, 5:21 PM · Restricted Project
wmi added a comment to D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.
In D97350#2601716, @hoy wrote:

Thank for the fix. I've been seeing an assert failure related to ICP. Do you think that can be fixed by this patch?

llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp:78: uint32_t llvm::ICallPromotionAnalysis::getProfitablePromotionCandidates(const llvm::Instruction*, uint32_t, uint64_t): Assertion `Count <= RemainingCount' failed.

Mar 3 2021, 4:39 PM · Restricted Project
wmi updated the diff for D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass.

Address David's comment. By using -1 to represent targets which have been promoted in the value profile, we only have to sort the values in count descending order, and choose the top MaxNumPromotions values whenever we store or load the values from value profile.

Mar 3 2021, 3:05 PM · Restricted Project

Mar 2 2021

wmi accepted D95962: [CSSPGO] Introducing dangling pseudo probes..

LGTM.

Mar 2 2021, 11:12 PM · Restricted Project
wmi added inline comments to D95962: [CSSPGO] Introducing dangling pseudo probes..
Mar 2 2021, 10:56 PM · Restricted Project
wmi added inline comments to D95962: [CSSPGO] Introducing dangling pseudo probes..
Mar 2 2021, 8:08 PM · Restricted Project

Mar 1 2021

wmi accepted D97481: [CSSPGO] Unblocking optimizations by dangling pseudo probes..

LGTM.

Mar 1 2021, 8:43 AM · Restricted Project

Feb 28 2021

wmi added inline comments to D97481: [CSSPGO] Unblocking optimizations by dangling pseudo probes..
Feb 28 2021, 10:22 PM · Restricted Project

Feb 27 2021

wmi committed rG7fb400112f6c: [SampleFDO] Add a cutoff flag to control how many symbols will be included (authored by wmi).
[SampleFDO] Add a cutoff flag to control how many symbols will be included
Feb 27 2021, 11:16 PM
wmi closed D97623: [SampleFDO] Add a cutoff flag to control how many symbols will be included into profile symbol list..
Feb 27 2021, 11:16 PM · Restricted Project
wmi updated the diff for D97623: [SampleFDO] Add a cutoff flag to control how many symbols will be included into profile symbol list..

Address Teresa's comment.

Feb 27 2021, 11:02 PM · Restricted Project
wmi added inline comments to D97623: [SampleFDO] Add a cutoff flag to control how many symbols will be included into profile symbol list..
Feb 27 2021, 11:01 PM · Restricted Project