AggressiveInstCombine.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. //===- AggressiveInstCombine.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 file implements the aggressive expression pattern combiner classes.
  10. // Currently, it handles expression patterns for:
  11. // * Truncate instruction
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h"
  15. #include "AggressiveInstCombineInternal.h"
  16. #include "llvm-c/Initialization.h"
  17. #include "llvm-c/Transforms/AggressiveInstCombine.h"
  18. #include "llvm/ADT/Statistic.h"
  19. #include "llvm/Analysis/AliasAnalysis.h"
  20. #include "llvm/Analysis/AssumptionCache.h"
  21. #include "llvm/Analysis/BasicAliasAnalysis.h"
  22. #include "llvm/Analysis/GlobalsModRef.h"
  23. #include "llvm/Analysis/TargetLibraryInfo.h"
  24. #include "llvm/Analysis/ValueTracking.h"
  25. #include "llvm/IR/DataLayout.h"
  26. #include "llvm/IR/Dominators.h"
  27. #include "llvm/IR/Function.h"
  28. #include "llvm/IR/IRBuilder.h"
  29. #include "llvm/IR/LegacyPassManager.h"
  30. #include "llvm/IR/PatternMatch.h"
  31. #include "llvm/InitializePasses.h"
  32. #include "llvm/Pass.h"
  33. #include "llvm/Transforms/Utils/Local.h"
  34. using namespace llvm;
  35. using namespace PatternMatch;
  36. #define DEBUG_TYPE "aggressive-instcombine"
  37. STATISTIC(NumAnyOrAllBitsSet, "Number of any/all-bits-set patterns folded");
  38. STATISTIC(NumGuardedRotates,
  39. "Number of guarded rotates transformed into funnel shifts");
  40. STATISTIC(NumGuardedFunnelShifts,
  41. "Number of guarded funnel shifts transformed into funnel shifts");
  42. STATISTIC(NumPopCountRecognized, "Number of popcount idioms recognized");
  43. namespace {
  44. /// Contains expression pattern combiner logic.
  45. /// This class provides both the logic to combine expression patterns and
  46. /// combine them. It differs from InstCombiner class in that each pattern
  47. /// combiner runs only once as opposed to InstCombine's multi-iteration,
  48. /// which allows pattern combiner to have higher complexity than the O(1)
  49. /// required by the instruction combiner.
  50. class AggressiveInstCombinerLegacyPass : public FunctionPass {
  51. public:
  52. static char ID; // Pass identification, replacement for typeid
  53. AggressiveInstCombinerLegacyPass() : FunctionPass(ID) {
  54. initializeAggressiveInstCombinerLegacyPassPass(
  55. *PassRegistry::getPassRegistry());
  56. }
  57. void getAnalysisUsage(AnalysisUsage &AU) const override;
  58. /// Run all expression pattern optimizations on the given /p F function.
  59. ///
  60. /// \param F function to optimize.
  61. /// \returns true if the IR is changed.
  62. bool runOnFunction(Function &F) override;
  63. };
  64. } // namespace
  65. /// Match a pattern for a bitwise funnel/rotate operation that partially guards
  66. /// against undefined behavior by branching around the funnel-shift/rotation
  67. /// when the shift amount is 0.
  68. static bool foldGuardedFunnelShift(Instruction &I, const DominatorTree &DT) {
  69. if (I.getOpcode() != Instruction::PHI || I.getNumOperands() != 2)
  70. return false;
  71. // As with the one-use checks below, this is not strictly necessary, but we
  72. // are being cautious to avoid potential perf regressions on targets that
  73. // do not actually have a funnel/rotate instruction (where the funnel shift
  74. // would be expanded back into math/shift/logic ops).
  75. if (!isPowerOf2_32(I.getType()->getScalarSizeInBits()))
  76. return false;
  77. // Match V to funnel shift left/right and capture the source operands and
  78. // shift amount.
  79. auto matchFunnelShift = [](Value *V, Value *&ShVal0, Value *&ShVal1,
  80. Value *&ShAmt) {
  81. Value *SubAmt;
  82. unsigned Width = V->getType()->getScalarSizeInBits();
  83. // fshl(ShVal0, ShVal1, ShAmt)
  84. // == (ShVal0 << ShAmt) | (ShVal1 >> (Width -ShAmt))
  85. if (match(V, m_OneUse(m_c_Or(
  86. m_Shl(m_Value(ShVal0), m_Value(ShAmt)),
  87. m_LShr(m_Value(ShVal1),
  88. m_Sub(m_SpecificInt(Width), m_Value(SubAmt))))))) {
  89. if (ShAmt == SubAmt) // TODO: Use m_Specific
  90. return Intrinsic::fshl;
  91. }
  92. // fshr(ShVal0, ShVal1, ShAmt)
  93. // == (ShVal0 >> ShAmt) | (ShVal1 << (Width - ShAmt))
  94. if (match(V,
  95. m_OneUse(m_c_Or(m_Shl(m_Value(ShVal0), m_Sub(m_SpecificInt(Width),
  96. m_Value(SubAmt))),
  97. m_LShr(m_Value(ShVal1), m_Value(ShAmt)))))) {
  98. if (ShAmt == SubAmt) // TODO: Use m_Specific
  99. return Intrinsic::fshr;
  100. }
  101. return Intrinsic::not_intrinsic;
  102. };
  103. // One phi operand must be a funnel/rotate operation, and the other phi
  104. // operand must be the source value of that funnel/rotate operation:
  105. // phi [ rotate(RotSrc, ShAmt), FunnelBB ], [ RotSrc, GuardBB ]
  106. // phi [ fshl(ShVal0, ShVal1, ShAmt), FunnelBB ], [ ShVal0, GuardBB ]
  107. // phi [ fshr(ShVal0, ShVal1, ShAmt), FunnelBB ], [ ShVal1, GuardBB ]
  108. PHINode &Phi = cast<PHINode>(I);
  109. unsigned FunnelOp = 0, GuardOp = 1;
  110. Value *P0 = Phi.getOperand(0), *P1 = Phi.getOperand(1);
  111. Value *ShVal0, *ShVal1, *ShAmt;
  112. Intrinsic::ID IID = matchFunnelShift(P0, ShVal0, ShVal1, ShAmt);
  113. if (IID == Intrinsic::not_intrinsic ||
  114. (IID == Intrinsic::fshl && ShVal0 != P1) ||
  115. (IID == Intrinsic::fshr && ShVal1 != P1)) {
  116. IID = matchFunnelShift(P1, ShVal0, ShVal1, ShAmt);
  117. if (IID == Intrinsic::not_intrinsic ||
  118. (IID == Intrinsic::fshl && ShVal0 != P0) ||
  119. (IID == Intrinsic::fshr && ShVal1 != P0))
  120. return false;
  121. assert((IID == Intrinsic::fshl || IID == Intrinsic::fshr) &&
  122. "Pattern must match funnel shift left or right");
  123. std::swap(FunnelOp, GuardOp);
  124. }
  125. // The incoming block with our source operand must be the "guard" block.
  126. // That must contain a cmp+branch to avoid the funnel/rotate when the shift
  127. // amount is equal to 0. The other incoming block is the block with the
  128. // funnel/rotate.
  129. BasicBlock *GuardBB = Phi.getIncomingBlock(GuardOp);
  130. BasicBlock *FunnelBB = Phi.getIncomingBlock(FunnelOp);
  131. Instruction *TermI = GuardBB->getTerminator();
  132. // Ensure that the shift values dominate each block.
  133. if (!DT.dominates(ShVal0, TermI) || !DT.dominates(ShVal1, TermI))
  134. return false;
  135. ICmpInst::Predicate Pred;
  136. BasicBlock *PhiBB = Phi.getParent();
  137. if (!match(TermI, m_Br(m_ICmp(Pred, m_Specific(ShAmt), m_ZeroInt()),
  138. m_SpecificBB(PhiBB), m_SpecificBB(FunnelBB))))
  139. return false;
  140. if (Pred != CmpInst::ICMP_EQ)
  141. return false;
  142. IRBuilder<> Builder(PhiBB, PhiBB->getFirstInsertionPt());
  143. if (ShVal0 == ShVal1)
  144. ++NumGuardedRotates;
  145. else
  146. ++NumGuardedFunnelShifts;
  147. // If this is not a rotate then the select was blocking poison from the
  148. // 'shift-by-zero' non-TVal, but a funnel shift won't - so freeze it.
  149. bool IsFshl = IID == Intrinsic::fshl;
  150. if (ShVal0 != ShVal1) {
  151. if (IsFshl && !llvm::isGuaranteedNotToBePoison(ShVal1))
  152. ShVal1 = Builder.CreateFreeze(ShVal1);
  153. else if (!IsFshl && !llvm::isGuaranteedNotToBePoison(ShVal0))
  154. ShVal0 = Builder.CreateFreeze(ShVal0);
  155. }
  156. // We matched a variation of this IR pattern:
  157. // GuardBB:
  158. // %cmp = icmp eq i32 %ShAmt, 0
  159. // br i1 %cmp, label %PhiBB, label %FunnelBB
  160. // FunnelBB:
  161. // %sub = sub i32 32, %ShAmt
  162. // %shr = lshr i32 %ShVal1, %sub
  163. // %shl = shl i32 %ShVal0, %ShAmt
  164. // %fsh = or i32 %shr, %shl
  165. // br label %PhiBB
  166. // PhiBB:
  167. // %cond = phi i32 [ %fsh, %FunnelBB ], [ %ShVal0, %GuardBB ]
  168. // -->
  169. // llvm.fshl.i32(i32 %ShVal0, i32 %ShVal1, i32 %ShAmt)
  170. Function *F = Intrinsic::getDeclaration(Phi.getModule(), IID, Phi.getType());
  171. Phi.replaceAllUsesWith(Builder.CreateCall(F, {ShVal0, ShVal1, ShAmt}));
  172. return true;
  173. }
  174. /// This is used by foldAnyOrAllBitsSet() to capture a source value (Root) and
  175. /// the bit indexes (Mask) needed by a masked compare. If we're matching a chain
  176. /// of 'and' ops, then we also need to capture the fact that we saw an
  177. /// "and X, 1", so that's an extra return value for that case.
  178. struct MaskOps {
  179. Value *Root;
  180. APInt Mask;
  181. bool MatchAndChain;
  182. bool FoundAnd1;
  183. MaskOps(unsigned BitWidth, bool MatchAnds)
  184. : Root(nullptr), Mask(APInt::getZero(BitWidth)), MatchAndChain(MatchAnds),
  185. FoundAnd1(false) {}
  186. };
  187. /// This is a recursive helper for foldAnyOrAllBitsSet() that walks through a
  188. /// chain of 'and' or 'or' instructions looking for shift ops of a common source
  189. /// value. Examples:
  190. /// or (or (or X, (X >> 3)), (X >> 5)), (X >> 8)
  191. /// returns { X, 0x129 }
  192. /// and (and (X >> 1), 1), (X >> 4)
  193. /// returns { X, 0x12 }
  194. static bool matchAndOrChain(Value *V, MaskOps &MOps) {
  195. Value *Op0, *Op1;
  196. if (MOps.MatchAndChain) {
  197. // Recurse through a chain of 'and' operands. This requires an extra check
  198. // vs. the 'or' matcher: we must find an "and X, 1" instruction somewhere
  199. // in the chain to know that all of the high bits are cleared.
  200. if (match(V, m_And(m_Value(Op0), m_One()))) {
  201. MOps.FoundAnd1 = true;
  202. return matchAndOrChain(Op0, MOps);
  203. }
  204. if (match(V, m_And(m_Value(Op0), m_Value(Op1))))
  205. return matchAndOrChain(Op0, MOps) && matchAndOrChain(Op1, MOps);
  206. } else {
  207. // Recurse through a chain of 'or' operands.
  208. if (match(V, m_Or(m_Value(Op0), m_Value(Op1))))
  209. return matchAndOrChain(Op0, MOps) && matchAndOrChain(Op1, MOps);
  210. }
  211. // We need a shift-right or a bare value representing a compare of bit 0 of
  212. // the original source operand.
  213. Value *Candidate;
  214. const APInt *BitIndex = nullptr;
  215. if (!match(V, m_LShr(m_Value(Candidate), m_APInt(BitIndex))))
  216. Candidate = V;
  217. // Initialize result source operand.
  218. if (!MOps.Root)
  219. MOps.Root = Candidate;
  220. // The shift constant is out-of-range? This code hasn't been simplified.
  221. if (BitIndex && BitIndex->uge(MOps.Mask.getBitWidth()))
  222. return false;
  223. // Fill in the mask bit derived from the shift constant.
  224. MOps.Mask.setBit(BitIndex ? BitIndex->getZExtValue() : 0);
  225. return MOps.Root == Candidate;
  226. }
  227. /// Match patterns that correspond to "any-bits-set" and "all-bits-set".
  228. /// These will include a chain of 'or' or 'and'-shifted bits from a
  229. /// common source value:
  230. /// and (or (lshr X, C), ...), 1 --> (X & CMask) != 0
  231. /// and (and (lshr X, C), ...), 1 --> (X & CMask) == CMask
  232. /// Note: "any-bits-clear" and "all-bits-clear" are variations of these patterns
  233. /// that differ only with a final 'not' of the result. We expect that final
  234. /// 'not' to be folded with the compare that we create here (invert predicate).
  235. static bool foldAnyOrAllBitsSet(Instruction &I) {
  236. // The 'any-bits-set' ('or' chain) pattern is simpler to match because the
  237. // final "and X, 1" instruction must be the final op in the sequence.
  238. bool MatchAllBitsSet;
  239. if (match(&I, m_c_And(m_OneUse(m_And(m_Value(), m_Value())), m_Value())))
  240. MatchAllBitsSet = true;
  241. else if (match(&I, m_And(m_OneUse(m_Or(m_Value(), m_Value())), m_One())))
  242. MatchAllBitsSet = false;
  243. else
  244. return false;
  245. MaskOps MOps(I.getType()->getScalarSizeInBits(), MatchAllBitsSet);
  246. if (MatchAllBitsSet) {
  247. if (!matchAndOrChain(cast<BinaryOperator>(&I), MOps) || !MOps.FoundAnd1)
  248. return false;
  249. } else {
  250. if (!matchAndOrChain(cast<BinaryOperator>(&I)->getOperand(0), MOps))
  251. return false;
  252. }
  253. // The pattern was found. Create a masked compare that replaces all of the
  254. // shift and logic ops.
  255. IRBuilder<> Builder(&I);
  256. Constant *Mask = ConstantInt::get(I.getType(), MOps.Mask);
  257. Value *And = Builder.CreateAnd(MOps.Root, Mask);
  258. Value *Cmp = MatchAllBitsSet ? Builder.CreateICmpEQ(And, Mask)
  259. : Builder.CreateIsNotNull(And);
  260. Value *Zext = Builder.CreateZExt(Cmp, I.getType());
  261. I.replaceAllUsesWith(Zext);
  262. ++NumAnyOrAllBitsSet;
  263. return true;
  264. }
  265. // Try to recognize below function as popcount intrinsic.
  266. // This is the "best" algorithm from
  267. // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
  268. // Also used in TargetLowering::expandCTPOP().
  269. //
  270. // int popcount(unsigned int i) {
  271. // i = i - ((i >> 1) & 0x55555555);
  272. // i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  273. // i = ((i + (i >> 4)) & 0x0F0F0F0F);
  274. // return (i * 0x01010101) >> 24;
  275. // }
  276. static bool tryToRecognizePopCount(Instruction &I) {
  277. if (I.getOpcode() != Instruction::LShr)
  278. return false;
  279. Type *Ty = I.getType();
  280. if (!Ty->isIntOrIntVectorTy())
  281. return false;
  282. unsigned Len = Ty->getScalarSizeInBits();
  283. // FIXME: fix Len == 8 and other irregular type lengths.
  284. if (!(Len <= 128 && Len > 8 && Len % 8 == 0))
  285. return false;
  286. APInt Mask55 = APInt::getSplat(Len, APInt(8, 0x55));
  287. APInt Mask33 = APInt::getSplat(Len, APInt(8, 0x33));
  288. APInt Mask0F = APInt::getSplat(Len, APInt(8, 0x0F));
  289. APInt Mask01 = APInt::getSplat(Len, APInt(8, 0x01));
  290. APInt MaskShift = APInt(Len, Len - 8);
  291. Value *Op0 = I.getOperand(0);
  292. Value *Op1 = I.getOperand(1);
  293. Value *MulOp0;
  294. // Matching "(i * 0x01010101...) >> 24".
  295. if ((match(Op0, m_Mul(m_Value(MulOp0), m_SpecificInt(Mask01)))) &&
  296. match(Op1, m_SpecificInt(MaskShift))) {
  297. Value *ShiftOp0;
  298. // Matching "((i + (i >> 4)) & 0x0F0F0F0F...)".
  299. if (match(MulOp0, m_And(m_c_Add(m_LShr(m_Value(ShiftOp0), m_SpecificInt(4)),
  300. m_Deferred(ShiftOp0)),
  301. m_SpecificInt(Mask0F)))) {
  302. Value *AndOp0;
  303. // Matching "(i & 0x33333333...) + ((i >> 2) & 0x33333333...)".
  304. if (match(ShiftOp0,
  305. m_c_Add(m_And(m_Value(AndOp0), m_SpecificInt(Mask33)),
  306. m_And(m_LShr(m_Deferred(AndOp0), m_SpecificInt(2)),
  307. m_SpecificInt(Mask33))))) {
  308. Value *Root, *SubOp1;
  309. // Matching "i - ((i >> 1) & 0x55555555...)".
  310. if (match(AndOp0, m_Sub(m_Value(Root), m_Value(SubOp1))) &&
  311. match(SubOp1, m_And(m_LShr(m_Specific(Root), m_SpecificInt(1)),
  312. m_SpecificInt(Mask55)))) {
  313. LLVM_DEBUG(dbgs() << "Recognized popcount intrinsic\n");
  314. IRBuilder<> Builder(&I);
  315. Function *Func = Intrinsic::getDeclaration(
  316. I.getModule(), Intrinsic::ctpop, I.getType());
  317. I.replaceAllUsesWith(Builder.CreateCall(Func, {Root}));
  318. ++NumPopCountRecognized;
  319. return true;
  320. }
  321. }
  322. }
  323. }
  324. return false;
  325. }
  326. /// This is the entry point for folds that could be implemented in regular
  327. /// InstCombine, but they are separated because they are not expected to
  328. /// occur frequently and/or have more than a constant-length pattern match.
  329. static bool foldUnusualPatterns(Function &F, DominatorTree &DT) {
  330. bool MadeChange = false;
  331. for (BasicBlock &BB : F) {
  332. // Ignore unreachable basic blocks.
  333. if (!DT.isReachableFromEntry(&BB))
  334. continue;
  335. // Do not delete instructions under here and invalidate the iterator.
  336. // Walk the block backwards for efficiency. We're matching a chain of
  337. // use->defs, so we're more likely to succeed by starting from the bottom.
  338. // Also, we want to avoid matching partial patterns.
  339. // TODO: It would be more efficient if we removed dead instructions
  340. // iteratively in this loop rather than waiting until the end.
  341. for (Instruction &I : llvm::reverse(BB)) {
  342. MadeChange |= foldAnyOrAllBitsSet(I);
  343. MadeChange |= foldGuardedFunnelShift(I, DT);
  344. MadeChange |= tryToRecognizePopCount(I);
  345. }
  346. }
  347. // We're done with transforms, so remove dead instructions.
  348. if (MadeChange)
  349. for (BasicBlock &BB : F)
  350. SimplifyInstructionsInBlock(&BB);
  351. return MadeChange;
  352. }
  353. /// This is the entry point for all transforms. Pass manager differences are
  354. /// handled in the callers of this function.
  355. static bool runImpl(Function &F, AssumptionCache &AC, TargetLibraryInfo &TLI,
  356. DominatorTree &DT) {
  357. bool MadeChange = false;
  358. const DataLayout &DL = F.getParent()->getDataLayout();
  359. TruncInstCombine TIC(AC, TLI, DL, DT);
  360. MadeChange |= TIC.run(F);
  361. MadeChange |= foldUnusualPatterns(F, DT);
  362. return MadeChange;
  363. }
  364. void AggressiveInstCombinerLegacyPass::getAnalysisUsage(
  365. AnalysisUsage &AU) const {
  366. AU.setPreservesCFG();
  367. AU.addRequired<AssumptionCacheTracker>();
  368. AU.addRequired<DominatorTreeWrapperPass>();
  369. AU.addRequired<TargetLibraryInfoWrapperPass>();
  370. AU.addPreserved<AAResultsWrapperPass>();
  371. AU.addPreserved<BasicAAWrapperPass>();
  372. AU.addPreserved<DominatorTreeWrapperPass>();
  373. AU.addPreserved<GlobalsAAWrapperPass>();
  374. }
  375. bool AggressiveInstCombinerLegacyPass::runOnFunction(Function &F) {
  376. auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
  377. auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
  378. auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
  379. return runImpl(F, AC, TLI, DT);
  380. }
  381. PreservedAnalyses AggressiveInstCombinePass::run(Function &F,
  382. FunctionAnalysisManager &AM) {
  383. auto &AC = AM.getResult<AssumptionAnalysis>(F);
  384. auto &TLI = AM.getResult<TargetLibraryAnalysis>(F);
  385. auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
  386. if (!runImpl(F, AC, TLI, DT)) {
  387. // No changes, all analyses are preserved.
  388. return PreservedAnalyses::all();
  389. }
  390. // Mark all the analyses that instcombine updates as preserved.
  391. PreservedAnalyses PA;
  392. PA.preserveSet<CFGAnalyses>();
  393. return PA;
  394. }
  395. char AggressiveInstCombinerLegacyPass::ID = 0;
  396. INITIALIZE_PASS_BEGIN(AggressiveInstCombinerLegacyPass,
  397. "aggressive-instcombine",
  398. "Combine pattern based expressions", false, false)
  399. INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
  400. INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
  401. INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
  402. INITIALIZE_PASS_END(AggressiveInstCombinerLegacyPass, "aggressive-instcombine",
  403. "Combine pattern based expressions", false, false)
  404. // Initialization Routines
  405. void llvm::initializeAggressiveInstCombine(PassRegistry &Registry) {
  406. initializeAggressiveInstCombinerLegacyPassPass(Registry);
  407. }
  408. void LLVMInitializeAggressiveInstCombiner(LLVMPassRegistryRef R) {
  409. initializeAggressiveInstCombinerLegacyPassPass(*unwrap(R));
  410. }
  411. FunctionPass *llvm::createAggressiveInstCombinerPass() {
  412. return new AggressiveInstCombinerLegacyPass();
  413. }
  414. void LLVMAddAggressiveInstCombinerPass(LLVMPassManagerRef PM) {
  415. unwrap(PM)->add(createAggressiveInstCombinerPass());
  416. }