diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Transforms/InstCombine/InstCombiner.h" #include "llvm/Transforms/Utils/Local.h" +#include "llvm/Transforms/Utils/LoopUtils.h" using namespace llvm; @@ -753,6 +754,11 @@ UP.AllowExpensiveTripCount = true; } + // Enable unroll and jam for loops forced by user. + TransformationMode EnableMode = hasUnrollAndJamTransformation(L); + if (EnableMode & TM_ForcedByUser) + UP.UnrollAndJam = true; + BaseT::getUnrollingPreferences(L, SE, UP); }