One step closer to fix PR47644.
Details
Diff Detail
Event Timeline
LGTM, thanks! it might be good to wait a day or 2 with committing, so others can also take another look, because some of the changes can be quite subtle.
Almost all the new setDoesNotCapture calls are wrong. If a call returns a pointer base on an argument, it can't be marked nocapture.
FWIW, we should make "nocapture-maybe-return" an enum attribute, the Attributor uses that internally and can also put it in the IR if you are interested. It's quite helpful for capture analysis as we can simplify follow the return value, and therefore for aliasing.
llvm/lib/Transforms/Utils/BuildLibCalls.cpp | ||
---|---|---|
233 | I believer this is causing the first argument of str(n)cat to be incorrectly marked as write only. str(n)cat appends at the end of the first string, but to do so it first needs to read the argument to find the end of the null-terminated string. I put up a fix D100601 |
llvm/lib/Transforms/Utils/BuildLibCalls.cpp | ||
---|---|---|
233 | Right, thanks! |
I believer this is causing the first argument of str(n)cat to be incorrectly marked as write only. str(n)cat appends at the end of the first string, but to do so it first needs to read the argument to find the end of the null-terminated string. I put up a fix D100601