Index: llvm/lib/Transforms/Utils/LoopUtils.cpp =================================================================== --- llvm/lib/Transforms/Utils/LoopUtils.cpp +++ llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -598,7 +598,7 @@ } // Use a map to unique and a vector to guarantee deterministic ordering. - llvm::SmallDenseSet, 4> DeadDebugSet; + llvm::SmallDenseSet DeadDebugSet; llvm::SmallVector DeadDebugInst; if (ExitBlock) { @@ -627,11 +627,8 @@ auto *DVI = dyn_cast(&I); if (!DVI) continue; - auto Key = - DeadDebugSet.find({DVI->getVariable(), DVI->getExpression()}); - if (Key != DeadDebugSet.end()) + if (!DeadDebugSet.insert(DebugVariable(DVI)).second) continue; - DeadDebugSet.insert({DVI->getVariable(), DVI->getExpression()}); DeadDebugInst.push_back(DVI); }