[TargetLowering] Fix unnecessary call to `computeKnownBits` (NFCI)
In the SimplifyDemandedBits function, there is a fallthrough to the default case in the case of ISD::ADD, ISD::MUL and ISD::SUB. This leads to a call to computeKnownBits which is unnecessary as the calls to SimplifyDemandedBits in the cases themselves handle the calculation of the known bits. This information is discarded through the Known2 variables. By keeping this information around and calling KnownBits::mul or KnownBits::computeForAddSub directly, the unnecessary computation can be avoided. For now, the NSW bit is not passed through to KnownBits as this is something that computeKnownBits does not handle either. This requires updating computeForAddCarry to handle the flag as well. Differential Revision: https://reviews.llvm.org/D150110
parent
254986d2
Please register or sign in to comment