aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 58a1a74655..88e76dabfb 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2432,6 +2432,10 @@ bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
return false;
}
+ // Check that we can actually speculate the hoistable loads.
+ if (!LoadSpeculation.canHoistAllLoads())
+ return false;
+
// We can if-convert this loop.
return true;
}
@@ -3369,10 +3373,6 @@ bool LoopVectorizationLegality::blockCanBePredicated(BasicBlock *BB) {
}
}
- // Check that we can actually speculate the hoistable loads.
- if (!LoadSpeculation.canHoistAllLoads())
- return false;
-
return true;
}