Skip to content

Commit

Permalink
[RewriteStatepointsForGC] Fix debug assertion during derivable pointe…
Browse files Browse the repository at this point in the history
…r 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

llvm-svn: 237899
  • Loading branch information
igor-laevsky committed May 21, 2015
1 parent af1c9dd commit d83f697
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Expand Up @@ -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<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
}
Expand Down

0 comments on commit d83f697

Please sign in to comment.