[PATCH] D18100: Simplify Logic in IRMover

Tobias Edler von Koch via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 14:43:36 PST 2016


tobiasvk added a subscriber: tobiasvk.

================
Comment at: lib/Linker/IRMover.cpp:1058
@@ -1058,11 +1057,3 @@
 
-  // just missing from map
-  if (ShouldLink) {
-    auto I = ValueMap.find(SGV);
-    if (I != ValueMap.end())
-      return cast<Constant>(I->second);
-
-    I = AliasValueMap.find(SGV);
-    if (I != AliasValueMap.end())
-      return cast<Constant>(I->second);
-  }
+  /// First verify if the value hasn't been alreay linked.
+  auto I = ValueMap.find(SGV);
----------------
Why can you drop "if (ShouldLink)"? That seems unrelated to merging the two maps.


http://reviews.llvm.org/D18100





More information about the llvm-commits mailing list