Index: lib/Analysis/ValueTracking.cpp =================================================================== --- lib/Analysis/ValueTracking.cpp +++ lib/Analysis/ValueTracking.cpp @@ -543,6 +543,11 @@ return true; } + // If the context instruction is this assume, we shouldn't consider it valid. + // Otherwise the loops below will scan forward to the end of the block. + if (Inv == CxtI) + return false; + // With or without a DT, the only remaining case we will check is if the // instructions are in the same BB. Give up if that is not the case. if (Inv->getParent() != CxtI->getParent())