search for: isinbounds

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

Did you mean: inbounds
2013 Oct 01
3
[LLVMdev] ScalarEvolution::createNodeForPHI
...>(BEValueV)) { // If the increment is an inbounds GEP, then we know the address // space cannot be wrapped around. We cannot make any guarantee // about signed or unsigned overflow because pointers are // unsigned but we may have a negative index from the base // pointer. if (GEP->isInBounds()) Flags = setFlags(Flags, SCEV::FlagNW); } //-------------------------------------------------------------------------// Is there any reason to not check also Sub operator in a similar way to the Add operator? //-------------------------------------------------------------------------// if (...
2015 May 04
2
[LLVMdev] Semantics of an Inbounds GetElementPtr
...non-edge conditions. You could teach it that anything that compares it against null are false after an inbounds: IE // If the GEP is inbounds, and this is address space 0, we know the pointer is // not null. if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) if (GEP->isInBounds() && GEP->getAddressSpace() == 0) { // Need a propagateInequality that replaces any equality checks against // null with false } However, you want to go further here: What you really want to do in this case is teach GVN that any inbounds gep that post-dominates a compa...
2013 Oct 02
0
[LLVMdev] ScalarEvolution::createNodeForPHI
...// If the increment is an inbounds GEP, then we know the address > // space cannot be wrapped around. We cannot make any guarantee > // about signed or unsigned overflow because pointers are > // unsigned but we may have a negative index from the base > // pointer. > if (GEP->isInBounds()) > Flags = setFlags(Flags, SCEV::FlagNW); > } > //-------------------------------------------------------------------------// > > Is there any reason to not check also Sub operator in a similar way to the Add > operator? > > //-----------------------------------------...
2011 Feb 10
0
[LLVMdev] ConstantExpr::replaceUsesOfWithOnConstant() function for llvm::GetElementPtrConstantExpr
...9 Replacement = ConstantExpr::getGetElementPtr(Pointer, 2130 &Indices[0], Indices.size()); -------------------------------------------------------------------------------------------> modified 2129 if(cast<GEPOperator>(this)->isInBounds()) 2130 Replacement = ConstantExpr::getInBoundsGetElementPtr(Pointer, 2131 &Indices[0], Indices.size()); 2132 else 2133 Replacement = ConstantExpr::getGetElementPtr(Pointer, 2134...
2015 May 04
2
[LLVMdev] Semantics of an Inbounds GetElementPtr
On Mon, May 4, 2015 at 9:40 AM, Nicholas White <n.j.white at gmail.com> wrote: > Thanks - that makes sense. It's interesting that at -O3 the optimizer > can't reduce the below though - I'll dig into it a bit and see if I > can make a patch that fixes it: I'm unsure what you expect to happen below. It's not quite the same testcase. GVN will PRE the loads, so you
2014 Apr 22
2
[LLVMdev] InstCombine strips the inBounds attribute in GetElementPtr ConstantExpr
I can't upload my program due to confidentiality, but the problem is obvious. At lib/Analysis/ConstantFolding.cpp:646 Constant *C = ConstantExpr::getGetElementPtr(Ops[0], NewIdxs); if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { if (Constant *Folded = ConstantFoldConstantExpression(CE, TD, TLI)) C = Folded; } The generated ConstantExpr C doesn't inherit the
2013 Oct 02
1
[LLVMdev] ScalarEvolution::createNodeForPHI
...inbounds GEP, then we know the address > > // space cannot be wrapped around. We cannot make any guarantee > > // about signed or unsigned overflow because pointers are > > // unsigned but we may have a negative index from the base > > // pointer. > > if (GEP->isInBounds()) > > Flags = setFlags(Flags, SCEV::FlagNW); > > } > > //-------------------------------------------------------------------------// > > > > Is there any reason to not check also Sub operator in a similar way > > to the Add > > operator? > > &gt...
2013 Nov 16
0
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
...n for large strides? Hi Renato, Did you figure this out? The code you’re pointing to should preserve NSW and NUW. It is only clearing NW. Here’s what I think should happen, without actually trying it myself: - createNodeForGEP notices that inbounds implies NSW SCEV::NoWrapFlags Wrap = GEP->isInBounds() ? SCEV::FlagNSW : SCEV::FlagAnyWrap - The array index should already be an AddRecExpr with NSW const SCEV *IndexS = getSCEV(Index); - createNodeForGEP attempts to scale the index using the NSW flag we picked up earlier const SCEV *LocalOffset = getMulExpr(IndexS, ElementSize, Wra...
2013 Nov 13
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
Hi folks, I'm trying to analyse this piece of IR: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %0 = shl nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i32* %b, i64 %0 %1 = load i32* %arrayidx, align 4, !tbaa !1 %add = add nsw i32 %1, %I %arrayidx3 = getelementptr