Page MenuHomePhabricator

nikic (Nikita Popov)
User

Projects

User does not belong to any projects.

User Details

User Since
May 5 2018, 9:37 AM (71 w, 5 d)

Recent Activity

Thu, Sep 12

nikic added inline comments to D67514: [SCEV] Add smin/umin support to getRangeRef.
Thu, Sep 12, 12:51 PM · Restricted Project
nikic accepted D67514: [SCEV] Add smin/umin support to getRangeRef.

LG. Note that umin/smin support is also missing from GetMinTrailingZerosImpl.

Thu, Sep 12, 12:44 PM · Restricted Project

Mon, Sep 9

nikic added a comment to D67339: [ConstantRange] add helper function addWithNoWrap.

The implementation looks correct to me. As @lebedev.ri mentioned we usually add exhaustive tests for ConstantRange methods nowadays. I'm not totally sure what should be tested here... I guess we should test a) conservative correctness (no wrong results produced) and b) tight bounds if the input sets are non-wrapping/non-sign-wrapping.

Mon, Sep 9, 1:41 PM · Restricted Project
nikic added a reviewer for D67339: [ConstantRange] add helper function addWithNoWrap: lebedev.ri.
Mon, Sep 9, 12:42 AM · Restricted Project

Sat, Sep 7

nikic committed rG314893cc4ba0: [X86] Fix pshuflw formation from repeated shuffle mask (PR43230) (authored by nikic).
[X86] Fix pshuflw formation from repeated shuffle mask (PR43230)
Sat, Sep 7, 5:15 AM
nikic committed rL371307: [X86] Fix pshuflw formation from repeated shuffle mask (PR43230).
[X86] Fix pshuflw formation from repeated shuffle mask (PR43230)
Sat, Sep 7, 5:13 AM
nikic closed D67314: [X86] Fix pshuflw formation from repeated shuffle mask (PR43230).
Sat, Sep 7, 5:13 AM · Restricted Project
nikic committed rGfdc6977ff3c0: [LVI] Look through extractvalue of insertvalue (authored by nikic).
[LVI] Look through extractvalue of insertvalue
Sat, Sep 7, 5:04 AM
nikic committed rG5d02f259c098: [X86] Add test for PR43230; NFC (authored by nikic).
[X86] Add test for PR43230; NFC
Sat, Sep 7, 5:03 AM
nikic committed rL371306: [LVI] Look through extractvalue of insertvalue.
[LVI] Look through extractvalue of insertvalue
Sat, Sep 7, 5:02 AM
nikic closed D67035: [LVI] Look through extractvalue of insertvalue.
Sat, Sep 7, 5:02 AM · Restricted Project
nikic committed rL371305: [X86] Add test for PR43230; NFC.
[X86] Add test for PR43230; NFC
Sat, Sep 7, 5:02 AM
nikic added a comment to D64869: [SCEV] get more accurate range for AddExpr with NW flag.

Can you please split off the ConstantRange addition into a separate revision?

Sat, Sep 7, 4:28 AM · Restricted Project
nikic created D67314: [X86] Fix pshuflw formation from repeated shuffle mask (PR43230).
Sat, Sep 7, 3:54 AM · Restricted Project

Fri, Sep 6

nikic added a comment to D56455: [ADT] Fix SmallDenseMap assertion with large InlineBuckets.

@atrick That invariant doesn't exist currently. If a SmallDenseMap with less than InlineBuckets elements is compacted, it will change to the large rep (with an allocation). After this change it will instead stay in the small rep (without an allocation).

Fri, Sep 6, 12:58 PM · Restricted Project

Sat, Aug 31

nikic added a comment to D20669: [ConstantRange / SCEV] generalize overflow checking for ConstantRanges.

ConstantRange has (efficient) overflow detection for most cases now, but signedMulMayOverflow() is still missing. We could add that and then replace makeGNWR uses.

