[llvm] [LoopInterchange] Make the entries of the Dependency Matrix unique (PR #116195)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 02:03:35 PST 2024


================
@@ -156,7 +158,13 @@ static bool populateDependencyMatrix(CharMatrix &DepMatrix, unsigned Level,
           Dep.push_back('I');
         }
 
-        DepMatrix.push_back(Dep);
+        // Make sure we only add unique entries to the dependency matrix.
+        std::string DepStr = std::string(Dep.begin(), Dep.end());
----------------
nikic wrote:

I think you should be able to create this as a StringRef. No need to allocate std::string here.

https://github.com/llvm/llvm-project/pull/116195


More information about the llvm-commits mailing list