[PATCH] D95142: [SLC] Simplify strcpy and friends with non-zero address spaces

Mindong Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 28 19:35:23 PST 2021


mdchen added a comment.

In D95142#3157371 <https://reviews.llvm.org/D95142#3157371>, @jrtc27 wrote:

> In D95142#3157370 <https://reviews.llvm.org/D95142#3157370>, @mdchen wrote:
>
>>> The pointee type is meaningless in the IR and will be going away.
>>
>> @arsenm @arichardson Hi, this change let user-defined string functions(e.g., `size_t strlen(int*)`) pass the check and considered a libfunc, which can cause failure in later optimizations like `optimizeStrLen` which assumes `CharSize` is 8. And pointed type does matter in this case. What do you think?
>
> The code should've been compiled with either -fno-builtin-strlen or -ffreestanding, or used the right type for strlen, anything else is invalid. See -Wincompatible-library-redeclaration.

Oh I see, thanks for pointing it out!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95142/new/

https://reviews.llvm.org/D95142



More information about the llvm-commits mailing list