diff options
author | Jay Foad <jay.foad@amd.com> | 2025-07-23 11:35:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-23 11:35:57 +0100 |
commit | 756ac65987b84b7427c25d76f069a04a4a817a5c (patch) | |
tree | 7c3d20b61e8fcdafeff8123054e215d7ad70b5ab /llvm/lib/CodeGen | |
parent | 33455825428f9e1b7998a66e228da7f6d483acf8 (diff) | |
download | llvm-756ac65987b84b7427c25d76f069a04a4a817a5c.zip llvm-756ac65987b84b7427c25d76f069a04a4a817a5c.tar.gz llvm-756ac65987b84b7427c25d76f069a04a4a817a5c.tar.bz2 |
[CodeGen] Add a pass for testing finalizeBundle (#149813)
This allows for unit testing of finalizeBundle with standard MIR tests
using update_mir_test_checks.py.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstrBundle.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp index 34896c6..44b648a 100644 --- a/llvm/lib/CodeGen/MachineInstrBundle.cpp +++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp @@ -359,3 +359,13 @@ PhysRegInfo llvm::AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg, return PRI; } + +PreservedAnalyses +llvm::FinalizeBundleTestPass::run(MachineFunction &MF, + MachineFunctionAnalysisManager &) { + // For testing purposes, bundle the entire contents of each basic block + // except for terminators. + for (MachineBasicBlock &MBB : MF) + finalizeBundle(MBB, MBB.instr_begin(), MBB.getFirstInstrTerminator()); + return PreservedAnalyses::none(); +} |