This is an archive of the discontinued LLVM Phabricator instance.

[llvm] [X86] Make test more robust against different builds
ClosedPublic

Authored by aartbik on Apr 21 2020, 8:44 PM.

Details

Summary

Rationale:
Using the --debug-only flag requires a debug build. Also, the debug output is not always consistent over different builds.
This change avoids all problems by just testing the generated assembly for AVX.

Diff Detail

Event Timeline

aartbik created this revision.Apr 21 2020, 8:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2020, 8:44 PM

I don't really understand why? Can you add the motivation in the commit/revision description?

I don't really understand why? Can you add the motivation in the commit/revision description?

I think because the test is checking the -debug output.

Can we just check the assembly output and trust that asserts builds will trigger the assert that found this originally?

I don't really understand why? Can you add the motivation in the commit/revision description?

I think because the test is checking the -debug output.

Can we just check the assembly output and trust that asserts builds will trigger the assert that found this originally?

I just found out that this is needed for debug builds. Otherwise the test will fail for optimized builds.
I took inspiration from other files in the same directory, see e.g. merge-store-partially-alias-loads.ll
In this case, testing the assembly would of course work, but it would not be a strict as I wanted it to be.
Given that other tests do exactly this, I figured this was the best-practice for debug output testing.

If there are other best-practices for this, happy to comply...

aartbik edited the summary of this revision. (Show Details)Apr 21 2020, 10:46 PM
aartbik added a comment.EditedApr 21 2020, 11:04 PM

Hmm, given that some builds now break on using "extract_subvector" instead of "vselect",
I am actually really start to like the suggestion to just test the assembly and rely on
not hitting asserts in builds that support these, but not let the test rely on debug output.

CHECK: v4f64 = vselect

<stdin>:8:40: note: scanning from here
Initial selection DAG: %bb.0 'bug45563:'

<stdin>:41:7: note: possible intended match here
t54: v2f64 = extract_subvector t52, Constant:i64<0

aartbik updated this revision to Diff 259171.Apr 21 2020, 11:23 PM

more robust test

aartbik retitled this revision from [llvm] [X86] Add "REQUIRES asserts" to test to [llvm] [X86] Make test more robust against different builds.Apr 21 2020, 11:25 PM
aartbik edited the summary of this revision. (Show Details)

PTAL

craig.topper added inline comments.Apr 21 2020, 11:32 PM
llvm/test/CodeGen/X86/pr45563.ll
1

Drop the stderr redirect?

aartbik updated this revision to Diff 259173.Apr 21 2020, 11:45 PM
aartbik marked an inline comment as done.

dropped the stderr redirect, no longer needed

This revision is now accepted and ready to land.Apr 22 2020, 12:11 AM
This revision was automatically updated to reflect the committed changes.