search for: getudivexpr

Displaying 8 results from an estimated 8 matches for "getudivexpr".

2020 Jul 30
2
Normalize a SCEV Expression
...e from a loop like: int64_t *p; for (int64_t i = 0; i < ...; ++i) p[i+2]... And assuming that I'm on a 64-bit machine. What I would like to do is normalize it like that, basically this: {2,+,1} i.e. map it to the index. Now, I tried to get the underlying element size of the pointer, then getUDivExpr(OriginalSCEV, ElementSize); But I don't get the desired SCEV back. Instead I'm getting: {16,+,8} \u 8, i.e. just adding udiv in the original expression. Why is this not simplified? Thanks, Stefanos Baziotis -------------- next part -------------- An HTML attachment was scrubbed... URL: &l...
2011 Nov 11
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...get something like 1*sizeof(long) const SCEV *Offset = SE->getMinusSCEV(PointerOneSCEV, PointerTwoSCEV); // Now we devide it by the element size Type *AllocTy = LoadOne->getType()->getAllocTy(); const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); if (const SCEVConstant *IntOffsetSCEV = dyn_cast<SCEVConstant>(OffsetInElements)) { ConstantInt *IntOffset = IntOffsetSCEV->getValue() return IntOffset; } else { return "This seems to be a complicated offset"; } const SCEV *OffsetInElements = SE-&...
2011 Nov 11
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Fri, 2011-11-11 at 23:55 +0100, Tobias Grosser wrote: > On 11/11/2011 11:36 PM, Hal Finkel wrote: > > On Thu, 2011-11-10 at 23:07 +0100, Tobias Grosser wrote: > >> On 11/08/2011 11:29 PM, Hal Finkel wrote: > >> Talking about this I looked again into ScalarEvolution. > >> > >> To analyze a load, you would do: > >> > >> LoadInst *Load
2011 Nov 15
3
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...ong) > const SCEV *Offset = SE->getMinusSCEV(PointerOneSCEV, PointerTwoSCEV); > > // Now we devide it by the element size > Type *AllocTy = LoadOne->getType()->getAllocTy(); > const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); > const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); > > if (const SCEVConstant *IntOffsetSCEV > = dyn_cast<SCEVConstant>(OffsetInElements)) { > ConstantInt *IntOffset = IntOffsetSCEV->getValue() > return IntOffset; > } else { > return "This seems to be a complicated offset"; &gt...
2020 Jul 31
2
Normalize a SCEV Expression
...> > p[i+2]... > > > > And assuming that I'm on a 64-bit machine. What I would like to do is > normalize it > > like that, basically this: {2,+,1} i.e. map it to the index. > > > > Now, I tried to get the underlying element size of the pointer, then > getUDivExpr(OriginalSCEV, ElementSize); But I don't get the desired SCEV > back. Instead I'm getting: > > {16,+,8} \u 8, i.e. just adding udiv in the original expression. > > > > > I guess the problem here is that the AddRec is missing overflow flags, > which means the expres...
2011 Nov 16
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...set = SE->getMinusSCEV(PointerOneSCEV, PointerTwoSCEV); > > > > // Now we devide it by the element size > > Type *AllocTy = LoadOne->getType()->getAllocTy(); > > const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); > > const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); > > > > if (const SCEVConstant *IntOffsetSCEV > > = dyn_cast<SCEVConstant>(OffsetInElements)) { > > ConstantInt *IntOffset = IntOffsetSCEV->getValue() > > return IntOffset; > > } else { > > return "This seems to...
2011 Nov 17
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...Ty_tss) { > + return 1; > + } else if (-off == VTy_tss) { > + return -1; > + } Braces not needed. > + } Did you think of using SE.getSizeOfExpr()? const SCEV *ElementSize = SE.getSizeofExpr(Iprt->getAllocType()) const SCEV *ElementOffset = SE.getUDivExpr(RelOffSCEV, ElementSize); if (const SCEVConstant *ConstOffset = dyn_cast<SCEVConstant>(ElementOffset)) return ConstOffset->getValue(); else return "Unknown offset" > + bool BBVectorize::vectorizePairs(unsigned vBits, BasicBlock&BB) { > + std::vector&...
2011 Nov 21
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...} else if (-off == VTy_tss) { > > + return -1; > > + } > Braces not needed. > > > + } > Did you think of using SE.getSizeOfExpr()? > > const SCEV *ElementSize = SE.getSizeofExpr(Iprt->getAllocType()) > const SCEV *ElementOffset = SE.getUDivExpr(RelOffSCEV, ElementSize); > > if (const SCEVConstant *ConstOffset = > dyn_cast<SCEVConstant>(ElementOffset)) > return ConstOffset->getValue(); > > else > return "Unknown offset" > > > + bool BBVectorize::vectorizePairs(unsigned vBits...