Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

MatzeB (Matthias Braun)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 13 2013, 3:10 PM (527 w, 5 d)

Not actively working on LLVM at the moment

Recent Activity

Wed, Sep 20

MatzeB added inline comments to D151848: [X86, Peephole] Enable FoldImmediate for X86.
Wed, Sep 20, 4:38 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D151848: [X86, Peephole] Enable FoldImmediate for X86.
Wed, Sep 20, 4:23 PM · Restricted Project, Restricted Project

Mon, Sep 11

MatzeB committed rGb30c9c937802: LoopUnrollRuntime: Add weights to all branches (authored by MatzeB).
LoopUnrollRuntime: Add weights to all branches
Mon, Sep 11, 2:26 PM · Restricted Project, Restricted Project
MatzeB closed D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 2:26 PM · Restricted Project, Restricted Project
MatzeB updated the summary of D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 1:49 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D158642: LoopUnrollRuntime: Add weights to all branches.

Tweak comments for weight constants.

Mon, Sep 11, 1:46 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 1:45 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D158642: LoopUnrollRuntime: Add weights to all branches.

Rework formula for prolog/epilog loop-backedge weights as suggested by @wenlei .

Mon, Sep 11, 1:29 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D158875: [ADT] Fix IntEqClasses::join to return the leader in all cases..
Mon, Sep 11, 12:12 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 11:56 AM · Restricted Project, Restricted Project
MatzeB added inline comments to D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 11:16 AM · Restricted Project, Restricted Project
MatzeB added inline comments to D158642: LoopUnrollRuntime: Add weights to all branches.
Mon, Sep 11, 11:04 AM · Restricted Project, Restricted Project
MatzeB committed rG5d7f84ee17f3: LoopRotate: Add code to update branch weights (authored by MatzeB).
LoopRotate: Add code to update branch weights
Mon, Sep 11, 10:40 AM · Restricted Project, Restricted Project
MatzeB committed rGf8431a0e4008: Avoid running optimization passes in frontend test (authored by MatzeB).
Avoid running optimization passes in frontend test
Mon, Sep 11, 10:39 AM · Restricted Project, Restricted Project
MatzeB committed rG285e0235f5f6: ProfDataUtils: Add extractFromBranchWeightMD function; NFC (authored by MatzeB).
ProfDataUtils: Add extractFromBranchWeightMD function; NFC
Mon, Sep 11, 10:39 AM · Restricted Project, Restricted Project
MatzeB closed D157462: LoopRotate: Add code to update branch weights.
Mon, Sep 11, 10:39 AM · Restricted Project, Restricted Project
MatzeB closed D157937: ProfDataUtils: Add extractFromBranchWeightMD function; NFC.
Mon, Sep 11, 10:39 AM · Restricted Project, Restricted Project
MatzeB closed D157518: Avoid running optimization passes in frontend test.
Mon, Sep 11, 10:39 AM · Restricted Project, Restricted Project
MatzeB added a comment to D157462: LoopRotate: Add code to update branch weights.

It seems there is no further feedback. Landing this now.

Mon, Sep 11, 10:00 AM · Restricted Project, Restricted Project

Tue, Sep 5

MatzeB added inline comments to D159322: LoopVectorize: Set branch_weight for conditional branches.
Tue, Sep 5, 1:59 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D159322: LoopVectorize: Set branch_weight for conditional branches.
Tue, Sep 5, 1:58 PM · Restricted Project, Restricted Project
MatzeB added a comment to D159322: LoopVectorize: Set branch_weight for conditional branches.

like when emitMemRuntimeChecks is done, we really just don't know how likely these arrays overlap or not.

Tue, Sep 5, 1:53 PM · Restricted Project, Restricted Project
MatzeB added a comment to D159322: LoopVectorize: Set branch_weight for conditional branches.

Slightly different off-topic from the change itself, but for this to be future proof, I'm also wondering that eventually should we have the BranchInst::Create API for cond branch to always ask for branch weights if the parent function has non-zero entry count.

Tue, Sep 5, 1:47 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157518: Avoid running optimization passes in frontend test.
Tue, Sep 5, 11:22 AM · Restricted Project, Restricted Project
MatzeB added a comment to D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely.

This is already abandoned, so will not further pursue this. But for the discussion:

Tue, Sep 5, 11:14 AM · Restricted Project, Restricted Project

Fri, Sep 1

MatzeB abandoned D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely.
Fri, Sep 1, 5:18 PM · Restricted Project, Restricted Project
MatzeB abandoned D158668: RFC: Add getLikelyBranchWeight helper function.
Fri, Sep 1, 5:17 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

