Do one lookup instead of two.

llvm-svn: 112434
This commit is contained in:
Dan Gohman 2010-08-29 15:18:49 +00:00
parent 4e9013673c
commit defdc9d59c

View File

@ -161,9 +161,10 @@ RegUseTracker::DropUse(size_t LUIdx) {
bool
RegUseTracker::isRegUsedByUsesOtherThan(const SCEV *Reg, size_t LUIdx) const {
if (!RegUsesMap.count(Reg)) return false;
const SmallBitVector &UsedByIndices =
RegUsesMap.find(Reg)->second.UsedByIndices;
RegUsesTy::const_iterator I = RegUsesMap.find(Reg);
if (I == RegUsesMap.end())
return false;
const SmallBitVector &UsedByIndices = I->second.UsedByIndices;
int i = UsedByIndices.find_first();
if (i == -1) return false;
if ((size_t)i != LUIdx) return true;