This is an archive of the discontinued LLVM Phabricator instance.

[x86/SLH] Flesh out the data-invariant instruction table a bit based on feedback from Craig.
ClosedPublic

Authored by chandlerc on Jul 16 2018, 11:34 PM.

Details

Summary

The only thing he suggested that I've skipped here is the double-wide
multiply instructions. Multiply is an area I'm nervous about there being
some hidden data-dependent behavior, and it doesn't seem important for
any benchmarks I have, so skipping it and sticking with the minimal
multiply support that matches what I know is widely used in existing
crypto libraries. We can always add double-wide multiply when we have
clarity from vendors about its behavior and guarantees.

I've tried to at least cover the fundamentals here with tests, although
I've not tried to cover every width or permutation. I can add more tests
where folks think it would be helpful.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Jul 16 2018, 11:34 PM
craig.topper added inline comments.Jul 16 2018, 11:58 PM
llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
869 ↗(On Diff #155810)

Drop the RCR/RCL instructions? We don't ever isel them and they are multi uop instructions.

963 ↗(On Diff #155810)

These are double width multiplies too. Should we drop them?

chandlerc updated this revision to Diff 155893.Jul 17 2018, 8:20 AM
chandlerc marked 2 inline comments as done.

Removing instructions based on review.

All done.

llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
963 ↗(On Diff #155810)

I mean, I *think* they're safe, but I'm very happy to go minimal for now.

This revision is now accepted and ready to land.Jul 17 2018, 10:11 AM
This revision was automatically updated to reflect the committed changes.