@@ -283,8 +283,7 @@ class PredicateInfoBuilder {
283
283
284
284
bool PredicateInfoBuilder::stackIsInScope (const ValueDFSStack &Stack,
285
285
const ValueDFS &VDUse) const {
286
- if (Stack.empty ())
287
- return false ;
286
+ assert (!Stack.empty () && " Should not be called with empty stack" );
288
287
// If it's a phi only use, make sure it's for this phi node edge, and that the
289
288
// use is in a phi node. If it's anything else, and the top of the stack is
290
289
// a LN_Last def, we need to pop the stack. We deliberately sort phi uses
@@ -677,22 +676,18 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl<Value *> &OpsToRename) {
677
676
LLVM_DEBUG (dbgs () << " Current DFS numbers are (" << VD.DFSIn << " ,"
678
677
<< VD.DFSOut << " )\n " );
679
678
680
- bool ShouldPush = (VD.Def || PossibleCopy);
681
- bool OutOfScope = !stackIsInScope (RenameStack, VD);
682
- if (OutOfScope || ShouldPush) {
683
- // Sync to our current scope.
684
- popStackUntilDFSScope (RenameStack, VD);
685
- if (ShouldPush) {
686
- RenameStack.push_back (VD);
687
- }
679
+ // Sync to our current scope.
680
+ popStackUntilDFSScope (RenameStack, VD);
681
+
682
+ if (VD.Def || PossibleCopy) {
683
+ RenameStack.push_back (VD);
684
+ continue ;
688
685
}
686
+
689
687
// If we get to this point, and the stack is empty we must have a use
690
688
// with no renaming needed, just skip it.
691
689
if (RenameStack.empty ())
692
690
continue ;
693
- // Skip values, only want to rename the uses
694
- if (VD.Def || PossibleCopy)
695
- continue ;
696
691
if (!DebugCounter::shouldExecute (RenameCounter)) {
697
692
LLVM_DEBUG (dbgs () << " Skipping execution due to debug counter\n " );
698
693
continue ;
0 commit comments