I have a feeling @mtrofin would prefer pass-specific weights rather than a unified notion of "likely"/"unlikely"... So with the latest round of patches it's probably best to abandon this for now.

Fri, Sep 1, 5:17 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB added a reviewer for D158668: RFC: Add getLikelyBranchWeight helper function: mtrofin.
Fri, Sep 1, 5:16 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB updated the diff for D159322: LoopVectorize: Set branch_weight for conditional branches.

factor out weight constants in a similar way to D158642

Fri, Sep 1, 5:15 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.

Factor out weights constant to match the style used in D158642

Fri, Sep 1, 4:11 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D158642: LoopUnrollRuntime: Add weights to all branches.

factor out branch weight constants.

Fri, Sep 1, 3:52 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D159322: LoopVectorize: Set branch_weight for conditional branches.
Fri, Sep 1, 12:58 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D159322: LoopVectorize: Set branch_weight for conditional branches.
Fri, Sep 1, 12:58 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D158642: LoopUnrollRuntime: Add weights to all branches.
Fri, Sep 1, 12:53 PM · Restricted Project, Restricted Project

Thu, Aug 31

MatzeB added a comment to D159322: LoopVectorize: Set branch_weight for conditional branches.

For the discussion about the 127:1 ratio see also D158668 (and discussion in D158642 and D157462)

Thu, Aug 31, 6:05 PM · Restricted Project, Restricted Project
MatzeB requested review of D159322: LoopVectorize: Set branch_weight for conditional branches.
Thu, Aug 31, 6:02 PM · Restricted Project, Restricted Project

Aug 25 2023

MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 25 2023, 2:04 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 25 2023, 1:40 PM · Restricted Project, Restricted Project
MatzeB added a comment to D158875: [ADT] Fix IntEqClasses::join to return the leader in all cases..

Nice catch!

Aug 25 2023, 1:37 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 25 2023, 12:02 PM · Restricted Project, Restricted Project

Aug 24 2023

MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 24 2023, 4:49 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely.
Aug 24 2023, 10:32 AM · Restricted Project, Restricted Project

Aug 23 2023

MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

I'd also posit, that maybe since we're changing this we should reevaluate the numbers we use as defaults.

Aug 23 2023, 4:38 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB retitled D158668: RFC: Add getLikelyBranchWeight helper function from Add getLikelyBranchWeight helper function to RFC: Add getLikelyBranchWeight helper function.
Aug 23 2023, 4:02 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB retitled D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely from Interpet {branch_weights 1, 0} as likely/unlikely to RFC: Interpet {branch_weights 1, 0} as likely/unlikely.
Aug 23 2023, 4:01 PM · Restricted Project, Restricted Project
MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

And as another strawman / discussion-starter I put up D158680 where I use !{"branch_weights", i32 1, i32 0} to represent likely branches and the actual "LikelyWeight" mostly becomes an internal implementation detail of the BranchProbabilityInfo class... This seemed like a neat way to get an abstract "likely", "unlikely" notation, but not sure of the effects if we no longer would have "truly zero" weights because they would be interpreted differently now...

Aug 23 2023, 4:01 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB added a reviewer for D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely: mtrofin.
Aug 23 2023, 3:59 PM · Restricted Project, Restricted Project
MatzeB added a comment to D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely.

And here's another straw-man proposal to get a discussion going: Because I am having trouble to say what the difference between branch_weights 1, 0 and llvm.expect even is: This change turns any branch_weights X, 0 or branch_weights 0, X into an abstract representation of likely/unlikely that BranchProbabilityInfo will interpret when computing the analysis...

Aug 23 2023, 3:58 PM · Restricted Project, Restricted Project
MatzeB requested review of D158680: RFC: Interpet {branch_weights 1, 0} as likely/unlikely.
Aug 23 2023, 3:57 PM · Restricted Project, Restricted Project
MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

On the other hand, I dislike exposing some internal detail of a pass.

Aug 23 2023, 3:21 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

My initial reaction to this was that we should keep the --unlikely-branch-weights flag available

Aug 23 2023, 3:19 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB added a comment to D158668: RFC: Add getLikelyBranchWeight helper function.

Putting this out as a strawman/RFC. Should we add this function to allow LLVM passes to construct "likely"/"unlikely" branch_weights metadata? (I need this in D158642 and D157462)

