Page MenuHomePhabricator
Feed Advanced Search

Today

davidxl accepted D74346: Flags for displaying only hot nodes in CFGPrinter graph.

lgtm

Tue, Feb 18, 9:12 AM · Restricted Project

Thu, Feb 13

davidxl added a comment to D73994: [InlineCost] Relax bonus restrictions on uninlinable functions.

I have concerns on so much plumbing changes to make the small heuristic change.

Thu, Feb 13, 11:37 AM · Restricted Project
davidxl added a comment to D73142: Heat Coloring for CFGPrinter and CallPrinter.

Addressed @davidxl and @sfertile comments.

Answering @davidxl 's comment on "The function entry count should have the information", line 73, HeatUtils.cpp:
This function counts the number of calls of one specific function by another specific function while Function.entryCount() returns number entries for this function.

Answering @davidxl 's comment on "for the program's max count, max function count, get it from ProfileSummaryInfo.", line 99, HeatUtils.cpp:
ProfileSummaryInfo doesn't contain info on the maximum frequency in the module, it needs to be calculated.

Updates:

  • Ran clang-format through all the files
  • Deleted some function which had no use (see hasProfiling function)
  • Deleted const unsigned variables
Thu, Feb 13, 9:47 AM · Restricted Project

Wed, Feb 12

davidxl added a comment to D74511: [BFI] Fix missed BFI updates in MachineSink..

Add a test case (which would fail under the validation option) without the fix?

Wed, Feb 12, 4:04 PM · Restricted Project
davidxl added a comment to D74346: Flags for displaying only hot nodes in CFGPrinter graph.

what is the use case of these options? Do hidden nodes create too much noise?

Wed, Feb 12, 1:28 PM · Restricted Project

Tue, Feb 11

davidxl accepted D73387: [MBP] Partial tail duplication into hot predecessors.

lgtm

Tue, Feb 11, 1:27 PM · Restricted Project

Mon, Feb 10

davidxl accepted D71308: [CallPromotionUtils] Add tryPromoteCall..

lgtm

Mon, Feb 10, 12:27 PM · Restricted Project

Fri, Feb 7

davidxl added a comment to D68065: Propeller: LLD Support for Basic Block Sections.

Here is a summary of today's discussion:

  • this seems a straightforward implementation of your proposal
  • this patch introduces a new notion of "Jump Relocations" to represent data related to rewriting jump instructions at end of sections. Even though the Jump Relocations are somewhat similar to existing Relocations, but they are maintained in different arrays, and they are handled and consumed by different code locations. So maybe we should avoid calling it a "relocation" because "jump relocations" aren't relocations in object files?

So you had a discussion about this:)

I attended a LLVM Social yesterday and asked some people about their feelings. We are still dubious whether doing all the heavy lifting on the linker side is the right approach. Disassembly at linker side may give some short term benefits, but the interaction with debug info/asynchronous unwind tables/symbol information is muddy. The improvement is fixed. Linkers don't really understand the semantics, so the available optimizations are rather limited. In a long term, this can cause some maintenance burden. I can think of several problems:

  • Needs a psABI defined relocation type. The relocation type will probably have no use other than this very specific optimization.
  • Needs non-trivial work to port to COFF.
  • Another target may be a very different story.
  • This duplicates some work of MachineBlockPlacement.
  • The code will be duplicated on lld side may be a lot. emitNops can be reused with AsmPrinter. Branch terminators optimization may be reused with BranchFolding. etc It the current MachineFunction interface does not allow sharable MachineBasicBlocks with other MachineFunctions. Fix it.
Fri, Feb 7, 11:21 AM · Restricted Project, lld

Wed, Feb 5

davidxl accepted D74073: [PGO][PGSO] Enable profile guided size optimization for non-cold code under instrumentation PGO..

lgtm

Wed, Feb 5, 1:58 PM · Restricted Project

Tue, Feb 4

davidxl added a comment to D73994: [InlineCost] Relax bonus restrictions on uninlinable functions.

This is sort of extension of the 'shouldBeDeferred' check in Inliner.cpp, except that here the caller may not actually be inlined. Blindly eliminating bonus may preventing the callee from being inlined while not actually enabling the caller to be inlined.

Tue, Feb 4, 3:27 PM · Restricted Project
davidxl accepted D72937: [PGO][PGSO] Tune flags for profile guided size optimization..

