Page MenuHomePhabricator
Feed Advanced Search

Today

nikic added a reviewer for D70376: [LVI] Restructure caching: reames.

@efriedma When using AssertingVH a bunch of the existing JT/CVP tests start to fail, so I think we don't need a test case that produces an actual collision in the map.

Tue, Nov 19, 4:51 AM · Restricted Project

Yesterday

nikic created D70376: [LVI] Restructure caching.
Mon, Nov 18, 1:03 AM · Restricted Project
nikic reopened D69914: [LVI] Normalize pointer behavior.

Reopening as this has been reverted in rG7a3ad48d6de0e79a92361252a815b894565b9a0f.

Mon, Nov 18, 12:57 AM · Restricted Project

Thu, Nov 14

nikic added a comment to rG7a3ad48d6de0: Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken….

Assuming this is a legitimate mis-compile, the root cause might be the same as D70103, just for the pointer dereference cache, rather than overdefined value cache.

Thu, Nov 14, 1:29 PM

Sat, Nov 9

nikic created D70044: [LVI] Make results independent of query order (WIP).
Sat, Nov 9, 6:15 AM · Restricted Project

Fri, Nov 8

nikic added inline comments to D69686: [LVI][CVP] Use block value in getPredicateAt().
Fri, Nov 8, 1:02 PM · Restricted Project
nikic updated the diff for D69686: [LVI][CVP] Use block value in getPredicateAt().

Rebase over changes to pointer handling.

Fri, Nov 8, 11:57 AM · Restricted Project
nikic committed rG885a05f48a5d: Reapply [LVI] Normalize pointer behavior (authored by nikic).
Reapply [LVI] Normalize pointer behavior
Fri, Nov 8, 11:21 AM
nikic committed rG43ae5f4386b8: Revert "[LVI] Normalize pointer behavior" (authored by nikic).
Revert "[LVI] Normalize pointer behavior"
Fri, Nov 8, 9:31 AM
nikic added a reverting change for rG15bc4dc9a894: [LVI] Normalize pointer behavior: rG43ae5f4386b8: Revert "[LVI] Normalize pointer behavior".
Fri, Nov 8, 9:31 AM
nikic committed rG15bc4dc9a894: [LVI] Normalize pointer behavior (authored by nikic).
[LVI] Normalize pointer behavior
Fri, Nov 8, 9:03 AM
nikic closed D69914: [LVI] Normalize pointer behavior.
Fri, Nov 8, 9:03 AM · Restricted Project
nikic accepted D69994: [ConstantRange] Add umul_sat()/smul_sat() methods.

LGTM

Fri, Nov 8, 5:56 AM · Restricted Project
nikic accepted D69993: [APInt] Add saturating truncation methods.

I feel like the names are a bit inconsistent with existing uadd_sat etc, but utrunc_sat seems worse than truncUSat, so let's just go with it...

Fri, Nov 8, 1:25 AM · Restricted Project

Thu, Nov 7

nikic accepted D69960: [ConstantRange] Add `ushl_sat()`/`sshl_sat()` methods..

LGTM

Thu, Nov 7, 2:26 PM · Restricted Project
nikic added a comment to D69960: [ConstantRange] Add `ushl_sat()`/`sshl_sat()` methods..

Unlike ConstantRange::shl(), these are precise.

Thu, Nov 7, 12:50 PM · Restricted Project
nikic updated the diff for D69914: [LVI] Normalize pointer behavior.

Make eraseValueFromPerBlockValueCache a free function, add todo.

Thu, Nov 7, 8:27 AM · Restricted Project
nikic accepted D69942: [ConstantRange][LVI] Use overflow flags from `sub` to constrain the range.

LGTM

Thu, Nov 7, 5:14 AM · Restricted Project
nikic added inline comments to D69914: [LVI] Normalize pointer behavior.
Thu, Nov 7, 12:31 AM · Restricted Project

Wed, Nov 6

nikic added inline comments to D69918: [CR][WIP] Add `subWithNoWrap()` method.
Wed, Nov 6, 1:56 PM · Restricted Project
nikic accepted D69918: [CR][WIP] Add `subWithNoWrap()` method.

LGTM. addWithNoWrap() has some more tests for specific inputs, but I don't think we really need them here.