Sat, Aug 31, 6:47 AM
nikic created D67035: [LVI] Look through extractvalue of insertvalue.
Sat, Aug 31, 3:07 AM · Restricted Project
nikic committed rGa91f72927967: [CVP] Add tests for simplified with.overflow + icmp; NFC (authored by nikic).
[CVP] Add tests for simplified with.overflow + icmp; NFC
Sat, Aug 31, 2:59 AM
nikic committed rGac5821395bb8: [LVI] Extract solveBlockValueExtractValue(); NFC (authored by nikic).
[LVI] Extract solveBlockValueExtractValue(); NFC
Sat, Aug 31, 2:59 AM
nikic committed rGb9e668f2e738: [CVP] Generate simpler code for elided with.overflow intrinsics (authored by nikic).
[CVP] Generate simpler code for elided with.overflow intrinsics
Sat, Aug 31, 2:59 AM
nikic committed rL370575: [LVI] Extract solveBlockValueExtractValue(); NFC.
[LVI] Extract solveBlockValueExtractValue(); NFC
Sat, Aug 31, 2:57 AM
nikic committed rL370574: [CVP] Add tests for simplified with.overflow + icmp; NFC.
[CVP] Add tests for simplified with.overflow + icmp; NFC
Sat, Aug 31, 2:57 AM
nikic committed rL370573: [CVP] Generate simpler code for elided with.overflow intrinsics.
[CVP] Generate simpler code for elided with.overflow intrinsics
Sat, Aug 31, 2:57 AM
nikic closed D67034: [CVP] Generate simpler code for elided with.overflow intrinsics.
Sat, Aug 31, 2:57 AM · Restricted Project
nikic created D67034: [CVP] Generate simpler code for elided with.overflow intrinsics.
Sat, Aug 31, 2:04 AM · Restricted Project
nikic added a comment to D19867: [LVI] Teach LVI to see through x.with.overflow calls.

@lebedev.ri Thanks! The problem here is that for these test cases CVP will convert the with.overflow intrinsic to a simple add/sub/mul together with insertvalue instructions. LVI can't see through extractvalue of insertvalue, which is why the followup optimization on the condition does not trigger (it would only happen on the next run). I'll look into fixing this.

Sat, Aug 31, 1:18 AM

Fri, Aug 30

nikic added a comment to D47927: [TargetLowering] Simplify expansion of S{ADD,SUB}O.

IMHO this should land as-is, and setcc folds can be implemented additionally if there are other places where they would be useful. My rationale would be that it is better to directly perform a simpler lowering than a complex lowering that then gets optimized. (Basically: If you can reduce the size of the implementing code and get a better result, then I think we should always be doing that.)

Fri, Aug 30, 6:02 AM · Restricted Project
nikic added a comment to D19867: [LVI] Teach LVI to see through x.with.overflow calls.

@lebedev.ri I believe I implemented something equivalent in the meantime, see https://github.com/llvm/llvm-project/blob/688183ec54482666e4faa6b6e1a83fe3ccc9372d/llvm/lib/Analysis/LazyValueInfo.cpp#L1099-L1105.

Fri, Aug 30, 12:49 AM

Sun, Aug 25

nikic committed rGaa71c977ba98: [SDAG] Fold umul_lohi with 0 or 1 multiplicand (authored by nikic).
[SDAG] Fold umul_lohi with 0 or 1 multiplicand
Sun, Aug 25, 1:04 AM
nikic committed rL369864: [SDAG] Fold umul_lohi with 0 or 1 multiplicand.
[SDAG] Fold umul_lohi with 0 or 1 multiplicand
Sun, Aug 25, 1:03 AM
nikic closed D66380: [SDAG] Fold umul_lohi with 0 or 1 multiplicand.
Sun, Aug 25, 1:03 AM · Restricted Project

Fri, Aug 23

