Page MenuHomePhabricator

spatel (Sanjay Patel)
User

Projects

User does not belong to any projects.

User Details

User Since
May 22 2014, 1:24 PM (369 w, 4 d)

Recent Activity

Today

spatel accepted D104247: [DAGCombine] reassoc flag shouldn't enable contract.

LGTM.
Since we are opting for a definition of reassoc that is not a superset of the other flags, it might be worth seeing if transforms related to arcp and afn are similarly affected.

Mon, Jun 21, 11:14 AM · Restricted Project
spatel added inline comments to D104247: [DAGCombine] reassoc flag shouldn't enable contract.
Mon, Jun 21, 9:04 AM · Restricted Project
spatel committed rG198b79caae4f: [InstCombine] move bitmanipulation-of-select folds (authored by spatel).
[InstCombine] move bitmanipulation-of-select folds
Mon, Jun 21, 8:32 AM
spatel committed rG64b2676ca829: [InstCombine] fold ctlz/cttz-of-select with 1 or more constant arms (authored by spatel).
[InstCombine] fold ctlz/cttz-of-select with 1 or more constant arms
Mon, Jun 21, 8:11 AM

Yesterday

spatel committed rG4c44b02d87bc: [InstCombine] fold ctpop-of-select with 1 or more constant arms (authored by spatel).
[InstCombine] fold ctpop-of-select with 1 or more constant arms
Sun, Jun 20, 8:36 AM
spatel committed rG240acb0cff3f: [InstCombine] avoid infinite loops with select folds of constant expressions (authored by spatel).
[InstCombine] avoid infinite loops with select folds of constant expressions
Sun, Jun 20, 6:53 AM

Sat, Jun 19

spatel committed rG328b21a3389c: [InstCombine][test] add tests for select-of-bit-manip; NFC (authored by spatel).
[InstCombine][test] add tests for select-of-bit-manip; NFC
Sat, Jun 19, 9:35 AM

Fri, Jun 18

spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Fri, Jun 18, 2:46 PM · Restricted Project
spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Fri, Jun 18, 1:01 PM · Restricted Project
spatel accepted D104441: [IVDescriptors] Fix comment that getUnsafeAlgebraInst has been renamed to getExactFPMathInst.

LGTM

Fri, Jun 18, 11:32 AM · Restricted Project
spatel added a reviewer for D102673: [ConstantFolding] Fold constrained arithmetic intrinsics: scanon.

Ping @scanon to comment on whether the exception vs. fold-ability logic seems correct.

Fri, Jun 18, 9:53 AM · Restricted Project
spatel updated the diff for D104472: [ValueTracking] look through bitcast of vector in computeKnownBits.

