diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-14 00:17:10 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-07-14 00:17:10 +0000 |
commit | d7e9937175da8d4546c5656ea36a9d9fc1d248d5 (patch) | |
tree | aa13f4e1958a838c9783cb542dd2344a4808b09c /llvm/lib/CodeGen/InterferenceCache.h | |
parent | 56a20a492bf6f0c04169bd506c19d22bbcc94c3d (diff) | |
download | llvm-d7e9937175da8d4546c5656ea36a9d9fc1d248d5.zip llvm-d7e9937175da8d4546c5656ea36a9d9fc1d248d5.tar.gz llvm-d7e9937175da8d4546c5656ea36a9d9fc1d248d5.tar.bz2 |
Reapply r135074 and r135080 with a fix.
The cache entry referenced by the best split candidate could become
clobbered by an unsuccessful candidate.
The correct fix here is to use reference counts on the cache entries.
Coming up.
llvm-svn: 135113
Diffstat (limited to 'llvm/lib/CodeGen/InterferenceCache.h')
-rw-r--r-- | llvm/lib/CodeGen/InterferenceCache.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/InterferenceCache.h b/llvm/lib/CodeGen/InterferenceCache.h index 6c36fa4..6434b3a7 100644 --- a/llvm/lib/CodeGen/InterferenceCache.h +++ b/llvm/lib/CodeGen/InterferenceCache.h @@ -127,10 +127,14 @@ public: Entry *CacheEntry; BlockInterference *Current; public: - /// Cursor - Create a cursor for the interference allocated to PhysReg and - /// all its aliases. - Cursor(InterferenceCache &Cache, unsigned PhysReg) - : CacheEntry(Cache.get(PhysReg)), Current(0) {} + /// Cursor - Create a dangling cursor. + Cursor() : CacheEntry(0), Current(0) {} + + /// setPhysReg - Point this cursor to PhysReg's interference. + void setPhysReg(InterferenceCache &Cache, unsigned PhysReg) { + CacheEntry = Cache.get(PhysReg); + Current = 0; + } /// moveTo - Move cursor to basic block MBBNum. void moveToBlock(unsigned MBBNum) { |