nikic accepted D66608: [InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null.

LGTM

Fri, Aug 23, 12:33 AM · Restricted Project

Thu, Aug 22

nikic added a comment to D66608: [InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null.

As mentioned on the previous review, do we need to handle getelementptr inbounds {}, {}* %p, i32 %idx? That is, an inbounds GEP on a zero-sized type, which may be null for a non-zero index. It looks like this case is not handled in the existing code either though, so possibly this construction isn't legal (though I don't see anything to that effect in langref)?

Thu, Aug 22, 1:32 PM · Restricted Project

Aug 19 2019

nikic requested changes to D64869: [SCEV] get more accurate range for AddExpr with NW flag.

makeGuaranteedNoWrapRegion() cannot be used to constrain input ranges. E.g. consider that the RHS is [UINT_MAX-1, UINT_MAX]. Then the GWNR is just [0, 0], even though 1 would be a legal value for LHS (assuming the RHS is UINT_MAX-1).

Aug 19 2019, 3:10 PM · Restricted Project

Aug 18 2019

nikic added inline comments to D66380: [SDAG] Fold umul_lohi with 0 or 1 multiplicand.
Aug 18 2019, 6:15 AM · Restricted Project

Aug 17 2019

nikic created D66380: [SDAG] Fold umul_lohi with 0 or 1 multiplicand.
Aug 17 2019, 9:46 AM · Restricted Project
nikic added inline comments to D66338: [CGP] Drop no op intrinsic calls.
Aug 17 2019, 9:27 AM · Restricted Project

Aug 15 2019

nikic added a comment to D65148: [SimplifyCFG] Bump phi-node-folding-threshold from 2 to 3.

@lebedev.ri CVP can already determine that the condition is always true:

Aug 15 2019, 12:33 PM · Restricted Project

Aug 13 2019

nikic committed rG2a4f26b4c28a: [ValueTracking] Improve reverse assumption inference (authored by nikic).
[ValueTracking] Improve reverse assumption inference
Aug 13 2019, 10:18 AM
nikic committed rL368723: [ValueTracking] Improve reverse assumption inference.
[ValueTracking] Improve reverse assumption inference
Aug 13 2019, 10:18 AM
nikic closed D37215: [ValueTracking] improve reverse assumption inference.
Aug 13 2019, 10:18 AM · Restricted Project

Aug 12 2019

nikic planned changes to D65718: [LangRef] Document forward-progress requirement.

This documentation should probably be combined with the introduction of the requires_forward_progress attribute. The current codebase in not consistent in this regard (e.g. we have code in LoopDeletion specifically assuming no forward-progress requirement). It would be better to condition that kind of code on an attribute rather than drop it entirely and add it back later.

Aug 12 2019, 11:00 AM · Restricted Project

Aug 7 2019

nikic accepted D65544: [RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count.

LGTM as a starting point.

Aug 7 2019, 1:11 PM · Restricted Project
nikic updated the diff for D65718: [LangRef] Document forward-progress requirement.

Clarify that any synthetic side-effect is sufficient. Add llvm.sideeffect to infinite loop in phi example.

Aug 7 2019, 8:17 AM · Restricted Project
nikic edited reviewers for D37215: [ValueTracking] improve reverse assumption inference, added: spatel, lebedev.ri; removed: eddyb, nagisa.
Aug 7 2019, 8:03 AM · Restricted Project

Aug 6 2019

nikic accepted D65692: [ValueTracking] When calculating known bits for integer abs, make sure we're looking at a negate and not just any instruction with the nsw flag set..

LGTM

Aug 6 2019, 9:53 AM · Restricted Project

Aug 4 2019

nikic added a comment to D65718: [LangRef] Document forward-progress requirement.

I was under impression that the exact opposite was the status,
even if it wasn't consistently followed everywhere.

Aug 4 2019, 10:27 AM · Restricted Project
nikic created D65718: [LangRef] Document forward-progress requirement.
Aug 4 2019, 9:05 AM · Restricted Project
nikic added inline comments to D59978: [Attributor] Deduce the "no-return" attribute for functions.
Aug 4 2019, 6:04 AM · Restricted Project

Aug 2 2019

nikic added a comment to D65692: [ValueTracking] When calculating known bits for integer abs, make sure we're looking at a negate and not just any instruction with the nsw flag set..

As we only have a handful of SPF_ABS uses, it might make sense to introduce a separate abs flavor for the nsw case (which would also allow to handle the x-y case more accurately). SPF_PABS? SPF_ABS_NSW?

Aug 2 2019, 11:52 PM · Restricted Project
nikic committed rG4f8259bdbc59: [Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760) (authored by nikic).
[Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760)
Aug 2 2019, 11:50 PM
nikic committed rL367753: [Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).
[Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760)
Aug 2 2019, 11:47 PM
nikic closed D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).
Aug 2 2019, 11:47 PM · Restricted Project
nikic updated subscribers of D59978: [Attributor] Deduce the "no-return" attribute for functions.
Aug 2 2019, 11:39 PM · Restricted Project
nikic added inline comments to D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).
Aug 2 2019, 2:43 PM · Restricted Project
nikic updated the diff for D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).

Generate check lines.

Aug 2 2019, 2:38 PM · Restricted Project
nikic added inline comments to D59978: [Attributor] Deduce the "no-return" attribute for functions.
Aug 2 2019, 12:58 PM · Restricted Project
nikic added a comment to D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).

I've reduced the test case to a more reasonable size now...

Aug 2 2019, 12:27 PM · Restricted Project
nikic updated the diff for D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).

Also mark tTBB_JT and tTBH_JT as not duplicable.

Aug 2 2019, 12:14 PM · Restricted Project
nikic updated the diff for D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).

Simplify testcase.

Aug 2 2019, 11:59 AM · Restricted Project

Aug 1 2019

nikic created D65606: [ARM] Fix invalid symbol redefinition due to duplicated jumptable (PR42760).
Aug 1 2019, 1:47 PM · Restricted Project
nikic updated the diff for D37215: [ValueTracking] improve reverse assumption inference.

