Page MenuHomePhabricator

mkazantsev (Max Kazantsev)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 23 2017, 8:11 PM (207 w, 4 d)

Recent Activity

Wed, Jan 13

mkazantsev updated the diff for D94654: [SCEV] Do not cache comparison result upon reached max depth as "equivalence". PR48725.
Wed, Jan 13, 11:43 PM · Restricted Project
mkazantsev requested review of D94654: [SCEV] Do not cache comparison result upon reached max depth as "equivalence". PR48725.
Wed, Jan 13, 11:38 PM · Restricted Project
mkazantsev added inline comments to D92367: [SCEV] Fix incorrect exit count calculated in error scope.
Wed, Jan 13, 11:20 PM · Restricted Project

Tue, Jan 12

mkazantsev committed rGe8287cb2b292: [Test] Add failing test for PR48725 (authored by mkazantsev).
[Test] Add failing test for PR48725
Tue, Jan 12, 1:07 AM

Dec 14 2020

mkazantsev committed rG8b330f1f6919: [SCEV] Add missing type check into getRangeForAffineNoSelfWrappingAR (authored by mkazantsev).
[SCEV] Add missing type check into getRangeForAffineNoSelfWrappingAR
Dec 14 2020, 11:51 PM
mkazantsev committed rG2fc2e6de8222: [Test] Test on assertion failure with expensive SCEV range inference (authored by mkazantsev).
[Test] Test on assertion failure with expensive SCEV range inference
Dec 14 2020, 10:48 PM

Dec 8 2020

mkazantsev added inline comments to D92367: [SCEV] Fix incorrect exit count calculated in error scope.
Dec 8 2020, 8:39 PM · Restricted Project

Dec 7 2020

mkazantsev committed rG55009a0ff8bc: [Test] Auto-update test checks (authored by mkazantsev).
[Test] Auto-update test checks
Dec 7 2020, 3:34 AM

Dec 4 2020

mkazantsev added inline comments to D92367: [SCEV] Fix incorrect exit count calculated in error scope.
Dec 4 2020, 4:25 AM · Restricted Project
mkazantsev added a comment to D92367: [SCEV] Fix incorrect exit count calculated in error scope.

Please reduce the test or give an elaborate explanation of the problem. So far it's not clear to me what was the problem and why it fixed this way.

Dec 4 2020, 4:24 AM · Restricted Project
mkazantsev added inline comments to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.
Dec 4 2020, 4:10 AM · Restricted Project

Dec 3 2020

mkazantsev added a reverting change for rG4bd35cdc3ae1: Revert "[IndVars] ICmpInst should not prevent IV widening": rG12b6c5e68282: Return "[IndVars] ICmpInst should not prevent IV widening".
Dec 3 2020, 9:35 PM
mkazantsev committed rG12b6c5e68282: Return "[IndVars] ICmpInst should not prevent IV widening" (authored by mkazantsev).
Return "[IndVars] ICmpInst should not prevent IV widening"
Dec 3 2020, 9:35 PM
mkazantsev committed rG3df0daceb2c6: [IndVars] Quick fix LHS/RHS bug (authored by mkazantsev).
[IndVars] Quick fix LHS/RHS bug
Dec 3 2020, 9:35 PM
mkazantsev added a comment to D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.

LGTM

Dec 3 2020, 4:45 AM · Restricted Project
mkazantsev accepted D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.
Dec 3 2020, 4:45 AM · Restricted Project
mkazantsev accepted D92561: [NFC][Tests] Auto generate checks for llvm/test/Transforms/NaryReassociate/pr24301.ll using update_test_checks.py.

That could go without review. LGTM.

Dec 3 2020, 3:16 AM · Restricted Project
mkazantsev added a reverting change for rG0c9c6ddf17bb: [IndVars] ICmpInst should not prevent IV widening: rG4bd35cdc3ae1: Revert "[IndVars] ICmpInst should not prevent IV widening".
Dec 3 2020, 3:02 AM
mkazantsev committed rG4bd35cdc3ae1: Revert "[IndVars] ICmpInst should not prevent IV widening" (authored by mkazantsev).
Revert "[IndVars] ICmpInst should not prevent IV widening"
Dec 3 2020, 3:02 AM
mkazantsev added a reverting change for D92207: [IndVars] ICmpInst should not prevent IV widening: rG4bd35cdc3ae1: Revert "[IndVars] ICmpInst should not prevent IV widening".
Dec 3 2020, 3:02 AM · Restricted Project

