-
Notifications
You must be signed in to change notification settings - Fork 12.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 misoptimizes shr+and to setgt #1285
Comments
assigned to @lattner |
How about translating the (x >> 5) & 1 != 0 into (x & 0x0020) instead? |
compilable testcase: int %test(int* %tmp1) { |
Fixed. Testcase here: Transforms/InstCombine/2006-09-15-CastToBool.ll Patch here: BTW, instcombine now reduces the function in the testcase to: int %test(int* %tmp1) { The shift is required because the function is required to deliver int 1/0, not a bool. Thanks! -Chris |
Fantastic. Thanks Chris! |
*** Bug llvm/llvm-bugzilla-archive#953 has been marked as a duplicate of this bug. *** |
* Use undef when extent of array is non-constant or simply undefined (rather than -1). Add code to handle copy-in/copy-out of assumed-size arrays. Add test. Check before and after array value copy. * Address Pete's review comments.
Extended Description
The instruction combiner is making the following transformation:
simplifying "(x >> 5) & 1 != 0" into "x > 31". They are not the same; consider
64: 64 >> 5 = 2, 2 & 1 = 0. But 64 > 31.
The text was updated successfully, but these errors were encountered: