31#define GET_GICOMBINER_DEPS
32#include "X86GenPreLegalizeGICombiner.inc"
33#undef GET_GICOMBINER_DEPS
35#define DEBUG_TYPE "x86-prelegalizer-combiner"
44 nullptr, EnableOpt,
F.hasOptSize(),
F.hasMinSize());
52#define GET_GICOMBINER_TYPES
53#include "X86GenPreLegalizeGICombiner.inc"
54#undef GET_GICOMBINER_TYPES
56class X86PreLegalizerCombinerImpl :
public Combiner {
59 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig;
63 X86PreLegalizerCombinerImpl(
66 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
69 static const char *
getName() {
return "X86PreLegalizerCombiner"; }
76#define GET_GICOMBINER_CLASS_MEMBERS
77#include "X86GenPreLegalizeGICombiner.inc"
78#undef GET_GICOMBINER_CLASS_MEMBERS
81#define GET_GICOMBINER_IMPL
82#include "X86GenPreLegalizeGICombiner.inc"
83#undef GET_GICOMBINER_IMPL
85X86PreLegalizerCombinerImpl::X86PreLegalizerCombinerImpl(
88 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
91 Helper(Observer,
B,
true, &VT, MDT,
93 RuleConfig(RuleConfig), STI(MF.getSubtarget<
X86Subtarget>()),
95#include
"X86GenPreLegalizeGICombiner.inc"
100bool X86PreLegalizerCombinerImpl::tryCombineAll(
MachineInstr &
MI)
const {
101 return tryCombineAllImpl(
MI);
104class X86PreLegalizerCombinerLegacy :
public MachineFunctionPass {
108 X86PreLegalizerCombinerLegacy();
110 StringRef getPassName()
const override {
111 return "X86PreLegalizerCombinerLegacy";
116 void getAnalysisUsage(AnalysisUsage &AU)
const override;
119 X86PreLegalizerCombinerImplRuleConfig RuleConfig;
123void X86PreLegalizerCombinerLegacy::getAnalysisUsage(AnalysisUsage &AU)
const {
127 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
135X86PreLegalizerCombinerLegacy::X86PreLegalizerCombinerLegacy()
136 : MachineFunctionPass(
ID) {
137 if (!RuleConfig.parseCommandLineOption())
141bool X86PreLegalizerCombinerLegacy::runOnMachineFunction(
MachineFunction &MF) {
144 auto &TPC = getAnalysis<TargetPassConfig>();
148 getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
149 auto *CSEInfo = &
Wrapper.get(TPC.getCSEConfig());
154 &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
156 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
158 X86PreLegalizerCombinerImpl Impl(MF, CInfo, *VT, CSEInfo, RuleConfig, MDT);
159 return Impl.combineMachineInstrs();
162char X86PreLegalizerCombinerLegacy::ID = 0;
164 "Combine X86 machine instrs before legalization",
false,
170 "Combine X86 machine instrs before legalization",
false,
181 X86PreLegalizerCombinerImplRuleConfig RuleConfig;
182 if (!RuleConfig.parseCommandLineOption())
191 X86PreLegalizerCombinerImpl Impl(MF, CInfo, VT, CSEInfo.get(), RuleConfig,
193 Impl.combineMachineInstrs();
203 return new X86PreLegalizerCombinerLegacy();
#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.
Provides analysis for querying information about KnownBits during GISel passes.
Interface for Targets to specify which operations they can successfully select and how the others sho...
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.
The actual analysis pass wrapper.
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.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
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.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
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 PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
FunctionPass * createX86PreLegalizerCombinerLegacy()
bool EnableFullDCE
Whether dead code elimination is performed before each Combiner iteration.