Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / Transforms / Utils / LoopUnroll.cpp
index accb7316cab4cdb307f972587708c1826283b6a5..67e564187d7dae279db20767e359dc4a6ff2a399 100644 (file)
@@ -531,9 +531,8 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
     if (!OuterL && !CompletelyUnroll)
       OuterL = L;
     if (OuterL) {
-      DataLayoutPass *DLP = PP->getAnalysisIfAvailable<DataLayoutPass>();
-      const DataLayout *DL = DLP ? &DLP->getDataLayout() : nullptr;
-      simplifyLoop(OuterL, DT, LI, PP, /*AliasAnalysis*/ nullptr, SE, DL, AC);
+      const DataLayout &DL = F->getParent()->getDataLayout();
+      simplifyLoop(OuterL, DT, LI, PP, /*AliasAnalysis*/ nullptr, SE, &DL, AC);
 
       // LCSSA must be performed on the outermost affected loop. The unrolled
       // loop's last loop latch is guaranteed to be in the outermost loop after