This is an archive of the discontinued LLVM Phabricator instance.

[X86][BtVer2][MCA][NFC] Add CMPEQ one-idioms tests
ClosedPublic

Authored by lebedev.ri on Jul 3 2018, 6:35 AM.

Details

Summary

As per Agner's Microarchitecture doc (21.8 AMD Bobcat and Jaguar pipeline - Dependency-breaking instructions), these, like zero-idioms, are dependency-breaking, although they produce ones and still consume resources.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Jul 3 2018, 6:35 AM
lebedev.ri retitled this revision from [X86][BtVer2][MCA][NFC] Add CMPEQ zero-idioms tests to [X86][BtVer2][MCA][NFC] Add CMPEQ one-idioms tests.
lebedev.ri edited the summary of this revision. (Show Details)

Ok, well, i guess what i was trying to ask/understand is, is that already properly represented https://godbolt.org/g/9rYPYA, or not?

No, we don't properly model dependency breaking instructions yet - zero-idioms are making use of a special case of llvm-mca that assumes dependency breaking if no resources are used - IMO that's something that should be removed and we come up with a better way to model this.

Simon is right on this.
We still don't model dependency breaking instructions. There is already a plan to teach llvm-mca how to identify those instructions, and that is next on my TODO list. Once we have that system in place, we can remove the "zero-latency implies dependency-breaking" hack in llvm-mca.

This patch doesn't do the right thing. The timeline clearly shows how dependencies are not broken.

Ok, that is actually good, i was starting to question my [rudimentary] understanding of all this.

-Andrea

Then, back to square one, are D48876 tests of any use? :)

You can commit those tests to show that we don't correctly model dependency breaking packed compare instructions on BtVer2. However, I would remove the padd from the tests.

@andreadb do you feel like officially LGTM'ing this modulo the nit? :)

andreadb accepted this revision.Jul 4 2018, 9:22 AM

You can commit those tests to show that we don't correctly model dependency breaking packed compare instructions on BtVer2. However, I would remove the padd from the tests.

@andreadb do you feel like officially LGTM'ing this modulo the nit? :)

Yes please. Thanks!

This revision is now accepted and ready to land.Jul 4 2018, 9:22 AM

You can commit those tests to show that we don't correctly model dependency breaking packed compare instructions on BtVer2. However, I would remove the padd from the tests.

@andreadb do you feel like officially LGTM'ing this modulo the nit? :)

Yes please. Thanks!

Thank you!

This revision was automatically updated to reflect the committed changes.