From 897d9bccdcde5348ffea6353370c93a64a8ad5b6 Mon Sep 17 00:00:00 2001 From: Igor Laevsky Date: Thu, 21 May 2015 13:02:14 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237899 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 06ade397cfa..1f1e745439f 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1944,12 +1944,12 @@ static void rematerializeLiveValues(CallSite CS, 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(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 }