This is an archive of the discontinued LLVM Phabricator instance.

[CostModel][AArch64] Add tests for ctlz, ctpop and cttz. NFC.
ClosedPublic

Authored by RosieSumpter on Jun 3 2021, 2:13 AM.

Diff Detail

Unit TestsFailed

Event Timeline

RosieSumpter created this revision.Jun 3 2021, 2:13 AM
RosieSumpter requested review of this revision.Jun 3 2021, 2:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2021, 2:13 AM
SjoerdMeijer added inline comments.Jun 3 2021, 2:33 AM
llvm/test/Analysis/CostModel/AArch64/ctlz.ll
67

This tests a 8 x 64 = 256 bit vector, which is already bigger than the vector register.

76

And this tests a 512 bit vector. Having this tests here won't hurt anyone, but I don't think it adds much compared to the previous tests, so might as well remove this one.

112

Same for this one.

191

You could consider adding a 32 x i8 case here, i.e. a test/vector that is bigger than the register width.

llvm/test/Analysis/CostModel/AArch64/ctpop.ll
1

And similar remarks here about the vector widths as in the previous file.

4

Nit, typo: intstructions

Removed some tests where vectors are larger than 128 bits.

SjoerdMeijer added inline comments.Jun 3 2021, 7:42 AM
llvm/test/Analysis/CostModel/AArch64/ctlz.ll
58

Sorry if that wasn't clear, but you can keep this one.

103

Keep this one.

148

Keep this one.

llvm/test/Analysis/CostModel/AArch64/ctpop.ll
58

Keep this one.

103

Keep this one.

llvm/test/Analysis/CostModel/AArch64/cttz.ll
58

Keep this one.

103

Keep this one.

SjoerdMeijer accepted this revision.Jun 3 2021, 7:53 AM

Sorry, ignore my previous comments, I have spotted them now (with your help).

This looks like a good set of new cost-model tests to me.

This revision is now accepted and ready to land.Jun 3 2021, 7:53 AM