[llvm] [AggressiveInstCombine] Expand strchr/memchr with small constant strings (PR #98501)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 14 22:40:51 PDT 2024


================
@@ -54,6 +54,11 @@ static cl::opt<unsigned> StrNCmpInlineThreshold(
     cl::desc("The maximum length of a constant string for a builtin string cmp "
              "call eligible for inlining. The default value is 3."));
 
+static cl::opt<unsigned>
+    StrChrInlineThreshold("strchr-inline-threshold", cl::init(3), cl::Hidden,
----------------
dtcxzyw wrote:

See https://github.com/dtcxzyw/llvm-tools/blob/main/strchr.cpp

```
Len Count
3 305
4 14
5 31
6 35
7 25
8 6
9 10
10 4
11 80
12 3
13 7
14 9
15 16
16 11
17 35
18 2
19 3
20 4
22 1
23 5
24 3
25 3
29 1
33 10
37 2
38 1
41 1
45 2
49 5
53 1
54 5
56 1
63 1
64 8
65 9
66 1
78 18
86 1
91 1
```

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


More information about the llvm-commits mailing list