[SelectionDAG] Handle NSW for ADD/SUB in computeKnownBits()
authorDhruv Chawla <dhruv263.dc@gmail.com>
Wed, 17 May 2023 13:12:11 +0000 (15:12 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 17 May 2023 13:15:05 +0000 (15:15 +0200)
commitb66551370fdfc6f357ae0d77237119d2b1077b62
tree445e3308441859baa52dcc5656981f13d5fa42b7
parentf8ab84171e6e718434d0237dfe026b5af9a53db1
[SelectionDAG] Handle NSW for ADD/SUB in computeKnownBits()

This patch is a continuation of D150110. It separates the cases for
ADD and SUB into their own cases so that computeForAddSub can be
directly called and the NSW flag passed. This allows better
optimization when the NSW flag is enabled, and allows fixing up the
TODO that was there previously in SimplifyDemandedBits.

Differential Revision: https://reviews.llvm.org/D150769
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/Thumb2/mve-blockplacement.ll