32#define GET_GICOMBINER_DEPS
33#include "X86GenPreLegalizeGICombiner.inc"
34#undef GET_GICOMBINER_DEPS
36#define DEBUG_TYPE "x86-prelegalizer-combiner"
43#define GET_GICOMBINER_TYPES
44#include "X86GenPreLegalizeGICombiner.inc"
45#undef GET_GICOMBINER_TYPES
47class X86PreLegalizerCombinerImpl :
public Combiner {
50 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig;
54 X86PreLegalizerCombinerImpl(
57 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
61 static const char *
getName() {
return "X86PreLegalizerCombiner"; }
68#define GET_GICOMBINER_CLASS_MEMBERS
69#include "X86GenPreLegalizeGICombiner.inc"
70#undef GET_GICOMBINER_CLASS_MEMBERS
73#define GET_GICOMBINER_IMPL
74#include "X86GenPreLegalizeGICombiner.inc"
75#undef GET_GICOMBINER_IMPL
77X86PreLegalizerCombinerImpl::X86PreLegalizerCombinerImpl(
80 const X86PreLegalizerCombinerImplRuleConfig &RuleConfig,
82 :
Combiner(MF, CInfo, TPC, &VT, CSEInfo),
83 Helper(Observer,
B,
true, &VT, MDT, LI),
84 RuleConfig(RuleConfig), STI(STI),
86#include
"X86GenPreLegalizeGICombiner.inc"
91bool X86PreLegalizerCombinerImpl::tryCombineAll(
MachineInstr &
MI)
const {
92 return tryCombineAllImpl(
MI);
95class X86PreLegalizerCombiner :
public MachineFunctionPass {
99 X86PreLegalizerCombiner();
101 StringRef getPassName()
const override {
return "X86PreLegalizerCombiner"; }
103 bool runOnMachineFunction(MachineFunction &MF)
override;
105 void getAnalysisUsage(AnalysisUsage &AU)
const override;
108 X86PreLegalizerCombinerImplRuleConfig RuleConfig;
112void X86PreLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU)
const {
116 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
125X86PreLegalizerCombiner::X86PreLegalizerCombiner() : MachineFunctionPass(
ID) {
126 if (!RuleConfig.parseCommandLineOption())
130bool X86PreLegalizerCombiner::runOnMachineFunction(
MachineFunction &MF) {
133 auto &TPC = getAnalysis<TargetPassConfig>();
137 getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
138 auto *CSEInfo = &
Wrapper.get(TPC.getCSEConfig());
147 &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
149 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
151 LI, EnableOpt,
F.hasOptSize(),
156 CInfo.EnableFullDCE =
true;
157 X86PreLegalizerCombinerImpl Impl(MF, CInfo, &TPC, *VT, CSEInfo, RuleConfig,
159 return Impl.combineMachineInstrs();
162char X86PreLegalizerCombiner::ID = 0;
164 "Combine X86 machine instrs before legalization",
false,
170 "Combine X86 machine instrs before legalization",
false,
175 return new X86PreLegalizerCombiner();
#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.
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:
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...
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.
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.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Representation of each machine instruction.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
Target-Independent Code Generator Pass Configuration Options.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
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 * createX86PreLegalizerCombiner()