This is an archive of the discontinued LLVM Phabricator instance.

[LangRef][Local] dereferenceable metadata violation is UB
ClosedPublic

Authored by nikic on Apr 13 2023, 2:04 AM.

Details

Summary

I believe !dereferencable violation is immediate undefined behavior, but this was not explicitly spelled out in LangRef. We already assume that !dereferenceable is implicitly !noundef and cannot return poison in isGuaranteedNotToBeUndefOrPoison().

The reason why we made dereferenceable implicitly noundef is that the purpose of this metadata is to allow speculation, and that would not be legal on a potential poison pointer.

Diff Detail

Event Timeline

nikic created this revision.Apr 13 2023, 2:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 2:04 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic requested review of this revision.Apr 13 2023, 2:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 2:04 AM
nlopes accepted this revision.Apr 13 2023, 9:12 AM

LGTM!

This revision is now accepted and ready to land.Apr 13 2023, 9:12 AM
This revision was landed with ongoing or failed builds.Apr 14 2023, 1:56 AM
This revision was automatically updated to reflect the committed changes.