aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2024-03-15 09:30:46 +0000
committerGitHub <noreply@github.com>2024-03-15 09:30:46 +0000
commit8310fd3a093ce98e4df599f7cac2081f551e3fef (patch)
tree3fbc29ca52dc19b874aa27d8ed788cc1ffd1b245 /llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
parent719e077a5680ccfd6601195754c1702b03ba3645 (diff)
downloadllvm-8310fd3a093ce98e4df599f7cac2081f551e3fef.zip
llvm-8310fd3a093ce98e4df599f7cac2081f551e3fef.tar.gz
llvm-8310fd3a093ce98e4df599f7cac2081f551e3fef.tar.bz2
[MachineLICM] Give opportunity to analyze physregs for invariance. (#84779)
At the moment MachineLoopInfo has a very simple way to determine if a use of a physical register will be invariant: if it is not a constant value or if it's not an ignorable use, then it's not considered invariant. From a compile-time performance perspective this makes a lot of sense, but it limits code that uses implicit physical registers from being hoisted until the later MachineLICM pass (after register allocation), which has a lot fewer opportunities to hoist. For AArch64 SME we use an implicit physical register ($vg) to avoid rematerialization beyond certain instructions. Doing this led to regressions because simple expressions were no longer hoisted by Early MachineLICM. This patch adds some extra checks to 'isLoopInvariant' to see if any of the defs are found in the loop. If not, we can considered it loop invariant. We expect the impact on compile-time to be negligible because there is an incentive for users to reduce the need for the smstart/smstop instructions that define $vg. In either case, we've put the functionality under a target interface to limit this only to specific registers.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp')
0 files changed, 0 insertions, 0 deletions