Skip to content

Commit 45bd02c

Browse files
committed
[LV] fix thinko
1 parent dc3bc43 commit 45bd02c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4871,10 +4871,10 @@ bool LoopVectorizationPlanner::isMoreProfitable(
48714871
// Assume vscale may be larger than 1 (or the value being tuned for),
48724872
// so that scalable vectorization is slightly favorable over fixed-width
48734873
// vectorization.
4874-
bool AXorBScalable = A.Width.isScalable() ^ B.Width.isScalable();
4875-
auto CmpFn = [AXorBScalable](const InstructionCost &LHS,
4876-
const InstructionCost &RHS) {
4877-
return AXorBScalable ? LHS <= RHS : LHS < RHS;
4874+
bool PreferScalable = A.Width.isScalable() && !B.Width.isScalable();
4875+
auto CmpFn = [PreferScalable](const InstructionCost &LHS,
4876+
const InstructionCost &RHS) {
4877+
return PreferScalable ? LHS <= RHS : LHS < RHS;
48784878
};
48794879

48804880
// To avoid the need for FP division:

0 commit comments

Comments
 (0)