search for: isknownnonzero

Displaying 6 results from an estimated 6 matches for "isknownnonzero".

2017 Dec 14
2
[RFC] Add TargetTransformInfo::isAllocaPtrValueNonZero and let ValueTracking depend on TargetTransformInfo
Some optimizations depend on whether alloca instruction always has non-zero value. Currently, this checking is done by isKnownNonZero() in ValueTracking, and it assumes alloca in address space 0 always has non-zero value but alloca in non-zero address spaces does not always have non-zero value. However, this assumption is incorrect for certain targets. For example, amdgcn---amdgiz target has alloca in address space 5, and its al...
2017 Dec 14
3
[RFC] Add TargetTransformInfo::isAllocaPtrValueNonZero and let ValueTracking depend on TargetTransformInfo
...lueTracking functions (and maximally retains our ability to process IR without backends compiled in). Thanks again, Hal On 12/14/2017 02:32 PM, Liu, Yaxun (Sam) via llvm-dev wrote: Some optimizations depend on whether alloca instruction always has non-zero value. Currently, this checking is done by isKnownNonZero() in ValueTracking, and it assumes alloca in address space 0 always has non-zero value but alloca in non-zero address spaces does not always have non-zero value. However, this assumption is incorrect for certain targets. For example, amdgcn---amdgiz target has alloca in address space 5, and its al...
2010 Apr 17
2
[LLVMdev] SCEV expression for ICmpInst
...to B > A, and transform A >= B to A > B - 1 (or A + 1> B), and A <= B to A < B + 1 (or A - 1 < B). Furthermore, we can transform A > B to A - B > 0 and A != B to A - B != 0, so the SCEV for conditions will be very simple. As there are already some functions such as "isKnownNonZero" in ScalarEvolution, so we can compute these condition easily. With the SCEV for conditions, we may write more meaningful code: SCEVEQCond *S = SE.getCondition(some_icmp_instruction); if (some_cond.isAlwaysTrue(SE)) ... do some thing ... else ... do some others thing ... Dose this make...
2012 Apr 09
0
[LLVMdev] new methods for ScalarEvolutions
Working on a dependence test, I wrote some code that looked like this: const SCEV *delta = ...; bool deltaMaybeZero = !SE->isKnownNonZero(delta); bool deltaMaybePositive = !SE->isKnownNonPositive(delta); bool deltaMaybeNegative = !SE->isKnownNonNegative(delta); I'm really happy with the power of the SCEVs, letting me answer these questions, but I'm unhappy with how the code reads, namely the double negatives. Perh...
2010 Apr 17
1
[LLVMdev] SCEV expression for ICmpInst
...nsform A >= B to A > B - 1 (or A + 1> B), and A <= B to A < > B + 1 (or A - 1 < B). Furthermore, we can transform A > B to A - B > 0 and A > != B to A - B != 0, so the SCEV for conditions will be very simple. > > As there are already some functions such as "isKnownNonZero" in > ScalarEvolution, so we can compute these condition easily. > > With the SCEV for conditions, we may write more meaningful code: > > SCEVEQCond *S = SE.getCondition(some_icmp_instruction); > > if (some_cond.isAlwaysTrue(SE)) > ... do some thing ... > else &g...
2020 Feb 18
8
The semantics of nonnull attribute
Hello all, LangRef says it is undefined behavior to pass null to a nonnull argument (`call f(nonnull null);`), but the semantics is too strong for a few existing optimizations. To support these, we can relax the semantics so `f(nonnull null)` is equivalent to `f(poison)`, but (A) it again blocks another set of optimizations, and (B) this makes the semantics of nonnull deviate from other