lgtm

Tue, Feb 4, 1:28 PM · Restricted Project
davidxl added inline comments to D72937: [PGO][PGSO] Tune flags for profile guided size optimization..
Tue, Feb 4, 11:17 AM · Restricted Project

Mon, Feb 3

davidxl added a comment to D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2).

Also missing a test case on cold basic blocks.

Mon, Feb 3, 3:54 PM · Restricted Project
davidxl accepted D73920: [BFI] Add a debug check for unknown block queries..

thanks, this is a very useful feature. LGTM

Mon, Feb 3, 1:24 PM · Restricted Project
davidxl added inline comments to D73387: [MBP] Partial tail duplication into hot predecessors.
Mon, Feb 3, 10:11 AM · Restricted Project
davidxl accepted D73825: [llvm][NFC] Factor out cost-model independent inling decision.

lgtm

Mon, Feb 3, 9:47 AM · Restricted Project

Sat, Feb 1

davidxl added inline comments to D73825: [llvm][NFC] Factor out cost-model independent inling decision.
Sat, Feb 1, 4:45 PM · Restricted Project

Fri, Jan 31

davidxl added inline comments to D69591: Devirtualize a call on alloca without waiting for post inline cleanup and next DevirtSCCRepeatedPass iteration..
Fri, Jan 31, 5:31 PM · Restricted Project, Restricted Project

Thu, Jan 30

davidxl added inline comments to D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2).
Thu, Jan 30, 3:55 PM · Restricted Project
davidxl added inline comments to D71308: [CallPromotionUtils] Add tryPromoteCall..
Thu, Jan 30, 2:20 PM · Restricted Project
davidxl added a comment to D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2).

Can you add more test cases to cover things like bb labels, and different bb section types (cold, EH, unique etc). For cold section types, the merging should kick in etc.

Thu, Jan 30, 1:50 PM · Restricted Project
davidxl accepted D73381: [PGO][PGSO] Handle MBFIWrapper.

lgtm

Thu, Jan 30, 1:26 PM · Restricted Project

Wed, Jan 29

davidxl accepted D73662: [llvm][NFC] Rename CallAnalyzer::onCommonInstructionSimplification.

lgtm

Wed, Jan 29, 6:12 PM · Restricted Project
davidxl added inline comments to D68063: Propeller: LLVM support for basic block sections.
Wed, Jan 29, 3:12 PM · Restricted Project
davidxl accepted D73327: [compiler-rt][profile] fix test/instrprof-set-filename.c on windows.

lgtm

Wed, Jan 29, 2:26 PM · Restricted Project, Restricted Project
davidxl added a comment to D73662: [llvm][NFC] Rename CallAnalyzer::onCommonInstructionSimplification.

How about 'OnMissedSimplification' for simplicity?

Wed, Jan 29, 1:59 PM · Restricted Project
davidxl added inline comments to D73381: [PGO][PGSO] Handle MBFIWrapper.
Wed, Jan 29, 11:21 AM · Restricted Project
davidxl added inline comments to D73381: [PGO][PGSO] Handle MBFIWrapper.
Wed, Jan 29, 10:07 AM · Restricted Project

Tue, Jan 28

davidxl accepted D73420: [llvm] Ensure InlineCost-related fields are initialized.

lgtm

Tue, Jan 28, 12:35 PM · Restricted Project
davidxl added inline comments to D73420: [llvm] Ensure InlineCost-related fields are initialized.
Tue, Jan 28, 12:11 PM · Restricted Project
davidxl added inline comments to D73420: [llvm] Ensure InlineCost-related fields are initialized.
Tue, Jan 28, 10:11 AM · Restricted Project
davidxl added inline comments to D73142: Heat Coloring for CFGPrinter and CallPrinter.
Tue, Jan 28, 10:02 AM · Restricted Project
davidxl added inline comments to D73387: [MBP] Partial tail duplication into hot predecessors.
Tue, Jan 28, 9:44 AM · Restricted Project
davidxl accepted D73494: [MBFI] Move BranchFolding::MBFIWrapper to its own files. NFC..

lgtm

Tue, Jan 28, 9:31 AM · Restricted Project

Mon, Jan 27

davidxl added a comment to D68063: Propeller: LLVM support for basic block sections.