Remove isAssumeLikeIntrinsic handling, this is now handled by willreturn attributes on intrinsics.

Aug 1 2019, 12:56 PM · Restricted Project

Jul 30 2019

nikic accepted D65455: [FunctionAttrs] Annotate "willreturn" for AssumeLikeInst.

LGTM

Jul 30 2019, 10:56 AM · Restricted Project

Jul 29 2019

nikic added a comment to D65186: [MustExec] Add a generic "must-be-executed-context" explorer.

I'm not sure I understand the design/purpose of this utility. As far as I can see, the main benefit this has over a standard guaranteed-to-transfer loop is that it will be able to continue into a unique successor BB. As most must-exec uses I've seen (including your ArgPromotion example, as well as attribute deduction uses) are interested in instructions that must-exec from entry, this will not happen for non-degenerate CFGs (where BBs have not been merged).

Jul 29 2019, 2:14 PM · Restricted Project

Jul 28 2019

nikic added inline comments to D63046: [Attributor] Deduce "willreturn" function attribute.
Jul 28 2019, 2:24 AM · Restricted Project
nikic added a comment to D65150: [InstSimplify] Drop leftover "division-by-zero guard" around `@llvm.umul.with.overflow` overflow bit.

I think this is something of a recurring pattern (not so much the and/or forms, but the original phi/select form), where we have select (x != C1), y, C2, where it turns out that y[x = C1] == C2 and thus the whole expression reduces to y (same with phi's). We might want to invest in a general solution to this problem. Something along the lines of finding this kind of pattern, then checking y backwards for uses of x (to a small depth) and if we find them, replace x with C1, run InstSimplify over it and see if it reduces to C2 in the end.

Jul 28 2019, 2:19 AM · Restricted Project
nikic accepted D65144: [InstCombine] Fold '((%x * %y) u/ %x) != %y' to '@llvm.umul.with.overflow' + overflow bit extraction.

LGTM

Jul 28 2019, 2:08 AM · Restricted Project
nikic added inline comments to D65143: [InstCombine] Fold '(-1 u/ %x) u< %y' to '@llvm.umul.with.overflow' + overflow bit extraction.
Jul 28 2019, 2:00 AM · Restricted Project
nikic added inline comments to D63046: [Attributor] Deduce "willreturn" function attribute.
Jul 28 2019, 1:42 AM · Restricted Project

Jul 27 2019

nikic added inline comments to D65144: [InstCombine] Fold '((%x * %y) u/ %x) != %y' to '@llvm.umul.with.overflow' + overflow bit extraction.
Jul 27 2019, 1:18 PM · Restricted Project
nikic accepted D65143: [InstCombine] Fold '(-1 u/ %x) u< %y' to '@llvm.umul.with.overflow' + overflow bit extraction.

LGTM

Jul 27 2019, 1:01 PM · Restricted Project
nikic added inline comments to D63046: [Attributor] Deduce "willreturn" function attribute.
Jul 27 2019, 7:36 AM · Restricted Project

Jul 26 2019

nikic added a comment to D65151: [InstSimplify] Drop leftover "division-by-zero guard" around `@llvm.umul.with.overflow` inverted overflow bit.

There's some code related to this in GVN: https://github.com/llvm-mirror/llvm/blob/6c33c8991a6740ed8c87d5d3980a6469b415628d/lib/Transforms/Scalar/GVN.cpp#L333-L342 However it only works if an appropriate extractelement already exists.

Jul 26 2019, 8:58 AM · Restricted Project

Jul 23 2019

nikic added a comment to D64819: [UpdateTestChecks][Bug41532] Add handle of basic block names..

Maybe this could be put behind a flag and only used in the few instances where it is needed?

Jul 23 2019, 4:04 AM · Restricted Project
nikic added a comment to D64819: [UpdateTestChecks][Bug41532] Add handle of basic block names..

I'm not sure I see the value in this change in either implementation. Changing block names seem to be a pretty niche issue (haven't ever run into this myself) and I don't think handling them in update_test_checks is worth the churn it will cause.

Jul 23 2019, 4:01 AM · Restricted Project

Jul 21 2019

nikic added inline comments to rG1d149d08d3ae: [InstCombine] Remove insertRangeTest code that handles the equality case..
Jul 21 2019, 1:36 AM

Jul 20 2019

nikic added inline comments to D65017: [InstCombine] Teach foldOrOfICmps to allow icmp eq MIN_INT/MAX to be part of a range comparision. Similar for foldAndOfICmps.
Jul 20 2019, 2:37 AM · Restricted Project

Jul 17 2019

