Page MenuHomePhabricator

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

mkazantsev (Max Kazantsev)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 23 2017, 8:11 PM (348 w, 6 d)

Recent Activity

May 28 2023

mkazantsev committed rGdd0cf23e4a87: [LICM] Reassociate & hoist sub expressions (authored by mkazantsev).
[LICM] Reassociate & hoist sub expressions
May 28 2023, 10:53 PM · Restricted Project, Restricted Project
mkazantsev closed D148001: [LICM] Reassociate & hoist sub expressions.
May 28 2023, 10:53 PM · Restricted Project, Restricted Project
mkazantsev added a comment to D148001: [LICM] Reassociate & hoist sub expressions.

Ping

May 28 2023, 9:00 PM · Restricted Project, Restricted Project

May 22 2023

mkazantsev added a comment to D148001: [LICM] Reassociate & hoist sub expressions.

Ping

May 22 2023, 9:59 PM · Restricted Project, Restricted Project

May 21 2023

mkazantsev committed rG0d95b20b63d7: [LICM] Reassociate & hoist add expressions (authored by mkazantsev).
[LICM] Reassociate & hoist add expressions
May 21 2023, 11:22 PM · Restricted Project, Restricted Project
mkazantsev closed D149132: [LICM] Reassociate & hoist add expressions.
May 21 2023, 11:22 PM · Restricted Project, Restricted Project

May 16 2023

mkazantsev added a comment to D149132: [LICM] Reassociate & hoist add expressions.

Ping

May 16 2023, 10:14 PM · Restricted Project, Restricted Project

May 14 2023

mkazantsev added a comment to D149132: [LICM] Reassociate & hoist add expressions.

Ping

May 14 2023, 7:18 AM · Restricted Project, Restricted Project

May 5 2023

mkazantsev committed rG7fbf72a10129: [ValueTracking][NFC] Factor out computeKnownBitsFromCmp (authored by mkazantsev).
[ValueTracking][NFC] Factor out computeKnownBitsFromCmp
May 5 2023, 3:04 AM · Restricted Project, Restricted Project
mkazantsev closed D149940: [ValueTracking][NFC] Split off computeKnownBitsFromCmp from computeKnownBitsFromAssume.
May 5 2023, 3:04 AM · Restricted Project, Restricted Project
mkazantsev committed rG1d424eead9c1: [NFC][ValueTracking] Hoist isValidAssumeForContext out of switch (authored by mkazantsev).
[NFC][ValueTracking] Hoist isValidAssumeForContext out of switch
May 5 2023, 2:50 AM · Restricted Project, Restricted Project
mkazantsev closed D149939: [NFC][ValueTracking] Hoist isValidAssumeForContext out of switch.
May 5 2023, 2:49 AM · Restricted Project, Restricted Project
mkazantsev requested review of D149940: [ValueTracking][NFC] Split off computeKnownBitsFromCmp from computeKnownBitsFromAssume.
May 5 2023, 1:49 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D149939: [NFC][ValueTracking] Hoist isValidAssumeForContext out of switch.

I don't know, does it have any negative CT impact? If not, then I think this should be done.

May 5 2023, 1:45 AM · Restricted Project, Restricted Project
mkazantsev requested review of D149939: [NFC][ValueTracking] Hoist isValidAssumeForContext out of switch.
May 5 2023, 1:45 AM · Restricted Project, Restricted Project

May 4 2023

mkazantsev accepted D149529: [SCEV][reland] More precise trip multiples.

Do we know if we can forget smth when strenghtening flags without harming the compile time to get the more precise resutlt in these cases?

May 4 2023, 9:28 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149786: [SCEV] Try smaller ZExts when using loop guard info..
May 4 2023, 9:15 PM · Restricted Project, Restricted Project

May 2 2023

mkazantsev added a comment to D149132: [LICM] Reassociate & hoist add expressions.

D149648 shows that SCEV is more powerful than value tracking (the latter cannot figure out the range from dominating checks).

