This is an archive of the discontinued LLVM Phabricator instance.

SpeculativeExecution: Allow speculating more instruction types
ClosedPublic

Authored by piotr on Nov 18 2020, 1:31 AM.

Details

Summary

Support more instructions in SpeculativeExecution pass:

  • ExtractValue
  • InsertValue
  • Trunc
  • Freeze

Diff Detail

Event Timeline

piotr created this revision.Nov 18 2020, 1:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2020, 1:31 AM
piotr requested review of this revision.Nov 18 2020, 1:31 AM
piotr added a comment.Nov 18 2020, 1:37 AM

As Matt pointed out in D91633, extractvalue and insertvalue were also missing, so I am adding them here (the new tests are taken from D24543). Also the tests added earlier in D91633 are being moved to spec-other.ll.

piotr updated this revision to Diff 306081.Nov 18 2020, 6:10 AM
piotr added a subscriber: foad.

Added two more instructions: trunc and freeze (thanks @foad).

foad added a comment.Nov 18 2020, 6:16 AM

Added two more instructions: trunc and freeze (thanks @foad).

Thanks! Stepping back a bit, why does this pass have a whitelist of instructions at all, instead of just relying on isSafeToSpeculativelyExecute?

piotr edited the summary of this revision. (Show Details)Nov 18 2020, 6:20 AM
piotr added a comment.Nov 18 2020, 6:27 AM

I asked myself the same question - this was tried before - see https://reviews.llvm.org/D24544. I do not know any more details.

arsenm accepted this revision.Nov 18 2020, 6:52 AM
This revision is now accepted and ready to land.Nov 18 2020, 6:52 AM
This revision was landed with ongoing or failed builds.Nov 18 2020, 8:00 AM
This revision was automatically updated to reflect the committed changes.