This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Use SCEVUnknown(poison) instead of SCEVUnknown(undef).
ClosedPublic

Authored by fhahn on Jun 25 2022, 8:42 AM.

Details

Summary

Use poison instead of undef for SCEVUnkown of unreachable values.
This should be in line with the movement to replace undef with poison
when possible.

Suggested in D114650.

Diff Detail

Event Timeline

fhahn created this revision.Jun 25 2022, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2022, 8:43 AM
fhahn requested review of this revision.Jun 25 2022, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2022, 8:43 AM
nikic added inline comments.Jun 25 2022, 8:49 AM
llvm/lib/Analysis/ScalarEvolution.cpp
7199

This change is fine, but I don't think the containsUndef -> containsPoison change makes sense. We can still have SCEVUnknown of UndefValue (from other places), and I believe current containsUndef() callers do want to check for those as well.

fhahn added inline comments.Jun 25 2022, 9:10 AM
llvm/lib/Analysis/ScalarEvolution.cpp
7199

I suppose we would need to check for both undef & poison, which is achieved by just checking for UndefVal (because PoisonValue inherits from UndefValue)?

fhahn updated this revision to Diff 439993.Jun 25 2022, 9:18 AM

Undo changes to containsUndefs.

nikic accepted this revision.Jun 25 2022, 11:41 AM

LGTM

llvm/lib/Analysis/ScalarEvolution.cpp
7199

Yes, exactly.

This revision is now accepted and ready to land.Jun 25 2022, 11:41 AM
This revision was landed with ongoing or failed builds.Jun 27 2022, 1:33 AM
This revision was automatically updated to reflect the committed changes.