Try to avoid monolithic patch like this. Please consider splitting it into a few smaller incremental patches with (possibly) independent testing. Logically, it can be split into 1) IR support; 2) machine BB level support; 3) debug support 4) CFI support 5) exception and 6) the 'main tranformation' part if there is one'.

Mon, Jan 27, 1:03 PM · Restricted Project

Fri, Jan 24

davidxl added a comment to D73381: [PGO][PGSO] Handle MBFIWrapper.

The MBFIWrapper change seems NFC, can it be extracted out first?

Fri, Jan 24, 1:53 PM · Restricted Project

Thu, Jan 23

davidxl added a comment to D73221: [PGO] Attach appropriate funclet operand bundles to value profiling instrumentation calls.

ok with me if Reid is ok with windows specific logic.

Thu, Jan 23, 11:41 AM · Restricted Project

Wed, Jan 22

davidxl added a comment to D73221: [PGO] Attach appropriate funclet operand bundles to value profiling instrumentation calls.

Can you extract Window's specific code into its own helper function if possible?

Wed, Jan 22, 3:22 PM · Restricted Project
davidxl accepted D73222: [PGO] Early detection regarding whether pgo counter promotion is possible.

lgtm

Wed, Jan 22, 3:12 PM · Restricted Project
davidxl added inline comments to D73222: [PGO] Early detection regarding whether pgo counter promotion is possible.
Wed, Jan 22, 2:31 PM · Restricted Project
davidxl added inline comments to D73222: [PGO] Early detection regarding whether pgo counter promotion is possible.
Wed, Jan 22, 1:27 PM · Restricted Project
davidxl added a comment to D73217: [InlineCost] Add flag to allow changing the default inline cost .

there are checks of explicit occurrences of inline-threshold option later, so the behavior seems unchanged.

Wed, Jan 22, 1:18 PM · Restricted Project
davidxl added a comment to D73217: [InlineCost] Add flag to allow changing the default inline cost .

ok. I see the intention. As long as the behavior of --inline-threshold option is not changed (it still overrides the new option), the new option seems fine to me. Adding individually controlled option for size opt seems a good idea too.

Wed, Jan 22, 12:51 PM · Restricted Project
davidxl added a comment to D73217: [InlineCost] Add flag to allow changing the default inline cost .

This change won't work. See

Wed, Jan 22, 12:23 PM · Restricted Project

Tue, Jan 21

davidxl accepted D73146: [PGO][PGSO] Update BFI in CodeGenPrepare::optimizeSelectInst..

lgtm

Tue, Jan 21, 4:04 PM · Restricted Project

Mon, Jan 20

davidxl accepted D72949: [NFC] small rename of private member in InlineCost.cpp.

lgtm

Mon, Jan 20, 9:49 AM · Restricted Project

Sun, Jan 19

davidxl added inline comments to D72949: [NFC] small rename of private member in InlineCost.cpp.
Sun, Jan 19, 10:25 PM · Restricted Project

Jan 17 2020

