Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / Transforms / Vectorize / LoopVectorize.cpp
index 9124272aa82c1c689b19d3561fbd6533853df63e..686b8995a31218e70e7acbf3fea9997bf58e8d4a 100644 (file)
@@ -1274,8 +1274,7 @@ struct LoopVectorize : public FunctionPass {
 
   bool runOnFunction(Function &F) override {
     SE = &getAnalysis<ScalarEvolution>();
-    DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
-    DL = DLP ? &DLP->getDataLayout() : nullptr;
+    DL = &F.getParent()->getDataLayout();
     LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
     TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
     DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();