43#define GET_GICOMBINER_DEPS
44#include "X86GenPostLegalizeGICombiner.inc"
45#undef GET_GICOMBINER_DEPS
47#define DEBUG_TYPE "X86-postlegalizer-combiner"
54#define GET_GICOMBINER_TYPES
55#include "X86GenPostLegalizeGICombiner.inc"
56#undef GET_GICOMBINER_TYPES
58class X86PostLegalizerCombinerImpl :
public Combiner {
61 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig;
65 X86PostLegalizerCombinerImpl(
68 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig,
72 static const char *
getName() {
return "X86PostLegalizerCombiner"; }
78#define GET_GICOMBINER_CLASS_MEMBERS
79#include "X86GenPostLegalizeGICombiner.inc"
80#undef GET_GICOMBINER_CLASS_MEMBERS
83#define GET_GICOMBINER_IMPL
84#include "X86GenPostLegalizeGICombiner.inc"
85#undef GET_GICOMBINER_IMPL
87X86PostLegalizerCombinerImpl::X86PostLegalizerCombinerImpl(
90 const X86PostLegalizerCombinerImplRuleConfig &RuleConfig,
92 :
Combiner(MF, CInfo, TPC, &VT, CSEInfo),
93 Helper(Observer,
B,
false, &VT, MDT, LI),
94 RuleConfig(RuleConfig), STI(STI),
96#include
"X86GenPostLegalizeGICombiner.inc"
101bool X86PostLegalizerCombinerImpl::tryCombineAll(
MachineInstr &
MI)
const {
102 return tryCombineAllImpl(
MI);
105class X86PostLegalizerCombiner :
public MachineFunctionPass {
109 X86PostLegalizerCombiner();
111 StringRef getPassName()
const override {
return "X86PostLegalizerCombiner"; }
113 bool runOnMachineFunction(MachineFunction &MF)
override;
114 void getAnalysisUsage(AnalysisUsage &AU)
const override;
117 X86PostLegalizerCombinerImplRuleConfig RuleConfig;
121void X86PostLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU)
const {
125 AU.
addRequired<GISelValueTrackingAnalysisLegacy>();
136X86PostLegalizerCombiner::X86PostLegalizerCombiner() : MachineFunctionPass(
ID) {
137 if (!RuleConfig.parseCommandLineOption())
141bool X86PostLegalizerCombiner::runOnMachineFunction(
MachineFunction &MF) {
145 auto *TPC = &getAnalysis<TargetPassConfig>();
149 const auto *LI =
ST.getLegalizerInfo();
152 &getAnalysis<GISelValueTrackingAnalysisLegacy>().get(MF);
154 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
156 getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
157 auto *CSEInfo = &
Wrapper.get(TPC->getCSEConfig());
161 nullptr, !skipFunction(
F),
162 F.hasOptSize(),
F.hasMinSize());
164 CInfo.MaxIterations = 1;
167 CInfo.EnableFullDCE =
false;
168 X86PostLegalizerCombinerImpl Impl(MF, CInfo, TPC, *VT, CSEInfo, RuleConfig,
170 return Impl.combineMachineInstrs();
173char X86PostLegalizerCombiner::ID = 0;
175 "Combine X86 MachineInstrs after legalization",
false,
180 "Combine X86 MachineInstrs after legalization",
false,
185 return new X86PostLegalizerCombiner();
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 file implements a version of MachineIRBuilder which CSEs insts within a MachineBasicBlock.
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.
Declares convenience wrapper classes for interpreting MachineInstr instances as specific generic oper...
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.
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.
Representation of each machine instruction.
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 reportFatalInternalError(Error Err)
Report a fatal error that indicates a bug in LLVM.
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
FunctionPass * createX86PostLegalizerCombiner()
@ SinglePass
Enables Observer-based DCE and additional heuristics that retry combining defined and used instructio...