diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1351,6 +1351,9 @@
 
     // FIXME: isValidRewrite() is a hack. it should be an assert, eventually.
     Phi.ValidRewrite = isValidRewrite(SE, Phi.ExpansionPoint, Phi.Expansion);
+    assert(Phi.ValidRewrite &&
+           "Now that the SCEV is strict wrt pointer/integer types, this "
+           "invariant is expected to be uphold by SCEV itself.");
     if (!Phi.ValidRewrite) {
       DeadInsts.push_back(Phi.Expansion);
       continue;