30#define GET_GICOMBINER_DEPS
31#include "RISCVGenO0PreLegalizeGICombiner.inc"
32#undef GET_GICOMBINER_DEPS
34#define DEBUG_TYPE "riscv-O0-prelegalizer-combiner"
39#define GET_GICOMBINER_TYPES
40#include "RISCVGenO0PreLegalizeGICombiner.inc"
41#undef GET_GICOMBINER_TYPES
43class RISCVO0PreLegalizerCombinerImpl :
public Combiner {
46 const RISCVO0PreLegalizerCombinerImplRuleConfig &RuleConfig;
50 RISCVO0PreLegalizerCombinerImpl(
53 const RISCVO0PreLegalizerCombinerImplRuleConfig &RuleConfig,
56 static const char *
getName() {
return "RISCVO0PreLegalizerCombiner"; }
61#define GET_GICOMBINER_CLASS_MEMBERS
62#include "RISCVGenO0PreLegalizeGICombiner.inc"
63#undef GET_GICOMBINER_CLASS_MEMBERS
66#define GET_GICOMBINER_IMPL
67#include "RISCVGenO0PreLegalizeGICombiner.inc"
68#undef GET_GICOMBINER_IMPL
70RISCVO0PreLegalizerCombinerImpl::RISCVO0PreLegalizerCombinerImpl(
73 const RISCVO0PreLegalizerCombinerImplRuleConfig &RuleConfig,
76 Helper(Observer,
B,
true, &VT), RuleConfig(RuleConfig),
79#include
"RISCVGenO0PreLegalizeGICombiner.inc"
91 RISCVO0PreLegalizerCombinerLegacy();
94 return "RISCVO0PreLegalizerCombiner";
103void RISCVO0PreLegalizerCombinerLegacy::getAnalysisUsage(
112RISCVO0PreLegalizerCombinerLegacy::RISCVO0PreLegalizerCombinerLegacy()
121 RISCVO0PreLegalizerCombinerImplRuleConfig RuleConfig;
122 if (!RuleConfig.parseCommandLineOption())
132 F.hasOptSize(),
F.hasMinSize());
135 CInfo.MaxIterations = 1;
137 RISCVO0PreLegalizerCombinerImpl Impl(MF, CInfo, *VT,
138 nullptr, RuleConfig, ST);
139 return Impl.combineMachineInstrs();
142char RISCVO0PreLegalizerCombinerLegacy::ID = 0;
144 "Combine RISC-V machine instrs before legalization",
149 "Combine RISC-V machine instrs before legalization",
false,
153 return new RISCVO0PreLegalizerCombinerLegacy();
156bool RISCVO0PreLegalizerCombinerLegacy::runOnMachineFunction(
159 return &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
172 .preserve<GISelValueTrackingAnalysis>();
#define GET_GICOMBINER_CONSTRUCTOR_INITS
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This contains common combine transformations that may be used in a combine pass,or by the target else...
Option class for Targets to specify which operations are combined how and when.
This contains the base class for all Combiners generated by TableGen.
Provides analysis for querying information about KnownBits during GISel passes.
This file declares the MachineIRBuilder class.
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static StringRef getName(Value *V)
static bool runO0PreLegalizerCombiner(MachineFunction &MF, function_ref< GISelValueTracking *()> GetVT)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
The actual analysis pass wrapper.
To use KnownBitsInfo analysis in a pass, KnownBitsInfo &Info = getAnalysis<GISelValueTrackingInfoAnal...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineFunctionProperties & getProperties() const
Get the function properties.
Representation of each machine instruction.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
An efficient, type-erasing, non-owning reference to a callable.
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
FunctionPass * createRISCVO0PreLegalizerCombinerLegacyPass()
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.