@@ -747,7 +747,8 @@ void GVNPass::LeaderMap::insert(uint32_t N, Value *V, const BasicBlock *BB) {
747
747
748
748
// / Scan the list of values corresponding to a given
749
749
// / value number, and remove the given instruction if encountered.
750
- void GVNPass::LeaderMap::erase (uint32_t N, Instruction *I, BasicBlock *BB) {
750
+ void GVNPass::LeaderMap::erase (uint32_t N, Instruction *I,
751
+ const BasicBlock *BB) {
751
752
LeaderListNode *Prev = nullptr ;
752
753
LeaderListNode *Curr = &NumToLeaders[N];
753
754
@@ -2267,9 +2268,8 @@ GVNPass::ValueTable::assignExpNewValueNum(Expression &Exp) {
2267
2268
bool GVNPass::ValueTable::areAllValsInBB (uint32_t Num, const BasicBlock *BB,
2268
2269
GVNPass &Gvn) {
2269
2270
auto I = Gvn.LeaderTable .getLeaders (Num);
2270
- return std::all_of (
2271
- I.begin (), I.end (),
2272
- [=](const LeaderMap::LeaderTableEntry &L) { return L.BB == BB; });
2271
+ return all_of (
2272
+ I, [=](const LeaderMap::LeaderTableEntry &L) { return L.BB == BB; });
2273
2273
}
2274
2274
2275
2275
// / Wrap phiTranslateImpl to provide caching functionality.
@@ -2292,7 +2292,7 @@ bool GVNPass::ValueTable::areCallValsEqual(uint32_t Num, uint32_t NewNum,
2292
2292
GVNPass &Gvn) {
2293
2293
CallInst *Call = nullptr ;
2294
2294
auto Leaders = Gvn.LeaderTable .getLeaders (Num);
2295
- for (auto Entry : Leaders) {
2295
+ for (const auto & Entry : Leaders) {
2296
2296
Call = dyn_cast<CallInst>(Entry.Val );
2297
2297
if (Call && Call->getParent () == PhiBlock)
2298
2298
break ;
@@ -2393,7 +2393,7 @@ Value *GVNPass::findLeader(const BasicBlock *BB, uint32_t num) {
2393
2393
return nullptr ;
2394
2394
2395
2395
Value *Val = nullptr ;
2396
- for (auto Entry : Leaders) {
2396
+ for (const auto & Entry : Leaders) {
2397
2397
if (DT->dominates (Entry.BB , BB)) {
2398
2398
Val = Entry.Val ;
2399
2399
if (isa<Constant>(Val))
0 commit comments