AArch64PreLegalizerCombiner.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. //=== lib/CodeGen/GlobalISel/AArch64PreLegalizerCombiner.cpp --------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This pass does combining of machine instructions at the generic MI level,
  10. // before the legalizer.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "AArch64GlobalISelUtils.h"
  14. #include "AArch64TargetMachine.h"
  15. #include "llvm/CodeGen/GlobalISel/Combiner.h"
  16. #include "llvm/CodeGen/GlobalISel/CombinerHelper.h"
  17. #include "llvm/CodeGen/GlobalISel/CombinerInfo.h"
  18. #include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
  19. #include "llvm/CodeGen/GlobalISel/MIPatternMatch.h"
  20. #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
  21. #include "llvm/CodeGen/MachineDominators.h"
  22. #include "llvm/CodeGen/MachineFunction.h"
  23. #include "llvm/CodeGen/MachineFunctionPass.h"
  24. #include "llvm/CodeGen/MachineRegisterInfo.h"
  25. #include "llvm/CodeGen/TargetPassConfig.h"
  26. #include "llvm/IR/Instructions.h"
  27. #include "llvm/Support/Debug.h"
  28. #define DEBUG_TYPE "aarch64-prelegalizer-combiner"
  29. using namespace llvm;
  30. using namespace MIPatternMatch;
  31. /// Return true if a G_FCONSTANT instruction is known to be better-represented
  32. /// as a G_CONSTANT.
  33. static bool matchFConstantToConstant(MachineInstr &MI,
  34. MachineRegisterInfo &MRI) {
  35. assert(MI.getOpcode() == TargetOpcode::G_FCONSTANT);
  36. Register DstReg = MI.getOperand(0).getReg();
  37. const unsigned DstSize = MRI.getType(DstReg).getSizeInBits();
  38. if (DstSize != 32 && DstSize != 64)
  39. return false;
  40. // When we're storing a value, it doesn't matter what register bank it's on.
  41. // Since not all floating point constants can be materialized using a fmov,
  42. // it makes more sense to just use a GPR.
  43. return all_of(MRI.use_nodbg_instructions(DstReg),
  44. [](const MachineInstr &Use) { return Use.mayStore(); });
  45. }
  46. /// Change a G_FCONSTANT into a G_CONSTANT.
  47. static void applyFConstantToConstant(MachineInstr &MI) {
  48. assert(MI.getOpcode() == TargetOpcode::G_FCONSTANT);
  49. MachineIRBuilder MIB(MI);
  50. const APFloat &ImmValAPF = MI.getOperand(1).getFPImm()->getValueAPF();
  51. MIB.buildConstant(MI.getOperand(0).getReg(), ImmValAPF.bitcastToAPInt());
  52. MI.eraseFromParent();
  53. }
  54. /// Try to match a G_ICMP of a G_TRUNC with zero, in which the truncated bits
  55. /// are sign bits. In this case, we can transform the G_ICMP to directly compare
  56. /// the wide value with a zero.
  57. static bool matchICmpRedundantTrunc(MachineInstr &MI, MachineRegisterInfo &MRI,
  58. GISelKnownBits *KB, Register &MatchInfo) {
  59. assert(MI.getOpcode() == TargetOpcode::G_ICMP && KB);
  60. auto Pred = (CmpInst::Predicate)MI.getOperand(1).getPredicate();
  61. if (!ICmpInst::isEquality(Pred))
  62. return false;
  63. Register LHS = MI.getOperand(2).getReg();
  64. LLT LHSTy = MRI.getType(LHS);
  65. if (!LHSTy.isScalar())
  66. return false;
  67. Register RHS = MI.getOperand(3).getReg();
  68. Register WideReg;
  69. if (!mi_match(LHS, MRI, m_GTrunc(m_Reg(WideReg))) ||
  70. !mi_match(RHS, MRI, m_SpecificICst(0)))
  71. return false;
  72. LLT WideTy = MRI.getType(WideReg);
  73. if (KB->computeNumSignBits(WideReg) <=
  74. WideTy.getSizeInBits() - LHSTy.getSizeInBits())
  75. return false;
  76. MatchInfo = WideReg;
  77. return true;
  78. }
  79. static bool applyICmpRedundantTrunc(MachineInstr &MI, MachineRegisterInfo &MRI,
  80. MachineIRBuilder &Builder,
  81. GISelChangeObserver &Observer,
  82. Register &WideReg) {
  83. assert(MI.getOpcode() == TargetOpcode::G_ICMP);
  84. LLT WideTy = MRI.getType(WideReg);
  85. // We're going to directly use the wide register as the LHS, and then use an
  86. // equivalent size zero for RHS.
  87. Builder.setInstrAndDebugLoc(MI);
  88. auto WideZero = Builder.buildConstant(WideTy, 0);
  89. Observer.changingInstr(MI);
  90. MI.getOperand(2).setReg(WideReg);
  91. MI.getOperand(3).setReg(WideZero.getReg(0));
  92. Observer.changedInstr(MI);
  93. return true;
  94. }
  95. /// \returns true if it is possible to fold a constant into a G_GLOBAL_VALUE.
  96. ///
  97. /// e.g.
  98. ///
  99. /// %g = G_GLOBAL_VALUE @x -> %g = G_GLOBAL_VALUE @x + cst
  100. static bool matchFoldGlobalOffset(MachineInstr &MI, MachineRegisterInfo &MRI,
  101. std::pair<uint64_t, uint64_t> &MatchInfo) {
  102. assert(MI.getOpcode() == TargetOpcode::G_GLOBAL_VALUE);
  103. MachineFunction &MF = *MI.getMF();
  104. auto &GlobalOp = MI.getOperand(1);
  105. auto *GV = GlobalOp.getGlobal();
  106. if (GV->isThreadLocal())
  107. return false;
  108. // Don't allow anything that could represent offsets etc.
  109. if (MF.getSubtarget<AArch64Subtarget>().ClassifyGlobalReference(
  110. GV, MF.getTarget()) != AArch64II::MO_NO_FLAG)
  111. return false;
  112. // Look for a G_GLOBAL_VALUE only used by G_PTR_ADDs against constants:
  113. //
  114. // %g = G_GLOBAL_VALUE @x
  115. // %ptr1 = G_PTR_ADD %g, cst1
  116. // %ptr2 = G_PTR_ADD %g, cst2
  117. // ...
  118. // %ptrN = G_PTR_ADD %g, cstN
  119. //
  120. // Identify the *smallest* constant. We want to be able to form this:
  121. //
  122. // %offset_g = G_GLOBAL_VALUE @x + min_cst
  123. // %g = G_PTR_ADD %offset_g, -min_cst
  124. // %ptr1 = G_PTR_ADD %g, cst1
  125. // ...
  126. Register Dst = MI.getOperand(0).getReg();
  127. uint64_t MinOffset = -1ull;
  128. for (auto &UseInstr : MRI.use_nodbg_instructions(Dst)) {
  129. if (UseInstr.getOpcode() != TargetOpcode::G_PTR_ADD)
  130. return false;
  131. auto Cst = getIConstantVRegValWithLookThrough(
  132. UseInstr.getOperand(2).getReg(), MRI);
  133. if (!Cst)
  134. return false;
  135. MinOffset = std::min(MinOffset, Cst->Value.getZExtValue());
  136. }
  137. // Require that the new offset is larger than the existing one to avoid
  138. // infinite loops.
  139. uint64_t CurrOffset = GlobalOp.getOffset();
  140. uint64_t NewOffset = MinOffset + CurrOffset;
  141. if (NewOffset <= CurrOffset)
  142. return false;
  143. // Check whether folding this offset is legal. It must not go out of bounds of
  144. // the referenced object to avoid violating the code model, and must be
  145. // smaller than 2^20 because this is the largest offset expressible in all
  146. // object formats. (The IMAGE_REL_ARM64_PAGEBASE_REL21 relocation in COFF
  147. // stores an immediate signed 21 bit offset.)
  148. //
  149. // This check also prevents us from folding negative offsets, which will end
  150. // up being treated in the same way as large positive ones. They could also
  151. // cause code model violations, and aren't really common enough to matter.
  152. if (NewOffset >= (1 << 20))
  153. return false;
  154. Type *T = GV->getValueType();
  155. if (!T->isSized() ||
  156. NewOffset > GV->getParent()->getDataLayout().getTypeAllocSize(T))
  157. return false;
  158. MatchInfo = std::make_pair(NewOffset, MinOffset);
  159. return true;
  160. }
  161. static bool applyFoldGlobalOffset(MachineInstr &MI, MachineRegisterInfo &MRI,
  162. MachineIRBuilder &B,
  163. GISelChangeObserver &Observer,
  164. std::pair<uint64_t, uint64_t> &MatchInfo) {
  165. // Change:
  166. //
  167. // %g = G_GLOBAL_VALUE @x
  168. // %ptr1 = G_PTR_ADD %g, cst1
  169. // %ptr2 = G_PTR_ADD %g, cst2
  170. // ...
  171. // %ptrN = G_PTR_ADD %g, cstN
  172. //
  173. // To:
  174. //
  175. // %offset_g = G_GLOBAL_VALUE @x + min_cst
  176. // %g = G_PTR_ADD %offset_g, -min_cst
  177. // %ptr1 = G_PTR_ADD %g, cst1
  178. // ...
  179. // %ptrN = G_PTR_ADD %g, cstN
  180. //
  181. // Then, the original G_PTR_ADDs should be folded later on so that they look
  182. // like this:
  183. //
  184. // %ptrN = G_PTR_ADD %offset_g, cstN - min_cst
  185. uint64_t Offset, MinOffset;
  186. std::tie(Offset, MinOffset) = MatchInfo;
  187. B.setInstrAndDebugLoc(MI);
  188. Observer.changingInstr(MI);
  189. auto &GlobalOp = MI.getOperand(1);
  190. auto *GV = GlobalOp.getGlobal();
  191. GlobalOp.ChangeToGA(GV, Offset, GlobalOp.getTargetFlags());
  192. Register Dst = MI.getOperand(0).getReg();
  193. Register NewGVDst = MRI.cloneVirtualRegister(Dst);
  194. MI.getOperand(0).setReg(NewGVDst);
  195. Observer.changedInstr(MI);
  196. B.buildPtrAdd(
  197. Dst, NewGVDst,
  198. B.buildConstant(LLT::scalar(64), -static_cast<int64_t>(MinOffset)));
  199. return true;
  200. }
  201. static bool tryToSimplifyUADDO(MachineInstr &MI, MachineIRBuilder &B,
  202. CombinerHelper &Helper,
  203. GISelChangeObserver &Observer) {
  204. // Try simplify G_UADDO with 8 or 16 bit operands to wide G_ADD and TBNZ if
  205. // result is only used in the no-overflow case. It is restricted to cases
  206. // where we know that the high-bits of the operands are 0. If there's an
  207. // overflow, then the the 9th or 17th bit must be set, which can be checked
  208. // using TBNZ.
  209. //
  210. // Change (for UADDOs on 8 and 16 bits):
  211. //
  212. // %z0 = G_ASSERT_ZEXT _
  213. // %op0 = G_TRUNC %z0
  214. // %z1 = G_ASSERT_ZEXT _
  215. // %op1 = G_TRUNC %z1
  216. // %val, %cond = G_UADDO %op0, %op1
  217. // G_BRCOND %cond, %error.bb
  218. //
  219. // error.bb:
  220. // (no successors and no uses of %val)
  221. //
  222. // To:
  223. //
  224. // %z0 = G_ASSERT_ZEXT _
  225. // %z1 = G_ASSERT_ZEXT _
  226. // %add = G_ADD %z0, %z1
  227. // %val = G_TRUNC %add
  228. // %bit = G_AND %add, 1 << scalar-size-in-bits(%op1)
  229. // %cond = G_ICMP NE, %bit, 0
  230. // G_BRCOND %cond, %error.bb
  231. auto &MRI = *B.getMRI();
  232. MachineOperand *DefOp0 = MRI.getOneDef(MI.getOperand(2).getReg());
  233. MachineOperand *DefOp1 = MRI.getOneDef(MI.getOperand(3).getReg());
  234. Register Op0Wide;
  235. Register Op1Wide;
  236. if (!mi_match(DefOp0->getParent(), MRI, m_GTrunc(m_Reg(Op0Wide))) ||
  237. !mi_match(DefOp1->getParent(), MRI, m_GTrunc(m_Reg(Op1Wide))))
  238. return false;
  239. LLT WideTy0 = MRI.getType(Op0Wide);
  240. LLT WideTy1 = MRI.getType(Op1Wide);
  241. Register ResVal = MI.getOperand(0).getReg();
  242. LLT OpTy = MRI.getType(ResVal);
  243. MachineInstr *Op0WideDef = MRI.getVRegDef(Op0Wide);
  244. MachineInstr *Op1WideDef = MRI.getVRegDef(Op1Wide);
  245. unsigned OpTySize = OpTy.getScalarSizeInBits();
  246. // First check that the G_TRUNC feeding the G_UADDO are no-ops, because the
  247. // inputs have been zero-extended.
  248. if (Op0WideDef->getOpcode() != TargetOpcode::G_ASSERT_ZEXT ||
  249. Op1WideDef->getOpcode() != TargetOpcode::G_ASSERT_ZEXT ||
  250. OpTySize != Op0WideDef->getOperand(2).getImm() ||
  251. OpTySize != Op1WideDef->getOperand(2).getImm())
  252. return false;
  253. // Only scalar UADDO with either 8 or 16 bit operands are handled.
  254. if (!WideTy0.isScalar() || !WideTy1.isScalar() || WideTy0 != WideTy1 ||
  255. OpTySize >= WideTy0.getScalarSizeInBits() ||
  256. (OpTySize != 8 && OpTySize != 16))
  257. return false;
  258. // The overflow-status result must be used by a branch only.
  259. Register ResStatus = MI.getOperand(1).getReg();
  260. if (!MRI.hasOneNonDBGUse(ResStatus))
  261. return false;
  262. MachineInstr *CondUser = &*MRI.use_instr_nodbg_begin(ResStatus);
  263. if (CondUser->getOpcode() != TargetOpcode::G_BRCOND)
  264. return false;
  265. // Make sure the computed result is only used in the no-overflow blocks.
  266. MachineBasicBlock *CurrentMBB = MI.getParent();
  267. MachineBasicBlock *FailMBB = CondUser->getOperand(1).getMBB();
  268. if (!FailMBB->succ_empty() || CondUser->getParent() != CurrentMBB)
  269. return false;
  270. if (any_of(MRI.use_nodbg_instructions(ResVal),
  271. [&MI, FailMBB, CurrentMBB](MachineInstr &I) {
  272. return &MI != &I &&
  273. (I.getParent() == FailMBB || I.getParent() == CurrentMBB);
  274. }))
  275. return false;
  276. // Remove G_ADDO.
  277. B.setInstrAndDebugLoc(*MI.getNextNode());
  278. MI.eraseFromParent();
  279. // Emit wide add.
  280. Register AddDst = MRI.cloneVirtualRegister(Op0Wide);
  281. B.buildInstr(TargetOpcode::G_ADD, {AddDst}, {Op0Wide, Op1Wide});
  282. // Emit check of the 9th or 17th bit and update users (the branch). This will
  283. // later be folded to TBNZ.
  284. Register CondBit = MRI.cloneVirtualRegister(Op0Wide);
  285. B.buildAnd(
  286. CondBit, AddDst,
  287. B.buildConstant(LLT::scalar(32), OpTySize == 8 ? 1 << 8 : 1 << 16));
  288. B.buildICmp(CmpInst::ICMP_NE, ResStatus, CondBit,
  289. B.buildConstant(LLT::scalar(32), 0));
  290. // Update ZEXts users of the result value. Because all uses are in the
  291. // no-overflow case, we know that the top bits are 0 and we can ignore ZExts.
  292. B.buildZExtOrTrunc(ResVal, AddDst);
  293. for (MachineOperand &U : make_early_inc_range(MRI.use_operands(ResVal))) {
  294. Register WideReg;
  295. if (mi_match(U.getParent(), MRI, m_GZExt(m_Reg(WideReg)))) {
  296. auto OldR = U.getParent()->getOperand(0).getReg();
  297. Observer.erasingInstr(*U.getParent());
  298. U.getParent()->eraseFromParent();
  299. Helper.replaceRegWith(MRI, OldR, AddDst);
  300. }
  301. }
  302. return true;
  303. }
  304. class AArch64PreLegalizerCombinerHelperState {
  305. protected:
  306. CombinerHelper &Helper;
  307. public:
  308. AArch64PreLegalizerCombinerHelperState(CombinerHelper &Helper)
  309. : Helper(Helper) {}
  310. };
  311. #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS
  312. #include "AArch64GenPreLegalizeGICombiner.inc"
  313. #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_DEPS
  314. namespace {
  315. #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H
  316. #include "AArch64GenPreLegalizeGICombiner.inc"
  317. #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_H
  318. class AArch64PreLegalizerCombinerInfo : public CombinerInfo {
  319. GISelKnownBits *KB;
  320. MachineDominatorTree *MDT;
  321. AArch64GenPreLegalizerCombinerHelperRuleConfig GeneratedRuleCfg;
  322. public:
  323. AArch64PreLegalizerCombinerInfo(bool EnableOpt, bool OptSize, bool MinSize,
  324. GISelKnownBits *KB, MachineDominatorTree *MDT)
  325. : CombinerInfo(/*AllowIllegalOps*/ true, /*ShouldLegalizeIllegal*/ false,
  326. /*LegalizerInfo*/ nullptr, EnableOpt, OptSize, MinSize),
  327. KB(KB), MDT(MDT) {
  328. if (!GeneratedRuleCfg.parseCommandLineOption())
  329. report_fatal_error("Invalid rule identifier");
  330. }
  331. virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
  332. MachineIRBuilder &B) const override;
  333. };
  334. bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
  335. MachineInstr &MI,
  336. MachineIRBuilder &B) const {
  337. CombinerHelper Helper(Observer, B, KB, MDT);
  338. AArch64GenPreLegalizerCombinerHelper Generated(GeneratedRuleCfg, Helper);
  339. if (Generated.tryCombineAll(Observer, MI, B))
  340. return true;
  341. unsigned Opc = MI.getOpcode();
  342. switch (Opc) {
  343. case TargetOpcode::G_CONCAT_VECTORS:
  344. return Helper.tryCombineConcatVectors(MI);
  345. case TargetOpcode::G_SHUFFLE_VECTOR:
  346. return Helper.tryCombineShuffleVector(MI);
  347. case TargetOpcode::G_UADDO:
  348. return tryToSimplifyUADDO(MI, B, Helper, Observer);
  349. case TargetOpcode::G_MEMCPY_INLINE:
  350. return Helper.tryEmitMemcpyInline(MI);
  351. case TargetOpcode::G_MEMCPY:
  352. case TargetOpcode::G_MEMMOVE:
  353. case TargetOpcode::G_MEMSET: {
  354. // If we're at -O0 set a maxlen of 32 to inline, otherwise let the other
  355. // heuristics decide.
  356. unsigned MaxLen = EnableOpt ? 0 : 32;
  357. // Try to inline memcpy type calls if optimizations are enabled.
  358. if (Helper.tryCombineMemCpyFamily(MI, MaxLen))
  359. return true;
  360. if (Opc == TargetOpcode::G_MEMSET)
  361. return llvm::AArch64GISelUtils::tryEmitBZero(MI, B, EnableMinSize);
  362. return false;
  363. }
  364. }
  365. return false;
  366. }
  367. #define AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP
  368. #include "AArch64GenPreLegalizeGICombiner.inc"
  369. #undef AARCH64PRELEGALIZERCOMBINERHELPER_GENCOMBINERHELPER_CPP
  370. // Pass boilerplate
  371. // ================
  372. class AArch64PreLegalizerCombiner : public MachineFunctionPass {
  373. public:
  374. static char ID;
  375. AArch64PreLegalizerCombiner();
  376. StringRef getPassName() const override { return "AArch64PreLegalizerCombiner"; }
  377. bool runOnMachineFunction(MachineFunction &MF) override;
  378. void getAnalysisUsage(AnalysisUsage &AU) const override;
  379. };
  380. } // end anonymous namespace
  381. void AArch64PreLegalizerCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
  382. AU.addRequired<TargetPassConfig>();
  383. AU.setPreservesCFG();
  384. getSelectionDAGFallbackAnalysisUsage(AU);
  385. AU.addRequired<GISelKnownBitsAnalysis>();
  386. AU.addPreserved<GISelKnownBitsAnalysis>();
  387. AU.addRequired<MachineDominatorTree>();
  388. AU.addPreserved<MachineDominatorTree>();
  389. AU.addRequired<GISelCSEAnalysisWrapperPass>();
  390. AU.addPreserved<GISelCSEAnalysisWrapperPass>();
  391. MachineFunctionPass::getAnalysisUsage(AU);
  392. }
  393. AArch64PreLegalizerCombiner::AArch64PreLegalizerCombiner()
  394. : MachineFunctionPass(ID) {
  395. initializeAArch64PreLegalizerCombinerPass(*PassRegistry::getPassRegistry());
  396. }
  397. bool AArch64PreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
  398. if (MF.getProperties().hasProperty(
  399. MachineFunctionProperties::Property::FailedISel))
  400. return false;
  401. auto &TPC = getAnalysis<TargetPassConfig>();
  402. // Enable CSE.
  403. GISelCSEAnalysisWrapper &Wrapper =
  404. getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
  405. auto *CSEInfo = &Wrapper.get(TPC.getCSEConfig());
  406. const Function &F = MF.getFunction();
  407. bool EnableOpt =
  408. MF.getTarget().getOptLevel() != CodeGenOpt::None && !skipFunction(F);
  409. GISelKnownBits *KB = &getAnalysis<GISelKnownBitsAnalysis>().get(MF);
  410. MachineDominatorTree *MDT = &getAnalysis<MachineDominatorTree>();
  411. AArch64PreLegalizerCombinerInfo PCInfo(EnableOpt, F.hasOptSize(),
  412. F.hasMinSize(), KB, MDT);
  413. Combiner C(PCInfo, &TPC);
  414. return C.combineMachineInstrs(MF, CSEInfo);
  415. }
  416. char AArch64PreLegalizerCombiner::ID = 0;
  417. INITIALIZE_PASS_BEGIN(AArch64PreLegalizerCombiner, DEBUG_TYPE,
  418. "Combine AArch64 machine instrs before legalization",
  419. false, false)
  420. INITIALIZE_PASS_DEPENDENCY(TargetPassConfig)
  421. INITIALIZE_PASS_DEPENDENCY(GISelKnownBitsAnalysis)
  422. INITIALIZE_PASS_DEPENDENCY(GISelCSEAnalysisWrapperPass)
  423. INITIALIZE_PASS_END(AArch64PreLegalizerCombiner, DEBUG_TYPE,
  424. "Combine AArch64 machine instrs before legalization", false,
  425. false)
  426. namespace llvm {
  427. FunctionPass *createAArch64PreLegalizerCombiner() {
  428. return new AArch64PreLegalizerCombiner();
  429. }
  430. } // end namespace llvm