Dec 1 2020

mkazantsev committed rG16bee4d36835: [Test] One CodeGen test showing missing opportunity on move elimination (authored by mkazantsev).
[Test] One CodeGen test showing missing opportunity on move elimination
Dec 1 2020, 10:17 PM
mkazantsev committed rG391a47e227b5: [Test] One more IndVars test (authored by mkazantsev).
[Test] One more IndVars test
Dec 1 2020, 10:17 PM

Nov 29 2020

mkazantsev committed rG0c9c6ddf17bb: [IndVars] ICmpInst should not prevent IV widening (authored by mkazantsev).
[IndVars] ICmpInst should not prevent IV widening
Nov 29 2020, 8:17 PM
mkazantsev closed D92207: [IndVars] ICmpInst should not prevent IV widening.
Nov 29 2020, 8:17 PM · Restricted Project

Nov 27 2020

mkazantsev added a comment to D92207: [IndVars] ICmpInst should not prevent IV widening.

I added tests for signed and for ne predicate, but currently they fail even before they reach this code. Can be enabled in follow-ups.

Nov 27 2020, 12:08 AM · Restricted Project
mkazantsev requested review of D92207: [IndVars] ICmpInst should not prevent IV widening.
Nov 27 2020, 12:06 AM · Restricted Project

Nov 26 2020

mkazantsev committed rG0077e1680f83: [Test] Add some more tests showing how we fail to widen IV (authored by mkazantsev).
[Test] Add some more tests showing how we fail to widen IV
Nov 26 2020, 11:04 PM
mkazantsev committed rGfaf183874cb6: [IndVars] LCSSA Phi users should not prevent widening (authored by mkazantsev).
[IndVars] LCSSA Phi users should not prevent widening
Nov 26 2020, 8:40 PM
mkazantsev closed D91593: [IndVars] LCSSA Phi users should not prevent widening.
Nov 26 2020, 8:39 PM · Restricted Project
mkazantsev added a reverting change for rGf690986f314f: Return "[SCEV] Use isBasicBlockEntryGuardedByCond in…: rG035955f92541: Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in….
Nov 26 2020, 3:14 AM
mkazantsev added a reverting change for D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond: rG035955f92541: Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in….
Nov 26 2020, 3:13 AM · Restricted Project
mkazantsev committed rG035955f92541: Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in… (authored by mkazantsev).
Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in…
Nov 26 2020, 3:13 AM
mkazantsev added a comment to D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.

Previous version was better, but still not good enough. Tried another version that removes two instances of isKnownViaNonRecuriveReasoning from the path.

