nikic wrote: > Do we do that for other flags already? I based this off Add/Sub wrap flags.
Add/Sub are not considered roots for demanded bits simplification, so we can't (reliably) perform this in there. `or` is a simplification root. > Are the KnownBits in SimplifyDemandedBit usable? We have this code > > ``` > if (SimplifyDemandedBits(I, 1, DemandedMask, RHSKnown, Depth + 1) || > > SimplifyDemandedBits(I, 0, DemandedMask & ~RHSKnown.One, LHSKnown, > > Depth + 1)) { > ``` > > @nikic Can we trust the known bits for the LHS if we didn't demanded them due > to known 1s on the right hand side? Good question. I don't think there is any good reason why we would return incorrect KnownBits for non-demanded bits. I've run some tests to verify that we don't do that currently and updated the documentation to guarantee this (https://github.com/llvm/llvm-project/commit/2031e7226cc5318c547c6d3f62ac62d369d0e723). https://github.com/llvm/llvm-project/pull/72912 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits