diff options
author | Dhruv Chawla <dhruv263.dc@gmail.com> | 2023-05-08 16:11:19 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-05-08 16:14:01 +0200 |
commit | 1d21d2eb7f1dc205c42cfccd1d7890442a78e912 (patch) | |
tree | 7779dbea9c7942461f93168a3febe2933528158b /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | 254986d2df8d8407b46329e452c16748d29ed4cd (diff) | |
download | llvm-1d21d2eb7f1dc205c42cfccd1d7890442a78e912.zip llvm-1d21d2eb7f1dc205c42cfccd1d7890442a78e912.tar.gz llvm-1d21d2eb7f1dc205c42cfccd1d7890442a78e912.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
0 files changed, 0 insertions, 0 deletions