[llvm] 8555e59 - [NFC][MemDep] Remove unnecessary Worklist.clear

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 22:32:15 PDT 2022


Author: Max Kazantsev
Date: 2022-06-03T12:31:44+07:00
New Revision: 8555e59a7172a7597f5eeecdc620f293297e2294

URL: https://github.com/llvm/llvm-project/commit/8555e59a7172a7597f5eeecdc620f293297e2294
DIFF: https://github.com/llvm/llvm-project/commit/8555e59a7172a7597f5eeecdc620f293297e2294.diff

LOG: [NFC][MemDep] Remove unnecessary Worklist.clear

This execution path leads to return 'false' where the Worklist
will be deallocated anyways. No need to clear it separately.

Added: 
    

Modified: 
    llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 586cac6c3f206..a3a9f437a93ae 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -1195,7 +1195,6 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(
     // If we do process a large number of blocks it becomes very expensive and
     // likely it isn't worth worrying about
     if (Result.size() > NumResultsLimit) {
-      Worklist.clear();
       // Sort it now (if needed) so that recursive invocations of
       // getNonLocalPointerDepFromBB and other routines that could reuse the
       // cache value will only see properly sorted cache arrays.


        


More information about the llvm-commits mailing list