History log of /llvm-project/llvm/unittests/Analysis/ValueTrackingTest.cpp (Results 51 – 75 of 126)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 0edf9995 28-Dec-2021 Sanjay Patel <spatel@rotateright.com>

[Analysis] allow caller to choose signed/unsigned when computing constant range

We should not lose analysis precision if an 'add' has both no-wrap
flags (nsw and nuw) compared to just one or the oth

[Analysis] allow caller to choose signed/unsigned when computing constant range

We should not lose analysis precision if an 'add' has both no-wrap
flags (nsw and nuw) compared to just one or the other.

This patch is modeled on a similar construct that was added with
D59386.

I don't think it is possible to expose a problem with an unsigned
compare because of the way this was coded (nuw is handled first).

InstCombine has an assert that fires with the example from:
https://github.com/llvm/llvm-project/issues/52884
...because it was expecting InstSimplify to handle this kind of
pattern with an smax.

Fixes #52884

Differential Revision: https://reviews.llvm.org/D116322

show more ...


# a56803b8 20-Dec-2021 Sanjay Patel <spatel@rotateright.com>

[Analysis] fix cast in ValueTracking to allow constant expression

The test would crash because a non-instruction negate op made it in here.

Fixes #51506


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4
# 8e4f7b74 24-Sep-2021 David Sherwood <david.sherwood@arm.com>

[Analysis] Fix another issue when querying vscale attributes on functions

There are several places in the code that are currently broken where
we assume an Instruction is always a member of a BasicB

[Analysis] Fix another issue when querying vscale attributes on functions

There are several places in the code that are currently broken where
we assume an Instruction is always a member of a BasicBlock that
lives in a Function. This is a problem specifically when
attempting to get the vscale_range attribute. This patch adds checks
that an Instruction's parent also has a parent!

I've added a test for a function-less @llvm.vscale intrinsic call here:

unittests/Analysis/ValueTrackingTest.cpp

show more ...


# c2634fc6 21-Sep-2021 David Sherwood <david.sherwood@arm.com>

[Analysis] Fix issues when querying vscale attributes on functions

There are several places in the code that are currently broken as
they assume an Instruction always has a parent Function when
atte

[Analysis] Fix issues when querying vscale attributes on functions

There are several places in the code that are currently broken as
they assume an Instruction always has a parent Function when
attempting to get the vscale_range attribute. This patch adds checks
that an Instruction has a parent.

I've added a test for a parentless @llvm.vscale intrinsic call here:

unittests/Analysis/ValueTrackingTest.cpp

Differential Revision: https://reviews.llvm.org/D110158

show more ...


# 5131037e 21-Sep-2021 Florian Hahn <flo@fhahn.com>

[ValueTracking,VectorCombine] Allow passing DT to computeConstantRange.

isValidAssumeForContext can provide better results with access to the
dominator tree in some cases. This patch adjusts compute

[ValueTracking,VectorCombine] Allow passing DT to computeConstantRange.

isValidAssumeForContext can provide better results with access to the
dominator tree in some cases. This patch adjusts computeConstantRange to
allow passing through a dominator tree.

The use VectorCombine is updated to pass through the DT to enable
additional scalarization.

Note that similar APIs like computeKnownBits already accept optional dominator
tree arguments.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D110175

show more ...


Revision tags: llvmorg-13.0.0-rc3
# 0a22510f 13-Sep-2021 Florian Mayer <fmayer@google.com>

[value-tracking] see through returned attribute.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D109675


Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1
# b58eda39 02-Aug-2021 Chang-Sun Lin, Jr <chang-sun.lin.jr@intel.com>

[ValueTracking] Fix computeConstantRange to use "may" instead of "always" semantics for llvm.assume

ValueTracking should allow for value ranges that may satisfy
llvm.assume, instead of restricting t

[ValueTracking] Fix computeConstantRange to use "may" instead of "always" semantics for llvm.assume

ValueTracking should allow for value ranges that may satisfy
llvm.assume, instead of restricting the ranges only to values that
will always satisfy the condition.

Differential Revision: https://reviews.llvm.org/D107298

show more ...


Revision tags: llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4
# 4c7f820b 26-Mar-2021 Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>

Update @llvm.powi to handle different int sizes for the exponent

This can be seen as a follow up to commit 0ee439b705e82a4fe20e2,
that changed the second argument of __powidf2, __powisf2 and
__powit

