llvm.org GIT mirror llvm / e292143
Diagnose non-structural differences in the case where blocks were structurally identical. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109743 91177308-0d34-0410-b5e6-96231b3b80d8 John McCall 9 years ago
1 changed file(s) with 16 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
193193
194194 // If the instructions differ, start the more sophisticated diff
195195 // algorithm at the start of the block.
196 if (diff(LeftI, RightI, false, true)) {
196 if (diff(LeftI, RightI, false, false)) {
197197 TentativeValues.clear();
198198 return runBlockDiff(L->begin(), R->begin());
199199 }
206206 } while (LI != LE); // This is sufficient: we can't get equality of
207207 // terminators if there are residual instructions.
208208
209 // Make all the tentative pairs solid.
210 for (llvm::DenseSet >::iterator
211 I = TentativeValues.begin(), E = TentativeValues.end(); I != E; ++I)
212 Values[I->first] = I->second;
213209 TentativeValues.clear();
210
211 // Do another pass over the block, this time in complaints mode.
212 LI = L->begin(); RI = R->begin();
213 do {
214 assert(LI != LE && RI != RE);
215 bool Result = diff(&*LI, &*RI, true, true);
216 assert(!Result && "structural differences second time around?");
217 (void) Result;
218
219 // Make the mapping non-tentative this time.
220 if (!LI->use_empty())
221 Values[&*LI] = &*RI;
222
223 ++LI, ++RI;
224 } while (LI != LE);
214225 }
215226
216227 bool matchForBlockDiff(Instruction *L, Instruction *R);