[llvm] [llubi] Add support for byte types (PR #200672)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 07:34:45 PDT 2026


================
@@ -472,21 +492,33 @@ AnyValue Context::fromBytes(ConstBytesView Bytes, Type *Ty,
       if (ContainsUndefinedBits)
         *ContainsUndefinedBits = true;
 
-      if (getEffectiveUndefValueBehavior() ==
-          UndefValueBehavior::NonDeterministic) {
+      if (!IsByteType && getEffectiveUndefValueBehavior() ==
+                             UndefValueBehavior::NonDeterministic) {
         // We don't use std::uniform_int_distribution here because it produces
         // different results across different library implementations. Instead,
         // we directly use the low bits from Rng.
         RandomBits = static_cast<uint8_t>(Rng());
       }
     }
+
+    if (IsByteType) {
+      // FIXME: Currently we treat undef bits as poison bits in the byte value,
+      // because keeping undef bits reintroduces undef SSA values.
+      // It should be fixed by completely remove undef bits from the memory.
----------------
nikic wrote:

```suggestion
      // It should be fixed by completely removing undef bits from the memory.
```

https://github.com/llvm/llvm-project/pull/200672


More information about the llvm-commits mailing list