May 2 2023, 5:59 AM · Restricted Project, Restricted Project
mkazantsev requested review of D149648: [WIP] Demo how SCEV is more powerful than value tracking.
May 2 2023, 5:58 AM · Restricted Project, Restricted Project
mkazantsev requested review of D148001: [LICM] Reassociate & hoist sub expressions.

Bringing SCEV to LICM brings potential correctness issues. I'll rather try to support this in value tracking.

May 2 2023, 5:00 AM · Restricted Project, Restricted Project
mkazantsev requested review of D149132: [LICM] Reassociate & hoist add expressions.

Ok, getting SCEV here brings potential correctness issues... Let's keep Value tracking.

May 2 2023, 4:59 AM · Restricted Project, Restricted Project
mkazantsev planned changes to D148001: [LICM] Reassociate & hoist sub expressions.

Rolling back to SCEV version.

May 2 2023, 2:40 AM · Restricted Project, Restricted Project
mkazantsev planned changes to D149132: [LICM] Reassociate & hoist add expressions.

I'm planning to roll back to SCEV version. Value Tracking doesn't infer things from dominating conditions.

May 2 2023, 2:39 AM · Restricted Project, Restricted Project
mkazantsev updated the diff for D148001: [LICM] Reassociate & hoist sub expressions.

Rebased & split off sub code from add as Serguei and Anna have proposed.

May 2 2023, 2:19 AM · Restricted Project, Restricted Project
mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

NFC. Used m_NSWAdd.

May 2 2023, 1:55 AM · Restricted Project, Restricted Project

May 1 2023

mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

Some NFC reafactoring due to request to untwine sub and add logic.

May 1 2023, 11:07 PM · Restricted Project, Restricted Project
mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

Fixed bug (typo) that caused messup with checks in tests. Bug was

if (ProvedNoOverflowAfterReassociate)
  return false;

instead of

if (!ProvedNoOverflowAfterReassociate)
  return false;

Friday evening refactoring is evil.

May 1 2023, 10:09 PM · Restricted Project, Restricted Project
mkazantsev added a comment to D149132: [LICM] Reassociate & hoist add expressions.
May 1 2023, 9:40 PM · Restricted Project, Restricted Project
mkazantsev planned changes to D149132: [LICM] Reassociate & hoist add expressions.

Err, indeed I messed up with test TODOs.

May 1 2023, 8:56 PM · Restricted Project, Restricted Project

Apr 28 2023

mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

Typo fixed, check reduced to nsw check.

Apr 28 2023, 5:04 AM · Restricted Project, Restricted Project
mkazantsev accepted D149136: [LICM] Don't duplicate instructions just because they're free.

LG, thanks!

Apr 28 2023, 4:59 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D149150: [SCEV] Support GEP in createSimpleAffineAddRec() (NFCI).

Is it possible to create a unit test?

Apr 28 2023, 4:54 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149150: [SCEV] Support GEP in createSimpleAffineAddRec() (NFCI).
Apr 28 2023, 4:53 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149251: [SCEV] Replace NumTripCountsComputed stat with NumExitCountsComputed.
Apr 28 2023, 4:39 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149251: [SCEV] Replace NumTripCountsComputed stat with NumExitCountsComputed.
Apr 28 2023, 4:33 AM · Restricted Project, Restricted Project
mkazantsev accepted D149323: [SCEV] Don't invalidate past dependency-breaking instructions.

Ok thanks, at least we'll know if it breaks.

Apr 28 2023, 4:07 AM · Restricted Project, Restricted Project
mkazantsev committed rGd5f1adcf6651: [TEST][LICM] Add test cases on widenable condition hoisting opportunity (authored by mkazantsev).
[TEST][LICM] Add test cases on widenable condition hoisting opportunity
Apr 28 2023, 3:56 AM · Restricted Project, Restricted Project
mkazantsev closed D149373: [TEST][LICM] Add test cases on widenable condition hoisting opportunity.
Apr 28 2023, 3:56 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D149323: [SCEV] Don't invalidate past dependency-breaking instructions.