Update @llvm.powi to handle different int sizes for the exponent

This can be seen as a follow up to commit 0ee439b705e82a4fe20e2,
that changed the second argument of __powidf2, __powisf2 and
__powitf2 in compiler-rt from si_int to int. That was to align with
how those runtimes are defined in libgcc.
One thing that seem to have been missing in that patch was to make
sure that the rest of LLVM also handle that the argument now depends
on the size of int (not using the si_int machine mode for 32-bit).
When using __builtin_powi for a target with 16-bit int clang crashed.
And when emitting libcalls to those rtlib functions, typically when
lowering @llvm.powi), the backend would always prepare the exponent
argument as an i32 which caused miscompiles when the rtlib was
compiled with 16-bit int.

The solution used here is to use an overloaded type for the second
argument in @llvm.powi. This way clang can use the "correct" type
when lowering __builtin_powi, and then later when emitting the libcall
it is assumed that the type used in @llvm.powi matches the rtlib
function.

One thing that needed some extra attention was that when vectorizing
calls several passes did not support that several arguments could
be overloaded in the intrinsics. This patch allows overload of a
scalar operand by adding hasVectorInstrinsicOverloadedScalarOpd, with
an entry for powi.

Differential Revision: https://reviews.llvm.org/D99439

show more ...


# a993bb08 16-Jun-2021 Sanjay Patel <spatel@rotateright.com>

[ValueTracking] add FP intrinsics to test for propagatesPoison; NFC