davidxl added a comment to D71307: [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null..

As other commented, please extract the code into its own function also add the support when AA is available ( as other parts of the function does).

Jan 17 2020, 2:15 PM · Restricted Project
davidxl requested changes to D72949: [NFC] small rename of private member in InlineCost.cpp.
Jan 17 2020, 2:15 PM · Restricted Project
davidxl accepted D72949: [NFC] small rename of private member in InlineCost.cpp.
Jan 17 2020, 2:15 PM · Restricted Project
davidxl accepted D71307: [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null..

lgtm

Jan 17 2020, 11:11 AM · Restricted Project
davidxl added inline comments to D71307: [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null..
Jan 17 2020, 9:34 AM · Restricted Project

Jan 16 2020

davidxl accepted D71308: [CallPromotionUtils] Add tryPromoteCall..

lgtm

Jan 16 2020, 3:13 PM · Restricted Project

Jan 15 2020

davidxl accepted D72744: [NFC] Refactor InlineResult for readability.

thanks for the cleanup. The implicit conversion was not quite readable. LGTM

Jan 15 2020, 10:59 AM · Restricted Project
davidxl accepted D72790: [SampleFDO] Fix invalid branch profile generated by indirect call promotion.

lgtm

Jan 15 2020, 10:40 AM · Restricted Project

Jan 14 2020

davidxl added a comment to D72744: [NFC] Refactor InlineResult for readability.

InlineResult --> inlining related result (viability, etc) -- it captures two pieces of information: 1) inline decision and 2) when decision is 'no', related inline analysis that leads to the no decision. The class name seems fine. The patch makes the 'decision' part more explicit, and also fixes some bug in missing the right analysis message.

Jan 14 2020, 9:31 PM · Restricted Project
davidxl added a comment to D72744: [NFC] Refactor InlineResult for readability.

Class Name ResultWithMessage sounds too generic. Why not keeping the InlineResult class name? The rest of the changes look reasonable.

Jan 14 2020, 4:53 PM · Restricted Project

Jan 13 2020

davidxl accepted D72653: [PGO][CHR] Guard against 0-to-0 branch weight and avoid division by zero crash..

lgtm

Jan 13 2020, 2:30 PM · Restricted Project
davidxl accepted D72618: [Inlining] Add PreInlineThreshold for the new pass manager.

lgtm

Jan 13 2020, 7:53 AM · Restricted Project

Jan 10 2020

davidxl accepted D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..

lgtm

Jan 10 2020, 3:21 PM · Restricted Project

Jan 9 2020

davidxl added inline comments to D71308: [CallPromotionUtils] Add tryPromoteCall..
Jan 9 2020, 12:25 PM · Restricted Project

Jan 8 2020

davidxl added inline comments to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..
Jan 8 2020, 2:23 PM · Restricted Project

Jan 7 2020

davidxl added a comment to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..

The intention is to make the base CallAnalysis becomes a symbolic execution engine (virtual optimizations) what can be reused. The cost tracking is extracted into the derived class.

Jan 7 2020, 11:41 AM · Restricted Project
davidxl added a reviewer for D71501: Cost Annotation Writer for InlineCost: kazu.
Jan 7 2020, 9:27 AM · Restricted Project
davidxl added a comment to D71501: Cost Annotation Writer for InlineCost.

This looks useful. Is it possible to add a test case?

Jan 7 2020, 9:27 AM · Restricted Project

Jan 6 2020

davidxl accepted D71970: [profile] Support merge pool size >= 10.

lgtm

Jan 6 2020, 11:45 AM · Restricted Project, Restricted Project
davidxl added a comment to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..

this looks good to me. Easwaran, do you have any comments on the refactoring?

Jan 6 2020, 9:07 AM · Restricted Project

Dec 23 2019

davidxl added a comment to D71776: [NFC][InlineCost] Refactor CallAnalyzer::analyze.

This patch will be part of mtrofin's https://reviews.llvm.org/D71733, so there is no need for it.

Dec 23 2019, 10:38 AM · Restricted Project
davidxl added inline comments to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..
Dec 23 2019, 10:38 AM · Restricted Project

Dec 20 2019

davidxl added inline comments to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..
Dec 20 2019, 8:16 PM · Restricted Project
davidxl added a comment to D69591: Devirtualize a call on alloca without waiting for post inline cleanup and next DevirtSCCRepeatedPass iteration..

Use AAManager (include/llvm/Analysis/AliasAnalysis.h) by registering only BasicAA ?

Dec 20 2019, 9:59 AM · Restricted Project, Restricted Project

Dec 19 2019

davidxl added a comment to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..

The SROA handling code should also be abstracted away and let the derived class handling cost accumulation. In particular, the common code pattern like:

Dec 19 2019, 10:44 PM · Restricted Project
davidxl added inline comments to D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal..
Dec 19 2019, 6:43 PM · Restricted Project
davidxl added a comment to D71307: [Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null..

BasicAA is stateless and should be available and used here to disambiguate.

Dec 19 2019, 4:14 PM · Restricted Project
davidxl accepted D71645: [NFC][InlineCost] Simplify internal inlining cost interface.

lgtm

Dec 19 2019, 3:10 PM · Restricted Project
davidxl added a comment to D71645: [NFC][InlineCost] Simplify internal inlining cost interface.

There is comment like this:

Dec 19 2019, 11:34 AM · Restricted Project

Dec 17 2019

davidxl accepted D71646: [NFC][InlineCost] Run clang-format on InlineCost.cpp.

lgtm

Dec 17 2019, 10:43 PM · Restricted Project

Dec 10 2019

davidxl accepted D71323: [profile] Avoid allocating a page on the stack, NFC.

lgtm

Dec 10 2019, 11:46 PM · Restricted Project, Restricted Project
davidxl accepted D71288: [PGO][PGSO] Enable size optimizations in code gen / target passes for cold code..

lgtm

Dec 10 2019, 10:55 AM · Restricted Project

Dec 6 2019

davidxl accepted D71149: [PGO][PGSO] Instrument the code gen / target passes..

lgtm

Dec 6 2019, 4:07 PM · Restricted Project
davidxl accepted D71072: [PGO][PGSO] Instrument the code gen / target passes..

lgtm

Dec 6 2019, 10:03 AM · Restricted Project

Dec 5 2019

davidxl added inline comments to D71072: [PGO][PGSO] Instrument the code gen / target passes..
Dec 5 2019, 10:15 AM · Restricted Project
davidxl accepted D64376: [MBP] Avoid tail duplication if it can't bring benefit.

lgtm

Dec 5 2019, 9:24 AM · Restricted Project

Dec 3 2019

davidxl accepted D70988: [PGO][PGSO] Distinguish queries from unit tests and explicitly enable for the existing IR passes only. NFC..

lgtm

Dec 3 2019, 3:23 PM · Restricted Project
davidxl added inline comments to D64376: [MBP] Avoid tail duplication if it can't bring benefit.
Dec 3 2019, 11:47 AM · Restricted Project

Dec 2 2019

davidxl accepted D70510: [PGO][PGSO] Add an optional query type parameter to shouldOptimizeForSize..

lgtm

Dec 2 2019, 1:05 PM · Restricted Project

Nov 25 2019

davidxl added a comment to D70655: [AutoFDO] Top-down Inlining for specialization with context-sensitive profile.

what I mentioned should be complementary to the top-down method in this patch -- it just allows the full top-down to be doable for cross module scenario as well.

Nov 25 2019, 11:32 AM · Restricted Project
davidxl added a comment to D70655: [AutoFDO] Top-down Inlining for specialization with context-sensitive profile.

One way to handle it is 1) delay early inlining of sites into a hot function if a big percentage of calls to the function are from other modules. This still allows intra module top down inlining of it; or 2) keep a clone of the unlined body of the original function and use that one during cross module inlining.

