MLIR

Multi-Level IR Compiler Framework

'ub' Dialect

Operations 

source

ub.poison (ub::PoisonOp) 

Poisoned constant operation.

Syntax:

operation ::= `ub.poison` attr-dict (`<` $value^ `>`)? `:` type($result)

The poison operation materializes a compile-time poisoned constant value to indicate deferred undefined behavior. value attribute is needed to indicate an optional additional poison semantics (e.g. partially poisoned vectors), default value indicates results is fully poisoned.

Examples:

// Short form
%0 = ub.poison : i32
// Long form
%1 = ub.poison <#custom_poison_elements_attr> : vector<4xi64>

Traits: AlwaysSpeculatableImplTrait, ConstantLike

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes: 

AttributeMLIR TypeDescription
value::mlir::ub::PoisonAttrInterfacePoisonAttrInterface instance

Results: 

ResultDescription
resultany type

Attributes 

PoisonAttr 

Syntax: #ub.poison