sanjoy (Sanjoy Das)
User

Projects

User does not belong to any projects.

User Details

User Since
Jun 6 2014, 4:30 PM (214 w, 2 d)

Recent Activity

Wed, Jul 11

sanjoy accepted D49049: [LSR] If no Use is interesting, early return..

I'd debug this a bit further, perhaps with some logging statements to figure out what happened (what use did we discard as non-interesting and why?). But if that looks like too much work then this change as-is is fine too.

Wed, Jul 11, 6:23 AM

Sun, Jul 8

sanjoy added a comment to D49042: [LangRef] Clarify alloca of zero bytes..

Does this mean we can "construct" undef as:

Sun, Jul 8, 11:18 AM
sanjoy added inline comments to D49041: [LangRef] Clarify undefined behavior for function attributes..
Sun, Jul 8, 10:48 AM

Fri, Jul 6

sanjoy requested changes to D49049: [LSR] If no Use is interesting, early return..

Do you have a test case for this?

Fri, Jul 6, 6:57 PM

Mon, Jul 2

sanjoy accepted D48409: [SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)..

lgtm

Mon, Jul 2, 11:42 AM

Wed, Jun 27

sanjoy accepted D47352: [instsimplify] Move the instsimplify pass to use more obvious file names and diretory..
Wed, Jun 27, 11:23 AM

Tue, Jun 26

sanjoy accepted D48399: [ConstantRange] Add support of mul in makeGuaranteedNoWrapRegion..

LGTM modulo comments on the test coverage inline.

Tue, Jun 26, 11:31 AM
sanjoy added a comment to D48597: [LoopInstSimplify] Discard SCEV if simplification happened..

IMO this doesn't seem like an invalidation bug -- SCEV Expander needs to be smarter about dealing with these kinds of simplifications.

Does this sound better?

Tue, Jun 26, 10:19 AM
sanjoy added a comment to D48597: [LoopInstSimplify] Discard SCEV if simplification happened..

IMO this doesn't seem like an invalidation bug -- SCEV Expander needs to be smarter about dealing with these kinds of simplifications.

Tue, Jun 26, 9:09 AM

Mon, Jun 25

sanjoy accepted D48498: [APInt] Add helpers for rounding u/sdivs..

lgtm

Mon, Jun 25, 3:57 PM

Fri, Jun 22

sanjoy added inline comments to D48498: [APInt] Add helpers for rounding u/sdivs..
Fri, Jun 22, 2:26 PM

Thu, Jun 21

sanjoy requested changes to D48399: [ConstantRange] Add support of mul in makeGuaranteedNoWrapRegion..
Thu, Jun 21, 10:01 PM
sanjoy accepted D48470: [LegacyPM] Fix PR37888 by teaching the legacy loop pass manager how to clear out deleted loops from the current queue beyond just the current loop..
Thu, Jun 21, 7:10 PM
sanjoy added a comment to D47895: llvm: Add support for "-fno-delete-null-pointer-checks".

Drive by comments

Thu, Jun 21, 1:15 PM

Wed, Jun 20

sanjoy added a comment to D48338: [SCEV] Improve zext(A /u B) and zext(A % B).

I agree with Tim that this is best discussed on llvm-dev, but SCEV generally tries to push zext and sext towards the expression leaves (as Tim already pointed out, I noticed after typing this :) ). The canonical example of this is add recurrences -- SCEV tries very hard to transform zext{A,+,B} to {zext A,+,zext B}.

Wed, Jun 20, 9:12 PM
sanjoy accepted D48338: [SCEV] Improve zext(A /u B) and zext(A % B).
Wed, Jun 20, 6:38 PM

Tue, Jun 19

sanjoy requested changes to D48338: [SCEV] Improve zext(A /u B) and zext(A % B).
Tue, Jun 19, 4:07 PM

Mon, Jun 18

sanjoy committed rL335016: Revert "[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags".
Revert "[SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags"
Mon, Jun 18, 9:14 PM

Sun, Jun 17

sanjoy added inline comments to D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata..
Sun, Jun 17, 11:43 AM

Jun 16 2018

sanjoy added inline comments to D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata..
Jun 16 2018, 12:25 PM
sanjoy added a comment to D47963: [LangRef] nnan and ninf produce poison..

