[all-commits] [llvm/llvm-project] 1d21d2: [TargetLowering] Fix unnecessary call to `computeK...
Dhruv Chawla via All-commits
all-commits at lists.llvm.org
Mon May 8 07:14:19 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1d21d2eb7f1dc205c42cfccd1d7890442a78e912
https://github.com/llvm/llvm-project/commit/1d21d2eb7f1dc205c42cfccd1d7890442a78e912
Author: Dhruv Chawla <dhruv263.dc at gmail.com>
Date: 2023-05-08 (Mon, 08 May 2023)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Log Message:
-----------
[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
More information about the All-commits
mailing list