search for: memoryisnotmodifiedbetween

Displaying 12 results from an estimated 12 matches for "memoryisnotmodifiedbetween".

2018 May 22
2
DSE: Remove useless stores between malloc & memset
...st = CI->getOperand(0); > Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; > if (isStringFromCalloc(Dst, TLI)) > return false; > errs() << "before\n"; > if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { <--- CRASH > errs() << "after\n"; > } > return false; > } > > Do you know what is wrong here? I followed the "example" (in eliminateNoopStore) how to use "memoryIsNotModifiedBetween". > > > Thank...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...056135d175216 (opt+0x6b0216) #15 0x00007f6e348051c1 __libc_start_main /build/glibc-itYbWN/glibc-2.26/csu/../csu/libc-start.c:342:0 #16 0x000056135d1f404a (opt+0x72f04a) 2018-05-22 23:32 GMT+02:00 Friedman, Eli <efriedma at codeaurora.org>: > It looks like the memoryIsNotModifiedBetween assumes the second argument > is a store, or some other instruction supported by MemoryLocation::get. If > you're passing in something else, you'll have to compute the MemoryLocation > some other way. > > (Generally, if you're asking a question about an assertion, please...
2018 May 21
2
DSE: Remove useless stores between malloc & memset
memoryIsNotModifiedBetween is precisely the sort of expensive walk we shouldn't be doing... I'm surprised it hasn't caused any serious issues yet.  Ideally, what we should be doing is using MemorySSA to find a dependency from the memset: if the closest dependency is the malloc, there aren't any stores bet...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
It looks like the memoryIsNotModifiedBetween assumes the second argument is a store, or some other instruction supported by MemoryLocation::get.  If you're passing in something else, you'll have to compute the MemoryLocation some other way. (Generally, if you're asking a question about an assertion, please include the whole s...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...tart_main /build/glibc-itYbWN/glibc-2.26 >> /csu/../csu/libc-start.c:342:0 >> #16 0x000056135d1f404a (opt+0x72f04a) >> >> >> 2018-05-22 23:32 GMT+02:00 Friedman, Eli <efriedma at codeaurora.org>: >> >>> It looks like the memoryIsNotModifiedBetween assumes the second argument >>> is a store, or some other instruction supported by MemoryLocation::get. If >>> you're passing in something else, you'll have to compute the MemoryLocation >>> some other way. >>> >>> (Generally, if you're aski...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...rlen) return false; Value *Dst = CI->getOperand(0); Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); if (!UnderlyingPointer) return false; if (isStringFromCalloc(Dst, TLI)) return false; errs() << "before\n"; if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { <--- CRASH errs() << "after\n"; } return false; } Do you know what is wrong here? I followed the "example" (in eliminateNoopStore) how to use "memoryIsNotModifiedBetween". Thank you for advice 2018-05-21 21:06 GMT+02...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...Func_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = > dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; > if (!isStringFromCalloc(Dst, TLI)) > return false; > > if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { > Value *Len = ConstantInt::get(CI->getType(), 0); > CI->replaceAllUsesWith(Len); > CI->eraseFromParent(); > return true; > } > return false; > } > > > ------------------------------------------------------ > That IR is still w...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...c(*Callee, Func) || !TLI->has(Func) || Func != LibFunc_strlen) return false; Value *Dst = CI->getOperand(0); Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); if (!UnderlyingPointer) return false; if (!isStringFromCalloc(Dst, TLI)) return false; if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { Value *Len = ConstantInt::get(CI->getType(), 0); CI->replaceAllUsesWith(Len); CI->eraseFromParent(); return true; } return false; } ------------------------------------------------------ That IR is still wrongly transformed with this code to ret i32 0 (but t...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...0x00007f6e348051c1 __libc_start_main /build/glibc-itYbWN/glibc-2. > 26/csu/../csu/libc-start.c:342:0 > #16 0x000056135d1f404a (opt+0x72f04a) > > > 2018-05-22 23:32 GMT+02:00 Friedman, Eli <efriedma at codeaurora.org>: > >> It looks like the memoryIsNotModifiedBetween assumes the second argument >> is a store, or some other instruction supported by MemoryLocation::get. If >> you're passing in something else, you'll have to compute the MemoryLocation >> some other way. >> >> (Generally, if you're asking a question about...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...Func_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = > dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; > if (!isStringFromCalloc(Dst, TLI)) > return false; > > if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { > Value *Len = ConstantInt::get(CI->getType(), 0); > CI->replaceAllUsesWith(Len); > CI->eraseFromParent(); > return true; > } > return false; > } > > > ------------------------------------------------------ > That IR is still w...
2018 May 21
0
DSE: Remove useless stores between malloc & memset
"memory accesses between the malloc and the memset without an expensive linear scan of the block/function" (1) do you mean just use "memoryIsNotModifiedBetween" function in DSE to check it? x = maloc(..); memset(x, ...) (2) GetUnderlyingObject would give me Value * (from malloc) ? Also another case: memset(s, 0, len); // len > 1 return strlen(s); // optimize to 0 (3) How to check memset and strlen pairs? I have a strlen call,...
2018 May 17
3
DSE: Remove useless stores between malloc & memset
Hello, I would like to find a way to do this removal properly. I found DSE and "eliminateNoopStore" can be useful for this thing. What I mean? int *test = malloc(15 * sizeof(int)); test[10] = 12; < ----- remove this store memset(test,0,sizeof(int) * 15); I already checked the function "eliminateNoopStore". Looks good, I think I would be to get the value ("A") we