This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCI
ClosedPublic

Authored by sbaranga on Jun 9 2016, 7:33 AM.

Details

Summary

Code generation for Cortex-A72/Cortex-A73 was accidentally changed
by r271555, which was a NFCI. The isCortexA57() predicate was not true
for Cortex-A72/Cortex-A73 before r271555 (since it was checking the CPU
string). Because Cortex-A72/Cortex-A73 inherit all features from Cortex-A57,
all decisions previously guarded by isCortexA57() are now taken.

This change restores the behaviour before r271555 by adding separate
ProcA72/ProcA73, which have the required features to preserve code
generation.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 60172.Jun 9 2016, 7:33 AM
sbaranga retitled this revision from to [AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCI.
sbaranga updated this object.
sbaranga added reviewers: rengolin, kristof.beyls, aadg.

Would it be possible to find a few codegen test cases that are specific to A57 and then add addtional RUN lines for A72 and A73 to make sure this doesn't regress?

rengolin edited edge metadata.Jun 9 2016, 8:22 AM

Ah, yes, that makes a lot of sense, and it's actually good to see A7x being more formally recognised.

The patch looks good to me, but I'm with Chad that we could have at least some tests to show the behaviour...

Would it be possible to find a few codegen test cases that are specific to A57 and then add addtional RUN lines for A72 and A73 to make sure this doesn't regress?

I suspect what we really want are tests for these features that aren't triggered by -mcpu=... (which is probably how they were initially added).

I suspect what we really want are tests for these features that aren't triggered by -mcpu=... (which is probably how they were initially added).

Can you add CPU features in command lines? Like:

-march=armv8a+FeaturePredictableSelectIsExpensive

If not, the only way to test those features is by selecting a CPU that has it versus one that hasn't.

I suspect what we really want are tests for these features that aren't triggered by -mcpu=... (which is probably how they were initially added).

Can you add CPU features in command lines? Like:

-march=armv8a+FeaturePredictableSelectIsExpensive

If not, the only way to test those features is by selecting a CPU that has it versus one that hasn't.

They can be turned on/off with -mattr:

bin/llc ../llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll -o - -mtriple=aarch64-linux-gnueabi -mattr=+merge-narrow-ld
bin/llc ../llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll -o - -mtriple=aarch64-linux-gnueabi -mattr=-merge-narrow-ld

rengolin accepted this revision.Jun 9 2016, 8:57 AM
rengolin edited edge metadata.

bin/llc ../llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll -o - -mtriple=aarch64-linux-gnueabi -mattr=+merge-narrow-ld
bin/llc ../llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll -o - -mtriple=aarch64-linux-gnueabi -mattr=-merge-narrow-ld

right, and if we already have those, then putting features into CPU descriptions don't need any additional test. It's also not going to regress, because we only do the migration once, and all future changes will be regarding features, not CPU names.

LGTM, assuming we already have all the necessary tests in place.

This revision is now accepted and ready to land.Jun 9 2016, 8:57 AM
mcrosier accepted this revision.Jun 9 2016, 10:05 AM
mcrosier added a reviewer: mcrosier.

SGTM.

sbaranga updated this revision to Diff 61384.Jun 21 2016, 8:59 AM
sbaranga edited edge metadata.

Rebase this change against ToT.

sbaranga closed this revision.Jun 21 2016, 9:00 AM

Committed in r273277.

Thanks,
Silviu