From 9a091de7fe83af010e6ce38e2ed1227ef475bf49 Mon Sep 17 00:00:00 2001 From: Guozhi Wei Date: Fri, 27 Oct 2023 19:47:23 +0000 Subject: [X86, Peephole] Enable FoldImmediate for X86 Enable FoldImmediate for X86 by implementing X86InstrInfo::FoldImmediate. Also enhanced peephole by deleting identical instructions after FoldImmediate. Differential Revision: https://reviews.llvm.org/D151848 --- llvm/lib/CodeGen/MachineFunction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 1f14546..9e67dcb 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -178,6 +178,12 @@ void MachineFunction::handleRemoval(MachineInstr &MI) { TheDelegate->MF_HandleRemoval(MI); } +void MachineFunction::handleChangeDesc(MachineInstr &MI, + const MCInstrDesc &TID) { + if (TheDelegate) + TheDelegate->MF_HandleChangeDesc(MI, TID); +} + void MachineFunction::init() { // Assume the function starts in SSA form with correct liveness. Properties.set(MachineFunctionProperties::Property::IsSSA); -- cgit v1.1