Page MenuHomePhabricator

Adding PoisonValue for representing poison value explicitly in IR
Needs ReviewPublic

Authored by liuz on Dec 6 2019, 8:57 AM.

Details

Summary

Define ConstantData::PoisonValue.
Add support for poison value to LLLexer/LLParser/BitcodeReader/BitcodeWriter.
Add support for poison value to llvm-c interface.
Add support for poison value to OCaml binding.
Add m_Poison in PatternMatch.

Diff Detail

Event Timeline

liuz created this revision.Dec 6 2019, 8:57 AM
liuz edited the summary of this revision. (Show Details)Dec 6 2019, 9:18 AM
whitequark resigned from this revision.Mar 10 2020, 2:43 PM
RKSimon resigned from this revision.Aug 2 2020, 3:03 AM
liuz updated this revision to Diff 296566.Tue, Oct 6, 5:21 PM
liuz retitled this revision from Add Poison Value to Adding PoisonValue for representing poison value explicitly in IR.Tue, Oct 6, 5:32 PM
nikic added a reviewer: nikic.Wed, Oct 7, 12:52 AM
nikic added a subscriber: nikic.

I would recommend making PoisonValue a subclass of UndefValue. Poison can always be relaxed to undef, and this will prevents lots of regressions when replacing undef with poison values.

aqjune added a comment.Wed, Oct 7, 3:32 AM

I would recommend making PoisonValue a subclass of UndefValue. Poison can always be relaxed to undef, and this will prevents lots of regressions when replacing undef with poison values.

+1 for this. You'll need to update UndefValue::classof.

liuz updated this revision to Diff 297125.Thu, Oct 8, 10:59 PM

PoisonValue is now a subclass of UndefValue

liuz edited the summary of this revision. (Show Details)Thu, Oct 8, 11:00 PM