[all-commits] [llvm/llvm-project] 783e07: [InstCombine] Add tests cases related to demanded ...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Thu Jul 18 02:45:59 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 783e07f3a4f4684613ffb4a442c97f25c83f309b
https://github.com/llvm/llvm-project/commit/783e07f3a4f4684613ffb4a442c97f25c83f309b
Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2024-07-18 (Thu, 18 Jul 2024)
Changed paths:
M llvm/test/Transforms/InstCombine/ashr-demand.ll
Log Message:
-----------
[InstCombine] Add tests cases related to demanded use bits for ashr
When trying to improve value tracking in
https://github.com/llvm/llvm-project/pull/97693
some regressions was found due to a "weirdness" in simplify demanded
use bits for ashr. Normally an ashr is replaced by lshr when the
shifted in bits aren't demanded. Some years ago (see commit
22178dd33b346020) there was a test case motivating to keep the ashr
when any sign bit (besides the shifted in bits) was demanded. The
weird part about it is that the better we get at analysing known sign
bits, the less likely it is that we canonicalize from ashr to lshr.
That makes it hard to tune other combines to work based on the
canonicalization, as well as possibly resulting in unexpected
regressions when improving value tracking.
This patch adds a test case for which it would be better to
canonicalize ashr into lshr when possible. Worth mentioning is also
that reverting 22178dd33b346020 doesn't seem to cause regressions
in any other lit tests (not even the one added in 22178dd33b346020).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list