[Mlir-commits] [mlir] 4f37450 - [mlir][Inliner] Store the resolved call by-value instead of by-reference

River Riddle llvmlistbot at llvm.org
Wed Apr 15 17:46:39 PDT 2020


Author: River Riddle
Date: 2020-04-15T17:42:27-07:00
New Revision: 4f37450b2cb2dfc3c201a1b87f25062560ef3327

URL: https://github.com/llvm/llvm-project/commit/4f37450b2cb2dfc3c201a1b87f25062560ef3327
DIFF: https://github.com/llvm/llvm-project/commit/4f37450b2cb2dfc3c201a1b87f25062560ef3327.diff

LOG: [mlir][Inliner] Store the resolved call by-value instead of by-reference

This avoids asan failures as more calls may be added during inlining, invalidating the reference.

Differential Revision: https://reviews.llvm.org/D78258

Added: 
    

Modified: 
    mlir/lib/Transforms/Inliner.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp
index f797ca8f6484..9826f5ca187f 100644
--- a/mlir/lib/Transforms/Inliner.cpp
+++ b/mlir/lib/Transforms/Inliner.cpp
@@ -455,7 +455,7 @@ inlineCallsInSCC(Inliner &inliner, CGUseList &useList,
   // here as more calls may be added during inlining.
   bool inlinedAnyCalls = false;
   for (unsigned i = 0; i != calls.size(); ++i) {
-    ResolvedCall &it = calls[i];
+    ResolvedCall it = calls[i];
     LLVM_DEBUG({
       llvm::dbgs() << "* Considering inlining call: ";
       it.call.dump();


        


More information about the Mlir-commits mailing list