LCSSA.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. //===-- LCSSA.cpp - Convert loops into loop-closed SSA form ---------------===//
  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 transforms loops by placing phi nodes at the end of the loops for
  10. // all values that are live across the loop boundary. For example, it turns
  11. // the left into the right code:
  12. //
  13. // for (...) for (...)
  14. // if (c) if (c)
  15. // X1 = ... X1 = ...
  16. // else else
  17. // X2 = ... X2 = ...
  18. // X3 = phi(X1, X2) X3 = phi(X1, X2)
  19. // ... = X3 + 4 X4 = phi(X3)
  20. // ... = X4 + 4
  21. //
  22. // This is still valid LLVM; the extra phi nodes are purely redundant, and will
  23. // be trivially eliminated by InstCombine. The major benefit of this
  24. // transformation is that it makes many other loop optimizations, such as
  25. // LoopUnswitching, simpler.
  26. //
  27. //===----------------------------------------------------------------------===//
  28. #include "llvm/Transforms/Utils/LCSSA.h"
  29. #include "llvm/ADT/STLExtras.h"
  30. #include "llvm/ADT/Statistic.h"
  31. #include "llvm/Analysis/AliasAnalysis.h"
  32. #include "llvm/Analysis/BasicAliasAnalysis.h"
  33. #include "llvm/Analysis/BranchProbabilityInfo.h"
  34. #include "llvm/Analysis/GlobalsModRef.h"
  35. #include "llvm/Analysis/LoopInfo.h"
  36. #include "llvm/Analysis/LoopPass.h"
  37. #include "llvm/Analysis/MemorySSA.h"
  38. #include "llvm/Analysis/ScalarEvolution.h"
  39. #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
  40. #include "llvm/IR/DebugInfo.h"
  41. #include "llvm/IR/Dominators.h"
  42. #include "llvm/IR/IRBuilder.h"
  43. #include "llvm/IR/Instructions.h"
  44. #include "llvm/IR/IntrinsicInst.h"
  45. #include "llvm/IR/PredIteratorCache.h"
  46. #include "llvm/InitializePasses.h"
  47. #include "llvm/Pass.h"
  48. #include "llvm/Support/CommandLine.h"
  49. #include "llvm/Transforms/Utils.h"
  50. #include "llvm/Transforms/Utils/LoopUtils.h"
  51. #include "llvm/Transforms/Utils/SSAUpdater.h"
  52. using namespace llvm;
  53. #define DEBUG_TYPE "lcssa"
  54. STATISTIC(NumLCSSA, "Number of live out of a loop variables");
  55. #ifdef EXPENSIVE_CHECKS
  56. static bool VerifyLoopLCSSA = true;
  57. #else
  58. static bool VerifyLoopLCSSA = false;
  59. #endif
  60. static cl::opt<bool, true>
  61. VerifyLoopLCSSAFlag("verify-loop-lcssa", cl::location(VerifyLoopLCSSA),
  62. cl::Hidden,
  63. cl::desc("Verify loop lcssa form (time consuming)"));
  64. /// Return true if the specified block is in the list.
  65. static bool isExitBlock(BasicBlock *BB,
  66. const SmallVectorImpl<BasicBlock *> &ExitBlocks) {
  67. return is_contained(ExitBlocks, BB);
  68. }
  69. /// For every instruction from the worklist, check to see if it has any uses
  70. /// that are outside the current loop. If so, insert LCSSA PHI nodes and
  71. /// rewrite the uses.
  72. bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
  73. const DominatorTree &DT, const LoopInfo &LI,
  74. ScalarEvolution *SE, IRBuilderBase &Builder,
  75. SmallVectorImpl<PHINode *> *PHIsToRemove) {
  76. SmallVector<Use *, 16> UsesToRewrite;
  77. SmallSetVector<PHINode *, 16> LocalPHIsToRemove;
  78. PredIteratorCache PredCache;
  79. bool Changed = false;
  80. IRBuilderBase::InsertPointGuard InsertPtGuard(Builder);
  81. // Cache the Loop ExitBlocks across this loop. We expect to get a lot of
  82. // instructions within the same loops, computing the exit blocks is
  83. // expensive, and we're not mutating the loop structure.
  84. SmallDenseMap<Loop*, SmallVector<BasicBlock *,1>> LoopExitBlocks;
  85. while (!Worklist.empty()) {
  86. UsesToRewrite.clear();
  87. Instruction *I = Worklist.pop_back_val();
  88. assert(!I->getType()->isTokenTy() && "Tokens shouldn't be in the worklist");
  89. BasicBlock *InstBB = I->getParent();
  90. Loop *L = LI.getLoopFor(InstBB);
  91. assert(L && "Instruction belongs to a BB that's not part of a loop");
  92. if (!LoopExitBlocks.count(L))
  93. L->getExitBlocks(LoopExitBlocks[L]);
  94. assert(LoopExitBlocks.count(L));
  95. const SmallVectorImpl<BasicBlock *> &ExitBlocks = LoopExitBlocks[L];
  96. if (ExitBlocks.empty())
  97. continue;
  98. for (Use &U : make_early_inc_range(I->uses())) {
  99. Instruction *User = cast<Instruction>(U.getUser());
  100. BasicBlock *UserBB = User->getParent();
  101. // Skip uses in unreachable blocks.
  102. if (!DT.isReachableFromEntry(UserBB)) {
  103. U.set(PoisonValue::get(I->getType()));
  104. continue;
  105. }
  106. // For practical purposes, we consider that the use in a PHI
  107. // occurs in the respective predecessor block. For more info,
  108. // see the `phi` doc in LangRef and the LCSSA doc.
  109. if (auto *PN = dyn_cast<PHINode>(User))
  110. UserBB = PN->getIncomingBlock(U);
  111. if (InstBB != UserBB && !L->contains(UserBB))
  112. UsesToRewrite.push_back(&U);
  113. }
  114. // If there are no uses outside the loop, exit with no change.
  115. if (UsesToRewrite.empty())
  116. continue;
  117. ++NumLCSSA; // We are applying the transformation
  118. // Invoke instructions are special in that their result value is not
  119. // available along their unwind edge. The code below tests to see whether
  120. // DomBB dominates the value, so adjust DomBB to the normal destination
  121. // block, which is effectively where the value is first usable.
  122. BasicBlock *DomBB = InstBB;
  123. if (auto *Inv = dyn_cast<InvokeInst>(I))
  124. DomBB = Inv->getNormalDest();
  125. const DomTreeNode *DomNode = DT.getNode(DomBB);
  126. SmallVector<PHINode *, 16> AddedPHIs;
  127. SmallVector<PHINode *, 8> PostProcessPHIs;
  128. SmallVector<PHINode *, 4> InsertedPHIs;
  129. SSAUpdater SSAUpdate(&InsertedPHIs);
  130. SSAUpdate.Initialize(I->getType(), I->getName());
  131. // Force re-computation of I, as some users now need to use the new PHI
  132. // node.
  133. if (SE)
  134. SE->forgetValue(I);
  135. // Insert the LCSSA phi's into all of the exit blocks dominated by the
  136. // value, and add them to the Phi's map.
  137. for (BasicBlock *ExitBB : ExitBlocks) {
  138. if (!DT.dominates(DomNode, DT.getNode(ExitBB)))
  139. continue;
  140. // If we already inserted something for this BB, don't reprocess it.
  141. if (SSAUpdate.HasValueForBlock(ExitBB))
  142. continue;
  143. Builder.SetInsertPoint(&ExitBB->front());
  144. PHINode *PN = Builder.CreatePHI(I->getType(), PredCache.size(ExitBB),
  145. I->getName() + ".lcssa");
  146. // Get the debug location from the original instruction.
  147. PN->setDebugLoc(I->getDebugLoc());
  148. // Add inputs from inside the loop for this PHI. This is valid
  149. // because `I` dominates `ExitBB` (checked above). This implies
  150. // that every incoming block/edge is dominated by `I` as well,
  151. // i.e. we can add uses of `I` to those incoming edges/append to the incoming
  152. // blocks without violating the SSA dominance property.
  153. for (BasicBlock *Pred : PredCache.get(ExitBB)) {
  154. PN->addIncoming(I, Pred);
  155. // If the exit block has a predecessor not within the loop, arrange for
  156. // the incoming value use corresponding to that predecessor to be
  157. // rewritten in terms of a different LCSSA PHI.
  158. if (!L->contains(Pred))
  159. UsesToRewrite.push_back(
  160. &PN->getOperandUse(PN->getOperandNumForIncomingValue(
  161. PN->getNumIncomingValues() - 1)));
  162. }
  163. AddedPHIs.push_back(PN);
  164. // Remember that this phi makes the value alive in this block.
  165. SSAUpdate.AddAvailableValue(ExitBB, PN);
  166. // LoopSimplify might fail to simplify some loops (e.g. when indirect
  167. // branches are involved). In such situations, it might happen that an
  168. // exit for Loop L1 is the header of a disjoint Loop L2. Thus, when we
  169. // create PHIs in such an exit block, we are also inserting PHIs into L2's
  170. // header. This could break LCSSA form for L2 because these inserted PHIs
  171. // can also have uses outside of L2. Remember all PHIs in such situation
  172. // as to revisit than later on. FIXME: Remove this if indirectbr support
  173. // into LoopSimplify gets improved.
  174. if (auto *OtherLoop = LI.getLoopFor(ExitBB))
  175. if (!L->contains(OtherLoop))
  176. PostProcessPHIs.push_back(PN);
  177. }
  178. // Rewrite all uses outside the loop in terms of the new PHIs we just
  179. // inserted.
  180. for (Use *UseToRewrite : UsesToRewrite) {
  181. Instruction *User = cast<Instruction>(UseToRewrite->getUser());
  182. BasicBlock *UserBB = User->getParent();
  183. // For practical purposes, we consider that the use in a PHI
  184. // occurs in the respective predecessor block. For more info,
  185. // see the `phi` doc in LangRef and the LCSSA doc.
  186. if (auto *PN = dyn_cast<PHINode>(User))
  187. UserBB = PN->getIncomingBlock(*UseToRewrite);
  188. // If this use is in an exit block, rewrite to use the newly inserted PHI.
  189. // This is required for correctness because SSAUpdate doesn't handle uses
  190. // in the same block. It assumes the PHI we inserted is at the end of the
  191. // block.
  192. if (isa<PHINode>(UserBB->begin()) && isExitBlock(UserBB, ExitBlocks)) {
  193. UseToRewrite->set(&UserBB->front());
  194. continue;
  195. }
  196. // If we added a single PHI, it must dominate all uses and we can directly
  197. // rename it.
  198. if (AddedPHIs.size() == 1) {
  199. UseToRewrite->set(AddedPHIs[0]);
  200. continue;
  201. }
  202. // Otherwise, do full PHI insertion.
  203. SSAUpdate.RewriteUse(*UseToRewrite);
  204. }
  205. SmallVector<DbgValueInst *, 4> DbgValues;
  206. llvm::findDbgValues(DbgValues, I);
  207. // Update pre-existing debug value uses that reside outside the loop.
  208. for (auto *DVI : DbgValues) {
  209. BasicBlock *UserBB = DVI->getParent();
  210. if (InstBB == UserBB || L->contains(UserBB))
  211. continue;
  212. // We currently only handle debug values residing in blocks that were
  213. // traversed while rewriting the uses. If we inserted just a single PHI,
  214. // we will handle all relevant debug values.
  215. Value *V = AddedPHIs.size() == 1 ? AddedPHIs[0]
  216. : SSAUpdate.FindValueForBlock(UserBB);
  217. if (V)
  218. DVI->replaceVariableLocationOp(I, V);
  219. }
  220. // SSAUpdater might have inserted phi-nodes inside other loops. We'll need
  221. // to post-process them to keep LCSSA form.
  222. for (PHINode *InsertedPN : InsertedPHIs) {
  223. if (auto *OtherLoop = LI.getLoopFor(InsertedPN->getParent()))
  224. if (!L->contains(OtherLoop))
  225. PostProcessPHIs.push_back(InsertedPN);
  226. }
  227. // Post process PHI instructions that were inserted into another disjoint
  228. // loop and update their exits properly.
  229. for (auto *PostProcessPN : PostProcessPHIs)
  230. if (!PostProcessPN->use_empty())
  231. Worklist.push_back(PostProcessPN);
  232. // Keep track of PHI nodes that we want to remove because they did not have
  233. // any uses rewritten.
  234. for (PHINode *PN : AddedPHIs)
  235. if (PN->use_empty())
  236. LocalPHIsToRemove.insert(PN);
  237. Changed = true;
  238. }
  239. // Remove PHI nodes that did not have any uses rewritten or add them to
  240. // PHIsToRemove, so the caller can remove them after some additional cleanup.
  241. // We need to redo the use_empty() check here, because even if the PHI node
  242. // wasn't used when added to LocalPHIsToRemove, later added PHI nodes can be
  243. // using it. This cleanup is not guaranteed to handle trees/cycles of PHI
  244. // nodes that only are used by each other. Such situations has only been
  245. // noticed when the input IR contains unreachable code, and leaving some extra
  246. // redundant PHI nodes in such situations is considered a minor problem.
  247. if (PHIsToRemove) {
  248. PHIsToRemove->append(LocalPHIsToRemove.begin(), LocalPHIsToRemove.end());
  249. } else {
  250. for (PHINode *PN : LocalPHIsToRemove)
  251. if (PN->use_empty())
  252. PN->eraseFromParent();
  253. }
  254. return Changed;
  255. }
  256. // Compute the set of BasicBlocks in the loop `L` dominating at least one exit.
  257. static void computeBlocksDominatingExits(
  258. Loop &L, const DominatorTree &DT, SmallVector<BasicBlock *, 8> &ExitBlocks,
  259. SmallSetVector<BasicBlock *, 8> &BlocksDominatingExits) {
  260. // We start from the exit blocks, as every block trivially dominates itself
  261. // (not strictly).
  262. SmallVector<BasicBlock *, 8> BBWorklist(ExitBlocks);
  263. while (!BBWorklist.empty()) {
  264. BasicBlock *BB = BBWorklist.pop_back_val();
  265. // Check if this is a loop header. If this is the case, we're done.
  266. if (L.getHeader() == BB)
  267. continue;
  268. // Otherwise, add its immediate predecessor in the dominator tree to the
  269. // worklist, unless we visited it already.
  270. BasicBlock *IDomBB = DT.getNode(BB)->getIDom()->getBlock();
  271. // Exit blocks can have an immediate dominator not belonging to the
  272. // loop. For an exit block to be immediately dominated by another block
  273. // outside the loop, it implies not all paths from that dominator, to the
  274. // exit block, go through the loop.
  275. // Example:
  276. //
  277. // |---- A
  278. // | |
  279. // | B<--
  280. // | | |
  281. // |---> C --
  282. // |
  283. // D
  284. //
  285. // C is the exit block of the loop and it's immediately dominated by A,
  286. // which doesn't belong to the loop.
  287. if (!L.contains(IDomBB))
  288. continue;
  289. if (BlocksDominatingExits.insert(IDomBB))
  290. BBWorklist.push_back(IDomBB);
  291. }
  292. }
  293. bool llvm::formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
  294. ScalarEvolution *SE) {
  295. bool Changed = false;
  296. #ifdef EXPENSIVE_CHECKS
  297. // Verify all sub-loops are in LCSSA form already.
  298. for (Loop *SubLoop: L) {
  299. (void)SubLoop; // Silence unused variable warning.
  300. assert(SubLoop->isRecursivelyLCSSAForm(DT, *LI) && "Subloop not in LCSSA!");
  301. }
  302. #endif
  303. SmallVector<BasicBlock *, 8> ExitBlocks;
  304. L.getExitBlocks(ExitBlocks);
  305. if (ExitBlocks.empty())
  306. return false;
  307. SmallSetVector<BasicBlock *, 8> BlocksDominatingExits;
  308. // We want to avoid use-scanning leveraging dominance informations.
  309. // If a block doesn't dominate any of the loop exits, the none of the values
  310. // defined in the loop can be used outside.
  311. // We compute the set of blocks fullfilling the conditions in advance
  312. // walking the dominator tree upwards until we hit a loop header.
  313. computeBlocksDominatingExits(L, DT, ExitBlocks, BlocksDominatingExits);
  314. SmallVector<Instruction *, 8> Worklist;
  315. // Look at all the instructions in the loop, checking to see if they have uses
  316. // outside the loop. If so, put them into the worklist to rewrite those uses.
  317. for (BasicBlock *BB : BlocksDominatingExits) {
  318. // Skip blocks that are part of any sub-loops, they must be in LCSSA
  319. // already.
  320. if (LI->getLoopFor(BB) != &L)
  321. continue;
  322. for (Instruction &I : *BB) {
  323. // Reject two common cases fast: instructions with no uses (like stores)
  324. // and instructions with one use that is in the same block as this.
  325. if (I.use_empty() ||
  326. (I.hasOneUse() && I.user_back()->getParent() == BB &&
  327. !isa<PHINode>(I.user_back())))
  328. continue;
  329. // Tokens cannot be used in PHI nodes, so we skip over them.
  330. // We can run into tokens which are live out of a loop with catchswitch
  331. // instructions in Windows EH if the catchswitch has one catchpad which
  332. // is inside the loop and another which is not.
  333. if (I.getType()->isTokenTy())
  334. continue;
  335. Worklist.push_back(&I);
  336. }
  337. }
  338. IRBuilder<> Builder(L.getHeader()->getContext());
  339. Changed = formLCSSAForInstructions(Worklist, DT, *LI, SE, Builder);
  340. // If we modified the code, remove any caches about the loop from SCEV to
  341. // avoid dangling entries.
  342. // FIXME: This is a big hammer, can we clear the cache more selectively?
  343. if (SE && Changed)
  344. SE->forgetLoop(&L);
  345. assert(L.isLCSSAForm(DT));
  346. return Changed;
  347. }
  348. /// Process a loop nest depth first.
  349. bool llvm::formLCSSARecursively(Loop &L, const DominatorTree &DT,
  350. const LoopInfo *LI, ScalarEvolution *SE) {
  351. bool Changed = false;
  352. // Recurse depth-first through inner loops.
  353. for (Loop *SubLoop : L.getSubLoops())
  354. Changed |= formLCSSARecursively(*SubLoop, DT, LI, SE);
  355. Changed |= formLCSSA(L, DT, LI, SE);
  356. return Changed;
  357. }
  358. /// Process all loops in the function, inner-most out.
  359. static bool formLCSSAOnAllLoops(const LoopInfo *LI, const DominatorTree &DT,
  360. ScalarEvolution *SE) {
  361. bool Changed = false;
  362. for (const auto &L : *LI)
  363. Changed |= formLCSSARecursively(*L, DT, LI, SE);
  364. return Changed;
  365. }
  366. namespace {
  367. struct LCSSAWrapperPass : public FunctionPass {
  368. static char ID; // Pass identification, replacement for typeid
  369. LCSSAWrapperPass() : FunctionPass(ID) {
  370. initializeLCSSAWrapperPassPass(*PassRegistry::getPassRegistry());
  371. }
  372. // Cached analysis information for the current function.
  373. DominatorTree *DT;
  374. LoopInfo *LI;
  375. ScalarEvolution *SE;
  376. bool runOnFunction(Function &F) override;
  377. void verifyAnalysis() const override {
  378. // This check is very expensive. On the loop intensive compiles it may cause
  379. // up to 10x slowdown. Currently it's disabled by default. LPPassManager
  380. // always does limited form of the LCSSA verification. Similar reasoning
  381. // was used for the LoopInfo verifier.
  382. if (VerifyLoopLCSSA) {
  383. assert(all_of(*LI,
  384. [&](Loop *L) {
  385. return L->isRecursivelyLCSSAForm(*DT, *LI);
  386. }) &&
  387. "LCSSA form is broken!");
  388. }
  389. };
  390. /// This transformation requires natural loop information & requires that
  391. /// loop preheaders be inserted into the CFG. It maintains both of these,
  392. /// as well as the CFG. It also requires dominator information.
  393. void getAnalysisUsage(AnalysisUsage &AU) const override {
  394. AU.setPreservesCFG();
  395. AU.addRequired<DominatorTreeWrapperPass>();
  396. AU.addRequired<LoopInfoWrapperPass>();
  397. AU.addPreservedID(LoopSimplifyID);
  398. AU.addPreserved<AAResultsWrapperPass>();
  399. AU.addPreserved<BasicAAWrapperPass>();
  400. AU.addPreserved<GlobalsAAWrapperPass>();
  401. AU.addPreserved<ScalarEvolutionWrapperPass>();
  402. AU.addPreserved<SCEVAAWrapperPass>();
  403. AU.addPreserved<BranchProbabilityInfoWrapperPass>();
  404. AU.addPreserved<MemorySSAWrapperPass>();
  405. // This is needed to perform LCSSA verification inside LPPassManager
  406. AU.addRequired<LCSSAVerificationPass>();
  407. AU.addPreserved<LCSSAVerificationPass>();
  408. }
  409. };
  410. }
  411. char LCSSAWrapperPass::ID = 0;
  412. INITIALIZE_PASS_BEGIN(LCSSAWrapperPass, "lcssa", "Loop-Closed SSA Form Pass",
  413. false, false)
  414. INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
  415. INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
  416. INITIALIZE_PASS_DEPENDENCY(LCSSAVerificationPass)
  417. INITIALIZE_PASS_END(LCSSAWrapperPass, "lcssa", "Loop-Closed SSA Form Pass",
  418. false, false)
  419. Pass *llvm::createLCSSAPass() { return new LCSSAWrapperPass(); }
  420. char &llvm::LCSSAID = LCSSAWrapperPass::ID;
  421. /// Transform \p F into loop-closed SSA form.
  422. bool LCSSAWrapperPass::runOnFunction(Function &F) {
  423. LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
  424. DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
  425. auto *SEWP = getAnalysisIfAvailable<ScalarEvolutionWrapperPass>();
  426. SE = SEWP ? &SEWP->getSE() : nullptr;
  427. return formLCSSAOnAllLoops(LI, *DT, SE);
  428. }
  429. PreservedAnalyses LCSSAPass::run(Function &F, FunctionAnalysisManager &AM) {
  430. auto &LI = AM.getResult<LoopAnalysis>(F);
  431. auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
  432. auto *SE = AM.getCachedResult<ScalarEvolutionAnalysis>(F);
  433. if (!formLCSSAOnAllLoops(&LI, DT, SE))
  434. return PreservedAnalyses::all();
  435. PreservedAnalyses PA;
  436. PA.preserveSet<CFGAnalyses>();
  437. PA.preserve<ScalarEvolutionAnalysis>();
  438. // BPI maps terminators to probabilities, since we don't modify the CFG, no
  439. // updates are needed to preserve it.
  440. PA.preserve<BranchProbabilityAnalysis>();
  441. PA.preserve<MemorySSAAnalysis>();
  442. return PA;
  443. }