mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
refactor the MemoryBuiltin analysis:
- provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc) - provide an API to compute the size and offset of an object pointed by Move a few clients (GVN, AA, instcombine, ...) to the new API. This implementation is a lot more aggressive than each of the custom implementations being replaced. Patch reviewed by Nick Lewycky and Chandler Carruth, thanks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -474,8 +474,7 @@ getPointerDependencyFrom(const AliasAnalysis::Location &MemLoc, bool isLoad,
|
||||
// a subsequent bitcast of the malloc call result. There can be stores to
|
||||
// the malloced memory between the malloc call and its bitcast uses, and we
|
||||
// need to continue scanning until the malloc call.
|
||||
if (isa<AllocaInst>(Inst) ||
|
||||
(isa<CallInst>(Inst) && extractMallocCall(Inst))) {
|
||||
if (isa<AllocaInst>(Inst) || isNoAliasFn(Inst)) {
|
||||
const Value *AccessPtr = GetUnderlyingObject(MemLoc.Ptr, TD);
|
||||
|
||||
if (AccessPtr == Inst || AA->isMustAlias(Inst, AccessPtr))
|
||||
|
||||
Reference in New Issue
Block a user