This is an archive of the discontinued LLVM Phabricator instance.

[X86] Update test cases that would be affected when X86FixupBWInsts is turned on.
AbandonedPublic

Authored by kbsmith1 on Feb 11 2016, 3:32 PM.

Details

Reviewers
spatel
qcolombet
Summary

This updates a small number of lit tests that will be affected when X86FixupBWInsts is turned on by default. This simply
uses the internal switch to be sure to disable that optimization for these specific tests, so that they continue to test what they
are expecting to test.

Diff Detail

Event Timeline

kbsmith1 updated this revision to Diff 47738.Feb 11 2016, 3:32 PM
kbsmith1 retitled this revision from to [X86] Update test cases that would be affected when X86FixupBWInsts is turned on..
kbsmith1 updated this object.
kbsmith1 added reviewers: spatel, qcolombet.
kbsmith1 added a subscriber: llvm-commits.
spatel edited edge metadata.Feb 12 2016, 9:36 AM

This feels similar to D12656, and I don't think it's the right choice for the same reasons that were cited in that review.

I'd prefer that we just change the checks in these tests as part of flipping/removing the "-fixup-byte-word-insts" switch. Alternatively, we could add another RUN to these tests to show the exact codegen difference produced by -fixup-byte-word-insts for these cases.

Masking the default output could hide codegen differences that we would actually like to observe. As an example, we may want to limit the FixupBW pass based on micro-arch (should an in-order CPU get the same set of transforms as as OoO?). If that happens, then these tests become more important as verification that the default behavior is not changing.

This feels similar to D12656, and I don't think it's the right choice for the same reasons that were cited in that review.

I'd prefer that we just change the checks in these tests as part of flipping/removing the "-fixup-byte-word-insts" switch. Alternatively, we could add another RUN to these tests to show the exact codegen difference produced by -fixup-byte-word-insts for these cases.

Masking the default output could hide codegen differences that we would actually like to observe. As an example, we may want to limit the FixupBW pass based on micro-arch (should an in-order CPU get the same set of transforms as as OoO?). If that happens, then these tests become more important as verification that the default behavior is not changing.

I think that having additional RUN commands that show what the results should be in the presence of fixup-byte-word-insts would be OK, although many of the checks would be the same and therefore simply duplicated, making the tests harder to maintain. I think that using the option to turn off this transformation does the best job of leaving these tests as good unit tests of what they were intended to unit test, and that we should be adding specific tests as needed to adequately unit tests fixup-byte-word-inst option. I think this is different than D12656 in that I am not changing the patterns to allow "either" movw/movzwl (for example), and so these tests continue to have very specific expected output results. Due to the inability to have MachineIR specific unit tests, this seems like a very reasonable way to continue to have existing unit tests work as expected. If both you and Quentin disagree with my position on this specific change, I'll abandon it, but I think doing so dilutes the value of these tests as unit tests.

kbsmith1 abandoned this revision.Feb 18 2016, 8:30 AM

Due to the inability to have MachineIR specific unit tests, this seems like a very reasonable way to continue to have existing unit tests work as expected.

Kevin,
I don't know if this changes anything, but there is some support for checking MachineIR via the -stop-after and -start-before options to llc. I used it in the /test/CodeGen/X86/machine-combiner-int.ll regression test to verify that machine operands are dead. There are probably better examples in other regression tests.