All this did before was assert in EarlyCSE.
While we're cleaning this up, can you remove this NumMemRefs variable? The interface is only useful if NumMemRefs is 1, and the structure only supports one PtrVal, so it is only usable if you set NumMemRefs to 1 (EarlyCSE aborts using this interface at all if NumMemRefs != 1). If we were going to extend it to support multiple memory references, we'd probably need a vector of something, and then we'd get this number from the size of the vector. Thus, this NumMemRefs will likely never be needed.