If we prove that two values are the same, their SCEVs can also be proven the same (and not necessarity SCEVUnknown). If a load is equal to some non-load. then load's SCEV can be non-SCEVUnknown.

Apr 28 2023, 2:30 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D149323: [SCEV] Don't invalidate past dependency-breaking instructions.

Consider example:

%sum = add i32 %x, %y
%load_p= gep ptr %p, i32 %sum
%load1 = load %i32 load_p
Apr 28 2023, 1:34 AM · Restricted Project, Restricted Project
mkazantsev accepted D149344: [SCEV] Replace IsAvailableOnEntry with block disposition.

I agree that these two things should be the same.

Apr 28 2023, 1:29 AM · Restricted Project, Restricted Project

Apr 27 2023

mkazantsev added inline comments to D149373: [TEST][LICM] Add test cases on widenable condition hoisting opportunity.
Apr 27 2023, 10:34 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149374: [LICM] Hoist widenable condition when it's the only non-invariant operand of its user.
Apr 27 2023, 9:39 PM · Restricted Project, Restricted Project

Apr 25 2023

mkazantsev planned changes to D148001: [LICM] Reassociate & hoist sub expressions.

This will require rebase.

Apr 25 2023, 11:55 PM · Restricted Project, Restricted Project
mkazantsev added a comment to D148001: [LICM] Reassociate & hoist sub expressions.

General question: don't you want to separate sub and add handling in completely different functions.
To be honest, there will be small code duplication but in this case no need to mixup add and sub logic.
It will be easier to review and support in the future.

If duplication is a problem you can create functions for sub and add to keep first and last lines are in common.

Apr 25 2023, 11:34 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 11:19 PM · Restricted Project, Restricted Project
mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

Reworked w/o SCEV, using ValueTracking's API as Nikita has proposed.

Apr 25 2023, 11:19 PM · Restricted Project, Restricted Project
mkazantsev planned changes to D149132: [LICM] Reassociate & hoist add expressions.

Proof: https://alive2.llvm.org/ce/z/imgdNt

Somewhat skeptical about introducing SCEV use in LICM. As you are actually reasoning about loop invariants here, do we need SCEV? Would using computeOverflowForSignedSub() from ValueTracking work, possibly even provide better results?

Apr 25 2023, 10:28 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 10:11 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 10:08 PM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 10:07 PM · Restricted Project, Restricted Project
mkazantsev accepted D149134: [LICM] Don't try to constant fold instructions.

Just curious, what makes it so expensive? Is it SafetyInfo update?

Apr 25 2023, 4:39 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D149136: [LICM] Don't duplicate instructions just because they're free.

I also agree that we should possibly consider dropping this transform at all.

Apr 25 2023, 4:36 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149136: [LICM] Don't duplicate instructions just because they're free.
Apr 25 2023, 4:35 AM · Restricted Project, Restricted Project
mkazantsev updated the diff for D149132: [LICM] Reassociate & hoist add expressions.

Added even more comments.

Apr 25 2023, 4:03 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 3:44 AM · Restricted Project, Restricted Project
mkazantsev committed rGab07cbe4377a: [SCEV] Support sub in and negative constants willNotOverflow (authored by mkazantsev).
[SCEV] Support sub in and negative constants willNotOverflow
Apr 25 2023, 3:08 AM · Restricted Project, Restricted Project
mkazantsev closed D148618: [SCEV] Support sub in and negative constants willNotOverflow.
Apr 25 2023, 3:08 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D148618: [SCEV] Support sub in and negative constants willNotOverflow.
Apr 25 2023, 2:40 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D148618: [SCEV] Support sub in and negative constants willNotOverflow.
Apr 25 2023, 2:30 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D148001: [LICM] Reassociate & hoist sub expressions.
Apr 25 2023, 1:52 AM · Restricted Project, Restricted Project
mkazantsev retitled D148001: [LICM] Reassociate & hoist sub expressions from [LICM] Reassociate & hoist add/sub expressions to [LICM] Reassociate & hoist sub expressions.
Apr 25 2023, 1:40 AM · Restricted Project, Restricted Project
mkazantsev updated the diff for D148001: [LICM] Reassociate & hoist sub expressions.

