aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorRahul Joshi <rjoshi@nvidia.com>2025-05-22 08:07:52 -0700
committerGitHub <noreply@github.com>2025-05-22 08:07:52 -0700
commit1fdf02ad5a4ca155017eea22688365a20aab077c (patch)
tree38da88552269eba7d8e30bfadbbf0c8d60375127 /llvm/lib/CodeGen/MIRPrinter.cpp
parenteee958285bde228df2893f70f879c1af8ec8386c (diff)
downloadllvm-1fdf02ad5a4ca155017eea22688365a20aab077c.zip
llvm-1fdf02ad5a4ca155017eea22688365a20aab077c.tar.gz
llvm-1fdf02ad5a4ca155017eea22688365a20aab077c.tar.bz2
[LLVM][CodeGen] Add convenience accessors for MachineFunctionProperties (#140002)users/pcc/spr/main.elf-add-branch-to-branch-optimization
Add per-property has<Prop>/set<Prop>/reset<Prop> functions to MachineFunctionProperties.
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 368b9eb..b7b8f66 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -188,25 +188,16 @@ static void printMF(raw_ostream &OS, const MachineModuleInfo &MMI,
YamlMF.IsOutlined = MF.isOutlined();
YamlMF.UseDebugInstrRef = MF.useDebugInstrRef();
- YamlMF.Legalized = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::Legalized);
- YamlMF.RegBankSelected = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::RegBankSelected);
- YamlMF.Selected = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::Selected);
- YamlMF.FailedISel = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::FailedISel);
- YamlMF.FailsVerification = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::FailsVerification);
- YamlMF.TracksDebugUserValues = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::TracksDebugUserValues);
-
- YamlMF.NoPHIs = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::NoPHIs);
- YamlMF.IsSSA = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::IsSSA);
- YamlMF.NoVRegs = MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::NoVRegs);
+ const MachineFunctionProperties &Props = MF.getProperties();
+ YamlMF.Legalized = Props.hasLegalized();
+ YamlMF.RegBankSelected = Props.hasRegBankSelected();
+ YamlMF.Selected = Props.hasSelected();
+ YamlMF.FailedISel = Props.hasFailedISel();
+ YamlMF.FailsVerification = Props.hasFailsVerification();
+ YamlMF.TracksDebugUserValues = Props.hasTracksDebugUserValues();
+ YamlMF.NoPHIs = Props.hasNoPHIs();
+ YamlMF.IsSSA = Props.hasIsSSA();
+ YamlMF.NoVRegs = Props.hasNoVRegs();
convertMRI(YamlMF, MF, MF.getRegInfo(), MF.getSubtarget().getRegisterInfo());
MachineModuleSlotTracker &MST = State.MST;