I think we should have these produce poison -- if we have them produce undef we'll have the same kinds of problems as we have with regular undef.

Jun 16 2018, 11:49 AM

Jun 15 2018

sanjoy accepted D48238: [SCEV] Simplify some flags expressions..

lgtm, thanks!

Jun 15 2018, 2:41 PM
sanjoy accepted D48237: [SCEV] Use LLVM_MARK_AS_BITMASK_ENUM in SCEV..

lgtm, thanks!

Jun 15 2018, 2:41 PM

Jun 14 2018

sanjoy accepted D48158: [SCEV] Simplify zext/trunc idiom that appears when handling bitmasks..

lgtm

Jun 14 2018, 10:03 AM
sanjoy accepted D48160: [SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances..

lgtm

Jun 14 2018, 9:41 AM

Jun 11 2018

sanjoy added a comment to D48041: [SCEV] Add transform zext((A * B * ...)<nuw>) --> (zext(A) * zext(B) * ...)<nuw>..

Hi Justin,

This (or the previous) commit caused a ~1.4% compile time slowdown on CTMark/mafft/pairlocalalign. Any ideas on how we can avoid it?

Jun 11 2018, 8:52 PM
sanjoy accepted D48038: [SCEV] Add nuw/nsw to mul ops in StrengthenNoWrapFlags where safe..

lgtm!

Jun 11 2018, 12:00 PM
sanjoy accepted D48041: [SCEV] Add transform zext((A * B * ...)<nuw>) --> (zext(A) * zext(B) * ...)<nuw>..

lgtm

Jun 11 2018, 11:58 AM

Jun 10 2018

sanjoy accepted D46706: [PM/LoopUnswitch] Support partial trivial unswitching..

This lgtm.

Jun 10 2018, 8:43 PM
sanjoy added a comment to D46760: [InstCombine] Enhance narrowUDivURem..

Bixia - is it correct to say that the behavior we want here is that we narrow arithmetic operations from 64 bits to 32 bits, irrespective of how many extra zero extend instructions we need to add? If yes, perhaps this isn't a good match for InstCombine and we should be looking at a specialized target-dependent transformation pass? InstCombine is a "mini LLVM" in that many LLVM passes have a simpler "do no harm" variant implemented in InstCombine, so this won't be anything new design-wise.

Jun 10 2018, 8:16 PM

Jun 9 2018

sanjoy added a comment to D47767: [SCEV] Drop cached info after late nsw/nuw flags setting.

Can you please also add a SCEV-only test case?

Jun 9 2018, 10:59 PM
sanjoy accepted D47974: [SimplifyIndVars] Ignore dead users.

lgtm

Jun 9 2018, 10:55 PM

Jun 8 2018

sanjoy added inline comments to D47965: [SCEV] Canonicalize "A /u C1 /u C2" to "A /u (C1*C2)"..
Jun 8 2018, 7:33 PM
sanjoy accepted D47965: [SCEV] Canonicalize "A /u C1 /u C2" to "A /u (C1*C2)"..
Jun 8 2018, 7:32 PM
sanjoy accepted D47951: [SCEV] Look through zero-extends in howFarToZero.

lgtm

Jun 8 2018, 1:35 PM
sanjoy added inline comments to D47951: [SCEV] Look through zero-extends in howFarToZero.
Jun 8 2018, 11:34 AM

Jun 1 2018

sanjoy accepted D47647: [PM/LoopUnswitch] Fix how the cloned loops are handled when updating analyses..

lgtm

Jun 1 2018, 6:09 PM

May 29 2018

sanjoy added a comment to D46760: [InstCombine] Enhance narrowUDivURem..

The transformation we really want is: (Z(A) / N) * N + Z(A) % N => Z(A) where Z(...) is zero extension. Maybe we can do that directly instead of reasoning about use lists like this (if we do it directly we will trivially not be increasing the number of zero extensions)?

May 29 2018, 4:25 PM
sanjoy accepted D47408: [PM/LoopUnswitch] When using the new SimpleLoopUnswitch pass, schedule loop-cleanup passes at the beginning of the loop pass pipeline, and re-enqueue loops after even trivial unswitching..

lgtm

May 29 2018, 2:03 PM
sanjoy accepted D47407: [LoopInstSimplify] Re-implement the core logic of loop-instsimplify to be both simpler and substantially more efficient..
May 29 2018, 12:07 PM
sanjoy added a comment to D47214: [InstCombine] Replace bcmp/bcopy with memcmp/memmove.

Maybe try to come up with at least a microbenchmark that would show the gain. You can also benchmark LNT test suite and see if there is any improvement, but the microbenchmark should be easier.

May 29 2018, 10:19 AM

May 24 2018

sanjoy accepted D47353: Restore the LoopInstSimplify pass, reverting r327329 that removed it..

lgtm

May 24 2018, 6:33 PM
sanjoy added a comment to D47327: Check that memory allocation succeeds before use..

As llvm is mostly an api, i assumed that it would be robust and this was a one-off.
Anything big should be done automagically, so i am going to look at sic-ing clang-tidy and/or the static analyzer at this problem.

May 24 2018, 1:39 PM
sanjoy added inline comments to D46706: [PM/LoopUnswitch] Support partial trivial unswitching..
May 24 2018, 11:47 AM
sanjoy added a comment to D47327: Check that memory allocation succeeds before use..

I will change this to try-catch

May 24 2018, 10:11 AM

May 23 2018

sanjoy accepted D47139: [NaryReassociate] Detect deleted instr with WeakTrackingVH.

lgtm

May 23 2018, 1:13 PM
sanjoy added a comment to D47139: [NaryReassociate] Detect deleted instr with WeakTrackingVH.

I end up with infinite loops when trying the lazy approach. As I'm not really familiar with the the algorithm used, I instead made this minimal change to fix the problem I saw in pr37539.

May 23 2018, 9:30 AM

May 22 2018

sanjoy added a comment to D47214: [InstCombine] Replace bcmp/bcopy with memcmp/memmove.

I have no benchmarks. But changing them to mem-functions allows us to apply another set of transformations in "optimizeMemcmp/Memmove".

May 22 2018, 2:21 PM
sanjoy requested changes to D47139: [NaryReassociate] Detect deleted instr with WeakTrackingVH.
May 22 2018, 2:13 PM
sanjoy added a comment to D47214: [InstCombine] Replace bcmp/bcopy with memcmp/memmove.

why?

Anyway these functions call mem* functions, so why not call them directly?

May 22 2018, 2:06 PM

May 11 2018

sanjoy committed rL332101: Use iteration instead of recursion in CFIInserter.
Use iteration instead of recursion in CFIInserter
May 11 2018, 8:58 AM
sanjoy closed D46671: Use iteration instead of recursion in CFIInserter.
May 11 2018, 8:58 AM

May 10 2018

sanjoy added a comment to D46706: [PM/LoopUnswitch] Support partial trivial unswitching..

Actually now that I think of it, I wonder if looking back through the condition expression tree to find all loop invariant values is necessary -- if we see these kinds of cases (loop_varying & loop_invariant0) & loop_invariant1) then perhaps we should teach LICM et. al. to reassociate and hoist the loop_invariant0 & loop_invariant1 bit instead of worrying about them in loop unswitch?

