[InstCombine] Return poison for known bits conflict
authorNikita Popov <npopov@redhat.com>
Wed, 17 May 2023 16:39:26 +0000 (18:39 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 17 May 2023 16:40:12 +0000 (18:40 +0200)
I suspect that this case is not actually reachable in practice
(because it gets folded away by other code before), but if we do
reach it, we should return poison, not undef.

llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

index ac824b2..ad30309 100644 (file)
@@ -660,7 +660,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
         else if (SignBitOne)
           Known.One.setSignBit();
         if (Known.hasConflict())
-          return UndefValue::get(VTy);
+          return PoisonValue::get(VTy);
       }
     } else {
       // This is a variable shift, so we can't shift the demand mask by a known