Wed, Nov 6, 1:56 PM · Restricted Project
nikic added a comment to D69918: [CR][WIP] Add `subWithNoWrap()` method.

If that's the case, I'm not sure whether or not we should rely on that, it seems rather subtle.

Now that i've added EXPECT_EQ(CR.isEmptySet(), AllOverflow); test,
that seems like a safe assumption to me? Seems like a net win to me.

Wed, Nov 6, 1:15 PM · Restricted Project
nikic added a comment to D69918: [CR][WIP] Add `subWithNoWrap()` method.

@lebedev.ri I suspect this is due to the intersection with the raw add() range. Maybe it happens that the intersection between add() and [MAX, MAX] is always empty in the case where the overflow check triggers? Can you try removing that intersection and see what happens?

Wed, Nov 6, 12:50 PM · Restricted Project
nikic added inline comments to D67339: [ConstantRange] add helper function addWithNoWrap.
Wed, Nov 6, 12:02 PM · Restricted Project
nikic accepted D69695: [LoopPred] Fix two subtle issues found by inspection.

LGTM

Wed, Nov 6, 12:02 PM · Restricted Project
nikic created D69914: [LVI] Normalize pointer behavior.
Wed, Nov 6, 11:04 AM · Restricted Project

Tue, Nov 5

nikic added a comment to D69686: [LVI][CVP] Use block value in getPredicateAt().

Can you give some context on the problem you're trying to solve? This doesn't look quite right, but maybe with some context I can make a suggestion as to how to approach cleanly?

Tue, Nov 5, 2:53 AM · Restricted Project
nikic added a comment to D69686: [LVI][CVP] Use block value in getPredicateAt().

@lebedev.ri Weirdly that does not match the results I get:

Tue, Nov 5, 2:41 AM · Restricted Project

Sun, Nov 3

nikic updated the diff for D54749: Saturating float to int casts: Basics [1/n].

Rebase.

Sun, Nov 3, 3:05 AM · Restricted Project
nikic updated the diff for D58644: [InstCombine] Optimize overflow check base on uadd.with.overflow result (PR40846).

Rebase and use new matchers.

Sun, Nov 3, 2:29 AM · Restricted Project

Sat, Nov 2

nikic added a comment to D69686: [LVI][CVP] Use block value in getPredicateAt().

What correctness testing was done, test-suite?

Sat, Nov 2, 8:06 AM · Restricted Project

Fri, Nov 1

nikic committed rG98245d081e72: [JT][CVP] Regenerate test checks, again (authored by nikic).
[JT][CVP] Regenerate test checks, again
Fri, Nov 1, 2:34 PM
nikic added a comment to D69686: [LVI][CVP] Use block value in getPredicateAt().

@lebedev.ri I added a couple of comments on the JT tests, probably after you opened the tab ^^ The reason for the diffs is that we now evaluate the condition to a constant, while previously these were phi threaded. It has a bit of an odd effect here, but I would expect that in practice folding a branch completely is generally preferable.

Fri, Nov 1, 9:58 AM · Restricted Project

Thu, Oct 31

nikic added inline comments to D69687: [NFCI] Rerun update_test_checks.py on all Analysis tests.
Thu, Oct 31, 3:39 PM · Restricted Project
nikic added inline comments to D69686: [LVI][CVP] Use block value in getPredicateAt().
Thu, Oct 31, 2:52 PM · Restricted Project
nikic created D69686: [LVI][CVP] Use block value in getPredicateAt().
Thu, Oct 31, 2:43 PM · Restricted Project
nikic committed rG1cfe3e6df9fa: [LVI] Regenerate test checks; NFC (authored by nikic).
[LVI] Regenerate test checks; NFC
Thu, Oct 31, 2:34 PM
nikic committed rG2f8a43e1997d: [CVP] Add tests for icmp on local ranges; NFC (authored by nikic).
[CVP] Add tests for icmp on local ranges; NFC
Thu, Oct 31, 2:34 PM
nikic added a comment to D68819: [Utils] Allow update_test_checks to check function arguments.

Ugh, I now see that this is actually intentional. I think any changes to the default behavior of update_tests_checks should be discussed on llvm-dev in the future. These kinds of changes are quite disruptive and in this case imho don't pay for themselves.