Aug 23 2023, 1:48 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB requested review of D158668: RFC: Add getLikelyBranchWeight helper function.
Aug 23 2023, 1:47 PM · Restricted Project, Restricted Project, Restricted Project
MatzeB updated the summary of D157462: LoopRotate: Add code to update branch weights.
Aug 23 2023, 12:02 PM · Restricted Project, Restricted Project
MatzeB updated the summary of D157462: LoopRotate: Add code to update branch weights.
Aug 23 2023, 12:00 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 23 2023, 11:59 AM · Restricted Project, Restricted Project
MatzeB added a reviewer for D157462: LoopRotate: Add code to update branch weights: mtrofin.
Aug 23 2023, 11:58 AM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
  • Fixed overflow test when scaling up weights.
  • Still need a better way than hardcoding 127 as "likely" branch weight; hoping that people can give me some hint in the discussion I started in https://reviews.llvm.org/D158642
Aug 23 2023, 11:58 AM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 23 2023, 11:25 AM · Restricted Project, Restricted Project
MatzeB added a comment to D158642: LoopUnrollRuntime: Add weights to all branches.

Maybe we should expose the "LikelyBranchWeight" of LowerExpectIntrinsic.cpp in an internal LLVM header? So frontends are still forced to use the llvm.expect abstractions while LLVM-internal code can do the quicker thing and add likely branch weights directly...

Aug 23 2023, 11:23 AM · Restricted Project, Restricted Project
MatzeB updated subscribers of D158642: LoopUnrollRuntime: Add weights to all branches.

I guess we may need a discussion about how to express these "nearly always taken" / "nearly never taken" branch weights. The hardcoded 1:127 ratio in the current patch is pretty arbitrary.

Aug 23 2023, 11:01 AM · Restricted Project, Restricted Project
MatzeB retitled D158642: LoopUnrollRuntime: Add weights to all branches from LoopUnrollRuntime: Add branch weights to newly created branches to LoopUnrollRuntime: Add weights to all branches.
Aug 23 2023, 10:38 AM · Restricted Project, Restricted Project
MatzeB requested review of D158642: LoopUnrollRuntime: Add weights to all branches.
Aug 23 2023, 10:35 AM · Restricted Project, Restricted Project

Aug 18 2023

MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 18 2023, 2:59 PM · Restricted Project, Restricted Project

Aug 16 2023

MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 16 2023, 4:06 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 16 2023, 4:04 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.

Change code to avoid zero branch-weights.

Aug 16 2023, 4:03 PM · Restricted Project, Restricted Project

Aug 15 2023

MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 15 2023, 1:04 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 15 2023, 10:41 AM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 15 2023, 10:41 AM · Restricted Project, Restricted Project

Aug 14 2023

MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 5:04 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 5:02 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 5:02 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 4:57 PM · Restricted Project, Restricted Project
MatzeB updated the diff for D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 4:56 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 14 2023, 4:56 PM · Restricted Project, Restricted Project
MatzeB requested review of D157937: ProfDataUtils: Add extractFromBranchWeightMD function; NFC.
Aug 14 2023, 4:55 PM · Restricted Project, Restricted Project

Aug 9 2023

MatzeB updated the diff for D157518: Avoid running optimization passes in frontend test.
Aug 9 2023, 9:56 AM · Restricted Project, Restricted Project
MatzeB updated the summary of D157518: Avoid running optimization passes in frontend test.
Aug 9 2023, 9:50 AM · Restricted Project, Restricted Project
MatzeB updated the diff for D157518: Avoid running optimization passes in frontend test.

Decided to just use "utils/update_cc_test_checks.py" so we can inspect the generate llvm.expect calls directly.

Aug 9 2023, 9:50 AM · Restricted Project, Restricted Project
MatzeB requested review of D157518: Avoid running optimization passes in frontend test.
Aug 9 2023, 9:39 AM · Restricted Project, Restricted Project

Aug 8 2023

MatzeB added inline comments to D157462: LoopRotate: Add code to update branch weights.
Aug 8 2023, 5:25 PM · Restricted Project, Restricted Project
MatzeB requested review of D157462: LoopRotate: Add code to update branch weights.
Aug 8 2023, 5:23 PM · Restricted Project, Restricted Project
MatzeB accepted D157423: [Coroutines][NFC] Only look for Alloca or Load when finding dbg.declare for temp spills.

LGTM

Aug 8 2023, 1:10 PM · Restricted Project, Restricted Project
MatzeB accepted D156850: [NFC][Coroutines] Use a reverse post-order to guide the computation about cross suspend infomation to reach a fixed point faster..

