Page MenuHomePhabricator

sanjoy (Sanjoy Das)
User

Projects

User does not belong to any projects.

User Details

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

Recent Activity

Yesterday

sanjoy added a reviewer for D57728: Relax constraints for reduction vectorization: kristof.beyls.
Tue, Feb 19, 2:36 PM · Restricted Project

Mon, Feb 11

sanjoy added a comment to D57728: Relax constraints for reduction vectorization.

ping!

Mon, Feb 11, 3:44 PM · Restricted Project

Wed, Feb 6

sanjoy accepted D56625: [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA..

lgtm

Wed, Feb 6, 12:02 PM · Restricted Project

Mon, Feb 4

sanjoy updated subscribers of D57728: Relax constraints for reduction vectorization.
Mon, Feb 4, 5:35 PM · Restricted Project
sanjoy created D57728: Relax constraints for reduction vectorization.
Mon, Feb 4, 5:35 PM · Restricted Project

Fri, Feb 1

sanjoy requested changes to D57578: [SCEV][WIP] Simplify Add and Mul expressions with Undef.

I don't think we can fold undef within SCEV since SCEV's choice for undef might not be what other transformations choose. For instance if you have a loop:

Fri, Feb 1, 9:27 PM
sanjoy accepted D57568: [SCEV] Don't bother preserving LCSSA in SCEV.

I'm okay with the direction, but I'm also worried that this breaks some subtle invariant between SCEV and SCEVExpander. Have you tried bootstrapping clang with this change to see if that shakes out any issues?

Fri, Feb 1, 9:06 PM
sanjoy accepted D57567: [SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes.

This is fine, but IMO mapping them to undef feels cleaner conceptually.

Fri, Feb 1, 9:04 PM · Restricted Project

Fri, Jan 25

sanjoy added inline comments to D56625: [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA..
Fri, Jan 25, 2:21 PM · Restricted Project
sanjoy accepted D57253: [WarnMissedTransforms] Set default to 1..

lgtm

Fri, Jan 25, 12:18 PM

Thu, Jan 24

sanjoy added inline comments to D35990: [SCEV] Prohibit SCEV transformations for huge SCEVs.
Thu, Jan 24, 9:42 AM

Mon, Jan 21

sanjoy added a comment to D35989: [SCEV][NFC] Introduces expression sizes estimation.

Re-requesting review per Daniil's comment above. @sanjoy , is this overhead acceptable? I can come up with an alternative maps-based solution if it is not (i.e. only calculate this size for those SCEVs where we need it).

Do you have an estimate of what is the max memory consumption when bootstrapping? I'm pretty sure 0.8M is a very small fraction of the total memory consumption, but would be nice to be sure.

We were estimating max amount of SCEVs that exist at the same time during a bootstrap compilation

Mon, Jan 21, 12:28 PM

Jan 16 2019

sanjoy added a comment to D35989: [SCEV][NFC] Introduces expression sizes estimation.

Re-requesting review per Daniil's comment above. @sanjoy , is this overhead acceptable? I can come up with an alternative maps-based solution if it is not (i.e. only calculate this size for those SCEVs where we need it).

Jan 16 2019, 11:07 AM

Jan 10 2019

sanjoy committed rL350886: Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer.
Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer
Jan 10 2019, 12:16 PM
sanjoy closed D56521: Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer.
Jan 10 2019, 12:16 PM
sanjoy added a reviewer for D56521: Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer: dblaikie.
Jan 10 2019, 11:21 AM

Jan 9 2019

sanjoy accepted D40375: Use MemorySSA in LICM to do sinking and hoisting..

lgtm

Jan 9 2019, 4:41 PM
sanjoy created D56521: Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer.
Jan 9 2019, 4:25 PM
sanjoy requested changes to D40375: Use MemorySSA in LICM to do sinking and hoisting..

I didn't carefully review the MSSA specific stuff since you're the domain expert here. I do have some general comments.

Jan 9 2019, 1:54 PM

Oct 22 2018

sanjoy updated subscribers of D53306: [X86] Stop promoting integer loads to vXi64.

Hi Craig,

Oct 22 2018, 12:49 PM

Oct 15 2018

sanjoy accepted D53282: [SCEV] Limit AddRec "simplifications" to avoid combinatorial explosions.

lgtm

Oct 15 2018, 7:56 AM

Oct 10 2018

sanjoy accepted D53061: [IndVars] Drop "exact" flag from lshr and udiv when substituting their args.

lgtm

Oct 10 2018, 11:24 AM

Oct 8 2018

sanjoy added inline comments to D51207: Introduce llvm.experimental.widenable_condition intrinsic.
Oct 8 2018, 10:54 AM

Oct 5 2018

sanjoy added a comment to D52930: [SCEV][NFC] Verify IR in isLoop[Entry,Backedge]GuardedByCond.

+1 on the general idea, though like Florian I too think this is too expensive for a normal debug build. How about putting it under a flag (putting under EXPENSIVE_CHECKS requires a recompile right?) that can even run on release builds? That flag can even be enabled by default on EXPENSIVE_CHECKS builds.

Oct 5 2018, 9:58 AM

Sep 24 2018

sanjoy added a comment to D51664: [IR] Lazily number instructions for local dominance queries.

If I get no results, at least 1% RSS is an upper bound on increased LTO memory usage. I'm happy to trade that for 40% shorter compile time of the slowest TUs in clang.

Sep 24 2018, 2:29 PM · Restricted Project
sanjoy added a comment to D51664: [IR] Lazily number instructions for local dominance queries.

The downside is that Instruction grows from 56 bytes to 64 bytes, and I don't have a good way to measure what that costs in practice.

Sep 24 2018, 11:49 AM · Restricted Project

Sep 22 2018

sanjoy added inline comments to D51207: Introduce llvm.experimental.widenable_condition intrinsic.
Sep 22 2018, 11:44 AM

Sep 10 2018

sanjoy added inline comments to D51207: Introduce llvm.experimental.widenable_condition intrinsic.
Sep 10 2018, 2:37 PM

Aug 24 2018

sanjoy added a comment to D51207: Introduce llvm.experimental.widenable_condition intrinsic.

Conceptually this seems fine to me, but I won't have time to do a proper review.

Aug 24 2018, 9:07 AM
sanjoy removed a reviewer for D51207: Introduce llvm.experimental.widenable_condition intrinsic: sanjoy.
Aug 24 2018, 9:06 AM

Aug 20 2018

sanjoy accepted D45300: Update MemorySSA BasicBlockUtils..

lgtm

Aug 20 2018, 2:24 PM

Aug 18 2018

sanjoy added inline comments to D49156: [MemorySSA] Add API to update MemoryPhis, following CFG changes..
Aug 18 2018, 12:22 PM
sanjoy added a comment to D50558: [MustExecute] Fix algorithmic bug in isGuaranteedToExecute. PR38514.

Actually this logic is accidentally correct right now because isGuaranteedToTransferExecutionToSuccessor thinks that volatile loads don't transfer execution to successors (which was under discurrion and probably needs removed) and MustExecute is super-conservative about such instructions in non-header blocks (see https://reviews.llvm.org/D50377). When MustThrow analysis becomes less restrictive, this problem becomes a real one and we hoist sdiv from such examples despite the fact that they are no longer "finite" according to C++ specification.

Aug 18 2018, 11:58 AM

Aug 16 2018

sanjoy added a comment to D50558: [MustExecute] Fix algorithmic bug in isGuaranteedToExecute. PR38514.

JFYI this is somewhat of a hornet's nest -- I believe cases like test_impossible_exit_in_untaken_block are actually correct for C/C++ because infloops without side effects are UB.

Aug 16 2018, 8:47 PM

Aug 14 2018

sanjoy added a comment to D45151: [LICM] Hoisting invariant.group loads.

I'm sorry I can't be more decisive here since I wasn't deeply involved with the devirtualization work early on and so lack a lot of context. The general direction here seems fine to me -- given that we use metadata to express a large range of things, it seems ok to have metadata specific MD dropping policies. However, given that Hal originally objected to this, we should make sure he is on board.

Aug 14 2018, 3:46 PM

Aug 13 2018

sanjoy added a comment to D45151: [LICM] Hoisting invariant.group loads.

Can we spec !invariant.group in a way that lets us always keep the metadata when hoisting? Right now it isn't clear what happens if its contract is violated, i.e. what the behavior of this program is:

Aug 13 2018, 10:57 AM
sanjoy added a comment to D50497: [AliasSetTracker] Do not treat experimental_guard intrinsic as memory writing instruction.

Even if we have to make this same change to AST after using inaccessiblememonly for guards, that seems cleaner than special casing guards here.

Aug 13 2018, 10:51 AM
sanjoy added a comment to D50497: [AliasSetTracker] Do not treat experimental_guard intrinsic as memory writing instruction.

Will marking guards with inaccessiblememonly do the right thing?

Aug 13 2018, 10:51 AM

Aug 9 2018

sanjoy added a comment to D50501: [LICM] Hoist guards with invariant conditions.

Didn't look at the code, but this needs a test case that shows we don't hoist the second guard in

Aug 9 2018, 11:40 AM

Aug 3 2018

sanjoy added a comment to D50248: [GuardWidening] Insert fictive guards to loop preheader to increase chances of widening.

Did you consider phrasing this as an "LICM" on guard? It is a bit of a code smell in LLVM to do an operation speculatively and then undo it immediately.

Aug 3 2018, 6:48 AM

Aug 2 2018

sanjoy added a reviewer for D50167: RFC: [SCEV] Add explicit representations of umin/smin: mkazantsev.
Aug 2 2018, 9:29 AM
sanjoy accepted D48283: [SCEV] Properly solve quadratic equations.

lgtm

Aug 2 2018, 9:25 AM

Aug 1 2018

sanjoy added a comment to D48283: [SCEV] Properly solve quadratic equations.

Only one non-trivial question inline.

Aug 1 2018, 11:05 AM

Jul 31 2018

sanjoy added a comment to D48283: [SCEV] Properly solve quadratic equations.

Now that the code is in APInt we should have some tests in unittests/ADT/APIntTest.cpp. Can we pull in some subset of D50095 that runs within a reasonable amount of time (only bitwidth 4, for instance)?

Jul 31 2018, 3:08 PM

Jul 28 2018

sanjoy added a comment to D48283: [SCEV] Properly solve quadratic equations.

I didn't review the math, but I think there are some easy steps we can take to make this more watertight. Firstly, the code that operates purely on APInt should be moved to APInt.h. With that, we should be able to brute-force all possible inputs for a small bitwidth (i3 or i4) and check that the solutions are correct. What do you think?

Jul 28 2018, 2:59 PM

Jul 26 2018

sanjoy accepted D49832: [SCEV] Don't expand Wrap predicate using inttoptr in ni addrspaces.

lgtm

Jul 26 2018, 9:17 AM

Jul 18 2018

sanjoy accepted D49471: [SCEV] Fix buggy behavior in getAddExpr with truncs.

lgtm

Jul 18 2018, 9:35 AM

Jul 11 2018

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.

Jul 11 2018, 6:23 AM

Jul 8 2018

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

Does this mean we can "construct" undef as:

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

Jul 6 2018

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

Do you have a test case for this?

Jul 6 2018, 6:57 PM

Jul 2 2018

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

lgtm

Jul 2 2018, 11:42 AM

Jun 27 2018

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

Jun 26 2018

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

LGTM modulo comments on the test coverage inline.

Jun 26 2018, 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?

Jun 26 2018, 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.

Jun 26 2018, 9:09 AM

Jun 25 2018

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

lgtm

Jun 25 2018, 3:57 PM

Jun 22 2018

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

Jun 21 2018

sanjoy requested changes to D48399: [ConstantRange] Add support of mul in makeGuaranteedNoWrapRegion..
Jun 21 2018, 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..
Jun 21 2018, 7:10 PM
sanjoy added a comment to D47895: llvm: Add support for "-fno-delete-null-pointer-checks".

Drive by comments

Jun 21 2018, 1:15 PM

Jun 20 2018

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}.

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

Jun 19 2018

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

Jun 18 2018

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

Jun 17 2018

sanjoy added inline comments to D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata..
Jun 17 2018, 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