Don't use std::set_difference when the two sets are sorted differently. Compute

the difference manually instead.

This allows GVNPRE to produce correct analysis for the example in the GVNPRE
paper.

llvm-svn: 37425
This commit is contained in:
Owen Anderson 2007-06-04 23:34:56 +00:00
parent 3df5299f94
commit 3c9d8eef21
1 changed files with 6 additions and 7 deletions

View File

@ -420,13 +420,12 @@ bool GVNPRE::runOnFunction(Function &F) {
s_ins, ExprLT());
anticIn.clear();
std::insert_iterator<std::set<Value*, ExprLT> > antic_ins(anticIn,
anticIn.begin());
std::set_difference(S.begin(), S.end(),
generatedTemporaries[BB].begin(),
generatedTemporaries[BB].end(),
antic_ins,
ExprLT());
for (std::set<Value*, ExprLT>::iterator I = S.begin(), E = S.end();
I != E; ++I) {
if (generatedTemporaries[BB].find(*I) == generatedTemporaries[BB].end())
anticIn.insert(*I);
}
clean(VN, anticIn);