Page MenuHomePhabricator
Feed Advanced Search

Sat, Aug 1

wmi accepted D83852: [llvm-profdata] Implement llvm-profdata overlap for sample profiles.

Thanks. Another suggestion about comment. Other than that, LGTM.

Sat, Aug 1, 10:14 AM · Restricted Project

Fri, Jul 31

wmi accepted D84997: [AutoFDO] Avoid merging inlinee samples multiple times.

LGTM. Thanks.

Fri, Jul 31, 9:02 AM · Restricted Project

Thu, Jul 30

wmi added a comment to D84997: [AutoFDO] Avoid merging inlinee samples multiple times.

I see. Thanks for the explanation.

Thu, Jul 30, 10:01 PM · Restricted Project
wmi added a comment to D84994: [SampleFDO] Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee is enabled.

Commit the fix for the second problem in D84997 together with the assertion and testcase in this patch, so D84997 can be dedicated to solve the other problem.

Thu, Jul 30, 9:27 PM · Restricted Project
wmi committed rG836991d3676f: Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee (authored by wmi).
Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee
Thu, Jul 30, 9:21 PM
wmi closed D84994: [SampleFDO] Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee is enabled.
Thu, Jul 30, 9:21 PM · Restricted Project
wmi added a comment to D84997: [AutoFDO] Avoid merging inlinee samples multiple times.

The multiple inline instance copies generated from loop unrolling or jump threading should have their own FunctionSamples objects. Why merging multiple inline instance to the outline profile will trigger assertion? Could you have a testcase for it?

It's a slightly difference case. In the training build, we didn't unroll, so there's a single inline site in the loop, but in the PGO optimizing build, the loop got unrolled with call site duplicated. And the duplicated call sites all point to the same FunctionSamples, in which case we should merge them only once. Agree that we should add a test case.

Thu, Jul 30, 9:06 PM · Restricted Project
wmi added a comment to D84997: [AutoFDO] Avoid merging inlinee samples multiple times.
In D84997#2186522, @wmi wrote:

Yes, the fix in D84997 is more concise. Here I use a straightforward fix. It is ok for Hongtao to commit D84997, but just add a testcase (free to use the one here).

Thu, Jul 30, 8:28 PM · Restricted Project
wmi added a comment to D84994: [SampleFDO] Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee is enabled.

Yes, the fix in D84997 is more concise. Here I use a straightforward fix. It is ok for Hongtao to commit D84997, but just add a testcase (free to use the one here).

Thu, Jul 30, 8:26 PM · Restricted Project
wmi added a comment to D84997: [AutoFDO] Avoid merging inlinee samples multiple times.

Yes, the fix in D84997 is more concise. Here I use a straightforward fix. It is ok for Hongtao to commit D84997, but just add a testcase (free to use the one here).

Thu, Jul 30, 8:25 PM · Restricted Project
wmi added a comment to D84997: [AutoFDO] Avoid merging inlinee samples multiple times.

The multiple inline instance copies generated from loop unrolling or jump threading should have their own FunctionSamples objects. Why merging multiple inline instance to the outline profile will trigger assertion? Could you have a testcase for it?

Thu, Jul 30, 8:22 PM · Restricted Project
wmi requested review of D84994: [SampleFDO] Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee is enabled.
Thu, Jul 30, 5:56 PM · Restricted Project

Mon, Jul 27

wmi committed rGa23f62343cb7: Supplement instr profile with sample profile. (authored by wmi).
Supplement instr profile with sample profile.
Mon, Jul 27, 9:24 PM
wmi closed D81981: [PGO] Supplement PGO profile with Sample profile.
Mon, Jul 27, 9:23 PM · Restricted Project
wmi added inline comments to D81981: [PGO] Supplement PGO profile with Sample profile.
Mon, Jul 27, 10:09 AM · Restricted Project

Sat, Jul 25

wmi added a comment to D83852: [llvm-profdata] Implement llvm-profdata overlap for sample profiles.

Thanks for the work. It is a very useful feature.

Sat, Jul 25, 11:39 AM · Restricted Project

Fri, Jul 24

wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Address David's comments.

Fri, Jul 24, 4:53 PM · Restricted Project

Wed, Jul 22

wmi added inline comments to D81981: [PGO] Supplement PGO profile with Sample profile.
Wed, Jul 22, 2:42 PM · Restricted Project

Tue, Jul 21

wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Address David's comment

Tue, Jul 21, 10:50 AM · Restricted Project

Fri, Jul 17

wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

