aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2023-10-27 19:47:23 +0000
committerGuozhi Wei <carrot@google.com>2023-10-27 19:47:23 +0000
commit9a091de7fe83af010e6ce38e2ed1227ef475bf49 (patch)
tree8943acfe0befe6cc7fee7a358503aecf4006ccbf /llvm/lib/CodeGen/MachineFunction.cpp
parentc18e78cfe3d3bd2982fe5964aff1df23be6b58ee (diff)
downloadllvm-9a091de7fe83af010e6ce38e2ed1227ef475bf49.zip
llvm-9a091de7fe83af010e6ce38e2ed1227ef475bf49.tar.gz
llvm-9a091de7fe83af010e6ce38e2ed1227ef475bf49.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp6
1 files changed, 6 insertions, 0 deletions
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);