@Override public Iterable<LocationIdentity> getLocations() { return lastMemorySnapshot.getKeys(); }
public void killReadCache(LocationIdentity identity, int index) { Iterator<ReadCacheEntry> iter = readCache.getKeys().iterator(); while (iter.hasNext()) { ReadCacheEntry entry = iter.next(); if (entry.identity.equals(identity) && (index == -1 || entry.index == -1 || index == entry.index || entry.overflowAccess)) { iter.remove(); } } }
public void killReadCache(LocationIdentity identity) { Iterator<CacheEntry<?>> iterator = readCache.getKeys().iterator(); while (iterator.hasNext()) { CacheEntry<?> entry = iterator.next(); if (entry.conflicts(identity)) { iterator.remove(); } } }
@Override protected PEReadEliminationBlockState stripKilledLoopLocations(Loop<Block> loop, PEReadEliminationBlockState originalInitialState) { PEReadEliminationBlockState initialState = super.stripKilledLoopLocations(loop, originalInitialState); LoopKillCache loopKilledLocations = loopLocationKillCache.get(loop); if (loopKilledLocations != null && loopKilledLocations.loopKillsLocations()) { Iterator<ReadCacheEntry> it = initialState.readCache.getKeys().iterator(); while (it.hasNext()) { ReadCacheEntry entry = it.next(); if (loopKilledLocations.containsLocation(entry.identity)) { it.remove(); } } } return initialState; }
@Override protected ReadEliminationBlockState stripKilledLoopLocations(Loop<Block> loop, ReadEliminationBlockState originalInitialState) { ReadEliminationBlockState initialState = super.stripKilledLoopLocations(loop, originalInitialState); LoopKillCache loopKilledLocations = loopLocationKillCache.get(loop); if (loopKilledLocations != null && loopKilledLocations.loopKillsLocations()) { Iterator<CacheEntry<?>> it = initialState.readCache.getKeys().iterator(); while (it.hasNext()) { CacheEntry<?> entry = it.next(); if (loopKilledLocations.containsLocation(entry.getIdentity())) { it.remove(); } } } return initialState; } }
for (ReadCacheEntry entry : states.get(0).readCache.getKeys()) { if (entry.object == getPhiValueAt(phi, 0)) { mergeReadCachePhi(phi, entry.identity, entry.index, entry.kind, entry.overflowAccess, states);
for (CacheEntry<?> entry : states.get(0).readCache.getKeys()) { if (entry.object == getPhiValueAt(phi, 0)) { mergeReadCachePhi(phi, entry, states);
for (Block d : blockToExisting.getKeys()) { if (strictlyDominates(d, b)) { use.replaceFirstInput(node, blockToExisting.get(d));
@Override protected EconomicMap<LoopExitNode, MemoryMapImpl> processLoop(LoopBeginNode loop, MemoryMapImpl initialState) { EconomicSet<LocationIdentity> modifiedLocations = modifiedInLoops.get(loop); EconomicMap<LocationIdentity, MemoryPhiNode> phis = EconomicMap.create(Equivalence.DEFAULT); if (modifiedLocations.contains(LocationIdentity.any())) { // create phis for all locations if ANY is modified in the loop modifiedLocations = EconomicSet.create(Equivalence.DEFAULT, modifiedLocations); modifiedLocations.addAll(initialState.lastMemorySnapshot.getKeys()); } for (LocationIdentity location : modifiedLocations) { createMemoryPhi(loop, initialState, phis, location); } initialState.lastMemorySnapshot.putAll(phis); LoopInfo<MemoryMapImpl> loopInfo = ReentrantNodeIterator.processLoop(this, loop, initialState); UnmodifiableMapCursor<LoopEndNode, MemoryMapImpl> endStateCursor = loopInfo.endStates.getEntries(); while (endStateCursor.advance()) { int endIndex = loop.phiPredecessorIndex(endStateCursor.getKey()); UnmodifiableMapCursor<LocationIdentity, MemoryPhiNode> phiCursor = phis.getEntries(); while (phiCursor.advance()) { LocationIdentity key = phiCursor.getKey(); PhiNode phi = phiCursor.getValue(); phi.initializeValueAt(endIndex, ValueNodeUtil.asNode(endStateCursor.getValue().getLastLocationAccess(key))); } } return loopInfo.exitStates; }
ReadCacheEntry[] entries = new ReadCacheEntry[initialState.getReadCache().size()]; int z = 0; for (ReadCacheEntry entry : initialState.getReadCache().getKeys()) { entries[z++] = entry;