search for: underlyingpointer

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

2018 May 22
2
DSE: Remove useless stores between malloc & memset
...dering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->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)...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
..., DenseMap<Instruction *, size_t> *InstrOrdering) { // Must be a strlen. LibFunc Func; Function *Callee = CI->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-&g...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...dering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->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)...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...e = CI->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; >>>> errs() << "before\n"; >>>&gt...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...// Must be a strlen. > LibFunc Func; > Function *Callee = CI->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; > errs() << "before\n"; > if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { <---...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...ion *, size_t> *InstrOrdering) { // Must be a strlen. LibFunc Func; Function *Callee = CI->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; errs() << "before\n"; if (memoryIsNotModifiedBetween(UnderlyingPointer, CI, AA)) { <--- CRASH errs() << &qu...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...;> LibFunc Func; >> Function *Callee = CI->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; >> errs() << "before\n"; >> if (memoryIsNotModifiedBetween(UnderlyingPoi...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...LibFunc Func; > Function *Callee = CI->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; > errs() << "before\n"; > if (memoryIsNotModifiedBetween(Underly...
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
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...t;> Function *Callee = CI->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; >>> errs() << "before\n"; >>> if (memoryIsNotModif...