Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
60,150 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/scariness_score_test.cpp.tmp

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.