aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CMakeLists.txt
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-04-06 17:47:00 +0200
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-12-01 13:21:35 -0500
commit6d12599fd4134c1da63198c74a25490d28c733f6 (patch)
tree286632236e9d145a49399c34aa172b87ec6fd656 /llvm/lib/CodeGen/CMakeLists.txt
parent7850ab21128875611dead7d312ffbe4c8b47a5f2 (diff)
downloadllvm-6d12599fd4134c1da63198c74a25490d28c733f6.zip
llvm-6d12599fd4134c1da63198c74a25490d28c733f6.tar.gz
llvm-6d12599fd4134c1da63198c74a25490d28c733f6.tar.bz2
[CodeGen] Add new pass for late cleanup of redundant definitions.
A new pass MachineLateInstrsCleanup is added to be run after PEI. This is a simple pass that removes redundant and identical instructions whenever found by scanning the MF once while keeping track of register definitions in a map. These instructions are typically immediate loads resulting from rematerialization, and address loads emitted by target in eliminateFrameInde(). This is enabled by default, but a target could easily disable it by means of 'disablePass(&MachineLateInstrsCleanupID);'. This late cleanup is naturally not "optimal" in removing instructions as it is done by looking at phys-regs, but still quite effective. It would be desirable to improve other parts of CodeGen and avoid these redundant instructions in the first place, but there are no ideas for this yet. Differential Revision: https://reviews.llvm.org/D123394 Reviewed By: RKSimon, foad, craig.topper, arsenm, asb
Diffstat (limited to 'llvm/lib/CodeGen/CMakeLists.txt')
-rw-r--r--llvm/lib/CodeGen/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index db3b618..35d1012 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -119,6 +119,7 @@ add_llvm_component_library(LLVMCodeGen
MachineFunctionSplitter.cpp
MachineInstrBundle.cpp
MachineInstr.cpp
+ MachineLateInstrsCleanup.cpp
MachineLICM.cpp
MachineLoopInfo.cpp
MachineLoopUtils.cpp