Index: lib/Transforms/Scalar/NewGVN.cpp =================================================================== --- lib/Transforms/Scalar/NewGVN.cpp +++ lib/Transforms/Scalar/NewGVN.cpp @@ -1079,10 +1079,10 @@ assert( !isa(NewClass->RepLeader) || !NewClass->RepLeader || I == NewClass->RepLeader || - !DT->properlyDominates( + (!DT->properlyDominates( I->getParent(), cast(NewClass->RepLeader)->getParent()) && - "New class for instruction should not be dominated by instruction"); + "New class for instruction should not be dominated by instruction")); if (NewClass->RepLeader != I) { auto DFSNum = InstrDFS.lookup(I);