Skip to content
Unverified Commit 9694844d authored by Henry Jiang's avatar Henry Jiang Committed by GitHub
Browse files

Reland "[Transforms] LoopIdiomRecognize recognize strlen and wcslen #108985" (#132572)

Reland https://github.com/llvm/llvm-project/pull/108985

Extend `LoopIdiomRecognize` to find and replace loops of the form
```c
base = str;
while (*str)
  ++str;
```
and transforming the `strlen` loop idiom into the appropriate `strlen`
and `wcslen` library call which will give a small performance boost if
replaced.
```c
str = base + strlen(base)
len = str - base
```
parent ed022d93
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment