This is an archive of the discontinued LLVM Phabricator instance.

[CodeMetrics] Don't require speculatability for ephemeral values
ClosedPublic

Authored by nikic on Oct 20 2021, 1:27 PM.

Details

Summary

As discussed in D112016, our current requirement of speculatability for ephemeral is overly strict: What we really care about is that the instruction will be DCEd once the assume is dropped. For that it is sufficient that the instruction is side-effect free and not a terminator.

In particular, this allows non-dereferenceable loads to be ephemeral values.

Diff Detail

Event Timeline

nikic created this revision.Oct 20 2021, 1:27 PM
nikic requested review of this revision.Oct 20 2021, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2021, 1:27 PM
aeubanks added inline comments.Oct 20 2021, 1:35 PM
llvm/lib/Analysis/ValueTracking.cpp
497–499

it'd be nice to a have a test case for this, but that might be hard to come up with

llvm/test/Transforms/Inline/ephemeral.ll
28–30

the comment doesn't really make sense, it now is considered ephemeral
ditto in the other test

aeubanks accepted this revision.Oct 20 2021, 1:35 PM
This revision is now accepted and ready to land.Oct 20 2021, 1:35 PM
nikic added inline comments.Oct 20 2021, 1:44 PM
llvm/lib/Analysis/ValueTracking.cpp
497–499

Most likely this change doesn't have an observable effect. I mainly changed it for the sake of consistency.

This revision was landed with ongoing or failed builds.Oct 21 2021, 11:30 AM
This revision was automatically updated to reflect the committed changes.