aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJonas Paulsson <paulson1@linux.ibm.com>2025-03-13 08:50:54 -0600
committerGitHub <noreply@github.com>2025-03-13 15:50:54 +0100
commit85318bae285e9103acbc75ad3bdf78db1ce56f21 (patch)
tree82c852961990914fbfab88e27e1866694cdb8cd6 /flang/lib/Frontend/CompilerInvocation.cpp
parent28ffa7f6a4d609e097a4861090f42c35459e9303 (diff)
downloadllvm-85318bae285e9103acbc75ad3bdf78db1ce56f21.zip
llvm-85318bae285e9103acbc75ad3bdf78db1ce56f21.tar.gz
llvm-85318bae285e9103acbc75ad3bdf78db1ce56f21.tar.bz2
[MachineLateInstrsCleanup] Handle multiple kills for a preceding definition. (#119132)
When removing a redundant definition in order to reuse an earlier identical one it is necessary to remove any earlier kill flag as well. Previously, the assumption has been that any register that kills the defined Reg is enough to handle for this purpose, but this is actually not quite enough. A kill of a super-register does not necessarily imply that all of its subregs (including Reg) is defined at that point: a partial definition of a register is legal. This means Reg may have been killed earlier and is not live at that point. This patch changes the tracking of kill flags to allow for multiple flags to be removed: instead of remembering just the single / latest kill flag, a vector is now used to track and remove them all. TinyPtrVector seems ideal for this as there are only very rarely more than one kill flag, and it doesn't seem to give much difference in compile time. The kill flags handling here is making this pass much more complicated than it would have to be. This pass does not depend on kill flags for its own use, so an interesting alternative to all this handling would be to just remove them all. If there actually is a serious user, maybe that pass could instead recompute them. Also adding an assertion which is unrelated to kill flags, but it seems to make sense (according to liberal assertion policy), to verify that the preceding definition is in fact identical in clearKillsForDef(). Fixes #117783
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions