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

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 18:44:29 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.
----------------
ShivaChen wrote:

Thanks for the suggestions. :-) I added `!hasStdExtZicond()` to filter out zicond. For the scalar min/max, it seem the passes called getCmpSelInstrCost will see `llvm.smax.i*`. Assuming they won't change the cost?

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


More information about the llvm-commits mailing list