May 10 2018, 4:40 PM
sanjoy added inline comments to D46706: [PM/LoopUnswitch] Support partial trivial unswitching..
May 10 2018, 4:32 PM
sanjoy updated subscribers of D46706: [PM/LoopUnswitch] Support partial trivial unswitching..
May 10 2018, 11:23 AM
sanjoy updated the diff for D46671: Use iteration instead of recursion in CFIInserter.
  • fix bug + test case
May 10 2018, 10:33 AM
sanjoy added a comment to D46671: Use iteration instead of recursion in CFIInserter.

Incoming offset/register values of each successor block should match outgoing offset/register values of its predecessors.

May 10 2018, 10:32 AM

May 9 2018

sanjoy updated the diff for D46671: Use iteration instead of recursion in CFIInserter.
  • Use SmallVector::append
May 9 2018, 6:54 PM
sanjoy added inline comments to D46671: Use iteration instead of recursion in CFIInserter.
May 9 2018, 6:54 PM
sanjoy created D46671: Use iteration instead of recursion in CFIInserter.
May 9 2018, 6:23 PM
sanjoy accepted D46647: [InstCombine] Teach SimplifyDemandedBits that udiv doesn't demand low dividend bits that are zero in the divisor.

lgtm

May 9 2018, 3:24 PM
sanjoy added inline comments to D46647: [InstCombine] Teach SimplifyDemandedBits that udiv doesn't demand low dividend bits that are zero in the divisor.
May 9 2018, 1:56 PM
sanjoy added inline comments to D46647: [InstCombine] Teach SimplifyDemandedBits that udiv doesn't demand low dividend bits that are zero in the divisor.
May 9 2018, 10:52 AM

