Compiler support for learning program invariants