diff options
author | Henry Jiang <h243jian@uwaterloo.ca> | 2025-03-21 09:49:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-21 09:49:10 -0400 |
commit | ac9049df7e62e2ca4dc5d103593b51639b5715e3 (patch) | |
tree | e8b892c8cc86fa7e3a3214822c9d0f627a2692be /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | 610ade2ed7253593198287aa53a9b05852ef0ede (diff) | |
download | llvm-ac9049df7e62e2ca4dc5d103593b51639b5715e3.zip llvm-ac9049df7e62e2ca4dc5d103593b51639b5715e3.tar.gz llvm-ac9049df7e62e2ca4dc5d103593b51639b5715e3.tar.bz2 |
Reland "[Transforms] LoopIdiomRecognize recognize strlen and wcslen (#108985)" (#131412)
Relands https://github.com/llvm/llvm-project/pull/108985
This PR continues the effort made in
https://discourse.llvm.org/t/rfc-strlen-loop-idiom-recognition-folding/55848
and https://reviews.llvm.org/D83392 and https://reviews.llvm.org/D88460
to 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
```
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
0 files changed, 0 insertions, 0 deletions