25 #define DEBUG_TYPE "aarch64-prelegalizer-combiner" 28 using namespace MIPatternMatch;
30 #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS 31 #include "AArch64GenGICombiner.inc" 32 #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS 35 #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H 36 #include "AArch64GenGICombiner.inc" 37 #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H 39 class AArch64PreLegalizerCombinerInfo :
public CombinerInfo {
44 AArch64GenPreLegalizerCombinerHelper Generated;
46 AArch64PreLegalizerCombinerInfo(
bool EnableOpt,
bool OptSize,
bool MinSize,
49 nullptr, EnableOpt, OptSize, MinSize),
51 if (!Generated.parseCommandLineOption())
65 case TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS:
67 case Intrinsic::memcpy:
68 case Intrinsic::memmove:
69 case Intrinsic::memset: {
72 unsigned MaxLen = EnableOpt ? 0 : 32;
82 if (Generated.tryCombineAll(Observer, MI, B, Helper))
86 case TargetOpcode::G_CONCAT_VECTORS:
88 case TargetOpcode::G_SHUFFLE_VECTOR:
95 #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP 96 #include "AArch64GenGICombiner.inc" 97 #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP 106 AArch64PreLegalizerCombiner(
bool IsOptNone =
false);
108 StringRef getPassName()
const override {
return "AArch64PreLegalizerCombiner"; }
118 void AArch64PreLegalizerCombiner::getAnalysisUsage(
AnalysisUsage &AU)
const {
131 AArch64PreLegalizerCombiner::AArch64PreLegalizerCombiner(
bool IsOptNone)
136 bool AArch64PreLegalizerCombiner::runOnMachineFunction(
MachineFunction &MF) {
140 auto *TPC = &getAnalysis<TargetPassConfig>();
144 GISelKnownBits *KB = &getAnalysis<GISelKnownBitsAnalysis>().
get(MF);
146 IsOptNone ? nullptr : &getAnalysis<MachineDominatorTree>();
147 AArch64PreLegalizerCombinerInfo PCInfo(EnableOpt, F.hasOptSize(),
148 F.hasMinSize(), KB, MDT);
150 return C.combineMachineInstrs(MF,
nullptr);
155 "Combine AArch64 machine instrs before legalization",
166 return new AArch64PreLegalizerCombiner(IsOptNone);
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Combine AArch64 machine instrs before legalization
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
coro Split coroutine into a set of functions driving its state machine
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
const MachineFunctionProperties & getProperties() const
Get the function properties.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Target-Independent Code Generator Pass Configuration Options.
FunctionPass * createAArch64PreLegalizeCombiner(bool IsOptNone)
To use KnownBitsInfo analysis in a pass, KnownBitsInfo &Info = getAnalysis<GISelKnownBitsInfoAnalysis...
Abstract class that contains various methods for clients to notify about changes. ...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Helper class to build MachineInstr.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
INITIALIZE_PASS_BEGIN(AArch64PreLegalizerCombiner, DEBUG_TYPE, "Combine AArch64 machine instrs before legalization", false, false) INITIALIZE_PASS_END(AArch64PreLegalizerCombiner
void setPreservesCFG()
This function should be called by the pass, iff they do not:
const Function & getFunction() const
Return the LLVM function that this machine code represents.
void initializeAArch64PreLegalizerCombinerPass(PassRegistry &)
bool tryCombineShuffleVector(MachineInstr &MI)
Try to combine G_SHUFFLE_VECTOR into G_CONCAT_VECTORS.
Representation of each machine instruction.
bool tryCombineMemCpyFamily(MachineInstr &MI, unsigned MaxLen=0)
Optimize memcpy intrinsics et al, e.g.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
bool hasProperty(Property P) const
unsigned getIntrinsicID() const
Returns the Intrinsic::ID for this instruction.
StringRef - Represent a constant reference to a string, i.e.
bool tryCombineConcatVectors(MachineInstr &MI)
If MI is G_CONCAT_VECTORS, try to combine it.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...