I'm not sure what behavior we want if the FP environment is
not default (also not sure if there's a way to enumerate
the full list

[ValueTracking] add FP intrinsics to test for propagatesPoison; NFC

I'm not sure what behavior we want if the FP environment is
not default (also not sure if there's a way to enumerate
the full list of intrinsics programmatically), but currently
these are all defaulting to 'false' (doesn't propagate).

show more ...


# 572e506b 16-Jun-2021 Sanjay Patel <spatel@rotateright.com>

[ValueTracking] add tests for propagatesPoison with FP ops; NFC

Verify that this matches the behavior in InstSimplify:
D104383 / ce95200b7942

We still need to add code/tests for FP intrinsics.


# 4ad59f9a 07-Jun-2021 Simon Pilgrim <llvm-dev@redking.me.uk>

ValueTrackingTest.cpp - Pass DataLayout by reference. NFCI.


# d4d80a29 14-May-2021 Benjamin Kramer <benny.kra@googlemail.com>

Bump googletest to 1.10.0


# 5ae5d25e 14-Apr-2021 Sanjay Patel <spatel@rotateright.com>

[ValueTracking] match negative-stepping non-zero recurrence

This is pulled out of D100408.

This avoids a regression that would be exposed by making the
calling code from InstSimplify more efficient.


# 989445f4 13-Apr-2021 Sanjay Patel <spatel@rotateright.com>

[ValueTracking] add unit test for isKnownNonZero(); NFC

We call various value tracking APIs from within -instsimplify,
so I don't think this is visible in a larger test.


# df0b97da 31-Mar-2021 Juneyoung Lee <aqjune@gmail.com>

[ValueTracking] Add with.overflow intrinsics to poison analysis functions

This is a patch teaching ValueTracking that `s/u*.with.overflow` intrinsics do not
create undef/poison and they propagate po

[ValueTracking] Add with.overflow intrinsics to poison analysis functions

This is a patch teaching ValueTracking that `s/u*.with.overflow` intrinsics do not
create undef/poison and they propagate poison.
I couldn't write a nice example like the one with ctpop; ValueTrackingTest.cpp were simply updated
to check these instead.
This patch helps reducing regression while fixing https://llvm.org/pr49688 .

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D99671

show more ...


Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init
# 5d12b976 22-Jan-2021 Nikita Popov <nikita.ppv@gmail.com>

[ValueTracking] Don't assume readonly function will return

This is similar to D94106, but for the
isGuaranteedToTransferExecutionToSuccessor() helper. We should not
assume that readonly functions wi

[ValueTracking] Don't assume readonly function will return

This is similar to D94106, but for the
isGuaranteedToTransferExecutionToSuccessor() helper. We should not
assume that readonly functions will return, as this is only true for
mustprogress functions (in which case we already infer willreturn).
As with the DCE change, for now continue assuming that readonly
intrinsics will return, as not all target intrinsics have been
annotated yet.

Differential Revision: https://reviews.llvm.org/D95288

show more ...


Revision tags: llvmorg-11.1.0-rc2
# 051ec9f5 16-Jan-2021 Nikita Popov <nikita.ppv@gmail.com>

[ValueTracking] Strengthen impliesPoison reasoning

Split impliesPoison into two recursive walks, one over V, the
other over ValAssumedPoison. This allows us to reason about poison
implications in a

[ValueTracking] Strengthen impliesPoison reasoning

Split impliesPoison into two recursive walks, one over V, the
other over ValAssumedPoison. This allows us to reason about poison
implications in a number of additional cases that are important
in practice. This is a generalized form of D94859, which handles
the cmp to cmp implication in particular.

Differential Revision: https://reviews.llvm.org/D94866

show more ...


# f8cece18 13-Jan-2021 Markus Lavin <markus.lavin@ericsson.com>

[ValueTracking] Fix one s/dyn_cast/dyn_cast_or_null/

Handle if Constant::getAggregateElement() returns nullptr in
canCreateUndefOrPoison().

Differential Revision: https://reviews.llvm.org/D94494


Revision tags: llvmorg-11.1.0-rc1
# 29f8628d 05-Jan-2021 Juneyoung Lee <aqjune@gmail.com>

[Constant] Add containsPoisonElement

This patch

- Adds containsPoisonElement that checks existence of poison in constant vector elements,
- Renames containsUndefElement to containsUndefOrPoisonElem

[Constant] Add containsPoisonElement

This patch

- Adds containsPoisonElement that checks existence of poison in constant vector elements,
- Renames containsUndefElement to containsUndefOrPoisonElement to clarify its behavior & updates its uses properly

With this patch, isGuaranteedNotToBeUndefOrPoison's tests w.r.t constant vectors are added because its analysis is improved.

Thanks!

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D94053

show more ...


# abbef2fd 04-Jan-2021 Juneyoung Lee <aqjune@gmail.com>

[ValueTracking] isGuaranteedNotToBePoison should return true on undef

This is a one-line fix to isGuaranteedNotToBePoison to return true if
undef is given.


# 0f2c1801 28-Dec-2020 Juneyoung Lee <aqjune@gmail.com>

[ValueTracking] Implement impliesPoison

This PR adds impliesPoison(ValAssumedPoison, V) that returns true if V is
poison under the assumption that ValAssumedPoison is poison.

For example, impliesPo

[ValueTracking] Implement impliesPoison

This PR adds impliesPoison(ValAssumedPoison, V) that returns true if V is
poison under the assumption that ValAssumedPoison is poison.

For example, impliesPoison('icmp X, 10', 'icmp X, Y') return true because
'icmp X, Y' is poison if 'icmp X, 10' is poison.

impliesPoison can be used for sound optimization of select, as discussed in
D77868.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D78152

show more ...


# 860199df 27-Dec-2020 Juneyoung Lee <aqjune@gmail.com>

[ValueTracking] Use m_LogicalAnd/Or to look into conditions

This patch updates isImpliedCondition/isKnownNonZero to look into select form of
and/or as well.

See llvm.org/pr48353 and D93065 for more

[ValueTracking] Use m_LogicalAnd/Or to look into conditions

This patch updates isImpliedCondition/isKnownNonZero to look into select form of
and/or as well.

See llvm.org/pr48353 and D93065 for more context

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D93845

show more ...


# eca40c36 27-Dec-2020 Juneyoung Lee <aqjune@gmail.com>

[ValueTracking] Add unit tests for isKnownNonZero, isImpliedCondition (NFC)


Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2
# 8351f9b5 27-Nov-2020 Nikita Popov <nikita.ppv@gmail.com>

[ValueTracking] Fix assert on shufflevector of pointers

In this case getScalarSizeInBits() is not well-defined. Use the
existing TyBits variable that handles vectors of pointers correctly.


Revision tags: llvmorg-11.0.1-rc1
# 565f4e72 20-Oct-2020 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>

[ValueTracking] Add more tests for alignment assume bundles

I noticed that alignment was no longer inferred as well after I last merged
our CHERI fork from upstream. I opened this review before seei

[ValueTracking] Add more tests for alignment assume bundles

I noticed that alignment was no longer inferred as well after I last merged
our CHERI fork from upstream. I opened this review before seeing that D88669
already fixes the same problem, so this commit simply adds the new test that
I added as part of this change.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89830

show more ...


123456