Rebased on top of split off piece. I also tried to simplify the explanation and math formulae.

Apr 25 2023, 1:35 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D148001: [LICM] Reassociate & hoist sub expressions.

@anna I have split off the minimul piece of functionality as D149132. Will rebase this one now.

Apr 25 2023, 12:57 AM · Restricted Project, Restricted Project
mkazantsev requested review of D149132: [LICM] Reassociate & hoist add expressions.
Apr 25 2023, 12:56 AM · Restricted Project, Restricted Project
mkazantsev planned changes to D148001: [LICM] Reassociate & hoist sub expressions.
Apr 25 2023, 12:52 AM · Restricted Project, Restricted Project

Apr 24 2023

mkazantsev added a reviewer for D148001: [LICM] Reassociate & hoist sub expressions: anna.
Apr 24 2023, 2:57 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D148001: [LICM] Reassociate & hoist sub expressions.

Ping

Apr 24 2023, 2:41 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D141823: [SCEV] More precise trip multiples.
Apr 24 2023, 1:46 AM · Restricted Project, Restricted Project

Apr 23 2023

mkazantsev added a reviewer for D148618: [SCEV] Support sub in and negative constants willNotOverflow: skatkov.
Apr 23 2023, 10:20 PM · Restricted Project, Restricted Project
mkazantsev accepted D141823: [SCEV] More precise trip multiples.

LG, thanks! It's better to have more verification than needed than less than needed. :) Bugs with corrupted caches are so annoying.

Apr 23 2023, 10:11 PM · Restricted Project, Restricted Project
mkazantsev requested changes to D148244: [IRCE] Support inverted range check's predicate.
Apr 23 2023, 10:05 PM · Restricted Project, Restricted Project
mkazantsev added a comment to D148931: [SCEV] Don't blindly transfer nowrap flags to pre-inc addrec.

I don't quite understand your example. Two AddRecs with same start/step bound to one loop with different flags simply cannot exist, it would be one entity in UniqueSCEVs. And if we were able to infer nuw it for it in some situation, it means we have proven that it does not overflow (meaning that the loop doesn't make more than UINT_MAX iterations) regardless of uses. I don't think flag inference should rely on users at all, because there is expander, and it could create new uses out of thin air.

Apr 23 2023, 10:00 PM · Restricted Project, Restricted Project

Apr 21 2023

mkazantsev committed rG9d7785b2e995: [BasicBlockUtils][NFCI] Extract branch inverting to a separate method (authored by mkazantsev).
[BasicBlockUtils][NFCI] Extract branch inverting to a separate method
Apr 21 2023, 5:44 AM · Restricted Project, Restricted Project
mkazantsev closed D148708: [NFC][BasicBlockUtils] Extract branch inverting to a separate method.
Apr 21 2023, 5:44 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D148708: [NFC][BasicBlockUtils] Extract branch inverting to a separate method.

Please rebase.

Apr 21 2023, 4:56 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D148708: [NFC][BasicBlockUtils] Extract branch inverting to a separate method.
Apr 21 2023, 4:54 AM · Restricted Project, Restricted Project
mkazantsev accepted D148708: [NFC][BasicBlockUtils] Extract branch inverting to a separate method.
Apr 21 2023, 4:50 AM · Restricted Project, Restricted Project
mkazantsev accepted D148633: [SCEV] Clarify inference in isAddRecNeverPoison().
Apr 21 2023, 4:50 AM · Restricted Project, Restricted Project
mkazantsev committed rGb86b468731e9: [IRCE] Support non-strict range check's predicate (authored by mkazantsev).
[IRCE] Support non-strict range check's predicate
Apr 21 2023, 4:34 AM · Restricted Project, Restricted Project
mkazantsev closed D148227: [IRCE] Support non-strict range check's predicate.
Apr 21 2023, 4:34 AM · Restricted Project, Restricted Project
mkazantsev accepted D148227: [IRCE] Support non-strict range check's predicate.
Apr 21 2023, 3:45 AM · Restricted Project, Restricted Project
mkazantsev committed rG88da59682004: [IRCE][NFCI] Refactor parseRangeCheckICmp (authored by mkazantsev).
[IRCE][NFCI] Refactor parseRangeCheckICmp
Apr 21 2023, 3:33 AM · Restricted Project, Restricted Project
mkazantsev closed D148720: [IRCE] Refactor parseRangeCheckICmp.
Apr 21 2023, 3:33 AM · Restricted Project, Restricted Project
mkazantsev accepted D148720: [IRCE] Refactor parseRangeCheckICmp.

