Skip to content

Commit 7fe134c

Browse files
committed
Increase cost to 2 only when without Zicond
1 parent a2ca69b commit 7fe134c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,9 +1401,10 @@ InstructionCost RISCVTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
14011401
return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
14021402
I);
14031403

1404-
// Select might be expanded to move and branch.
1404+
// Select might be expanded to move and branch without Zicond.
14051405
if (TLI->InstructionOpcodeToISD(Opcode) == ISD::SELECT &&
1406-
!ValTy->isVectorTy())
1406+
!ValTy->isVectorTy() && !ST->hasStdExtZicond() &&
1407+
!ST->hasVendorXVentanaCondOps())
14071408
return 2;
14081409

14091410
if (isa<FixedVectorType>(ValTy) && !ST->useRVVForFixedLengthVectors())

0 commit comments

Comments
 (0)