[llvm] [ValueTracking] Return `poison` for zero-sized types (PR #122647)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 12:02:14 PST 2025


================
@@ -6187,14 +6187,14 @@ Value *llvm::isBytewiseValue(Value *V, const DataLayout &DL) {
 
   LLVMContext &Ctx = V->getContext();
 
-  // Undef don't care.
-  auto *UndefInt8 = UndefValue::get(Type::getInt8Ty(Ctx));
+  // Poison don't care.
+  auto *PoisonInt8 = PoisonValue::get(Type::getInt8Ty(Ctx));
   if (isa<UndefValue>(V))
-    return UndefInt8;
+    return PoisonInt8;
----------------
nikic wrote:

This is incorrect, you are converting undef to poison here.

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


More information about the llvm-commits mailing list