mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Integrate the readonly/readnone logic more deeply
into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44487 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -198,8 +198,7 @@ bool ADCE::doADCE() {
|
||||
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
|
||||
Instruction *I = II++;
|
||||
if (CallInst *CI = dyn_cast<CallInst>(I)) {
|
||||
Function *F = CI->getCalledFunction();
|
||||
if (F && AA.onlyReadsMemory(F)) {
|
||||
if (AA.onlyReadsMemory(CI)) {
|
||||
if (CI->use_empty()) {
|
||||
BB->getInstList().erase(CI);
|
||||
++NumCallRemoved;
|
||||
|
||||
Reference in New Issue
Block a user