[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:49:46 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:

After applying @goldsteinn's suggestion in https://github.com/llvm/llvm-project/pull/98501#discussion_r1675751184:
```
EffectiveLen Count
3 305
4 14
5 32
6 34
7 25
8 6
9 10
10 5
11 80
12 3
13 10
14 7
15 14
16 11
17 35
18 2
19 4
20 4
22 1
23 11
24 3
25 2
29 1
33 4
37 2
38 1
41 1
45 2
49 5
53 1
54 5
56 1
63 3
64 7
65 9
66 1
68 1
78 18
```

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


More information about the llvm-commits mailing list