aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2022-05-17 20:34:19 -0700
committerPhilip Reames <preames@rivosinc.com>2022-05-17 20:45:14 -0700
commit9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7 (patch)
tree2f2affd100c974182e1d22ea001d8b559c938deb /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parentdca37af061fbe6590399dfb4e3fd3dda16d63144 (diff)
downloadllvm-9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7.zip
llvm-9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7.tar.gz
llvm-9b1e00738c5ddba681e17e5cb7c260d9afc4c3a7.tar.bz2
[BasicAA] Remove unneeded special case for malloc/calloc
This code pre-exists the generic handling for inaccessiblememonly. If we remove it and update one test with inaccessiblememonly, nothing else changes. Note that simply running O1 on that test would annotate malloc with the missing inaccessiblememonly.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index cfb3468..63d5842 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -994,20 +994,6 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
}
}
- // If the call is malloc/calloc like, we can assume that it doesn't
- // modify any IR visible value. This is only valid because we assume these
- // routines do not read values visible in the IR. TODO: Consider special
- // casing realloc and strdup routines which access only their arguments as
- // well. Or alternatively, replace all of this with inaccessiblememonly once
- // that's implemented fully.
- if (isMallocOrCallocLikeFn(Call, &TLI)) {
- // Be conservative if the accessed pointer may alias the allocation -
- // fallback to the generic handling below.
- if (getBestAAResults().alias(MemoryLocation::getBeforeOrAfter(Call), Loc,
- AAQI) == AliasResult::NoAlias)
- return ModRefInfo::NoModRef;
- }
-
// Ideally, there should be no need to special case for memcpy/memove
// intrinsics here since general machinery (based on memory attributes) should
// already handle it just fine. Unfortunately, it doesn't due to deficiency in