It's possible in some cases for the LHS to be a pointer where the RHS is not. This isn't directly possible for an icmp, but the analysis mixes up operands of different icmp expressions in some cases.
I haven't managed to reduce a testcase I can commit; the testcase in the bug depends on sanitizer passes, and the obvious reduction methods didn't work for me.
Also add an assertion to getNotSCEV() to make tracking down this sort of issue a bit easier in the future.
clang-format: please reformat the code