[llvm] [RISCV][CostModel] Remove inst cost of cmp inst in cmp-select sequence. (PR #91158)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Sun May 5 20:48:51 PDT 2024


================
@@ -715,7 +715,7 @@ define void @double_stride_ptr_iv(ptr %p, ptr %p2, i64 %stride) {
 ; STRIDED-NEXT:  entry:
 ; STRIDED-NEXT:    [[TMP0:%.*]] = call i64 @llvm.vscale.i64()
 ; STRIDED-NEXT:    [[TMP1:%.*]] = mul i64 [[TMP0]], 4
-; STRIDED-NEXT:    [[TMP2:%.*]] = call i64 @llvm.umax.i64(i64 32, i64 [[TMP1]])
+; STRIDED-NEXT:    [[TMP2:%.*]] = call i64 @llvm.umax.i64(i64 24, i64 [[TMP1]])
----------------
ElvisWang123 wrote:

The cost of the runtime checks is reduced from `14` to `10` (4 icmp+select) which makes fewer trip count will still be profitable.

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


More information about the llvm-commits mailing list