[llvm] 2031e72 - [InstCombine] Require non-demanded known bits to be accurate (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 05:28:51 PST 2023


Author: Nikita Popov
Date: 2023-11-30T14:26:57+01:00
New Revision: 2031e7226cc5318c547c6d3f62ac62d369d0e723

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

LOG: [InstCombine] Require non-demanded known bits to be accurate (NFC)

In practice this is already true, and having this as an explicit
guarantee is useful for #72912. I don't think there is any good
reason why we would want to produce incorrect KnownBits results
for non-demanded bits.

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 5f705d6882c60d7..86dc23126cbb9ce 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -107,8 +107,8 @@ bool InstCombinerImpl::SimplifyDemandedBits(Instruction *I, unsigned OpNo,
 /// expression.
 /// Known.One and Known.Zero always follow the invariant that:
 ///   Known.One & Known.Zero == 0.
-/// That is, a bit can't be both 1 and 0. Note that the bits in Known.One and
-/// Known.Zero may only be accurate for those bits set in DemandedMask. Note
+/// That is, a bit can't be both 1 and 0. The bits in Known.One and Known.Zero
+/// are accurate even for bits not in DemandedMask. Note
 /// also that the bitwidth of V, DemandedMask, Known.Zero and Known.One must all
 /// be the same.
 ///


        


More information about the llvm-commits mailing list