32#define GET_GICOMBINER_DEPS
33#include "X86GenPreLegalizeGICombiner.inc"
34#undef GET_GICOMBINER_DEPS
36#define DEBUG_TYPE "x86-prelegalizer-combiner"
45 nullptr, EnableOpt,
F.hasOptSize(),
F.hasMinSize());
53#define GET_GICOMBINER_TYPES
54#include "X86GenPreLegalizeGICombiner.inc"
55#undef GET_GICOMBINER_TYPES
57class X86PreLegalizerCombinerImpl :
public Combiner {
60 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig;
64 X86PreLegalizerCombinerImpl(
67 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
70 static const char *
getName() {
return "X86PreLegalizerCombiner"; }
77#define GET_GICOMBINER_CLASS_MEMBERS
78#include "X86GenPreLegalizeGICombiner.inc"
79#undef GET_GICOMBINER_CLASS_MEMBERS
82#define GET_GICOMBINER_IMPL
83#include "X86GenPreLegalizeGICombiner.inc"
84#undef GET_GICOMBINER_IMPL
86X86PreLegalizerCombinerImpl::X86PreLegalizerCombinerImpl(
89 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
92 Helper(Observer,
B,
true, &VT, MDT,
94 RuleConfig(RuleConfig), STI(MF.getSubtarget<
X86Subtarget>()),
96#include
"X86GenPreLegalizeGICombiner.inc"
101bool X86PreLegalizerCombinerImpl::tryCombineAll(
MachineInstr &
MI)
const {
102 return tryCombineAllImpl(
MI);
105class X86PreLegalizerCombinerLegacy :
public MachineFunctionPass {
109 X86PreLegalizerCombinerLegacy();
111 StringRef getPassName()
const override {
112 return "X86PreLegalizerCombinerLegacy";
115 bool runOnMachineFunction(MachineFunction &MF)
override;
117 void getAnalysisUsage(AnalysisUsage &AU)
const override;
120 X86PreLegalizerCombinerImplRuleConfig RuleConfig;
124void X86PreLegalizerCombinerLegacy::getAnalysisUsage(AnalysisUsage &AU)
const {
128 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
137X86PreLegalizerCombinerLegacy::X86PreLegalizerCombinerLegacy()
138 : MachineFunctionPass(
ID) {
139 if (!RuleConfig.parseCommandLineOption())
143bool X86PreLegalizerCombinerLegacy::runOnMachineFunction(
MachineFunction &MF) {
146 auto &TPC = getAnalysis<TargetPassConfig>();
150 getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
151 auto *CSEInfo = &
Wrapper.get(TPC.getCSEConfig());
156 &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
158 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
160 X86PreLegalizerCombinerImpl Impl(MF, CInfo, *VT, CSEInfo, RuleConfig, MDT);
161 return Impl.combineMachineInstrs();
164char X86PreLegalizerCombinerLegacy::ID = 0;
166 "Combine X86 machine instrs before legalization",
false,
172 "Combine X86 machine instrs before legalization",
false,
183 X86PreLegalizerCombinerImplRuleConfig RuleConfig;
184 if (!RuleConfig.parseCommandLineOption())
193 X86PreLegalizerCombinerImpl Impl(MF, CInfo, VT, CSEInfo.get(), RuleConfig,
195 Impl.combineMachineInstrs();
205 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)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
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.