mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
LoopVectorize: Invert case when we use a vector cmp value to query select cost
We generate a select with a vectorized condition argument when the condition is NOT loop invariant. Not the other way around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3338,7 +3338,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I, unsigned VF) {
|
||||
const SCEV *CondSCEV = SE->getSCEV(SI->getCondition());
|
||||
bool ScalarCond = (SE->isLoopInvariant(CondSCEV, TheLoop));
|
||||
Type *CondTy = SI->getCondition()->getType();
|
||||
if (ScalarCond)
|
||||
if (!ScalarCond)
|
||||
CondTy = VectorType::get(CondTy, VF);
|
||||
|
||||
return TTI.getCmpSelInstrCost(I->getOpcode(), VectorTy, CondTy);
|
||||
|
||||
Reference in New Issue
Block a user