Thu, Oct 31, 2:34 PM · Restricted Project
nikic added a comment to D68819: [Utils] Allow update_test_checks to check function arguments.

Even if --function-signature is not present, this generates spurious diffs:

Thu, Oct 31, 2:15 PM · Restricted Project

Wed, Oct 30

nikic added inline comments to D69571: [ValueTracking] Allow context-sensitive nullness check for non-pointers.
Wed, Oct 30, 1:26 AM · Restricted Project

Mon, Oct 28

nikic added a comment to D69244: [InstCombine] Extra combine for uadd_sat.

@lebedev.ri Might use m_UAddWithOverflow(), iirc it handles all these edge cases.

Mon, Oct 28, 6:56 AM · Restricted Project
nikic added inline comments to D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.
Mon, Oct 28, 1:10 AM · Restricted Project

Sun, Oct 27

nikic accepted D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.

LGTM, though I'd like a second opinion on the PatternMatch additions from @lebedev.ri or @spatel.

Sun, Oct 27, 3:32 PM · Restricted Project

Sat, Oct 26

nikic added a comment to D69387: [ConstantRange] Add toKnownBits() method.

So, this looks fine, but I'm still not quite clear on the use-case. I thought this might be useful for computing ranges of bit ops, but now that I see the implementation, I don't think that's the case. We just get the known top bits, but lose any information about the low bits (which can still be used, though in an operation-specific manner).

Sat, Oct 26, 2:09 PM · Restricted Project
nikic added a comment to D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802).

I initially thought that there might be a cache invalidation problem here, because we recently started to take nowrap flags into account when computing ranges, and we might end up reasoning based on the no longer present nowrap flags. In particular I had something like this in mind:

Sat, Oct 26, 9:17 AM · Restricted Project
nikic accepted D69439: [APInt] Introduce APIntOps::GetPositionOfMostSignificantDifferentBit().

LGTM, though I'd suggest a more compact name.

Sat, Oct 26, 8:53 AM · Restricted Project

Fri, Oct 25

nikic added inline comments to D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802).
Fri, Oct 25, 2:10 PM · Restricted Project
nikic added inline comments to D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802).
Fri, Oct 25, 2:02 PM · Restricted Project
nikic added inline comments to D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802).
Fri, Oct 25, 12:29 PM · Restricted Project
nikic added inline comments to D69387: [ConstantRange] Add toKnownBits() method.
Fri, Oct 25, 9:20 AM · Restricted Project

Thu, Oct 24

nikic added a comment to D69387: [ConstantRange] Add toKnownBits() method.

Possible use case: A better implementation for binaryAnd/binaryOr. Conceptually, those can be implemented by doing:

Thu, Oct 24, 12:07 PM · Restricted Project
nikic added inline comments to D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.
Thu, Oct 24, 12:00 PM · Restricted Project
nikic accepted D69398: [APInt} Add saturating left-shift ops.

LGTM

Thu, Oct 24, 11:55 AM · Restricted Project
nikic accepted D69397: [APInt} Add saturating multiply ops.

LGTM

Thu, Oct 24, 11:43 AM · Restricted Project
nikic added inline comments to D69387: [ConstantRange] Add toKnownBits() method.
Thu, Oct 24, 9:58 AM · Restricted Project
nikic added inline comments to D69387: [ConstantRange] Add toKnownBits() method.
Thu, Oct 24, 9:58 AM · Restricted Project

Wed, Oct 23

nikic accepted D69321: [LVI][CVP] LazyValueInfoImpl::solveBlockValueBinaryOp(): use no-wrap flags from `add` op.

Thanks for looking into this! I think we should definitely do this change as the functionality already exists, but based on the numbers, it probably doesn't make sense to invest in NoWrap implementations of other operators unless we also need them for something else (SCEV was the original motivation here).

Wed, Oct 23, 1:05 AM · Restricted Project

Tue, Oct 22

nikic resigned from D68360: PR41162 Implement LKK remainder and divisibility algorithms [urem].
Tue, Oct 22, 1:54 PM · Restricted Project
nikic added a comment to D68717: [Codegen] More add_sat and sub_sat promotion.

This needs a rebase after D68926. Possibly some parts of it will no longer make sense (though the USUBSAT case at least should still be a win...)