Nov 26 2020, 2:48 AM · Restricted Project
mkazantsev committed rGf690986f314f: Return "[SCEV] Use isBasicBlockEntryGuardedByCond in… (authored by mkazantsev).
Return "[SCEV] Use isBasicBlockEntryGuardedByCond in…
Nov 26 2020, 2:46 AM
mkazantsev added a reverting change for rG3d4c0460ec60: [SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond: rG91d6b6b5fb94: Revert "[SCEV] Use isBasicBlockEntryGuardedByCond in….
Nov 26 2020, 2:29 AM
mkazantsev committed rG91d6b6b5fb94: Revert "[SCEV] Use isBasicBlockEntryGuardedByCond in… (authored by mkazantsev).
Revert "[SCEV] Use isBasicBlockEntryGuardedByCond in…
Nov 26 2020, 2:29 AM
mkazantsev added a reverting change for D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond: rG91d6b6b5fb94: Revert "[SCEV] Use isBasicBlockEntryGuardedByCond in….
Nov 26 2020, 2:29 AM · Restricted Project
mkazantsev committed rG3d4c0460ec60: [SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond (authored by mkazantsev).
[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond
Nov 26 2020, 2:09 AM
mkazantsev added a comment to D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.

Maybe it's because isKnownPredicateAt makes an extra call to isKnownPredicate which we don't really need. Let's try more lightweight version with isBasicBlockEntryGuardedByCond. This should not introduce extra overhead.

Nov 26 2020, 2:03 AM · Restricted Project
mkazantsev abandoned D92153: [SCEV] Move assumes checks into isKnownPredicateAt.

Already present in isBasicBlockEntryGuardedByCond.

Nov 26 2020, 1:53 AM · Restricted Project
mkazantsev committed rG3b6481eae259: Revert "[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond" (authored by mkazantsev).
Revert "[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond"
Nov 26 2020, 1:43 AM
mkazantsev added a reverting change for rG14f2ad0e3cc5: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond: rG3b6481eae259: Revert "[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond".
Nov 26 2020, 1:43 AM
mkazantsev added a reverting change for D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond: rG3b6481eae259: Revert "[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond".
Nov 26 2020, 1:43 AM · Restricted Project
mkazantsev added a comment to D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.

Strange. I'll revert it for now and investigate.

Nov 26 2020, 1:40 AM · Restricted Project
mkazantsev updated the diff for D91593: [IndVars] LCSSA Phi users should not prevent widening.

Rebased, fixed '.wide name.

Nov 26 2020, 1:29 AM · Restricted Project
mkazantsev added inline comments to D91593: [IndVars] LCSSA Phi users should not prevent widening.
Nov 26 2020, 12:22 AM · Restricted Project

Nov 25 2020

mkazantsev added a comment to D91711: SCEV add function to see if SCEVUnknown is null.

My understanding of this situation is that, whenever we delete an instruction that may be referenced by SCEV, we should call forgetValue for it. SCEV that contains references on deleted instructions is invalid. Faling to forget deleted values is a bug. I don't understand why llvm.dbg.value is somehow special about it. This patch tries to hide the consequences of the bug instead of fixing it.

Nov 25 2020, 11:39 PM · Restricted Project
mkazantsev retitled D92153: [SCEV] Move assumes checks into isKnownPredicateAt from [SCEV] Move assertion checks into isKnownPredicateAt to [SCEV] Move assumes checks into isKnownPredicateAt.
Nov 25 2020, 11:32 PM · Restricted Project
mkazantsev requested review of D92153: [SCEV] Move assumes checks into isKnownPredicateAt.
Nov 25 2020, 10:32 PM · Restricted Project
mkazantsev committed rG14f2ad0e3cc5: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond (authored by mkazantsev).
[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond
Nov 25 2020, 10:21 PM
mkazantsev closed D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.
Nov 25 2020, 10:20 PM · Restricted Project
mkazantsev updated the summary of D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.
Nov 25 2020, 10:02 PM · Restricted Project
mkazantsev requested review of D92152: [SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond.
Nov 25 2020, 10:01 PM · Restricted Project
mkazantsev committed rGf10500e220e3: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check (authored by mkazantsev).
[IndVars] Use isLoopBackedgeGuardedByCond for last iteration check
Nov 25 2020, 9:38 PM
mkazantsev closed D91535: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check.
Nov 25 2020, 9:38 PM · Restricted Project
mkazantsev committed rG664e1da485d2: [LoopLoadElim] Make sure all loops are in simplify form. PR48150 (authored by mkazantsev).
[LoopLoadElim] Make sure all loops are in simplify form. PR48150
Nov 25 2020, 7:51 PM
mkazantsev closed D91525: [LoopLoadElim] Make sure all loops are in simplify form. PR48150.
Nov 25 2020, 7:51 PM · Restricted Project
mkazantsev added a comment to D91535: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check.

Actually, it only means that isLoopBackedgeGuardedByCond should directly call isKnownPredicateAt(Latch->getTerminator()) as the last resort. I will follow-up with this improvement adding relevant test.

Nov 25 2020, 7:14 PM · Restricted Project
mkazantsev added a comment to D91535: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check.

Eeek. I found a test where isKnownPredicateAt is more powerful. Need to use both then.

Nov 25 2020, 7:04 PM · Restricted Project
mkazantsev added a comment to D91711: SCEV add function to see if SCEVUnknown is null.

Do we know at which point LSR deletes the code? To me it looks like we just forgot to call forgetLoop or smth like this somewhere.

Nov 25 2020, 2:09 AM · Restricted Project
mkazantsev updated the diff for D91525: [LoopLoadElim] Make sure all loops are in simplify form. PR48150.
Nov 25 2020, 1:56 AM · Restricted Project
mkazantsev added a comment to D91525: [LoopLoadElim] Make sure all loops are in simplify form. PR48150.

I'm not super familiar with this, do you know why this only affects the new PM? (the code looks fine, I'd just like to understand what's going on better)

Nov 25 2020, 1:46 AM · Restricted Project

Nov 24 2020

mkazantsev added a reverting change for rG7dcc8899174f: [SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstItera…: rG9130651126b7: Revert "[SCEV] Generalize no-self-wrap check in….
Nov 24 2020, 10:27 PM
mkazantsev committed rG9130651126b7: Revert "[SCEV] Generalize no-self-wrap check in… (authored by mkazantsev).
Revert "[SCEV] Generalize no-self-wrap check in…
Nov 24 2020, 10:27 PM
mkazantsev added a reverting change for D91126: [SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations: rG9130651126b7: Revert "[SCEV] Generalize no-self-wrap check in….
Nov 24 2020, 10:27 PM · Restricted Project
mkazantsev added a comment to D91535: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check.

Yes, I ran 4077 fuzz tests checking this assumption, and it seems better in every case there. There can theoretically be cases where isLoopBackedgeGuardedBy is weaker, but it's only the reason to improve it.

Nov 24 2020, 9:07 PM · Restricted Project
mkazantsev committed rG28d7ba15435f: [IndVars] Use more precise context when eliminating narrowing (authored by mkazantsev).
[IndVars] Use more precise context when eliminating narrowing
Nov 24 2020, 8:48 PM
mkazantsev closed D90456: [IndVars] Use more precise context when eliminating narrowing.
Nov 24 2020, 8:48 PM · Restricted Project
mkazantsev accepted D91153: [IndVarSimplify] Fix Modified status when handling dead PHI nodes.

Please move the test out of MIPS-specific into general test directory if it's possible. Otherwise, LGTM.

Nov 24 2020, 8:25 PM · Restricted Project
mkazantsev added a comment to D91711: SCEV add function to see if SCEVUnknown is null.

The idea of having SCEV pointing to deleted instructions scares me. Imagine what if we had SCEVAddRecs referencing the loops we've already deleted. There is a vast field for nasty bugs caused by UB and memory corruption. I'd rather expect that we fail some assertion if we try to optimize with SCEV in that state.

Nov 24 2020, 8:21 PM · Restricted Project
mkazantsev added a comment to D91800: [PassManager] Run Induction Variable Simplification pass *after* Recognize loop idioms pass, not before.

The change looks very reasonable, though I don't know what motivation was behind the current ordering. There might have been some (arcane) reasons behind it. Fine by me, but please have someone else to take a look.

Nov 24 2020, 8:14 PM · Restricted Project
mkazantsev added a reverting change for rG2734a9ebf4a3: [NFC][SCEV] Generalize monotonicity check for full and limited iteration space: rG02fdbc356724: Revert "[NFC][SCEV] Generalize monotonicity check for full and limited….
Nov 24 2020, 3:10 AM
mkazantsev committed rG02fdbc356724: Revert "[NFC][SCEV] Generalize monotonicity check for full and limited… (authored by mkazantsev).
Revert "[NFC][SCEV] Generalize monotonicity check for full and limited…
Nov 24 2020, 3:10 AM
mkazantsev added a reverting change for D90395: [NFC][SCEV] Generalize monotonicity check for full and limited iteration space: rG02fdbc356724: Revert "[NFC][SCEV] Generalize monotonicity check for full and limited….
Nov 24 2020, 3:10 AM · Restricted Project
mkazantsev added a comment to D91126: [SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations.

This was completely illegal. Need to find a way to revert it now.

Nov 24 2020, 2:27 AM · Restricted Project

Nov 23 2020

mkazantsev updated the diff for D90456: [IndVars] Use more precise context when eliminating narrowing.

Roll back to older code concept (without generatization into DomTree). It seems unreasonably difficult to check in code there.

Nov 23 2020, 9:49 PM · Restricted Project
mkazantsev abandoned D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

Let's go with 3. The idea was to share this code if someone might need it. I'm totally fine if it's written every time in different places whenever someone needs this logic.

Nov 23 2020, 8:54 PM · Restricted Project
mkazantsev updated the diff for D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

Fixed check (as expected, dominates fails for two Phis from the same block).

Nov 23 2020, 2:42 AM · Restricted Project
mkazantsev updated the diff for D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

Added expensive asserts;
Renamed Insns->Instructions

Nov 23 2020, 2:27 AM · Restricted Project
mkazantsev committed rG48d7cc6ae23b: [SCEV] Fix incorrect treatment of max taken count. PR48225 (authored by mkazantsev).
[SCEV] Fix incorrect treatment of max taken count. PR48225
Nov 23 2020, 1:53 AM
mkazantsev closed D91942: [SCEV] Fix incorrect treatment of max taken count. PR48225.
Nov 23 2020, 1:53 AM · Restricted Project
mkazantsev added a comment to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

I see the deep API problem here now. Current dominates(Value *, Instruction *) should not be called like that (at least because it returns false for dominates(X, X)). It has a different semantics, and should be called something like "canBeUserOf".

Nov 23 2020, 12:54 AM · Restricted Project
mkazantsev requested review of D91942: [SCEV] Fix incorrect treatment of max taken count. PR48225.
Nov 23 2020, 12:32 AM · Restricted Project

Nov 22 2020

mkazantsev added inline comments to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.
Nov 22 2020, 11:50 PM · Restricted Project
mkazantsev added inline comments to D91525: [LoopLoadElim] Make sure all loops are in simplify form. PR48150.
Nov 22 2020, 11:40 PM · Restricted Project
mkazantsev added a comment to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

You can find the planned user in dependencies stack: https://reviews.llvm.org/D90456

I need the common dom to find the latest context where we can prove predicate so that it's also true for all given instructions.

What do you think about defining and implementing bool dominates(Inst, Inst) at the same time (or before) findNCDInst?

Nov 22 2020, 11:36 PM · Restricted Project
mkazantsev committed rG47e31d1b5eac: [NFC] Reduce code duplication in binop processing in… (authored by mkazantsev).
[NFC] Reduce code duplication in binop processing in…
Nov 22 2020, 11:08 PM
mkazantsev closed D91864: [NFC] Reduce code duplication in binop processing in computeExitLimitFromCondCached.
Nov 22 2020, 11:08 PM · Restricted Project
mkazantsev added inline comments to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.
Nov 22 2020, 10:52 PM · Restricted Project
mkazantsev added a comment to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

You can find the planned user in dependencies stack: https://reviews.llvm.org/D90456

Nov 22 2020, 10:50 PM · Restricted Project
mkazantsev added a comment to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

As an alternative implementation, have you considered teaching DomTree::findNCD to work with multiple basic blocks first, and then using this to implement the multi-instruction findNCD?
The algorithm would be like this: create a vector VBB of BB of all instructions, find its NCD, case split on the NCD and VBB being the same block or not.

Nov 22 2020, 9:36 PM · Restricted Project
mkazantsev added inline comments to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.
Nov 22 2020, 8:52 PM · Restricted Project

Nov 20 2020

mkazantsev requested review of D91864: [NFC] Reduce code duplication in binop processing in computeExitLimitFromCondCached.
Nov 20 2020, 5:13 AM · Restricted Project
mkazantsev committed rG2290daa93838: [Test] Auto-update checks in a test (authored by mkazantsev).
[Test] Auto-update checks in a test
Nov 20 2020, 1:54 AM
mkazantsev committed rG0c101c9cbcc7: [Test] Add tests demonstrating a bug in SCEV, PR48225 (authored by mkazantsev).
[Test] Add tests demonstrating a bug in SCEV, PR48225
Nov 20 2020, 1:00 AM

Nov 19 2020

mkazantsev added a comment to D91525: [LoopLoadElim] Make sure all loops are in simplify form. PR48150.

Ping.

Nov 19 2020, 10:57 PM · Restricted Project
mkazantsev requested review of D91593: [IndVars] LCSSA Phi users should not prevent widening.
Nov 19 2020, 8:24 PM · Restricted Project
mkazantsev added inline comments to D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.
Nov 19 2020, 4:18 AM · Restricted Project
mkazantsev updated the diff for D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

Added elaborate comments & tests with Phis.

Nov 19 2020, 4:10 AM · Restricted Project
mkazantsev updated the diff for D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions.

Fixed bug with duplicating instructions in the list. Added relative checks.

Nov 19 2020, 2:42 AM · Restricted Project