Nov 25 2019, 10:45 AM · Restricted Project
davidxl added a comment to D70655: [AutoFDO] Top-down Inlining for specialization with context-sensitive profile.

This looks good. Can this be handled for cross module (thinLTO) case somehow too?

Nov 25 2019, 8:28 AM · Restricted Project

Nov 22 2019

davidxl accepted D64532: [CMake] Support separate installation of InstrProfData.inc.

lgtm

Nov 22 2019, 11:57 AM · Restricted Project, Restricted Project

Nov 21 2019

davidxl added a comment to D70510: [PGO][PGSO] Add an optional query type parameter to shouldOptimizeForSize..

How is the query type going to be checked?

Nov 21 2019, 1:35 PM · Restricted Project
davidxl added inline comments to D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.
Nov 21 2019, 9:25 AM · Restricted Project, Restricted Project

Nov 20 2019

davidxl added a comment to D70510: [PGO][PGSO] Add an optional query type parameter to shouldOptimizeForSize..

Can this be derived statically from the FuncT or BlockT?

Nov 20 2019, 2:43 PM · Restricted Project
davidxl accepted D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.

lgtm

Nov 20 2019, 1:56 PM · Restricted Project, Restricted Project
davidxl added inline comments to D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.
Nov 20 2019, 1:28 PM · Restricted Project, Restricted Project
davidxl added inline comments to D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.
Nov 20 2019, 12:23 PM · Restricted Project, Restricted Project
davidxl added a comment to D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.

Perhaps just add additional checks on the content of the dumped profile to make the test case more complete.

Nov 20 2019, 8:44 AM · Restricted Project, Restricted Project

Nov 19 2019

davidxl accepted D70330: [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate.

thanks for the test case.

Nov 19 2019, 2:33 PM · Restricted Project, Restricted Project
davidxl added inline comments to D69591: Devirtualize a call on alloca without waiting for post inline cleanup and next DevirtSCCRepeatedPass iteration..
Nov 19 2019, 9:38 AM · Restricted Project, Restricted Project

Nov 15 2019

davidxl accepted D69586: [profile] Support online merging with continuous sync mode.

lgtm

Nov 15 2019, 7:12 PM · Restricted Project, Restricted Project, Restricted Project