aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CMakeLists.txt
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-12-05 08:14:40 -0600
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2022-12-05 12:53:50 -0600
commit5ecd363295089ad2db3c428ab1ee08ef1864ce3b (patch)
tree63fb6975a8db44baaf1e65c07d22c83683e69b04 /llvm/lib/CodeGen/CMakeLists.txt
parent962863d988195917b7d2ccfb83a3a166e01ffc77 (diff)
downloadllvm-5ecd363295089ad2db3c428ab1ee08ef1864ce3b.zip
llvm-5ecd363295089ad2db3c428ab1ee08ef1864ce3b.tar.gz
llvm-5ecd363295089ad2db3c428ab1ee08ef1864ce3b.tar.bz2
Reapply "[CodeGen] Add new pass for late cleanup of redundant definitions."
This reverts commit 122efef8ee9be57055d204d52c38700fe933c033. - Patch fixed to not reuse definitions from predecessors in EH landing pads. - Late review suggestions (by MaskRay) have been addressed. - M68k/pipeline.ll test updated. - Init captures added in processBlock() to avoid capturing structured bindings. - RISCV has this disabled for now. Original commit message: 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 75b77ee..4ca8501 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