Page MenuHomePhabricator

xur (Rong Xu)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 20 2015, 4:19 PM (294 w, 2 d)

Recent Activity

Fri, Apr 2

xur accepted D99821: [PGO, test] Fix typo in FileCheck var.

LGTM

Fri, Apr 2, 5:15 PM · Restricted Project

Tue, Mar 23

xur added inline comments to D99123: [SampleFDO] Flow Sensitive Sample FDO (FSAFDO).
Tue, Mar 23, 10:12 AM · Restricted Project

Mon, Mar 22

xur requested review of D99123: [SampleFDO] Flow Sensitive Sample FDO (FSAFDO).
Mon, Mar 22, 3:36 PM · Restricted Project

Wed, Mar 17

xur added a comment to D98763: [lld] add context-sensitive PGO options for COFF..

This looks good to me. But I'll let other approve this.

Wed, Mar 17, 9:39 AM · Restricted Project

Feb 25 2021

xur committed rG6103b6ad69fe: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class (authored by xur).
[SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class
Feb 25 2021, 8:27 AM
xur closed D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 25 2021, 8:26 AM · Restricted Project

Feb 19 2021

xur added inline comments to D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 19 2021, 3:45 PM · Restricted Project
xur updated the diff for D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.

Integrated David's review comments.

Feb 19 2021, 2:56 PM · Restricted Project
xur added inline comments to D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 19 2021, 2:48 PM · Restricted Project
xur abandoned D95698: [SampleFDO][NFC] Move the core implementation of Sample Profile Loader to a template.
Feb 19 2021, 10:52 AM · Restricted Project
xur accepted D92074: [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata.

The transformation part looks good to me.
Func validateRecord() still checks entries with 0 size only.
But it's OK, as the transformation will catch bad profiles.
I'll approve this patch. Sorry for taking so long.

Feb 19 2021, 10:42 AM · Restricted Project
xur updated the diff for D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.

Integrated the comments from David Blaikie.

Feb 19 2021, 10:14 AM · Restricted Project
xur added inline comments to D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 19 2021, 9:51 AM · Restricted Project

Feb 18 2021

xur added inline comments to D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 18 2021, 4:33 PM · Restricted Project
xur added a comment to D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.

Really really broad feedback - this work to write common abstractions over LLVM IR and MIR seems to overlap with https://lists.llvm.org/pipermail/llvm-dev/2020-December/147433.html

It's non-trivial as to what exactly these APIs should look like (virtual/type erased v templates, etc). But may be useful to consider some of the options here.

My current rough guess is that templates are probably the right tool, but that more common abstractions should be implemented in the IR types themselves - eg: the TypeMap and getFunction/getEntryBB could be rolled into the IR types themselves as authoritative/core features, rather than grafting them on with traits.

Feb 18 2021, 4:21 PM · Restricted Project
xur requested review of D96981: [SampleFDO][NFC] Refactor: make SampleProfileLoaderBaseImpl a template class.
Feb 18 2021, 11:34 AM · Restricted Project

Feb 17 2021

xur committed rG7397905ab0a0: [SampleFDO] Third Try: Refactor SampleProfile.cpp (authored by xur).
[SampleFDO] Third Try: Refactor SampleProfile.cpp
Feb 17 2021, 3:33 PM
xur added a comment to D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Adding "inline" keywords will make the functions COMDAT and will fix the
duplicates problem. I verified with -DLLVM_ENABLE_MODULES=On.

Feb 17 2021, 1:42 PM · Restricted Project
xur added a comment to D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Thanks for reporting this.
What config this failure is using? I don't see this error in my builds.
This is an intermediate step for templatelizing the code. I don't think
this will be a problem for the templated headers.

Feb 17 2021, 10:40 AM · Restricted Project

Feb 16 2021

xur committed rG6fd5ccff72ee: [SampleFDO] Reapply: Refactor SampleProfile.cpp (authored by xur).
[SampleFDO] Reapply: Refactor SampleProfile.cpp
Feb 16 2021, 4:54 PM
xur added a comment to D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Yes. I'm aware of this. I had a fix already. Testing it now.

Feb 16 2021, 3:08 PM · Restricted Project
xur added a comment to rG310b35304cdf: [SampleFDO][NFC] Refactor SampleProfile.cpp.

yes. I'm working this. I will send a patch shortly.

Feb 16 2021, 2:10 PM
xur updated subscribers of D96810: [SampleFDO] Provide a virtual desructor for SampleProfileLoaderBaseImpl.

No worry. This fix also works for me. Thank you and Kazu for the quick
response! Much appreciated.

Feb 16 2021, 1:55 PM · Restricted Project
xur accepted D96810: [SampleFDO] Provide a virtual desructor for SampleProfileLoaderBaseImpl.

Thanks for fixing this. I think this is fine. I don't think there will a direct allocation of the base type. We always use the derived type to allocate the object.
Samples field will be freed by the Reader which is an uniqe_pointer.

Feb 16 2021, 1:06 PM · Restricted Project
xur committed rG310b35304cdf: [SampleFDO][NFC] Refactor SampleProfile.cpp (authored by xur).
[SampleFDO][NFC] Refactor SampleProfile.cpp
Feb 16 2021, 11:20 AM
xur closed D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.
Feb 16 2021, 11:20 AM · Restricted Project
xur added a comment to D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Thanks for the update!
I agree that the probe based part can be moved to the base later. Once all
the lineno based code is in place, moving code should be straightforward.

Feb 16 2021, 11:00 AM · Restricted Project
xur updated subscribers of D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

WeiLei and Hongtao, do you have any concerns / comments? If not, I will
commit this change today.

Feb 16 2021, 10:25 AM · Restricted Project

Feb 11 2021

xur updated the diff for D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Here is the version include the definition of SampleCoverageTracker in the base class.
Without using the wrapper functions, it does look a bit cleaner.

Feb 11 2021, 1:33 PM · Restricted Project
xur added a reviewer for D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp: hoy.
Feb 11 2021, 1:01 PM · Restricted Project
xur updated the diff for D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.

Integrated Wei's review comment.

Feb 11 2021, 11:26 AM · Restricted Project
xur retitled D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp from SampleFDO][NFC] Refactor SampleProfile.cpp to [SampleFDO][NFC] Refactor SampleProfile.cpp.
Feb 11 2021, 11:23 AM · Restricted Project
xur accepted D96487: Restore diagnostic handler after CodeGenAction::ExecuteAction.

This looks fine to me. Thanks for fixing.

Feb 11 2021, 10:50 AM · Restricted Project, Restricted Project

Feb 10 2021

xur updated the summary of D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.
Feb 10 2021, 2:38 PM · Restricted Project
xur updated the summary of D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.
Feb 10 2021, 2:38 PM · Restricted Project
xur requested review of D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp.
Feb 10 2021, 2:36 PM · Restricted Project
xur retitled D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen from [SampleFDO][NFC] Refacrot SampleProfileLoad to reuse the code in MachineIR to [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.
Feb 10 2021, 2:12 PM · Restricted Project
xur committed rGdb0d7d0ba9f9: [SampleFDO][NFC] Refactor SampleProfileLoader to reuse in CodeGen (authored by xur).
[SampleFDO][NFC] Refactor SampleProfileLoader to reuse in CodeGen
Feb 10 2021, 1:29 PM
xur closed D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.
Feb 10 2021, 1:29 PM · Restricted Project
xur updated the diff for D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.

Integrated Wei's review comments.
The test case turns out to be my problem. Also fixed it.

Feb 10 2021, 11:40 AM · Restricted Project
xur added a comment to D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.

Thanks, Wei!

Feb 10 2021, 9:45 AM · Restricted Project

Feb 8 2021

xur added a comment to D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.

Thanks David for explaining this for me. Sorry for not making it clear in
the original email.

Feb 8 2021, 10:13 AM · Restricted Project

Feb 6 2021

xur updated the diff for D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.

Here is the another way to refactor the SampleProfileLoader:

Feb 6 2021, 1:53 PM · Restricted Project

Feb 3 2021

xur committed rGb8f13db5b7aa: [SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker (authored by xur).
[SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker
Feb 3 2021, 11:40 AM
xur closed D95823: [SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker.
Feb 3 2021, 11:40 AM · Restricted Project

Feb 2 2021

xur updated subscribers of D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.

I meant the functions move the header file. In the header file, we can
achieve the same by adding an inline keyword to the out of class function
definition (vs in class definition). Out of class definitions have better
readability because some of the functions are really large.

Feb 2 2021, 12:57 PM · Restricted Project

Feb 1 2021

xur updated subscribers of D95823: [SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker.

Machine level profile loader will use the SampleCoverage Tracker. This
class will be kept in the templated header. Machine level profile loader
and IR level profile loader will be using the exactly the same class (not
templatelized).

Feb 1 2021, 4:11 PM · Restricted Project
xur requested review of D95832: [SampleFDO][NFC] Refactor SampleProfileLoad to reuse the code in CodeGen.
Feb 1 2021, 3:51 PM · Restricted Project
xur added a comment to D95823: [SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker.

It's only used in this file, by SampleProfileLoader and SampleProfileTracker class. I could make it a class static method (in SampleProfileLoader), But I don't see an advantage of that -- just with longer class qualifier.

Feb 1 2021, 3:11 PM · Restricted Project
xur requested review of D95823: [SampleFDO][NFC] Detach SampleProfileLoader from SampleCoverageTracker.
Feb 1 2021, 2:26 PM · Restricted Project

Jan 29 2021

xur requested review of D95698: [SampleFDO][NFC] Move the core implementation of Sample Profile Loader to a template.
Jan 29 2021, 1:51 PM · Restricted Project

Jan 26 2021

xur added a comment to D92074: [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata.

I think the patch is going the right direction. Some minor comments:
(1) If we have two entries with the same value (other than 0), will we have the same issue? I think we will have same invalid switch statement. So can we extend this patch to handle this? That should be a small change.
(2) can we change "invalid merge" to "invalid profile"? This does not look like a merge issue -- at least from the test case where the problem is from the raw profile. This points to profile runtime issue. I think invalid profile is more appropriate here.

Jan 26 2021, 10:21 PM · Restricted Project
xur accepted D95495: Emit metadata if there is a profile hash mismatch.

lgtm too

Jan 26 2021, 10:08 PM · Restricted Project

Jan 14 2021

xur added a comment to D92074: [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata.

Sorry for the delay.

Jan 14 2021, 10:29 AM · Restricted Project

Jan 12 2021

xur accepted D94463: [Driver] Fix assertion failure when -fprofile-generate -fcs-profile-generate are used together.

looks good to me. Thanks for working on this.

Jan 12 2021, 2:10 PM · Restricted Project

Dec 17 2020

xur committed rG31c0b8700b4f: Fix clang-ppc64le-rhel buildbot build error (authored by xur).
Fix clang-ppc64le-rhel buildbot build error
Dec 17 2020, 7:16 PM
xur committed rG3733463dbb58: [IR][PGO] Add hot func attribute and use hot/cold attribute in func section (authored by xur).
[IR][PGO] Add hot func attribute and use hot/cold attribute in func section
Dec 17 2020, 6:55 PM
xur closed D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.
Dec 17 2020, 6:55 PM · Restricted Project, Restricted Project
xur added inline comments to D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.
Dec 17 2020, 5:23 PM · Restricted Project, Restricted Project

Dec 16 2020

xur committed rG0abd744597ee: [PGO] Use the sum of profile counts to fix the function entry count (authored by xur).
[PGO] Use the sum of profile counts to fix the function entry count
Dec 16 2020, 1:38 PM
xur closed D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts.
Dec 16 2020, 1:38 PM · Restricted Project
xur updated subscribers of D90275: [clang][IR] Add support for leaf attribute.

yes. Also #43 should be #42
I fixed it in
https://reviews.llvm.org/D92493
But that was just to make my test pass.

Dec 16 2020, 11:38 AM · Restricted Project, Restricted Project
xur updated the diff for D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.

Integrated comments from David and MaskRay.

Dec 16 2020, 11:31 AM · Restricted Project, Restricted Project
xur added a comment to D90275: [clang][IR] Add support for leaf attribute.

This breaks llvm/test/Bitcode/attributes.ll.
The added test code was obviously wrong.

Dec 16 2020, 11:26 AM · Restricted Project, Restricted Project
xur added inline comments to D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.
Dec 16 2020, 10:37 AM · Restricted Project, Restricted Project

Dec 14 2020

xur updated subscribers of D91813: [PGO] verify BFI counts after loading profile data.

Thanks for catching that.
I messed up the commit from another patch.
Fixed in commit c36f31c.

Dec 14 2020, 6:48 PM · Restricted Project, Restricted Project
xur committed rGc36f31c4db06: [PGO] remove unintentional code in early commit (authored by xur).
[PGO] remove unintentional code in early commit
Dec 14 2020, 6:44 PM
xur committed rG54e03d03a7a4: [PGO] Verify BFI counts after loading profile data (authored by xur).
[PGO] Verify BFI counts after loading profile data
Dec 14 2020, 4:17 PM
xur closed D91813: [PGO] verify BFI counts after loading profile data.
Dec 14 2020, 4:16 PM · Restricted Project, Restricted Project
xur updated the diff for D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.

Updated LangRef and added test cases per review comments.

Dec 14 2020, 3:42 PM · Restricted Project, Restricted Project

Dec 8 2020

xur accepted D91673: [PGO] Enable preinline and cleanup when optimize for size.

Sorry to the late response (I somehow missed the reply).

Dec 8 2020, 4:57 PM · Restricted Project, Restricted Project
xur accepted D92882: [MBP] Prevent rotating a chain contains entry block.

Look reasonable to me.

Dec 8 2020, 1:55 PM · Restricted Project

Dec 2 2020

xur retitled D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix from IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix to [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.
Dec 2 2020, 10:06 AM · Restricted Project, Restricted Project
xur requested review of D92493: [IR] Add hot to function attributes and use hot/cold attribute in function section prefix/suffix.
Dec 2 2020, 9:46 AM · Restricted Project, Restricted Project

Dec 1 2020

xur added a comment to D92074: [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata.

I'm not sure llvm-profdata is good place to fix. I would rather to fix this in the memop size transformation -- to detect this in the heuristic.
At the same, I'm interested to know what is the cause of this. Should we do something in profile runtime to prevent this.

Dec 1 2020, 10:47 AM · Restricted Project

Nov 20 2020

xur updated the diff for D91813: [PGO] verify BFI counts after loading profile data.

Integrated David's review comments.

Nov 20 2020, 12:36 PM · Restricted Project, Restricted Project
xur added inline comments to D91813: [PGO] verify BFI counts after loading profile data.
Nov 20 2020, 12:20 PM · Restricted Project, Restricted Project
xur updated the diff for D91813: [PGO] verify BFI counts after loading profile data.

Using remarks to print the message.
Note that the message printing is still under the internal option.
(This seems OK to me as other options, like EmitBranchProbability, are doing the same.)

Nov 20 2020, 11:12 AM · Restricted Project, Restricted Project

Nov 19 2020

xur accepted D91826: [PGO] Make -disable-preinline work with NPM.

LGTM.

Nov 19 2020, 10:06 PM · Restricted Project
xur added inline comments to D91813: [PGO] verify BFI counts after loading profile data.
Nov 19 2020, 9:57 PM · Restricted Project, Restricted Project
xur added inline comments to D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts.
Nov 19 2020, 3:03 PM · Restricted Project
xur requested review of D91813: [PGO] verify BFI counts after loading profile data.
Nov 19 2020, 11:57 AM · Restricted Project, Restricted Project
xur updated the diff for D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts.

Split the verification to another patch.

Nov 19 2020, 11:55 AM · Restricted Project

Nov 18 2020

xur updated the diff for D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts.

Updated the patch that addressed David's review comments.
One noticeable change was to .add a new option "pgo-vefify-hot-bfi" which will
output a message when one of the following happens:
(1) a hot rawCount becomes non-hot in BFI
(2) a cold rawCount becomes hot in BFI

Nov 18 2020, 5:42 PM · Restricted Project
xur added a comment to D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts.

I'm reviving this patch because this fixes one of our internal bugs.

Nov 18 2020, 5:35 PM · Restricted Project

Nov 17 2020

xur added a comment to D91673: [PGO] Enable preinline and cleanup when optimize for size.

This is probably OK for -Os (SizeLevel == 1), but we need to be careful with Oz (SizeLevel == 2).
We already know that enabling preinliner in general will reduce size -- as the preinliner is pretty conservative. But there will be cases size will be increased.

Nov 17 2020, 8:21 PM · Restricted Project, Restricted Project

Sep 11 2020

xur accepted D87417: [MachineBasicBlock] Fix a typo in function copySuccessor.

Yes. This looks a typo to me too.

Sep 11 2020, 1:40 PM · Restricted Project

Jul 27 2020

xur updated the diff for D83024: [PGO] Instrument function entry BB by default in IR PGO.

Update the patch after committing the support in a separated patch:
commit 50da55a58534e9207d8d5e31c8b4b5cf0c624175

Jul 27 2020, 11:16 AM · Restricted Project

Jul 24 2020

xur committed rG1dd39b113313: [PGO] Fix incorrect function entry count (authored by xur).
[PGO] Fix incorrect function entry count
Jul 24 2020, 5:41 PM
xur closed D84378: [PGO] Fix incorrect function entry count.
Jul 24 2020, 5:40 PM · Restricted Project
xur committed rG31bd15c56244: [PGO][InstrProf] Do not promote count if the exit blocks contains ret… (authored by xur).
[PGO][InstrProf] Do not promote count if the exit blocks contains ret…
Jul 24 2020, 5:39 PM
xur committed rG5546c2ab42d4: Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret… (authored by xur).
Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret…
Jul 24 2020, 5:36 PM
xur added a reverting change for rG6fdc6f6c7d34: [PGO][InstrProf] Do not promote count if the exit blocks contains ret…: rG5546c2ab42d4: Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret….
Jul 24 2020, 5:36 PM
xur committed rGdcf1bca0de3b: Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret… (authored by xur).
Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret…
Jul 24 2020, 5:34 PM
xur added a reverting change for rG867ef4472d8e: [PGO][InstrProf] Do not promote count if the exit blocks contains ret…: rGdcf1bca0de3b: Revert "[PGO][InstrProf] Do not promote count if the exit blocks contains ret….
Jul 24 2020, 5:34 PM
xur committed rG867ef4472d8e: [PGO][InstrProf] Do not promote count if the exit blocks contains ret… (authored by xur).
[PGO][InstrProf] Do not promote count if the exit blocks contains ret…
Jul 24 2020, 5:24 PM
xur committed rG6fdc6f6c7d34: [PGO][InstrProf] Do not promote count if the exit blocks contains ret… (authored by xur).
[PGO][InstrProf] Do not promote count if the exit blocks contains ret…
Jul 24 2020, 5:15 PM
xur closed D84379: PGO][InstrProf] Do not promote count if the exit blocks contains ret instruction.
Jul 24 2020, 5:15 PM · Restricted Project

Jul 23 2020

xur added inline comments to D84378: [PGO] Fix incorrect function entry count.
Jul 23 2020, 4:57 PM · Restricted Project
xur added inline comments to D84378: [PGO] Fix incorrect function entry count.
Jul 23 2020, 4:49 PM · Restricted Project