-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Instcombine] -instcombine-verify-known-bits failure. #109957
Comments
I fixed the immediate problem in 5ef02a3. It would make sense to also use llvm-project/llvm/lib/Support/KnownBits.cpp Line 1061 in 5ef02a3
|
When dividing by -1 we were breaking out of the code entirely, while we should fall through to computeKnownBits(). This fixes an instcombine-verify-known-bits discrepancy. Fixes llvm#109957.
I think the abs() doesn't make sense, since srem with a negative RHS is flipped into one with a positive RHS, changing LHS as appropriate. I tried exercising the abs() with different tests, with the same result: the change seems to be an NFC. |
@artagnon Good point. Do you want to submit a PR to switch that code to KnownBits::srem? |
On it. I'm currently working through the reasoning. |
When dividing by -1 we were breaking out of the code entirely, while we should fall through to computeKnownBits(). This fixes an instcombine-verify-known-bits discrepancy. Fixes llvm#109957.
tc_instcomb_knownbits.tar.gz
opt -mtriple=systemz-unknown -mcpu=z15 -O1 tc_instcomb_knownbits.bc -instcombine-verify-known-bits -o /dev/null
Mismatched known bits for %rem.i = srem i32 %conv.i, -1 in f
computeKnownBits(): 0000000000000000000000000000000?
SimplifyDemandedBits(): ????????????????????????????????
#8 0x000002aa01d6825c llvm::InstCombinerImpl::SimplifyDemandedInstructionBits
@RKSimon @jf-botto @nikic
The text was updated successfully, but these errors were encountered: