[llvm] r237899 - [RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization

Igor Laevsky igmyrj at gmail.com
Thu May 21 06:02:14 PDT 2015


Author: igor.laevsky
Date: Thu May 21 08:02:14 2015
New Revision: 237899

URL: http://llvm.org/viewvc/llvm-project?rev=237899&view=rev
Log:
[RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization

Correct assertion would be that there is no other uses from chain we are currently cloning. It is ok to have other uses of values not from this chain.

Differential Revision: http://reviews.llvm.org/D9882


Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=237899&r1=237898&r2=237899&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu May 21 08:02:14 2015
@@ -1944,12 +1944,12 @@ static void rematerializeLiveValues(Call
           assert(LastValue);
           ClonedValue->replaceUsesOfWith(LastValue, LastClonedValue);
 #ifndef NDEBUG
-          // Assert that cloned instruction does not use any instructions
-          // other than LastClonedValue
-          for (auto OpValue: ClonedValue->operand_values()) {
-            if (isa<Instruction>(OpValue))
-              assert(OpValue == LastClonedValue &&
-                     "unexpected use found in rematerialized value");
+          // Assert that cloned instruction does not use any instructions from
+          // this chain other than LastClonedValue
+          for (auto OpValue : ClonedValue->operand_values()) {
+            assert(std::find(ChainToBase.begin(), ChainToBase.end(), OpValue) ==
+                       ChainToBase.end() &&
+                   "incorrect use in rematerialization chain");
           }
 #endif
         }





More information about the llvm-commits mailing list