[llvm] [RISCV][CostModel] Change select cost to 2 (PR #75154)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 08:28:05 PST 2023


================
@@ -1401,6 +1401,11 @@ InstructionCost RISCVTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
     return BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind,
                                      I);
 
+  // Select might be expanded to move and branch.
----------------
preames wrote:

But it also might not...

I think you need to consider availability of the various select variant scalar instructions here and adjust the cost appropriately.  Consider zicond, and whichever of the scalar binmanip added min/max.  

https://github.com/llvm/llvm-project/pull/75154


More information about the llvm-commits mailing list