diff options
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index b3e63ae355..c33ee8fb87 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -3108,6 +3108,12 @@ bool SROA::promoteAllocas(Function &F) { if (PromotableAllocas.empty()) return false; + // Ensure that the list is unique. + std::sort(PromotableAllocas.begin(), PromotableAllocas.end()); + PromotableAllocas.erase(std::unique(PromotableAllocas.begin(), + PromotableAllocas.end()), + PromotableAllocas.end()); + NumPromoted += PromotableAllocas.size(); if (DT && !ForceSSAUpdater) { |