[PATCH] D38765: Don't replace constants with constants in GVN

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 20:56:36 PDT 2017


dberlin added inline comments.


================
Comment at: test/Transforms/GVN/no-crash-on-undef-assume.ll:1
+; RUN: opt < %s -gvn -S
+
----------------
davide wrote:
> alexcrichton wrote:
> > davide wrote:
> > > check the output?
> > Oh I wasn't quite sure what this should be checking, this is basically just asserting it doesn't crash (today this test case crashes w/ asserts enabled)
> you could probably just pipe the output to `FileCheck %s` and insert some check lines (please see any other test in tree).
> The reason is twofold:
> 1) if some xform changes this pattern, then we notice (imagine, e.g., at some point we decide to not strip calls to assume [I think this is what happens now])
> 2) you could replace `opt` with `/bin/true` and the test will still pass (while checking the output with filecheck makes this test more robust.
> 
> Thanks!
Yeah, pipe it to filecheck.
If you do that, you can use update_test_checks.py and it'll make CHECK lines for you.

For example, to update newgvn tests, i usually use:
python ../../../utils/update_test_checks.py --opt-binary=../../../debug-build/bin/opt <filename.ll>


from the tests/Transforms/NewGVN directory


https://reviews.llvm.org/D38765





More information about the llvm-commits mailing list