May 8 2018

sanjoy accepted D46046: [SCEV] Do not use induction in isKnownPredicate for simplification umax.

lgtm

May 8 2018, 9:47 PM

Apr 30 2018

sanjoy accepted D46290: Remove \brief commands from doxygen comments..

lgtm

Apr 30 2018, 2:34 PM

Apr 29 2018

sanjoy added a comment to D46046: [SCEV] Do not use induction in isKnownPredicate for simplification umax.

I'm a bit worried about adding yet another IsKnownViaXXX codepath (there are already too many!). Can we be a bit smarter in isKnownPredicate so that it avoids the recursive compile time blowup? If that's not possible, can we instead push the logic in isKnownPredicateWithoutInduction into isKnownViaNonRecursiveReasoning?

Apr 29 2018, 11:31 AM

Apr 26 2018

sanjoy added a comment to D44677: [SCEV] Make computeExitLimit more simple and more powerful.

computeExitLimit's logic shouldn't care if the exiting block is inside a nested loop, as long as the condition is invariant relative to the inner loop. (This should work correctly, as far as I can tell; if it doesn't, it would be easy to fix.) So the question is if there's some invariant related to the caching?

Apr 26 2018, 2:10 PM
sanjoy committed rL330992: [InstCombine] Simplify Add with remainder expressions as operands..
[InstCombine] Simplify Add with remainder expressions as operands.
Apr 26 2018, 1:56 PM
sanjoy closed D45976: [InstCombine] Simplify Add with remainder expressions as operands..
Apr 26 2018, 1:56 PM
sanjoy committed rL330991: Add test cases to prepare for the optimization that simplifies Add with.
Add test cases to prepare for the optimization that simplifies Add with
Apr 26 2018, 1:55 PM
sanjoy closed D46017: Add test cases to prepare for the optimization that simplifies Add with remainder expressions as operands..
Apr 26 2018, 1:55 PM
sanjoy accepted D45976: [InstCombine] Simplify Add with remainder expressions as operands..

lgtm with minor nits.

Apr 26 2018, 12:38 PM
sanjoy added inline comments to D45981: [Docs] Escape the @ symbol, so that it appears in documentation output. [NFC].
Apr 26 2018, 9:08 AM
sanjoy added a comment to D44677: [SCEV] Make computeExitLimit more simple and more powerful.

Given how many places we've had to add SE->forgetTopmostLoop after this pass, I'm wondering if this change violated some poorly specified SCEV invariant. In particular, previously had we called computeExitLimit on an exiting block in an loop inner to L we'd always conclude said exiting block was not "always executed the same number of times as the loop" because we'd bail out of the backwards climb at the header of the inner loop (which cannot have a getUniquePredecessor). What do you think?

Apr 26 2018, 8:39 AM
sanjoy added inline comments to D45981: [Docs] Escape the @ symbol, so that it appears in documentation output. [NFC].
Apr 26 2018, 8:11 AM
sanjoy accepted D45981: [Docs] Escape the @ symbol, so that it appears in documentation output. [NFC].

lgtm

Apr 26 2018, 8:10 AM

Apr 25 2018

sanjoy accepted D46047: [SCEV] Introduce bulk umin creation utilities.
Apr 25 2018, 9:54 AM
sanjoy requested changes to D45976: [InstCombine] Simplify Add with remainder expressions as operands..
Apr 25 2018, 9:50 AM

Apr 24 2018

sanjoy accepted D45943: [PM/LoopUnswitch] Begin teaching SimpleLoopUnswitch to use the new update API for dominators rather than doing manual, hacky updates..
Apr 24 2018, 1:51 PM
sanjoy requested changes to D45976: [InstCombine] Simplify Add with remainder expressions as operands..

Mostly nits except for the comment with the Alive proofs (didn't get to the meat of the patch yet).

Apr 24 2018, 12:02 PM
sanjoy accepted D46017: Add test cases to prepare for the optimization that simplifies Add with remainder expressions as operands..

lgtm modulo the one nit

Apr 24 2018, 11:25 AM

Apr 23 2018

sanjoy added a comment to D45937: [LoopSimplify] Fix incorrect SCEV invalidation.

ScalarEvolution::verify has false positives (i.e. it fails when it shouldn't) in some corner cases which is why it isn't run by default from verifyAnalysis[0]. So I don't think it is safe to add calls to ScalarEvolution::verify like this (this should really have been a comment on ScalarEvolution::verify -- I'll add that once these new call sites are removed).

Apr 23 2018, 3:23 PM
sanjoy added a comment to D45945: [LoopRotate] Fix incorrect SCEV invalidation in loop rotation.

Or will we lazily rebuild it?

Apr 23 2018, 3:11 PM
sanjoy requested changes to D45976: [InstCombine] Simplify Add with remainder expressions as operands..

Some style nits -- will review the content of the patch once these are fixed. You might want to skim through these: https://llvm.org/docs/CodingStandards.html http://llvm.org/docs/ProgrammersManual.html

Apr 23 2018, 11:49 AM

Mar 14 2018

sanjoy added inline comments to D44419: [SCEV][NFC] Remove TBB, FBB parameters from exit limit computations.
Mar 14 2018, 11:18 AM

Mar 12 2018

sanjoy accepted D43997: [SCEV][NFC] Smarter implementation of isAvailableAtLoopEntry.
Mar 12 2018, 10:35 PM
sanjoy requested changes to D43997: [SCEV][NFC] Smarter implementation of isAvailableAtLoopEntry.
Mar 12 2018, 10:57 AM
sanjoy accepted D43507: [SCEV] Fix isKnownPredicate.

lgtm (didn't review the logic based on @mkazantsev 's LGTM).

Mar 12 2018, 10:49 AM

Mar 9 2018

sanjoy added a comment to D44337: Make ConstantDataArray::get constructor templated. Will support signed integers..

Minor drive by comments.

Mar 9 2018, 5:23 PM

Mar 6 2018

sanjoy accepted D44102: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions..
Mar 6 2018, 11:28 PM

Mar 5 2018

sanjoy added a comment to D44102: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions..

Disappointingly, this doesn't work for simple cases where you mask the divisor:

%b = and i64 %a, 65535
%div = udiv i64 %b, 42
Mar 5 2018, 2:45 PM

Mar 2 2018

sanjoy added inline comments to D43759: [SCEV] Add one more case in computeConstantDifference.
Mar 2 2018, 9:55 AM

Feb 28 2018

sanjoy requested changes to D43759: [SCEV] Add one more case in computeConstantDifference.
Feb 28 2018, 10:00 PM
sanjoy removed a reviewer for D36130: [SLP] Vectorize jumbled memory loads.: sanjoy.
Feb 28 2018, 11:36 AM
sanjoy accepted D43810: [SCEV] Smart range calculation for SCEVUnknown Phis.

lgtm

Feb 28 2018, 12:54 AM

Feb 25 2018

sanjoy added inline comments to D43499: [SCEV] Introduce SCEVPostIncRewriter.
Feb 25 2018, 9:33 PM
sanjoy requested changes to D43507: [SCEV] Fix isKnownPredicate.

This change definitely needs some tests.

Feb 25 2018, 1:15 PM
sanjoy accepted D43498: [SCEV] Extends the SCEVInitRewriter.

lgtm with the two other issues mentioned in D43499 addressed.

Feb 25 2018, 1:10 PM
sanjoy accepted D43499: [SCEV] Introduce SCEVPostIncRewriter.

lgtm with minor fixes

Feb 25 2018, 1:10 PM
sanjoy accepted D43504: [SCEV] Factor out getLoopUseLists.
Feb 25 2018, 1:07 PM