This is an archive of the discontinued LLVM Phabricator instance.

Implement a FIXME for better poison handling in SimplifyCFG.
Needs ReviewPublic

Authored by resistor on Dec 28 2022, 10:07 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None

Diff Detail

Event Timeline

resistor created this revision.Dec 28 2022, 10:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 10:07 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
resistor requested review of this revision.Dec 28 2022, 10:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 10:07 PM
nikic added a subscriber: nikic.Dec 29 2022, 1:43 AM

Test?

llvm/lib/Transforms/Utils/SimplifyCFG.cpp
335

You need to check PoisonValue first, because PoisonValue is also an UndefValue.

341

The !isa<PoisonValue> checks shouldn't be necessary.

I don't have a test that exercises this, just following up on the FIXME comments.

llvm/lib/Transforms/Utils/SimplifyCFG.cpp
341

Why?

resistor updated this revision to Diff 485840.Jan 1 2023, 8:29 PM

Update for comments

nikic added a comment.Jan 2 2023, 1:48 AM

This is still missing tests.

llvm/lib/Transforms/Utils/SimplifyCFG.cpp
335

What I meant here is to move the PoisonValue checks below to above the UndefValue checks, so they are handled first.

341

If one value is poison, the other doesn't matter. Now, if both were actually poison this would already be handled by IV0 == IV1 above, but there's no need to spell it out here.

resistor updated this revision to Diff 486158.Jan 3 2023, 9:30 PM

Update for feedback

I have not been able to construct a test for this manually, and didn't find any hits for it in the test-suite.