aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ModuloSchedule.cpp
diff options
context:
space:
mode:
authorUsman Nadeem <mnadeem@quicinc.com>2024-03-16 11:24:42 -0700
committerGitHub <noreply@github.com>2024-03-16 11:24:42 -0700
commitc9325f8a2e7ec9bb9e0b28320aab4034bcb94a0d (patch)
tree4c2ca969ce86fcc97f453f39cde43f8065a994ad /llvm/lib/CodeGen/ModuloSchedule.cpp
parentf2794ccede6d32a6b5ef7a376ced420331e2be27 (diff)
downloadllvm-c9325f8a2e7ec9bb9e0b28320aab4034bcb94a0d.zip
llvm-c9325f8a2e7ec9bb9e0b28320aab4034bcb94a0d.tar.gz
llvm-c9325f8a2e7ec9bb9e0b28320aab4034bcb94a0d.tar.bz2
[DFAJumpThreading] Add an early exit heuristic for unpredictable values (#85015)
Right now the algorithm does not exit on unpredictable values. It waits until all the paths have been enumerated to see if any of those paths have that value. Waiting this late leads to a lot of wasteful computation and higher compile time. In this patch I have added a heuristic that checks if the value comes from the same inner loops as the switch, if so, then it is likely that the value will also be seen on a threadable path and the code in `getStateDefMap()` return an empty map. I tested this on the llvm test suite and the only change in the number of threaded switches was in 7zip (before 23, after 18). In all of those cases the current algorithm was partially threading the loop because it was hitting a limit on the number of paths to be explored. On increasing this limit even the current algorithm finds paths where the unpredictable value is seen. Compile time(with pass enabled by default and this patch): https://llvm-compile-time-tracker.com/compare.php?from=8c5e9cf737138aba22a4a8f64ef2c5efc80dd7f9&to=42c75d888058b35c6d15901b34e36251d8f766b9&stat=instructions:u
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
0 files changed, 0 insertions, 0 deletions