Fixes a regression from D75801. SimplifyDemandedUseBits() is also supposed to compute the known bits (of the demanded subset) of the instruction. For unknown instructions it does so by directly calling computeKnownBits(). For known instructions it will compute known bits itself. However, for instructions where only some cases are handled directly (e.g. a constant shift amount) the known bits invocation for the unhandled case is sometimes missing. This patch adds the missing calls and thus removes the main discrepancy with ExpensiveCombines mode.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Some comments on the intrinsics code, as it did some weird things before...
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | ||
---|---|---|
719 ↗ | (On Diff #248922) | Despite what the comment says, this was already computing known bits, because the "break" falls through to the call below. |
752 ↗ | (On Diff #248922) | While known bits were computed explicitly here, this break would still fall through to the known bits call below, and thus recompute the result from scratch. |
781 ↗ | (On Diff #248922) | This return nullptr skipped the bit of code for returning a constant integer below. |
790 ↗ | (On Diff #248922) | To avoid the three issues mentioned above, I'm now explicitly tracking whether known bits were computed or not for the call. |