[SCEV] Update SCEVLoopGuardRewriter to hold reference to map. (NFC)
authorFlorian Hahn <flo@fhahn.com>
Sat, 13 Nov 2021 09:39:14 +0000 (09:39 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sat, 13 Nov 2021 09:39:14 +0000 (09:39 +0000)
SCEVLoopGuardRewriter doesn't need to copy the rewrite map. It can just
hold a const reference instead, to avoid an unnecessary copy.

llvm/lib/Analysis/ScalarEvolution.cpp

index d7effde..5bdbe40 100644 (file)
@@ -13696,7 +13696,7 @@ ScalarEvolution::computeSymbolicMaxBackedgeTakenCount(const Loop *L) {
 ///
 /// At the moment only rewriting SCEVUnknown is supported.
 class SCEVLoopGuardRewriter : public SCEVRewriteVisitor<SCEVLoopGuardRewriter> {
-  DenseMap<const SCEV *, const SCEV *> Map;
+  const DenseMap<const SCEV *, const SCEV *> &Map;
 
 public:
   SCEVLoopGuardRewriter(ScalarEvolution &SE,