Tue, Oct 22, 1:44 PM · Restricted Project
nikic added a parent revision for D69252: [InstCombine] Canonicalize sadd.with.overflow to sadd.sat: D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.
Tue, Oct 22, 1:26 PM · Restricted Project
nikic added a child revision for D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat: D69252: [InstCombine] Canonicalize sadd.with.overflow to sadd.sat.
Tue, Oct 22, 1:26 PM · Restricted Project
nikic added inline comments to D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.
Tue, Oct 22, 1:26 PM · Restricted Project

Mon, Oct 21

nikic accepted D69277: [CVP] No-wrap deduction for `shl`.

LGTM. Small overall effect, but I think it still makes sense for completeness, and as far as I know this shouldn't be particularly expensive.

Mon, Oct 21, 1:17 PM · Restricted Project
nikic added inline comments to D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat.
Mon, Oct 21, 11:45 AM · Restricted Project
nikic accepted D68651: [InstCombine] Signed saturation patterns.

LG

Mon, Oct 21, 11:42 AM · Restricted Project

Oct 20 2019

nikic committed rGb1b7a2f7b63d: [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0 (authored by nikic).
[InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0
Oct 20 2019, 1:19 PM
nikic closed D69224: [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0.
Oct 20 2019, 1:19 PM · Restricted Project
nikic committed rL375374: [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0.
[InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0
Oct 20 2019, 1:19 PM
nikic created D69224: [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0.
Oct 20 2019, 12:57 PM · Restricted Project
nikic committed rGc08666abafb4: [InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC (authored by nikic).
[InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC
Oct 20 2019, 12:49 PM
nikic committed rL375372: [InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC.
[InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFC
Oct 20 2019, 12:48 PM
nikic accepted D69217: [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support.

LGTM

Oct 20 2019, 12:13 PM · Restricted Project
nikic added inline comments to D69217: [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support.
Oct 20 2019, 12:04 PM · Restricted Project
nikic committed rG926dae33ba65: [ConstantRange] Optimize nowrap region test, remove redundant tests; NFC (authored by nikic).
[ConstantRange] Optimize nowrap region test, remove redundant tests; NFC
Oct 20 2019, 12:02 PM
nikic committed rL375369: [ConstantRange] Optimize nowrap region test, remove redundant tests; NFC.
[ConstantRange] Optimize nowrap region test, remove redundant tests; NFC
Oct 20 2019, 12:02 PM
nikic added inline comments to D69217: [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support.
Oct 20 2019, 9:29 AM · Restricted Project

Oct 19 2019

nikic added inline comments to D69217: [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support.
Oct 19 2019, 3:32 PM · Restricted Project
nikic accepted D69009: [IndVars] Eliminate loop exits with equivalent exit counts.

LG

Oct 19 2019, 2:55 PM · Restricted Project
nikic added inline comments to D69217: [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` support.
Oct 19 2019, 2:00 PM · Restricted Project
nikic added inline comments to D69009: [IndVars] Eliminate loop exits with equivalent exit counts.
Oct 19 2019, 1:32 PM · Restricted Project

Oct 18 2019

nikic added a comment to D68672: [APInt] Rounding right-shifts.

I'm not sure i can parse that, fall out?

Oct 18 2019, 12:12 PM · Restricted Project
nikic added inline comments to D69009: [IndVars] Eliminate loop exits with equivalent exit counts.
Oct 18 2019, 11:44 AM · Restricted Project
nikic accepted D69183: [CVP] When proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try to prove other no-wrap.

LGTM, we already do the same for div/rem.

Oct 18 2019, 11:16 AM · Restricted Project
nikic accepted D69006: [SCEV] Simplify umin/max of zext and sext of the same value.

LGTM

Oct 18 2019, 10:58 AM · Restricted Project

Oct 17 2019

nikic added inline comments to D69009: [IndVars] Eliminate loop exits with equivalent exit counts.
Oct 17 2019, 12:08 PM · Restricted Project
nikic added a comment to D69006: [SCEV] Simplify umin/max of zext and sext of the same value.

Could you please also include test coverage for the smin/smax case? Otherwise this looks good.

Oct 17 2019, 11:59 AM · Restricted Project

Oct 16 2019

nikic added a comment to D68651: [InstCombine] Signed saturation patterns.

@lebedev.ri I believe that pattern is principally handled in canonicalizeSaturatedAdd(), it just depends on the way in which the overflow check is expressed. Apparently it checks for the ~X u< Y ? -1 : X + Y pattern, but not for (X + Y) < X ? -1 : X + Y, which is our canonical non-constant add overflow check form, I think.

Oct 16 2019, 1:27 PM · Restricted Project
nikic added a comment to D69006: [SCEV] Simplify umin/max of zext and sext of the same value.

A bit surprised that this pattern is not picked up by instcombine: https://godbolt.org/z/hP4wyd

Oct 16 2019, 11:42 AM · Restricted Project
nikic added a comment to D69006: [SCEV] Simplify umin/max of zext and sext of the same value.

As the property you're ultimately using here is that zext x u<= sext x, would it make more sense to include that as part of isKnownViaNonRecursiveReasoning()? A corollary is that sext x s<= zext x.

Oct 16 2019, 11:33 AM · Restricted Project

Oct 14 2019

nikic accepted D68926: [Codegen] Alter the default promotion for add_sat and sub_sat.

Overall this still looks good, and some of the tests (like AArch64/*_sat.ll) would look better than they do right now with appropriate zeroext/signext attributes. I think it's reasonable to expect that extension will often be free when doing promotion.

Oct 14 2019, 12:37 PM · Restricted Project

Oct 12 2019

nikic added a comment to D68672: [APInt] Rounding right-shifts.

I'd like to try to extend ConstantRange::makeGuaranteedNoWrapRegion()
to deal with Instruction::Shl so i believe i need rounding right shifts.

Oct 12 2019, 3:10 PM · Restricted Project
nikic added a comment to D68844: [SCEV] Compute exit count for simple floating point IVs.

I'm wondering if we can't extend Float2Int to convert these to operations on integers. I'm assuming it currently doesn't due to a FIXME: Handle select and phi nodes.

Oct 12 2019, 3:38 AM · Restricted Project
nikic accepted D68717: [Codegen] More add_sat and sub_sat promotion.

The signed cases are a bit of a mixed bag in isolation, but will probably do better inside a loop or with adjacent instructions.

Oct 12 2019, 3:20 AM · Restricted Project
nikic added a comment to D68651: [InstCombine] Signed saturation patterns.

Generally looks good to me, I'm only wondering whether the trunc is the right place to start the match. Starting from the min/max we could match a larger set of patterns, in particular those where the result of the saturation is still extended to a larger type -- for example doing a 16-bit saturating add but continuing with a 32-bit result.

Oct 12 2019, 2:18 AM · Restricted Project

Oct 10 2019

nikic added inline comments to D68811: [CVP] Remove a masking operation if range information implies it's a noop.
Oct 10 2019, 12:57 PM · Restricted Project
nikic committed rL374376: Request commit access for nikic.
Request commit access for nikic
Oct 10 2019, 9:29 AM

Oct 8 2019

nikic added a comment to D68651: [InstCombine] Signed saturation patterns.

@hsaito We've put quite a bit of effort into making sure that saturating intrinsics optimize as well or better than expanded IR sequences, which is why they are indeed considered canonical IR. Whether intrinsics are canonical needs to be decided on a case by case basis, there is no general rule about it. For example the unsigned mul overflow intrinsic is considered canonical (for obvious reasons -- the alternatives tend to be much more expensive) and is formed in InstCombine. Unsigned add/sub overflow on the other hand are not, because they tends to optimize much worse than expanded IR. Those are formed in CGP instead.

Oct 8 2019, 2:52 PM · Restricted Project
nikic accepted D68643: [Codegen] Alter the default promotion for add_sat and sub_sat.

This still uses the existing promotion when the promoted add/sub_sat is legal. In many situations (but not all) it would probably be better to just perform the new promotion.

Oct 8 2019, 1:14 PM · Restricted Project
nikic accepted D68654: [CVP} Replace SExt with ZExt if the input is known-non-negative.

LGTM. Especially as we already have the corresponding ashr to lshr transform, this seems like an obvious extension.

Oct 8 2019, 12:12 PM · Restricted Project