[PATCH] D31678: [InstCombine] Fix change flag handling to report all IR changes up to the pass manager or preseved analyses

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 15:37:34 PDT 2017


chandlerc added a comment.

In https://reviews.llvm.org/D31678#723024, @craig.topper wrote:

> @chandlerc do you know of other tests that check this sort of thing or can you give more guidance. I haven't spent a lot of time in the IR optimizers until recently.


The closest is probably `test/Transforms/Inline/cgscc-invalidate.ll`. It's doing essentially the same thing but for the inliner. Unfortunately, it is much more complicated in some ways due to testing an interprocedural pass. The key is typically:

1. compute some analysis
2. run optimization pass that does mutation
3. run verifier for analysis

If #3 gets a stale analysis it should fail. This means you need a verifier that will detect the old analysis as invalid after the mutation in #2. Then you want to write FileCheck patterns to verify that #2 actually *does* mutate the IR in the interesting way.


https://reviews.llvm.org/D31678





More information about the llvm-commits mailing list