As you can see, there still has many redundant operations. Just like the last iteration is to check whether it has reached a fixed point and etc.

Aug 8 2023, 8:59 AM · Restricted Project, Restricted Project
MatzeB added a comment to D155520: [LV] Complete load groups and release store groups in presence of dependency.

Thanks, but there's no need to wait for me, land it. Given the previous test-case works this should be good. We have extensive nightly tests running with our codebase, but if something breaks again our oncall should contact you :)

Aug 8 2023, 8:42 AM · Restricted Project, Restricted Project

Aug 3 2023

MatzeB added a comment to D147740: [llvm-profdata] Refactoring Sample Profile Reader to increase FDO build speed using MD5 as key to Sample Profile map.

Thanks for looking into this! Sounds like we may need unreasonably large inputs so going without a test should be okay. Either as a separate patch or merged with this one, whatever works best for you.

Aug 3 2023, 10:04 AM · Restricted Project, Restricted Project

Aug 2 2023

MatzeB added a comment to D156835: CoroFrame: Rework SuspendCrossingInfo analysis.

on another side note: The quadratic behavior for blocks with multiple predecessors would not happen for dataflow implementations "by-the-book" where the IN and OUT sets are saved separately. The fact that we compute the IN-set on the fly here but don't store it in the BlockData lead to the runtime explosion with the worklist algo...

Aug 2 2023, 4:23 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D156850: [NFC][Coroutines] Use a reverse post-order to guide the computation about cross suspend infomation to reach a fixed point faster..
Aug 2 2023, 4:18 PM · Restricted Project, Restricted Project
MatzeB added a comment to D156835: CoroFrame: Rework SuspendCrossingInfo analysis.

as in https://reviews.llvm.org/D156850 that is.

Aug 2 2023, 4:16 PM · Restricted Project, Restricted Project
MatzeB abandoned D156835: CoroFrame: Rework SuspendCrossingInfo analysis.
Aug 2 2023, 4:15 PM · Restricted Project, Restricted Project
MatzeB added a comment to D156835: CoroFrame: Rework SuspendCrossingInfo analysis.

I finally understand what happened. Turns out the variant loop runtime of the Worklist algorithm is dominated by some exception handling block having N predecessors for an input of genX input of size N. We updated every of those N predecessors and each time re-visisted that block and merged the info of all the N predecessors. So not sure what to make of this... it's surely a bit of an artifact of those artifically big inputs, but yeah we happen to avoid this problem by just doing multiple rounds of RPO over the whole functions as in https://reviews.llvm.org/D156850 so let's go with that.

Aug 2 2023, 4:15 PM · Restricted Project, Restricted Project
MatzeB added a comment to D156835: CoroFrame: Rework SuspendCrossingInfo analysis.

I checked and the number of blocks visited only increases linearly. So that's all expected. There are some effects leading to quadratic compiletime as the Consume/Kill BitVectors also get bigger with number of basic blocks, but we can't avoid that and it's independent of dataflow solving order.

Aug 2 2023, 3:21 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D156850: [NFC][Coroutines] Use a reverse post-order to guide the computation about cross suspend infomation to reach a fixed point faster..
Aug 2 2023, 2:11 PM · Restricted Project, Restricted Project
MatzeB added inline comments to D156850: [NFC][Coroutines] Use a reverse post-order to guide the computation about cross suspend infomation to reach a fixed point faster..
Aug 2 2023, 2:05 PM · Restricted Project, Restricted Project
MatzeB added a comment to D156835: CoroFrame: Rework SuspendCrossingInfo analysis.

Curious... With a single loop (and no loop nestings) I would have expected the worklist algorithm to converge quick enough (like maybe double the time of the loop-free program in practice). Would still be interested to learn why this goes wrong as I think of the worklist algorithm as the standard way to solve dataflow problems...

Aug 2 2023, 1:38 PM · Restricted Project, Restricted Project
MatzeB added a comment to rG3b34d69ac7a6: Revert "For #64088: mark vtable as used if we might emit a reference to it.".

No problem, thanks for following up!

Aug 2 2023, 10:17 AM · Restricted Project, Restricted Project

Aug 1 2023

MatzeB updated the summary of D156835: CoroFrame: Rework SuspendCrossingInfo analysis.
Aug 1 2023, 4:22 PM · Restricted Project, Restricted Project
MatzeB updated the summary of D156835: CoroFrame: Rework SuspendCrossingInfo analysis.
Aug 1 2023, 4:22 PM · Restricted Project, Restricted Project