I think this feature should be decoupled from the version change -- since this is an approximate anyway. One way to do this is to use max count or total count as a reference point and compute the scale factor.

Fri, Jul 17, 10:25 AM · Restricted Project

Thu, Jul 16

wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

I also plan to dump the functions cold in instr profile and hot in sample profile, and sort the output according to hotness in sample profile. That can be used to guide PGO users if they want to improve the representativeness of their loadtest. I leave that part in a separate patch for easier review.

Thu, Jul 16, 2:46 PM · Restricted Project
wmi accepted D83743: [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks.

LGTM. Better wait another day to see if other reviewers have further comments.

Thu, Jul 16, 12:07 PM · Restricted Project
wmi added inline comments to D83743: [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks.
Thu, Jul 16, 10:46 AM · Restricted Project

Wed, Jul 15

wmi added a comment to D83743: [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks.

Thanks for the explanation.

Wed, Jul 15, 8:55 AM · Restricted Project

Tue, Jul 14

wmi added a comment to D83743: [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks.

Can this be extended to the SCC inliner?

Yes, we can use it in SCC inliner as well. We just need extra plumbing there. We can do that in a separate change if needed.

Tue, Jul 14, 11:02 AM · Restricted Project

Fri, Jul 10

wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Address David's comments.

Fri, Jul 10, 7:20 PM · Restricted Project
wmi added inline comments to D81981: [PGO] Supplement PGO profile with Sample profile.
Fri, Jul 10, 7:20 PM · Restricted Project

Thu, Jul 9

wmi committed rGe296e9dfd6ce: [NFC] Change getEntryForPercentile to be a static function in… (authored by wmi).
[NFC] Change getEntryForPercentile to be a static function in…
Thu, Jul 9, 4:57 PM
wmi closed D83439: [NFC] Change getEntryForPercentile to be a static function in ProfileSummaryBuilder.
Thu, Jul 9, 4:57 PM · Restricted Project
wmi committed rG78fe6a3ee244: [NFC] Extract the code to write instr profile into function writeInstrProfile (authored by wmi).
[NFC] Extract the code to write instr profile into function writeInstrProfile
Thu, Jul 9, 4:31 PM
wmi closed D83521: [NFC] Extract the code to write instr profile into function writeInstrProfile.
Thu, Jul 9, 4:30 PM · Restricted Project
Herald added a project to D83521: [NFC] Extract the code to write instr profile into function writeInstrProfile: Restricted Project.
Thu, Jul 9, 4:22 PM · Restricted Project
wmi added a comment to D79978: Call Frame Information (CFI) Handling for Basic Block Sections.
In D79978#2141768, @wmi wrote:

I haven't looked into the details, but the test suggests that the patch is wrong:

# basic-block-sections-cfi-1.ll
        .section        .text,"ax",@progbits,unique,2
_Z2f3b.2:                               # %if.end
        .cfi_startproc
        .cfi_def_cfa %rbp, 16    # this should be inserted after addq $16, %rsp
        .cfi_offset %rbp, -16    # this should be after .cfi_def_cfa %rbp, 16
        addq    $16, %rsp
        popq    %rbp
        .cfi_def_cfa %rsp, 8
        retq

I think the position where the cfi directives are currently inserted is correct. Those directives at the beginning of BB are not to maintain call frame information for instructions inside of BB like "addq $16, %rsp" and "popq %rbp", but to setup the call frame information correctly at the beginning of BB because the BB could be moved around.

Ack. Then what instructions should be placed at the top of these basic blocks? Should .cfi_def_cfa_register %rbp be placed as well? If you move these basic blocks around, .cfi_def_cfa_register %rbp is currently not tracked.

Thu, Jul 9, 9:28 AM · Restricted Project
wmi added a comment to D79978: Call Frame Information (CFI) Handling for Basic Block Sections.

I haven't looked into the details, but the test suggests that the patch is wrong:

# basic-block-sections-cfi-1.ll
        .section        .text,"ax",@progbits,unique,2
_Z2f3b.2:                               # %if.end
        .cfi_startproc
        .cfi_def_cfa %rbp, 16    # this should be inserted after addq $16, %rsp
        .cfi_offset %rbp, -16    # this should be after .cfi_def_cfa %rbp, 16
        addq    $16, %rsp
        popq    %rbp
        .cfi_def_cfa %rsp, 8
        retq
Thu, Jul 9, 7:58 AM · Restricted Project

Wed, Jul 8

wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Fix a wrong flag name in test.

Wed, Jul 8, 3:54 PM · Restricted Project
wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Address David's comment.
Adjust comments, function names and flag names.

Wed, Jul 8, 3:46 PM · Restricted Project
wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

refactor GetEntryForPercentile out in https://reviews.llvm.org/D83439

Wed, Jul 8, 3:34 PM · Restricted Project
Herald added a project to D83439: [NFC] Change getEntryForPercentile to be a static function in ProfileSummaryBuilder: Restricted Project.
Wed, Jul 8, 3:27 PM · Restricted Project
wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

https://reviews.llvm.org/D82123 to always instrument function entry BB has been committed guarded by a flag. https://reviews.llvm.org/D83024 to enable the flag by default is under review.

Wed, Jul 8, 9:49 AM · Restricted Project
wmi committed rGe32469a14037: [SampleFDO] Enable sample-profile-top-down-load and sample-profile-merge… (authored by wmi).
[SampleFDO] Enable sample-profile-top-down-load and sample-profile-merge…
Wed, Jul 8, 9:24 AM
wmi closed D82919: [SampleFDO] Enable sample-profile-top-down-load by default..
Wed, Jul 8, 9:24 AM · Restricted Project

Tue, Jul 7

wmi accepted D79978: Call Frame Information (CFI) Handling for Basic Block Sections.

Thanks. LGTM. Please wait and see if David has more comments.

Tue, Jul 7, 9:54 PM · Restricted Project
wmi added inline comments to D79978: Call Frame Information (CFI) Handling for Basic Block Sections.
Tue, Jul 7, 8:54 AM · Restricted Project

Mon, Jul 6

wmi updated the diff for D82919: [SampleFDO] Enable sample-profile-top-down-load by default..

Disable sample-profile-merge-inlinee when sample-profile-top-down-load is not effective (Currently sample-profile-top-down-load is only effective for new pass manager).

Mon, Jul 6, 5:36 PM · Restricted Project
wmi added a comment to D82919: [SampleFDO] Enable sample-profile-top-down-load by default..

I tested the performance with sample-profile-top-down-load and sample-profile-merge-inlinee both enabled. In different compiler versions I got different result. In one version about three weeks older, I got 0.4% improvement for one benchmark steadily in multiple runs and neutral for another. In the head llvm version, I saw neutral result for both benchmarks.

Mon, Jul 6, 2:54 PM · Restricted Project
wmi updated the diff for D82919: [SampleFDO] Enable sample-profile-top-down-load by default..

Enable -sample-profile-merge-inlinee by default together with -sample-profile-top-down-load.

Mon, Jul 6, 2:45 PM · Restricted Project
wmi added a comment to D83024: [PGO] Instrument function entry BB by default in IR PGO.

Here version is overloaded with different meanings: 1) to indicate format change; 2) to indicate instrumentation compiler version that is capable of producing this format. These two purposes can be contradicting to each other as the user can use option to force the old format with the new compiler.

Mon, Jul 6, 9:21 AM · Restricted Project

Jun 30 2020

wmi added a comment to D82919: [SampleFDO] Enable sample-profile-top-down-load by default..

Sounds good to me. I will redo the performance test for it.

Jun 30 2020, 5:23 PM · Restricted Project
wmi created D82919: [SampleFDO] Enable sample-profile-top-down-load by default..
Jun 30 2020, 3:46 PM · Restricted Project

Jun 29 2020

wmi abandoned D82834: [clang] Move a template function definition to header file.

Thanks David!

Jun 29 2020, 10:00 PM
wmi created D82834: [clang] Move a template function definition to header file.
Jun 29 2020, 8:56 PM

Jun 25 2020

wmi updated the diff for D81981: [PGO] Supplement PGO profile with Sample profile.

Remove the compiler part since that part will be done in https://reviews.llvm.org/D82123.

Jun 25 2020, 4:56 PM · Restricted Project

Jun 21 2020

wmi added a comment to D82123: [PGO] Add a functionality to always instrument the func entry BB.

I tried it on an internal benchmark.

Jun 21 2020, 10:45 PM · Restricted Project

Jun 19 2020

wmi accepted D81800: Add --hot-func-list to llvm-profdata show for sample profiles.

LGTM. Thanks.

Jun 19 2020, 10:54 AM · Restricted Project

Jun 18 2020

wmi added a comment to D82123: [PGO] Add a functionality to always instrument the func entry BB.

Thanks for the patch! I guess atomic update is to reduce the cost of the entry counter for application with many threads. How much difference there is w/wo enabling -atomic-first-counter?

Jun 18 2020, 3:21 PM · Restricted Project

Jun 17 2020

wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

The index format needs to be backward compatible, so there needs to be some version specific handling there (can be removed later).

Jun 17 2020, 7:58 PM · Restricted Project
wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

If how we select BB to instrument depends on a switch, we would need instrumentation build and optimizing build to have consistent switch, otherwise counters could mismatch even if CFG checksum matches? I guess that's one reason why it'd be good to avoid different ways of selecting BBs.

Jun 17 2020, 7:26 PM · Restricted Project
wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

Why is the profile size increase? I expect the number of instrumented blocks remain mostly unchanged.

The reason for the question is that if the overhead is low, I think we should make the default to be true.

Jun 17 2020, 4:44 PM · Restricted Project
wmi added a comment to D81981: [PGO] Supplement PGO profile with Sample profile.

I think it is good to have an entry counter always, so that the profile dump is more readable. Do you have data showing the instrumentation overhead and profile size impact (clang and some large app)?

Jun 17 2020, 3:06 PM · Restricted Project

Jun 16 2020

wmi created D81981: [PGO] Supplement PGO profile with Sample profile.
Jun 16 2020, 5:01 PM · Restricted Project

Jun 15 2020

wmi added inline comments to D81800: Add --hot-func-list to llvm-profdata show for sample profiles.
Jun 15 2020, 5:08 PM · Restricted Project
wmi added a comment to D81800: Add --hot-func-list to llvm-profdata show for sample profiles.

Thanks for adding the feature.

Jun 15 2020, 10:23 AM · Restricted Project

Jun 11 2020

wmi accepted D80589: [NewPM] Avoid redundant CGSCC run for updated SCC.

Based on my limited knowledge of new pass manager, this change looks good. Please wait another day or two before commit in case Chandler has some comment.

Jun 11 2020, 5:05 PM · Restricted Project

Jun 4 2020

wmi accepted D81202: Fix the roundtrip test under llvm-profdata.

Thanks for catching the mistake!

Jun 4 2020, 5:41 PM · Restricted Project

Jun 2 2020

wmi committed rG7a6c89427c9b: [SampleFDO] Add use-sample-profile function attribute. (authored by wmi).
[SampleFDO] Add use-sample-profile function attribute.
Jun 2 2020, 6:08 PM
wmi closed D79959: [SampleFDO] Add use-sample-profile function attribute .
Jun 2 2020, 6:08 PM · Restricted Project, Restricted Project
wmi accepted D81030: [JumpThreading] Simplify FindMostPopularDest (NFC).

LGTM.

Jun 2 2020, 4:29 PM · Restricted Project
wmi updated the diff for D79959: [SampleFDO] Add use-sample-profile function attribute .

Address MaskRay's comment.

Jun 2 2020, 1:10 PM · Restricted Project, Restricted Project
wmi added inline comments to D79959: [SampleFDO] Add use-sample-profile function attribute .
Jun 2 2020, 1:10 PM · Restricted Project, Restricted Project

May 29 2020

wmi accepted D79831: [PGO] Improve the working set size heuristics under the partial sample PGO..

LGTM.

May 29 2020, 4:57 PM · Restricted Project
wmi updated the diff for D79959: [SampleFDO] Add use-sample-profile function attribute .

Address MaskRay's comment and fix a bunch of tests.

May 29 2020, 10:21 AM · Restricted Project, Restricted Project
wmi added inline comments to D79959: [SampleFDO] Add use-sample-profile function attribute .
May 29 2020, 10:21 AM · Restricted Project, Restricted Project

May 28 2020

wmi added inline comments to D79978: Call Frame Information (CFI) Handling for Basic Block Sections.
May 28 2020, 10:24 AM · Restricted Project

May 27 2020

wmi added inline comments to D79831: [PGO] Improve the working set size heuristics under the partial sample PGO..
May 27 2020, 9:16 PM · Restricted Project

May 21 2020

wmi added inline comments to D79831: [PGO] Improve the working set size heuristics under the partial sample PGO..
May 21 2020, 4:48 PM · Restricted Project

May 20 2020

wmi added inline comments to D79978: Call Frame Information (CFI) Handling for Basic Block Sections.
May 20 2020, 6:15 PM · Restricted Project
wmi accepted D79951: [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata..

LGTM.

May 20 2020, 2:18 PM · Restricted Project
wmi added inline comments to D79951: [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata..
May 20 2020, 2:18 PM · Restricted Project
wmi added a reviewer for D79951: [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata.: wmi.
May 20 2020, 2:18 PM · Restricted Project
wmi added a comment to D79959: [SampleFDO] Add use-sample-profile function attribute .

I guess you accidentally missed InlineCost.cpp in latest version?

May 20 2020, 12:02 PM · Restricted Project, Restricted Project
wmi updated the diff for D79959: [SampleFDO] Add use-sample-profile function attribute .

Address Hongtao's comment.

May 20 2020, 10:22 AM · Restricted Project, Restricted Project
wmi added inline comments to D79959: [SampleFDO] Add use-sample-profile function attribute .
May 20 2020, 8:10 AM · Restricted Project, Restricted Project

May 19 2020

wmi updated the diff for D79959: [SampleFDO] Add use-sample-profile function attribute .

Address Wenlei's comment.

May 19 2020, 9:58 PM · Restricted Project, Restricted Project

May 18 2020

wmi added inline comments to D79902: [IR] Make Module::setProfileSummary to replace an existing ProfileSummary flag..
May 18 2020, 12:26 PM · Restricted Project
wmi added inline comments to D79951: [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata..
May 18 2020, 11:55 AM · Restricted Project

May 17 2020

wmi added a comment to D79959: [SampleFDO] Add use-sample-profile function attribute .

If this is for experimental use, why not just introducing a LLVM internal option that specify a list of function to be skipped? It should be applied to inline instances of the function specified?

May 17 2020, 9:48 PM · Restricted Project, Restricted Project
wmi added a comment to D79959: [SampleFDO] Add use-sample-profile function attribute .

If we make it a function attribute, do we need to reject pre-LTO (CGSCC) inlining between function with different attribute value? If we always expect this attribute to be consistent among functions from the same module, this won't be a problem. However having it as a function attribute does offer function level flexibility (e.g. if this is exposed through __attribute(..)__), and we may want to account for it..

May 17 2020, 9:16 PM · Restricted Project, Restricted Project

May 14 2020

wmi committed rG67bb16049af1: [llvm-profdata] Update CommandGuide (authored by wmi).
[llvm-profdata] Update CommandGuide
May 14 2020, 2:09 PM
wmi closed D79911: [llvm-profdata] Update CommandGuide.
May 14 2020, 2:09 PM · Restricted Project
wmi created D79959: [SampleFDO] Add use-sample-profile function attribute .
May 14 2020, 1:03 PM · Restricted Project, Restricted Project

May 13 2020

wmi updated the diff for D79911: [llvm-profdata] Update CommandGuide.

Address David's comment.

May 13 2020, 4:57 PM · Restricted Project
wmi added inline comments to D79911: [llvm-profdata] Update CommandGuide.
May 13 2020, 4:57 PM · Restricted Project
wmi created D79911: [llvm-profdata] Update CommandGuide.
May 13 2020, 3:51 PM · Restricted Project

May 12 2020

wmi committed rG56926ae0faa6: [SampleFDO] Rename llvm-profdata flag -partial-profile to -gen-partial-profile. (authored by wmi).
[SampleFDO] Rename llvm-profdata flag -partial-profile to -gen-partial-profile.
May 12 2020, 3:38 PM

May 8 2020

wmi committed rGaa2ddfc73d6e: [SampleFDO] For functions without profiles, provide an option to put them in a… (authored by wmi).
[SampleFDO] For functions without profiles, provide an option to put them in a…
May 8 2020, 11:48 AM
wmi closed D62540: [SampleFDO] For functions without profiles, provide an option to put them in a special text section.
May 8 2020, 11:48 AM · Restricted Project
wmi committed rG538208f6c0cb: [lld] Add a new output section ".text.unknown" for funtions with unknown hotness (authored by wmi).
[lld] Add a new output section ".text.unknown" for funtions with unknown hotness
May 8 2020, 11:16 AM
wmi closed D79590: [lld] Add a new output section ".text.unknown" for funtions with unknown hotness info especially in sampleFDO .
May 8 2020, 11:16 AM · Restricted Project
wmi added a comment to D79590: [lld] Add a new output section ".text.unknown" for funtions with unknown hotness info especially in sampleFDO .

D79600 is a followup and the discussion about it won't affect this change, so I will go ahead and submit the change.

May 8 2020, 10:10 AM · Restricted Project

May 7 2020

wmi added a comment to D79600: [TargetLoweringObjectFileImpl] Produce .text.hot. instead of .text.hot for -fno-unique-section-names.

Although less likely, is there possiblity that someone has already been using attribute((section(".text.hot."))? Adding another trailing period will break the existing usage. We may either tolerate that case, or trigger an assertion.

May 7 2020, 4:19 PM · Restricted Project