LG, thanks

Apr 21 2023, 3:00 AM · Restricted Project, Restricted Project
mkazantsev committed rG8502c545771e: [FlattenCFG] Replace branch condition with a created one correctly (authored by mkazantsev).
[FlattenCFG] Replace branch condition with a created one correctly
Apr 21 2023, 2:50 AM · Restricted Project, Restricted Project
mkazantsev closed D148707: [FlattenCFG] Replace branch condition with a created one correctly.
Apr 21 2023, 2:50 AM · Restricted Project, Restricted Project
mkazantsev accepted D148707: [FlattenCFG] Replace branch condition with a created one correctly.

Confirmed with alive2.
Bugged version: https://alive2.llvm.org/ce/z/L4ps9v
Fixed version: https://alive2.llvm.org/ce/z/QdrG5U

Apr 21 2023, 2:45 AM · Restricted Project, Restricted Project
mkazantsev committed rGe9ecc484ecc5: [FlattenCFG] Add a test to demonstrate bug (authored by mkazantsev).
[FlattenCFG] Add a test to demonstrate bug
Apr 21 2023, 2:43 AM · Restricted Project, Restricted Project
mkazantsev closed D148706: [FlattenCFG] Add a test to demonstrate bug.
Apr 21 2023, 2:43 AM · Restricted Project, Restricted Project
mkazantsev accepted D148706: [FlattenCFG] Add a test to demonstrate bug.
Apr 21 2023, 2:41 AM · Restricted Project, Restricted Project
mkazantsev committed rG16bda64a1853: [Test] Regenerate checks using update_test_checks.py (authored by mkazantsev).
[Test] Regenerate checks using update_test_checks.py
Apr 21 2023, 1:55 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D148322: [SCEV] Infer NSW when subtracting expressions with the same signs.

I'd suspect that contextual analysis on SCEV creation might have negative CT impact.

Apr 21 2023, 1:53 AM · Restricted Project, Restricted Project
mkazantsev added inline comments to D148720: [IRCE] Refactor parseRangeCheckICmp.
Apr 21 2023, 1:13 AM · Restricted Project, Restricted Project
mkazantsev requested changes to D148720: [IRCE] Refactor parseRangeCheckICmp.
Apr 21 2023, 1:13 AM · Restricted Project, Restricted Project
mkazantsev requested changes to D141823: [SCEV] More precise trip multiples.

Some style comments & request to see if smth is doable in verifier with this cache.

Apr 21 2023, 1:10 AM · Restricted Project, Restricted Project
mkazantsev added a comment to D141823: [SCEV] More precise trip multiples.

Whenever a new cache is introduced, it is highly recommended to add logic to ScalarEvoltion::verify for it to make sure it is sane. Can you please add that?

Apr 21 2023, 1:03 AM · Restricted Project, Restricted Project

Apr 19 2023

mkazantsev abandoned D148621: [SCEV] Support negative constant in willNotOverflow.
Apr 19 2023, 2:45 AM · Restricted Project, Restricted Project
mkazantsev updated the diff for D148618: [SCEV] Support sub in and negative constants willNotOverflow.

Bug fixed, logic expanded.

Apr 19 2023, 2:45 AM · Restricted Project, Restricted Project

Apr 18 2023

mkazantsev planned changes to D148621: [SCEV] Support negative constant in willNotOverflow.
Apr 18 2023, 9:56 PM · Restricted Project, Restricted Project