nikic added inline comments to D64533: [IndVars] Special case the problematic (gep inbounds p, iv == nullptr) problem (pr42357) .
Jul 17 2019, 1:13 PM
nikic added inline comments to D64869: [SCEV] get more accurate range for AddExpr with NW flag.
Jul 17 2019, 9:57 AM · Restricted Project

Jul 14 2019

nikic added inline comments to D37215: [ValueTracking] improve reverse assumption inference.
Jul 14 2019, 9:16 AM · Restricted Project
nikic updated the diff for D37215: [ValueTracking] improve reverse assumption inference.

Rebase over baseline tests.

Jul 14 2019, 9:15 AM · Restricted Project
nikic committed rG57190b3974fb: [InstCombine] Add assume context test; NFC (authored by nikic).
[InstCombine] Add assume context test; NFC
Jul 14 2019, 8:57 AM
nikic committed rL366021: [InstCombine] Add assume context test; NFC.
[InstCombine] Add assume context test; NFC
Jul 14 2019, 8:55 AM
nikic requested review of D37215: [ValueTracking] improve reverse assumption inference.

In the meantime additional users of isAssumeLikeIntrinsic() have been added, so I've switched this to call isAssumeLikeIntrinsic() from isGuaranteedToTransferExecutionToSuccessor() instead. Does this still look good?

Jul 14 2019, 8:47 AM · Restricted Project
nikic updated the diff for D37215: [ValueTracking] improve reverse assumption inference.

Rebase.

Jul 14 2019, 8:46 AM · Restricted Project
nikic commandeered D37215: [ValueTracking] improve reverse assumption inference.

Looks like this never landed...

Jul 14 2019, 8:42 AM · Restricted Project

Jul 13 2019

nikic added inline comments to D64533: [IndVars] Special case the problematic (gep inbounds p, iv == nullptr) problem (pr42357) .
Jul 13 2019, 1:40 PM
nikic added a comment to rL365999: [InstCombine] add tests for umin/umax via usub.sat; NFC.

These tests are already present higher up in the file. The transform you have in mind is unsound due to undef, see D63060.

Jul 13 2019, 6:06 AM

Jul 12 2019

nikic added a comment to D64523: [SLPVectorizer] Fix getSpillCost() calculation.

I guess it would be better if it visited all the BBs. You could traverse the VectorizableTree once and collect the BBs to be visited before you walk through them. Btw the TreeEntries now have operands, which can help you collect the BBs in the right order.

Jul 12 2019, 2:39 PM · Restricted Project
nikic added inline comments to D60351: [builtins] Reformat builtins with clang-format.
Jul 12 2019, 2:15 PM · Restricted Project, Restricted Project
nikic committed rGa205ebb09cc5: [builtins] Fix assembly in arm sync-ops.h (authored by nikic).
[builtins] Fix assembly in arm sync-ops.h
Jul 12 2019, 1:53 PM
nikic committed rL365957: [builtins] Fix assembly in arm sync-ops.h.
[builtins] Fix assembly in arm sync-ops.h
Jul 12 2019, 1:52 PM
nikic committed rG411fa4c0dfe1: [SystemZ] Fix addcarry of addcarry of const carry (PR42606) (authored by nikic).
[SystemZ] Fix addcarry of addcarry of const carry (PR42606)
Jul 12 2019, 1:04 PM
nikic committed rL365949: [SystemZ] Fix addcarry of addcarry of const carry (PR42606).
[SystemZ] Fix addcarry of addcarry of const carry (PR42606)
Jul 12 2019, 1:03 PM
nikic closed D64658: [SystemZ] Fix addcarry of addcarry of const carry (PR42606).
Jul 12 2019, 1:03 PM · Restricted Project
nikic created D64658: [SystemZ] Fix addcarry of addcarry of const carry (PR42606).
Jul 12 2019, 12:16 PM · Restricted Project
nikic added inline comments to D60351: [builtins] Reformat builtins with clang-format.
Jul 12 2019, 9:54 AM · Restricted Project, Restricted Project
Herald added a project to D52634: [WebAssembly] Add DBG_VALUE with local operands location in WebAssemblyExplicitLocals pass: Restricted Project.
Jul 12 2019, 7:39 AM · Restricted Project, debug-info

Jul 11 2019

nikic added inline comments to D64509: [SCEV] Compute exit count from overflow test.
Jul 11 2019, 1:57 PM · Restricted Project
nikic accepted D63733: [IndVars] Use exit count reasoning to discharge obviously untaken exits.

LGTM

Jul 11 2019, 1:21 PM · Restricted Project