Index: llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp =================================================================== --- llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp +++ llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp @@ -213,10 +213,9 @@ bool LoopDataPrefetch::run() { // If PrefetchDistance is not set, don't run the pass. This gives an // opportunity for targets to run this pass for selected subtargets only - // (whose TTI sets PrefetchDistance). - if (getPrefetchDistance() == 0) + // (whose TTI sets PrefetchDistance and CacheLineSize). + if (getPrefetchDistance() == 0 || TTI->getCacheLineSize() == 0) return false; - assert(TTI->getCacheLineSize() && "Cache line size is not set for target"); bool MadeChange = false;