[llvm] d3da5b4 - [InstCombine] Return poison for known bits conflict

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 09:40:21 PDT 2023


Author: Nikita Popov
Date: 2023-05-17T18:40:12+02:00
New Revision: d3da5b4521f82e1b092006e3d168053e673f72d9

URL: https://github.com/llvm/llvm-project/commit/d3da5b4521f82e1b092006e3d168053e673f72d9
DIFF: https://github.com/llvm/llvm-project/commit/d3da5b4521f82e1b092006e3d168053e673f72d9.diff

LOG: [InstCombine] Return poison for known bits conflict

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index ac824b275d38..ad3030965db6 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -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


        


More information about the llvm-commits mailing list