Patch updated - no logic changes from earlier rev, but:

  1. Make code comment more extensive (I'm speculating that this version is better than what I had before. If so, I can update the SDAG comment too; if not, I can paste in the existing comment from SDAG.)
  2. Use KnownBits.insertBits() to reduce code.
Fri, Jun 18, 9:02 AM · Restricted Project
spatel added inline comments to rG7353beda4aa1: [DAG] SelectionDAG::computeKnownBits - use APInt::insertBits to merge subvector….
Fri, Jun 18, 8:33 AM
spatel added a comment to D104247: [DAGCombine] reassoc flag shouldn't enable contract.

In code that I've looked at (mostly C compiled with -ffast-math), we always have contract when we have reassoc, so I don't see much practical difference.
Can you explain more how we could benefit from this change - in the example in the description, we would have 4 instructions rather than 3 if we use FMA - is that better?
We should duplicate (instead of edit) at least a few of the tests, so we can verify that the existing tests do not form FMA now. That could also be used to show an advantage from not forming FMA.

Fri, Jun 18, 7:53 AM · Restricted Project
spatel added a comment to D104445: [SimplifyCFGPass] Tail-merging function-terminating blocks.

I don't have any real basis to say if this step is good. It would help to point to or show an example where we will eventually win from this change {+ the inverse} + a difference in inlining.
Seems like a potentially large scope change, so post to llvm-dev to see if anyone else has experience/opinions?

Fri, Jun 18, 7:35 AM · Restricted Project
spatel updated the summary of D104472: [ValueTracking] look through bitcast of vector in computeKnownBits.
Fri, Jun 18, 6:08 AM · Restricted Project
spatel added inline comments to D104472: [ValueTracking] look through bitcast of vector in computeKnownBits.
Fri, Jun 18, 4:39 AM · Restricted Project

Thu, Jun 17

spatel added a comment to D104472: [ValueTracking] look through bitcast of vector in computeKnownBits.

Would it please be possible to either enhance comments, or port more comments from the SelectionDAG::computeKnownBits()?
It appears to match that original implementation, and seems correct, but it is hard to read/get through.

Thu, Jun 17, 12:09 PM · Restricted Project
spatel requested review of D104472: [ValueTracking] look through bitcast of vector in computeKnownBits.
Thu, Jun 17, 10:03 AM · Restricted Project
spatel committed rG61196f855c39: [InstSimplify] add tests for computeKnownBits of shift-with-bitcast op; NFC (authored by spatel).
[InstSimplify] add tests for computeKnownBits of shift-with-bitcast op; NFC
Thu, Jun 17, 9:46 AM
spatel committed rG5b1079f6411b: [InstCombine][x86] add tests for complex vector shift value tracking; NFC (authored by spatel).
[InstCombine][x86] add tests for complex vector shift value tracking; NFC
Thu, Jun 17, 9:46 AM

Wed, Jun 16

spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Wed, Jun 16, 11:50 AM · Restricted Project
spatel committed rGa993bb08b834: [ValueTracking] add FP intrinsics to test for propagatesPoison; NFC (authored by spatel).
[ValueTracking] add FP intrinsics to test for propagatesPoison; NFC
Wed, Jun 16, 10:43 AM
spatel committed rG572e506b55f0: [ValueTracking] add tests for propagatesPoison with FP ops; NFC (authored by spatel).
[ValueTracking] add tests for propagatesPoison with FP ops; NFC
Wed, Jun 16, 9:18 AM
spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Wed, Jun 16, 8:47 AM · Restricted Project
spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Wed, Jun 16, 8:37 AM · Restricted Project
spatel committed rGce95200b7942: [InstSimplify] propagate poison through FP ops (authored by spatel).
[InstSimplify] propagate poison through FP ops
Wed, Jun 16, 8:33 AM
spatel closed D104383: [InstSimplify] propagate poison through FP ops.
Wed, Jun 16, 8:33 AM · Restricted Project
spatel added a comment to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.

Please see D104383 for an update to regular FP instruction simplification.

Wed, Jun 16, 7:11 AM · Restricted Project
spatel requested review of D104383: [InstSimplify] propagate poison through FP ops.
Wed, Jun 16, 7:09 AM · Restricted Project
spatel added inline comments to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.
Wed, Jun 16, 6:32 AM · Restricted Project

Mon, Jun 14

spatel committed rG8591640379ac: [InstCombine] add DeMorgan folds for logical ops in select form (authored by spatel).
[InstCombine] add DeMorgan folds for logical ops in select form
Mon, Jun 14, 9:56 AM
spatel committed rG56ae4f23b227: [InstCombine] add tests for logical and/or with not ops; NFC (authored by spatel).
[InstCombine] add tests for logical and/or with not ops; NFC
Mon, Jun 14, 9:56 AM
spatel added a comment to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

@lebedev.ri @RKSimon - any more comments?

Mon, Jun 14, 5:01 AM · Restricted Project

Sun, Jun 13

spatel added inline comments to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.
Sun, Jun 13, 4:14 PM · Restricted Project
spatel accepted D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

LGTM, but let's see if there are any more comments or concerns.

Sun, Jun 13, 4:12 PM · Restricted Project
spatel committed rGafd44bb6f29c: [InstCombine] fold ctlz/cttz of bool types (authored by spatel).
[InstCombine] fold ctlz/cttz of bool types
Sun, Jun 13, 5:27 AM
spatel added inline comments to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.
Sun, Jun 13, 4:59 AM · Restricted Project

Fri, Jun 11

spatel committed rG1c51bf3b7885: [InstCombine] add tests for bit manipulation intrinsics with bool values; NFC (authored by spatel).
[InstCombine] add tests for bit manipulation intrinsics with bool values; NFC
Fri, Jun 11, 3:20 PM
spatel committed rGad1d60bf5334: [InstCombine] update test checks; NFC (authored by spatel).
[InstCombine] update test checks; NFC
Fri, Jun 11, 3:20 PM
spatel added a comment to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

Hi @spatel Sir, doesn't https://alive2.llvm.org/ce/z/89_wJb prove that this works for even type smaller than log2 of the wide type ? I can add the same test to the unit test, but I am in doubt whether to add it as a check, since the example here proves that it works for difference of bitwidth of more than log 2 as well. I tested with 63, 2 sizes as well, and that works too. Please suggest if we require to add the log2 check, since these are working fine from the above examples.

Fri, Jun 11, 8:20 AM · Restricted Project
spatel committed rG602ab248335e: [SimplifyCFG] avoid crash on degenerate loop (authored by spatel).
[SimplifyCFG] avoid crash on degenerate loop
Fri, Jun 11, 6:45 AM
spatel closed D104063: [SimplifyCFG] avoid crash on degenerate loop.
Fri, Jun 11, 6:44 AM · Restricted Project
spatel added a comment to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

Removed the hard cut off check. Please review Sir.

Fri, Jun 11, 6:31 AM · Restricted Project
spatel added inline comments to D104063: [SimplifyCFG] avoid crash on degenerate loop.
Fri, Jun 11, 5:56 AM · Restricted Project
spatel updated the diff for D104063: [SimplifyCFG] avoid crash on degenerate loop.

Patch updated:
Make the bailout more general and try to explain the problem pattern in a code comment.

Fri, Jun 11, 5:14 AM · Restricted Project
spatel added a comment to D104063: [SimplifyCFG] avoid crash on degenerate loop.

And what happens when there's more than one PHI node in the block?

Fri, Jun 11, 5:07 AM · Restricted Project

Thu, Jun 10

spatel requested review of D104063: [SimplifyCFG] avoid crash on degenerate loop.
Thu, Jun 10, 2:30 PM · Restricted Project
spatel committed rG7b969ef8b4eb: [SimplifyCFG] avoid 'tmp' variables in test file; NFC (authored by spatel).
[SimplifyCFG] avoid 'tmp' variables in test file; NFC
Thu, Jun 10, 2:04 PM
spatel added a comment to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

If we look at the sequence with trunc, then preconditions are different.
I'm not sure if we have *some* problematic combination of src bitwidth and bitwidth increase,
but the hard cut-off that is currently there is not correct.

Thu, Jun 10, 11:04 AM · Restricted Project
spatel accepted D103419: [VectorCombine] Fix alignment in single element store.

LGTM

Thu, Jun 10, 6:12 AM · Restricted Project
spatel added a comment to rGd69c4372bfbe: [CodeGen] remove instcombine from codegen tests; NFC.

+1 to limiting it to new pass manager. (good spot btw, I was very confused why this was failing for me)

You get a different order of alloca statements when using the legacy PM.

Thu, Jun 10, 5:55 AM
spatel committed rGcc86b87a5700: [CodeGen] limit tests to current pass manager to avoid variability; NFC (authored by spatel).
[CodeGen] limit tests to current pass manager to avoid variability; NFC
Thu, Jun 10, 5:50 AM
spatel added a comment to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.

@lebedev.ri Sir, but if we don't take trunc into consideration, then how are we optimizing this?
Earlier it was 2 insts (zext - ctlz), and now its 3 insts(ctlz - add - zext). I agree that the ctlz , add are done on a lower datatype.
If we consider trunc as well, then we can convert 3 insts (zext - ctlz - trunc) to 2 insts (ctlz - add).
Shouldn't we do this opt only when the trunc is present?

In general - yes, in instcombine we should not increase the instruction count,
however as it was already hinted by @spatel, this seems like a rare edge case
where we should be okay with that. (unless @spatel disagrees?)

Thu, Jun 10, 5:35 AM · Restricted Project

Wed, Jun 9

spatel added inline comments to D103419: [VectorCombine] Fix alignment in single element store.
Wed, Jun 9, 9:39 AM · Restricted Project
spatel added inline comments to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.
Wed, Jun 9, 8:41 AM · Restricted Project
spatel accepted D103956: [ConstantFolding] Enable folding of min/max/copysign for all floats.

But would it be better to push this first since it is an extension to the existing functionality, then add the changes for constrained ops on top of this?

Wed, Jun 9, 8:30 AM · Restricted Project
spatel committed rG9eef6e39816a: [InstCombine] add tests for casts-around-ctlz; NFC (authored by spatel).
[InstCombine] add tests for casts-around-ctlz; NFC
Wed, Jun 9, 8:24 AM
spatel added a comment to rG3cdd05e519dd: [InstCombine] fold fnegs around select.

I pushed a minimal fix (intersect 'nsz'):
d2012d965d60

Wed, Jun 9, 7:59 AM
spatel committed rGdd763ac79196: [SDAG] fix miscompile from merging stores of different sizes (authored by spatel).
[SDAG] fix miscompile from merging stores of different sizes
Wed, Jun 9, 6:56 AM
spatel committed rG2ef81cb29795: [x86] add tests for store merging miscompile (PR50623); NFC (authored by spatel).
[x86] add tests for store merging miscompile (PR50623); NFC
Wed, Jun 9, 6:21 AM

Tue, Jun 8

spatel committed rGd2012d965d60: [InstCombine] fix nsz (fast-math) propagation from fneg-of-select (authored by spatel).
[InstCombine] fix nsz (fast-math) propagation from fneg-of-select
Tue, Jun 8, 2:05 PM
spatel committed rGc52ed5c4f1f2: [InstCombine] add FMF tests for fneg-of-select; NFC (authored by spatel).
[InstCombine] add FMF tests for fneg-of-select; NFC
Tue, Jun 8, 2:05 PM
spatel committed rGd69c4372bfbe: [CodeGen] remove instcombine from codegen tests; NFC (authored by spatel).
[CodeGen] remove instcombine from codegen tests; NFC
Tue, Jun 8, 12:33 PM
spatel added inline comments to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.
Tue, Jun 8, 10:41 AM · Restricted Project
spatel added inline comments to D103419: [VectorCombine] Fix alignment in single element store.
Tue, Jun 8, 9:45 AM · Restricted Project
spatel added a comment to D93818: [LangRef] Update shufflevector's semantics to return poison if the mask is undef.

Hi all,

Before diving into further updates in InstCombine (D94380 and D93817), what about pinning down this LangRef update first & letting people know via llvm-dev mail?

Tue, Jun 8, 9:33 AM · Restricted Project
spatel added inline comments to D103419: [VectorCombine] Fix alignment in single element store.
Tue, Jun 8, 8:02 AM · Restricted Project
spatel added inline comments to D102673: [ConstantFolding] Fold constrained arithmetic intrinsics.
Tue, Jun 8, 5:51 AM · Restricted Project
spatel planned changes to D102002: [PassManager] unify vector passes between regular and LTO pipelines.

Clearly, we're going to need to split this up, but it's not my highest priority, so marking for revision.

Tue, Jun 8, 5:42 AM · Restricted Project

Mon, Jun 7

spatel added inline comments to D103788: [InstCombine] Eliminate casts to optimize ctlz operation.
Mon, Jun 7, 11:55 AM · Restricted Project
spatel committed rG4675beaa2181: [InstCombine] intersect nsz and ninf fast-math-flags (FMF) for fneg(fdiv) fold (authored by spatel).
[InstCombine] intersect nsz and ninf fast-math-flags (FMF) for fneg(fdiv) fold
Mon, Jun 7, 10:23 AM
spatel committed rG519e98cd9af0: [InstCombine] refactor match clauses; NFC (authored by spatel).
[InstCombine] refactor match clauses; NFC
Mon, Jun 7, 10:23 AM
spatel committed rGdc173254e754: [InstCombine] add tests for FMF propagation via -(C/X); NFC (authored by spatel).
[InstCombine] add tests for FMF propagation via -(C/X); NFC
Mon, Jun 7, 10:23 AM
spatel committed rG7736c1936a93: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math (authored by vdsered).
[InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math
Mon, Jun 7, 5:10 AM
spatel closed D102574: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math.
Mon, Jun 7, 5:10 AM · Restricted Project
spatel accepted D102574: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math.

LGTM

Mon, Jun 7, 3:29 AM · Restricted Project

Sun, Jun 6

spatel added inline comments to D102574: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math.
Sun, Jun 6, 4:29 PM · Restricted Project

Fri, Jun 4

spatel added inline comments to D102673: [ConstantFolding] Fold constrained arithmetic intrinsics.
Fri, Jun 4, 8:54 AM · Restricted Project
spatel committed rG8a4d05ddb3ff: [ConstantFolding] add copysign tests for more FP types; NFC (authored by spatel).
[ConstantFolding] add copysign tests for more FP types; NFC
Fri, Jun 4, 8:47 AM
spatel added a comment to D103169: [FPEnv][InstSimplify] Constrained FP support for NaN.

I could split this up on the fadd/fsub/fmul/etc axis and only handle constrained fadd, for example. Would that be helpful? Your current thoughts, @spatel?

Fri, Jun 4, 7:22 AM · Restricted Project
spatel added a comment to D102574: [InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math.

@spatel you mentioned one more optimization with sext that we miss because of too strict use-constraint here. I'll create another patch for that. I think, it's going to be the last one. I don't know any other transformations for mul/fmul that would benefit from the new method.

Fri, Jun 4, 7:19 AM · Restricted Project
spatel committed rGf03f4944cf82: [InstCombine] add tests for pow() reassociation; NFC (authored by spatel).
[InstCombine] add tests for pow() reassociation; NFC
Fri, Jun 4, 7:16 AM
spatel added inline comments to rG23a116c8c446: [InstCombine] convert lshr to ashr to eliminate cast op.
Fri, Jun 4, 6:11 AM
spatel committed rG1fc6027406c5: [InstCombine] add/adjust test comments; NFC (authored by spatel).
[InstCombine] add/adjust test comments; NFC
Fri, Jun 4, 6:05 AM
spatel committed rG23a116c8c446: [InstCombine] convert lshr to ashr to eliminate cast op (authored by spatel).
[InstCombine] convert lshr to ashr to eliminate cast op
Fri, Jun 4, 4:05 AM
spatel committed rG8937450e8581: [InstCombine] add tests for sext-of-trunc-of-lshr; NFC (authored by spatel).
[InstCombine] add tests for sext-of-trunc-of-lshr; NFC
Fri, Jun 4, 4:05 AM

Thu, Jun 3

spatel committed rGb865eead7657: [InstCombine] eliminate sext and/or trunc if value has enough signbits (authored by spatel).
[InstCombine] eliminate sext and/or trunc if value has enough signbits
Thu, Jun 3, 10:59 AM
spatel closed D103617: [InstCombine] eliminate sext and/or trunc if value has enough signbits.
Thu, Jun 3, 10:59 AM · Restricted Project
spatel added a comment to D103617: [InstCombine] eliminate sext and/or trunc if value has enough signbits.

As per 5a654bfeab588715fa6d266a7789484850605a18, did you add the test where we'd form trunc?

Thu, Jun 3, 7:48 AM · Restricted Project
spatel requested review of D103617: [InstCombine] eliminate sext and/or trunc if value has enough signbits.
Thu, Jun 3, 7:35 AM · Restricted Project

Wed, Jun 2

spatel committed rG0718ac706d4d: [SDAG] allow cast folding for vector sext-of-setcc with signed compare (authored by spatel).
[SDAG] allow cast folding for vector sext-of-setcc with signed compare
Wed, Jun 2, 12:05 PM
spatel committed rGcfe32dd03f16: [x86] add signed compare variant test for PR50055; NFC (authored by spatel).
[x86] add signed compare variant test for PR50055; NFC
Wed, Jun 2, 11:15 AM
spatel added a comment to D103180: [InstSimplify] Add constant fold for extractelement + splat for scalable vectors.

For the test where the index is presumed invalid (i32 -1), is that enforced somehow? Is there a hard limit somewhere that says i32 0xffffffff must be invalid?

I think the reason it says is invalid is because of the test:
uge(ValSVTy->getMinNumElements() -> unsigned greater or equal

Wed, Jun 2, 10:53 AM · Restricted Project
spatel committed rGede3982792df: [SDAG] allow more cast folding for vector sext-of-setcc (authored by spatel).
[SDAG] allow more cast folding for vector sext-of-setcc
Wed, Jun 2, 10:15 AM
spatel committed rG8349ac9aa944: [x86] add test for sext-of-setcc; NFC (authored by spatel).
[x86] add test for sext-of-setcc; NFC
Wed, Jun 2, 10:15 AM
spatel closed D103462: [SDAG] allow more cast folding for vector sext-of-setcc.
Wed, Jun 2, 10:15 AM · Restricted Project
spatel added inline comments to D103462: [SDAG] allow more cast folding for vector sext-of-setcc.
Wed, Jun 2, 8:49 AM · Restricted Project

Tue, Jun 1

spatel added inline comments to D103462: [SDAG] allow more cast folding for vector sext-of-setcc.
Tue, Jun 1, 1:36 PM · Restricted Project
spatel committed rG337854270023: [InstCombine] add tests for cast folding; NFC (authored by spatel).
[InstCombine] add tests for cast folding; NFC
Tue, Jun 1, 1:03 PM