search for: isstringfromcalloc

Displaying 10 results from an estimated 10 matches for "isstringfromcalloc".

2018 May 22
2
DSE: Remove useless stores between malloc & memset
* if (isStringFromCalloc(Dst, TLI)) should be if (!isStringFromCalloc(Dst, TLI)) but still asserting... 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > Can you help a bit? > > I try to work with DSE but I got the following assert: > opt: /home/xbolva00/LLVM/llvm/include/llv...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...g a question about an assertion, please >>> include the whole stack trace; it's hard to guess what's happening >>> otherwise.) >>> >>> -Eli >>> >>> >>> On 5/22/2018 2:16 PM, Dávid Bolvanský wrote: >>> >>> * if (isStringFromCalloc(Dst, TLI)) should be if >>> (!isStringFromCalloc(Dst, TLI)) >>> but still asserting... >>> >>> 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: >>> >>>> Can you help a bit? >>>> >>>> I t...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...ibFunc(*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; > } > > > -------...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...I->getCalledFunction(); if (!TLI->getLibFunc(*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 sti...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...MemoryLocation > some other way. > > (Generally, if you're asking a question about an assertion, please include > the whole stack trace; it's hard to guess what's happening otherwise.) > > -Eli > > > On 5/22/2018 2:16 PM, Dávid Bolvanský wrote: > > * if (isStringFromCalloc(Dst, TLI)) should be if > (!isStringFromCalloc(Dst, TLI)) > but still asserting... > > 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > >> Can you help a bit? >> >> I try to work with DSE but I got the following assert: >> opt...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...ibFunc(*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; > } > > > -------...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...ething 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 stack trace; it's hard to guess what's happening otherwise.) -Eli On 5/22/2018 2:16 PM, Dávid Bolvanský wrote: > * if (isStringFromCalloc(Dst, TLI)) should be if > (!isStringFromCalloc(Dst, TLI)) > but still asserting... > > 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com > <mailto:david.bolvansky at gmail.com>>: > > Can you help a bit? > > I try to work with D...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...> (Generally, if you're asking a question about an assertion, please >> include the whole stack trace; it's hard to guess what's happening >> otherwise.) >> >> -Eli >> >> >> On 5/22/2018 2:16 PM, Dávid Bolvanský wrote: >> >> * if (isStringFromCalloc(Dst, TLI)) should be if >> (!isStringFromCalloc(Dst, TLI)) >> but still asserting... >> >> 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: >> >>> Can you help a bit? >>> >>> I try to work with DSE but I got th...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...(); if (!TLI->getLibFunc(*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; 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...
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 between the memset and the malloc.  (But we aren't using MemorySSA in