37#define GET_GICOMBINER_DEPS
38#include "X86GenPostLegalizeGICombiner.inc"
39#undef GET_GICOMBINER_DEPS
41#define DEBUG_TYPE "X86-postlegalizer-combiner"
52 F.hasOptSize(),
F.hasMinSize());
61#define GET_GICOMBINER_TYPES
62#include "X86GenPostLegalizeGICombiner.inc"
63#undef GET_GICOMBINER_TYPES
65class X86PostLegalizerCombinerImpl :
public Combiner {
68 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig;
72 X86PostLegalizerCombinerImpl(
75 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig,
78 static const char *
getName() {
return "X86PostLegalizerCombiner"; }
84#define GET_GICOMBINER_CLASS_MEMBERS
85#include "X86GenPostLegalizeGICombiner.inc"
86#undef GET_GICOMBINER_CLASS_MEMBERS
89#define GET_GICOMBINER_IMPL
90#include "X86GenPostLegalizeGICombiner.inc"
91#undef GET_GICOMBINER_IMPL
93X86PostLegalizerCombinerImpl::X86PostLegalizerCombinerImpl(
96 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig,
99 Helper(Observer,
B,
false, &VT, MDT,
101 RuleConfig(RuleConfig), STI(MF.getSubtarget<
X86Subtarget>()),
103#include
"X86GenPostLegalizeGICombiner.inc"
108bool X86PostLegalizerCombinerImpl::tryCombineAll(
MachineInstr &
MI)
const {
109 return tryCombineAllImpl(
MI);
112class X86PostLegalizerCombinerLegacy :
public MachineFunctionPass {
116 X86PostLegalizerCombinerLegacy();
118 StringRef getPassName()
const override {
119 return "X86PostLegalizerCombinerLegacy";
123 void getAnalysisUsage(AnalysisUsage &AU)
const override;
126 X86PostLegalizerCombinerImplRuleConfig RuleConfig;
130void X86PostLegalizerCombinerLegacy::getAnalysisUsage(AnalysisUsage &AU)
const {
134 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
144X86PostLegalizerCombinerLegacy::X86PostLegalizerCombinerLegacy()
145 : MachineFunctionPass(
ID) {
146 if (!RuleConfig.parseCommandLineOption())
150bool X86PostLegalizerCombinerLegacy::runOnMachineFunction(
MachineFunction &MF) {
154 auto *TPC = &getAnalysis<TargetPassConfig>();
158 &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
160 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
162 getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
163 auto *CSEInfo = &
Wrapper.get(TPC->getCSEConfig());
167 X86PostLegalizerCombinerImpl Impl(MF, CInfo, *VT, CSEInfo, RuleConfig, MDT);
168 return Impl.combineMachineInstrs();
171char X86PostLegalizerCombinerLegacy::ID = 0;
173 "Combine X86 MachineInstrs after legalization",
false,
178 "Combine X86 MachineInstrs after legalization",
false,
197 X86PostLegalizerCombinerImplRuleConfig RuleConfig;
198 if (!RuleConfig.parseCommandLineOption())
201 X86PostLegalizerCombinerImpl Impl(MF, CInfo, VT, CSEInfo.get(), RuleConfig,
203 if (!Impl.combineMachineInstrs())
214 return new X86PostLegalizerCombinerLegacy();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define GET_GICOMBINER_CONSTRUCTOR_INITS
amdgpu aa AMDGPU Address space based Alias Analysis Wrapper
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Provides analysis for continuously CSEing during GISel passes.
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.
This contains common code to allow clients to notify changes to machine instr.
Provides analysis for querying information about KnownBits during GISel passes.
Contains matchers for matching SSA Machine Instructions.
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)
Target-Independent Code Generator Pass Configuration Options pass.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
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.
Simple wrapper that does the following.
To use KnownBitsInfo analysis in a pass, KnownBitsInfo &Info = getAnalysis<GISelValueTrackingInfoAnal...
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineFunctionProperties & getProperties() const
Get the function properties.
Representation of each machine instruction.
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 & preserve()
Mark an analysis as preserved.
Target-Independent Code Generator Pass Configuration Options.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI void reportFatalInternalError(Error Err)
Report a fatal error that indicates a bug in LLVM.
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
FunctionPass * createX86PostLegalizerCombinerLegacy()
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
unsigned MaxIterations
The maximum number of times the Combiner will iterate over the MachineFunction.
ObserverLevel ObserverLvl
Select how the Combiner acts on MIR changes.
bool EnableFullDCE
Whether dead code elimination is performed before each Combiner iteration.
@ SinglePass
Enables Observer-based DCE and additional heuristics that retry combining defined and used instructio...