search for: memdepresult

Displaying 20 results from an estimated 25 matches for "memdepresult".

2010 Jul 18
2
[LLVMdev] MemoryDependenceAnalysis Bug or Feature?
Yes, I'm not arguing that there is a dependence, just that it's not a clobber dependence. The case of a load is already considered earlier in that function and with isLoad == false it returns MemDepResult::getDef(). My question is: why should a read-only call (which yields AliasAnalysis::Ref and is handled in this code fragment) be any different from e.g. a load. Isn't a read-only call effectively just a series of loads from a memory-dependence perspective? In other words, why does this code...
2010 Jul 16
2
[LLVMdev] MemoryDependenceAnalysis Bug or Feature?
...sAnalysis::NoModRef: // If the call has no effect on the queried pointer, just ignore it. continue; case AliasAnalysis::Mod: // If we're in an invariant region, we can ignore calls that ONLY // modify the pointer. if (InvariantTag) continue; return MemDepResult::getClobber(Inst); case AliasAnalysis::Ref: // If the call is known to never store to the pointer, and if this is a // load query, we can safely ignore it (scan past it). if (isLoad) continue; +++ return MemDepResult::getDef(Inst); default: // Other...
2010 Jul 18
0
[LLVMdev] MemoryDependenceAnalysis Bug or Feature?
...Sun, Jul 18, 2010 at 2:50 AM, Marc de Kruijf <dekruijf at cs.wisc.edu> wrote: > Yes, I'm not arguing that there is a dependence, just that it's not a > clobber dependence.  The case of a load is already considered earlier in > that function and with isLoad == false it returns MemDepResult::getDef(). >  My question is:  why should a read-only call (which yields > AliasAnalysis::Ref and is handled in this code fragment) be any different > from e.g. a load.  Isn't a read-only call effectively just a series of loads > from a memory-dependence perspective? > In other w...
2010 Jul 17
0
[LLVMdev] MemoryDependenceAnalysis Bug or Feature?
...If the call has no effect on the queried pointer, just ignore it. >        continue; >      case AliasAnalysis::Mod: >        // If we're in an invariant region, we can ignore calls that ONLY >        // modify the pointer. >        if (InvariantTag) continue; >        return MemDepResult::getClobber(Inst); >      case AliasAnalysis::Ref: >        // If the call is known to never store to the pointer, and if this is > a >        // load query, we can safely ignore it (scan past it). >        if (isLoad) >          continue; > +++    return MemDepResult::getDef(I...
2011 Nov 01
0
[LLVMdev] MemoryDependenceAnalysis && MemDepResult
How can extract memory dependence among of instructions. I used the following code but it find only one dep for a instruction.I want to get all dependences for an instruction. MemoryDependenceAnalysis &mda = getAnalysis<MemoryDependenceAnalysis>(); MemDepResult mdr = mda.getDependency(inst); if (mdr.isDef()) { Instruction *dep = mdr.getInst(); if (isa<LoadInst>(inst)) { if (isa<StoreInst>(dep)) { //READ AFTER WRITE }...
2015 Aug 07
2
load instruction erroneously removed by GVN
...p30, i16 10, i32 10), !dbg !22 call fastcc void @check_i(i16 2, i16 undef, i16 48), !dbg !24 ret i16 0, !dbg !25 } So GVN has deemed %_tmp33 = load i16, i16* %_tmp32, align 1, !dbg !24 useless, and removed it, replacing %_tmp33 with undef. While examining the load, processLoad does MemDepResult Dep = MD->getDependency(L); [...] Instruction *DepInst = Dep.getInst(); [...] // If this load really doesn't depend on anything, then we must be loading an // undef value. This can happen when loading for a fresh allocation with no // intervening stores, for example....
2013 Jan 18
0
[LLVMdev] llvm getDependency() for ICMP instructions is UNKNOWN
Hello everyone ! I am trying to get the dependencies for the variables of ICMP instructions. Do you know if I can use an already existing method? I tried to use getDependency() method of class MemoryDependenceAnalysis. Does it work only for particular instruction types? Its definition is MemDepResult MemoryDependenceAnalysis::getDependency ( Instruction * QueryInst ) When I running my pass if ( !(Inst->getOpcode() == Instruction::ICmp) ) continue; ...... MemDepResult Res = MDA.getDependency(Inst); ..... if (!Res.isNonLocal()) { Deps[Inst].insert(std::make...
2011 Dec 13
1
[LLVMdev] Memory Dependence Analysis
...ver instructions in block for (BasicBlock::iterator i = b->begin(), e = b->end(); i != e; ++i) { errs() << *i << "\n"; // look for loads and stores if (i->mayReadFromMemory() || i->mayWriteToMemory()) { // get dependence for this instruction MemDepResult d = MDA->getDependency(i); if (d.isClobber()) errs() << "clobber " << *(d.getInst()); if (d.isDef()) errs() << "def " << *(d.getInst()); if (d.isNonLocal()) { errs() << "\tnot defined in this block\n"; BasicBlock *bb = i->ge...
2009 Jul 23
0
[LLVMdev] [PATCH] PR2218
...comments. Some other points: 1. I don't see a check that the load isn't volatile, please don't hack volatile loads. 2. The dependency check is relatively expensive, so please reorder it to be checked after the check for alloca: + Value* pointer = L->getPointerOperand(); + MemDepResult dep = MD.getDependency(L); + + // Require pointer to have local dependency. + if(!dep.getInst() || dep.isNonLocal()) + return false; + + // Require pointer to be an alloca. + if(!isa<AllocaInst>(pointer)) + return false; 3. In this code, does the argument also need to be sret, or...
2009 Jul 22
2
[LLVMdev] [PATCH] PR2218
Hello, This patch fixes PR2218. However, I'm not pretty sure that this optimization should be in MemCpyOpt. I think that GVN is good place as well. Regards -- Jakub Staszak -------------- next part -------------- A non-text attachment was scrubbed... Name: pr2218.patch Type: application/octet-stream Size: 6146 bytes Desc: not available URL:
2016 Jul 20
2
load instruction erroneously removed by GVN v2
...dences. The block it should skip > is bb2, not loop1. > There is another call for local dependences. If you ask for local > dependences, then non-local ones, as GVN does, there is no point in having > it go and look at the local ones again :) > > Look at how GVN calls this: > MemDepResult Dep = MD->getDependency(L); > > // If it is defined in another block, try harder. > if (Dep.isNonLocal()) > return processNonLocalLoad(L); > > (IE get local dependence, if there is none, go looking at non-local > dependences). > > > The list of non-local...
2010 Sep 23
2
[LLVMdev] Finding all values derived from a function argument
...mda->getNonLocalPointerDependency((*I)->getPointerOperand(), true, (*I)->getParent(), results); for(llvm::SmallVector<llvm::NonLocalDepResult, 16>::iterator II = results.begin(), EE = results.end(); !pick && II != EE; ++II) { const llvm::MemDepResult &result = II->getResult(); if(llvm::Instruction *dep = result.getInst()) { if(llvm::StoreInst *store = llvm::dyn_cast<llvm::StoreInst>(dep)) pick |= (stores.count(store) != 0); } } #else...
2016 Jul 20
2
load instruction erroneously removed by GVN v2
...ot loop1. >>> There is another call for local dependences. If you ask for local >>> dependences, then non-local ones, as GVN does, there is no point in having >>> it go and look at the local ones again :) >>> >>> Look at how GVN calls this: >>> MemDepResult Dep = MD->getDependency(L); >>> >>> // If it is defined in another block, try harder. >>> if (Dep.isNonLocal()) >>> return processNonLocalLoad(L); >>> >>> (IE get local dependence, if there is none, go looking at non-local >>...
2016 Jul 20
2
load instruction erroneously removed by GVN v2
Hello to whom this may concern, Versioned this as I saw identical title before. I'm compiling a clang project where I'm seeing GVN mess up and replace a load with a wrong def value. I am using LLVM-3.5, but the problem has been observed upto 3.8. To illustrate the problem, define i32 @main scalar.ph: <initialize [80 x i16] %dest> ... preheader: %index=0 br test, loop1, bb2
2016 Dec 28
1
Help for DeadStoreElimination cross-block dependence
Hi all, I am working on a project that requires LLVM DeadStoreElimination However, when I look through the code in Transforms/Scalar/DeadStoreElimination.cpp, I see the following: // Ignore any store where we can't find a local dependence. // FIXME: cross-block DSE would be fun. :) if (!InstDep.isDef() && !InstDep.isClobber()) continue; I have two questions on this
2015 Jan 21
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
...y, it doesn't know about any > // phi translation that may have happened along the way. > > // If we have a partial alias, then return this as a clobber for > the > // client to handle. > if (R == AliasAnalysis::PartialAlias) > return MemDepResult::getClobber(Inst); > #endif > > > > > > > Conservative new patch attached. > > > > > > > > (Note that i still updated the testcases, because we will *never* be > > able to legally return PartialAlias as they were written) > > > > Yes...
2013 Jan 21
2
[LLVMdev] llvm alloca dependencies
...ysis::getDependency` should be good with option "Def", but works only for stores, not for loads. Also I have a segfault when trying to use `MemoryDependenceAnalysis::getNonLocalPointerDependency` or `MemoryDependenceAnalysis::getPointerDependencyFrom` . When I try to check my result using MemDepResult::getDef(), the result for Load instructions is the same instruction ! So its depending on itself, that being weird since it is using a variable that is previously defined in the code. I also was no able to use DependenceAnalysis::depends() or getSrc() etc. The alternative of making the intersecti...
2015 Jan 21
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
...ng load directly, it doesn't know about any > > // phi translation that may have happened along the way. > > > > // If we have a partial alias, then return this as a clobber for the > > // client to handle. > > if (R == AliasAnalysis::PartialAlias) > > return MemDepResult::getClobber(Inst) ; > > #endif > > > > > > > > > > > Conservative new patch attached. > > > > > > > > > > > > (Note that i still updated the testcases, because we will *never* > > > be > > > able to legally...
2009 Jul 25
2
[LLVMdev] [PATCH] PR2218
...1. I don't see a check that the load isn't volatile, please don't > hack volatile loads. > > 2. The dependency check is relatively expensive, so please reorder > it to be checked after the check for alloca: > > + Value* pointer = L->getPointerOperand(); > + MemDepResult dep = MD.getDependency(L); > + > + // Require pointer to have local dependency. > + if(!dep.getInst() || dep.isNonLocal()) > + return false; > + > + // Require pointer to be an alloca. > + if(!isa<AllocaInst>(pointer)) > + return false; > > > 3. In t...
2015 Jan 23
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
...it doesn't know about any > > // phi translation that may have happened along the way. > > > > // If we have a partial alias, then return this as a clobber for > > the > > // client to handle. > > if (R == AliasAnalysis::PartialAlias) > > return MemDepResult::getClobber(Inst) ; > > #endif > > > > > > > > > > > Conservative new patch attached. > > > > > > > > > > > > (Note that i still updated the testcases, because we will *never* > > > be > > > able...