search for: isknownnonnul

Displaying 9 results from an estimated 9 matches for "isknownnonnul".

Did you mean: isknownnonnull
2015 Feb 12
2
[LLVMdev] RFC: attribute for a pointer which is dereferenceable xor null
...ove a load outside a loop if it might introduce a fault. Knowing that a pointer is deferefenceable(N) at a location (i.e. the loop preheader) allows us to satisfy this constraint. In the near term, we can simply add a case in the dereferenceability analysis that combines the new attribute and isKnownNonNull. This won't be too effective out of the box, but will enable testing with llvm.assumes and might catch some cases. I will probably also add a case to look at the controlling branch to the loop preheader since in practice that tends to be where a unswitched null check would live. Longer...
2013 Jan 15
2
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
...checking a - // comparison of an alloca address to another object. We can rip off all - // inbounds GEP operations, even if they are variable. - LHSPtr = LHSPtr->stripInBoundsOffsets(); - if (llvm::isIdentifiedObject(LHSPtr)) { - RHSPtr = RHSPtr->stripInBoundsOffsets(); - if (llvm::isKnownNonNull(LHSPtr) || llvm::isKnownNonNull(RHSPtr)) { - // If both sides are different identified objects, they aren't equal - // unless they're null. - if (LHSPtr != RHSPtr && llvm::isIdentifiedObject(RHSPtr) && - Pred == CmpInst::ICMP_EQ) + // icmp <objec...
2013 Jan 16
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
...are irrevelant for (in)equality tests. + Value *LHSPtr = LHS->stripPointerCasts(); + Value *RHSPtr = RHS->stripPointerCasts(); + if (LHSPtr == RHSPtr) + return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Predicate)); + if (isa<ConstantPointerNull>(RHSPtr) && isKnownNonNull(LHSPtr)) { + if (ICmpInst::isEquality(Pred)) + return ConstantInt::get(ITy, Predicate != ICmpInst::ICMP_EQ); + } + if (ICmpInst::isEquality(Pred)) { + // RHS is not a null pointer and the objects are different. + // Remove inbound GEPs and determine the object types. +...
2012 Dec 12
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 1:26 PM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote: > On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote: >> > Is that >> > assumption violated if I explicitly cast away const and pass the result >> > to a function with NoAlias argument? >> >> Not immediately, no. It means that you can't access the
2012 Dec 12
3
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote: > > Is that > > assumption violated if I explicitly cast away const and pass the result > > to a function with NoAlias argument? > > Not immediately, no. It means that you can't access the constant > pointer's pointee directly within the noalias argument's scope. Access > to that object must go
2015 Jul 23
0
[LLVMdev] some superoptimizer results
...standpoint since in *theory* this is just returning a result the known bits could have figured out otherwise. - At least for me, the ability to reason about non-nullness is more important than the value of particular bits. If I were to start this from scratch, I'd probably start by making isKnownNonNull dominating condition aware. Given that starting place, a separate pass (i.e. not-instcomine) might make far more sense and help to decouple the code more. - I suspect that many of the cases found by this approach could be implemented as special cases. To use nullness as an example, recogniz...
2015 Jul 23
4
[LLVMdev] some superoptimizer results
> I just noticed: most of the results in this batch seem to be about exploiting `[zs]ext i1` having cost 1 > in order to replace a select of cost 3. > Could you do a run where select has cost 1 and [zs]ext i1 (and trunc to i1) has cost 2 or 3? I tried this (or something quite similar) earlier and it caused Souper to introduce *a lot* of selects. So the problem is that Souper's
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay, Thanks, I saw this flag and it's definitely should be considered, but it appeared to me to be static characteristic of target platform. I'm not sure how appropriate it would be to change its value from a front-end. It says "Has", while optional flag would rather say "Uses" meaning that implementation cares about floating point exceptions. Regards, Sergey
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
...change the resulting value. bool isSafeToSpeculativelyExecute(const Value *V, - const DataLayout *TD = nullptr); + const DataLayout *TD = nullptr, + bool HonorFPExceptions = false); /// isKnownNonNull - Return true if this pointer couldn't possibly be null by /// its definition. This returns true for allocas, non-extern-weak globals diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index f208bb7..9a67a82 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/An...