This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Switch regression tests to test features not CPUs
ClosedPublic

Authored by sbaranga on Jun 13 2016, 7:00 AM.

Details

Summary

We have switched to using features for all heuristics, but
the tests for these are still using -mcpu, which means we
are not directly testing the features.

This converts at least some of the existing regression tests
to use the new features.

This still leaves the following features untested:

merge-narrow-ld
predictable-select-expensive
alternate-sextload-cvt-f32-pattern
disable-latency-sched-heuristic

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 60516.Jun 13 2016, 7:00 AM
sbaranga retitled this revision from to [AArch64] Switch regression tests to test features not CPUs.
sbaranga updated this object.
sbaranga added subscribers: llvm-commits, MatzeB.
rengolin edited edge metadata.Jun 13 2016, 7:59 AM

Hi Silviu,

I'm all for using target features, and that's a good way to make sure we test *all* CPUs, not just the one where the feature was introduced.

Do we also need a small test to show that certain CPUs still have certain features? I'm not sure how to do that, though.

cheers,
--renato

Hi Silviu,

I'm all for using target features, and that's a good way to make sure we test *all* CPUs, not just the one where the feature was introduced.

Do we also need a small test to show that certain CPUs still have certain features? I'm not sure how to do that, though.

cheers,
--renato

Perhaps. That's something that we're already missing for most (all?) CPUs for these heuristics?
The best idea i can come up with is to make SubtargetEmitter.cpp generate some debug code that will print all features.

Cheers,
Silviu

Perhaps. That's something that we're already missing for most (all?) CPUs for these heuristics?
The best idea i can come up with is to make SubtargetEmitter.cpp generate some debug code that will print all features.

How about we *add* tests on sub-target features, instead of replace, and change the CPU's Check lines to the flag's own, so that we're testing both features and CPU's support?

sbaranga updated this revision to Diff 61358.Jun 21 2016, 5:16 AM
sbaranga edited edge metadata.

Keep the old tests, but add new ones which should be CPU independent and test the features.

Hi Silviu,

I was thinking more in the lines of using the same CHECK lines, to make sure they don't diverge?

So, if you have Cyclone specific as well as FeatureX in Cyclone:

; RUN: ... cyclone ... FileCheck --check=FEATUREX --check=CYCLONE
; RUN: ... +FeatureX . FileCheck --check=FEATUREX

; CHECK-CYCLONE: cyclone-specific things (Target->isCyclone())
; CHECK-FEATUREX: Feature X things, including Cyclone

Makes sense?

cheers,
--renato

Hi Renato,

So, if you have Cyclone specific as well as FeatureX in Cyclone:

; RUN: ... cyclone ... FileCheck --check=FEATUREX --check=CYCLONE
; RUN: ... +FeatureX . FileCheck --check=FEATUREX

; CHECK-CYCLONE: cyclone-specific things (Target->isCyclone())
; CHECK-FEATUREX: Feature X things, including Cyclone

Makes sense?

It does, and I was trying to follow this already (see test/CodeGen/AArch64/misched-fusion.ll for example). Is there any place where you think the CHECK lines could be improved?

Cheers,
Silviu

Ok, some inline comment to make my point more explicit. :)

Otherwise, looks good. Thanks!

test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll
87

Here, A57 has BalanceFPOps and could check for CHECK-BALFP rather than spit in A57 up there and GENERIC down here.

test/CodeGen/AArch64/merge-store.ll
13

These two sets of lines are identical because Cyclone has FeatureSlowMisaligned128Store, so the first RUN line could also check for CHECK-MISALIGNED instead of duplicate the CHECK lines or call it FAST.

test/CodeGen/AArch64/misched-fusion.ll
15

Duplicated, Cyclone has FeatureMacroOpFusion, call it CHECK-FUSION or something.

sbaranga updated this revision to Diff 61372.Jun 21 2016, 7:43 AM

Address review comments from Renato.
Additionally, misched-fusion.ll now uses regex so we don't need different check prefixes.

rengolin accepted this revision.Jun 21 2016, 7:48 AM
rengolin edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Jun 21 2016, 7:48 AM
sbaranga closed this revision.Jun 21 2016, 8:23 AM

Thanks, r273271!

test/CodeGen/AArch64/aarch64-a57-fp-load-balancing.ll