Page MenuHomePhabricator
Feed Advanced Search

Mar 11 2019

sanjoy accepted D58994: [SCEV] Use depth limit for trunc analysis.

lgtm!

Mar 11 2019, 9:32 PM · Restricted Project
sanjoy committed rG3f5ce18658f0: Reland "Relax constraints for reduction vectorization" (authored by sanjoy).
Reland "Relax constraints for reduction vectorization"
Mar 11 2019, 6:32 PM
sanjoy committed rL355889: Reland "Relax constraints for reduction vectorization".
Reland "Relax constraints for reduction vectorization"
Mar 11 2019, 6:32 PM
sanjoy committed rG2136a5bc49bf: Revert "Relax constraints for reduction vectorization" (authored by sanjoy).
Revert "Relax constraints for reduction vectorization"
Mar 11 2019, 3:37 PM
sanjoy committed rL355873: Revert "Relax constraints for reduction vectorization".
Revert "Relax constraints for reduction vectorization"
Mar 11 2019, 3:37 PM
sanjoy committed rG93f8cc186ace: Relax constraints for reduction vectorization (authored by sanjoy).
Relax constraints for reduction vectorization
Mar 11 2019, 2:36 PM
sanjoy committed rL355868: Relax constraints for reduction vectorization.
Relax constraints for reduction vectorization
Mar 11 2019, 2:35 PM
sanjoy closed D57728: Relax constraints for reduction vectorization.
Mar 11 2019, 2:35 PM · Restricted Project
sanjoy added inline comments to D57728: Relax constraints for reduction vectorization.
Mar 11 2019, 2:27 PM · Restricted Project

Mar 6 2019

sanjoy added inline comments to D57728: Relax constraints for reduction vectorization.
Mar 6 2019, 2:14 PM · Restricted Project
sanjoy updated the diff for D57728: Relax constraints for reduction vectorization.
  • Address review comments
Mar 6 2019, 2:14 PM · Restricted Project

Mar 5 2019

sanjoy updated the summary of D57728: Relax constraints for reduction vectorization.
Mar 5 2019, 3:38 PM · Restricted Project
sanjoy added a reviewer for D57728: Relax constraints for reduction vectorization: Ayal.
Mar 5 2019, 3:36 PM · Restricted Project

Mar 4 2019

sanjoy updated the diff for D57728: Relax constraints for reduction vectorization.

Rebase on trunk.

Mar 4 2019, 8:16 PM · Restricted Project
sanjoy committed rG719e78631de3: PHI nodes are not `FPMathOperator` s (authored by sanjoy).
PHI nodes are not `FPMathOperator` s
Mar 4 2019, 5:15 PM
sanjoy committed rL355362: PHI nodes are not `FPMathOperator` s.
PHI nodes are not `FPMathOperator` s
Mar 4 2019, 5:14 PM
sanjoy closed D58887: PHI nodes are not `FPMathOperator` s.
Mar 4 2019, 5:14 PM · Restricted Project
sanjoy updated the diff for D58887: PHI nodes are not `FPMathOperator` s.

Matt, I noticed a necessary change I had to make before landing this separately.
I didn't notice this because I was initially testing this combined with some
other changes.

Mar 4 2019, 2:14 PM · Restricted Project
sanjoy updated the diff for D58887: PHI nodes are not `FPMathOperator` s.

Add unit test

Mar 4 2019, 11:39 AM · Restricted Project
sanjoy added a comment to D58853: [SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR..

Thanks! While looking at the assertion failure, I also had a look around to see if callers of getBackedgeTakenCount & co check if the returned SCEVExpr is undef, but it seems most users do not do that. I do not have a good concrete example, where using an undef exit count is problematic, but I was wondering if it is safe in general? To me it seems problematic, e.g. if a pass expands an undef SCEVExpr.

One fishy example I could come up with are alias checks in loop-vectorize. If the trip count is undef, we will generate alias checks using undef as upper bound. Those checks could pass (-> say noalias), even though the pointers actually alias in the vector loop ( because we pick a different value for the undef trip count and now the actual trip count is different than the one used for alias checks)

Mar 4 2019, 11:26 AM · Restricted Project
sanjoy accepted D58435: [SCEV] Ensure that isHighCostExpansion takes into account what is being divided.

Thanks for the explanation!

Mar 4 2019, 11:12 AM · Restricted Project
sanjoy added a comment to D58887: PHI nodes are not `FPMathOperator` s.

Test case?

Mar 4 2019, 10:59 AM · Restricted Project

Mar 3 2019

sanjoy added a parent revision for D57728: Relax constraints for reduction vectorization: D58887: PHI nodes are not `FPMathOperator` s.
Mar 3 2019, 2:02 PM · Restricted Project
sanjoy added a child revision for D58887: PHI nodes are not `FPMathOperator` s: D57728: Relax constraints for reduction vectorization.
Mar 3 2019, 2:02 PM · Restricted Project
sanjoy updated the diff for D57728: Relax constraints for reduction vectorization.

Propagate only correct FP fast-math flags.

Mar 3 2019, 2:00 PM · Restricted Project
sanjoy created D58887: PHI nodes are not `FPMathOperator` s.
Mar 3 2019, 1:59 PM · Restricted Project

Mar 1 2019

sanjoy requested changes to D58435: [SCEV] Ensure that isHighCostExpansion takes into account what is being divided.

The change itself looks fine to me, but I'm a bit worried about the test changes. Is it possible that the tests were checking certain the correctness for certain expressions that we no longer check because these happen to be expensive? If that's the case maybe we should add a debug flag that disregards the "is expensive expansion" check to make sure the the same code paths remain tested?

Mar 1 2019, 4:49 PM · Restricted Project
sanjoy accepted D58853: [SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR..

lgtm!

Mar 1 2019, 4:43 PM · Restricted Project
sanjoy accepted D58851: [SCEV] Remove undef check for SCEVConstant (NFC).

lgtm

Mar 1 2019, 4:41 PM · Restricted Project

Feb 19 2019

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

Feb 11 2019

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

ping!

Feb 11 2019, 3:44 PM · Restricted Project

Feb 6 2019

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

lgtm

Feb 6 2019, 12:02 PM · Restricted Project

Feb 4 2019

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

Feb 1 2019

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:

Feb 1 2019, 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?

Feb 1 2019, 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.

Feb 1 2019, 9:04 PM · Restricted Project

Jan 25 2019

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

lgtm

Jan 25 2019, 12:18 PM

Jan 24 2019

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

Jan 21 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).

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

Jan 21 2019, 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 · Restricted Project

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 · Restricted Project
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 · Restricted Project
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 · Restricted Project

Jun 22 2018

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

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 · Restricted Project

Jun 16 2018

sanjoy added inline comments to D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata..
Jun 16 2018, 12:25 PM · Restricted Project
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