[all-commits] [llvm/llvm-project] 5fb571: [DFAJumpThreading] Don't bail early after encounte...
Usman Nadeem via All-commits
all-commits at lists.llvm.org
Wed Dec 25 01:29:22 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5fb57131b744c52f74919f9487f4a9fa69f455fb
https://github.com/llvm/llvm-project/commit/5fb57131b744c52f74919f9487f4a9fa69f455fb
Author: Usman Nadeem <mnadeem at quicinc.com>
Date: 2024-12-25 (Wed, 25 Dec 2024)
Changed paths:
M llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
M llvm/test/Transforms/DFAJumpThreading/dfa-unfold-select.ll
M llvm/test/Transforms/DFAJumpThreading/negative.ll
Log Message:
-----------
[DFAJumpThreading] Don't bail early after encountering unpredictable values (#119774)
After #96127 landed, mshockwave reported that the pass was no longer
threading SPEC2006/perlbench.
After 96127 we started bailing out in `getStateDefMap` and rejecting the
transformation because one of the unpredictable values was coming from
inside the loop. There was no fundamental change in that function except
that we started calling `Loop->contains(IncomingBB)` instead of
`LoopBBs.count(IncomingBB)`. After some analysis I came to the
conclusion that even before 96127 we would reject the transformation if
we provided large enough limits on the path traversal (large enough so
that LoopBBs contained blocks corresponding to that unpredictable
value).
In this patch I changed `getStateDefMap` to not terminate early on
finding an unpredictable value, this is because
`getPathsFromStateDefMap`, later, actually has checks to ensure that the
final list of paths only have predictable values. As a result we can now
partially thread functions like `negative6` in the tests that have some
predictable paths.
This patch does not really have any compile-time impact on the test
suite without `-dfa-early-exit-heuristic=false` (early exit is enabled
by default).
Change-Id: Ie1633b370ed4a0eda8dea52650b40f6f66ef49a3
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