In https://llvm.org/PR48810 , we are crashing while trying to propagate attributes from mempcpy (returns void*) to memcpy (returns nothing - void).
We can avoid the crash by removing known incompatible attributes for the void return type.
I'm not sure if this goes far enough (should we just drop all attributes since this isn't the same function?). We also need to audit other transforms in LibCallSimplifier to make sure there are no other cases that have the same problem.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM, one comment below though.
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
1158 | We could attach (some, if not all) return value attributes to the first operand in order to preserve them. I guess a FIXME would do for now if you don't feel like including this. |
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
1158 | I haven't looked at what is currently possible with attribute transforms other than this, so I'll add a comment. Not sure if/when I can extend the patch. |
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
1158 | Comment is fine. This bug needs fixing ;) |
We could attach (some, if not all) return value attributes to the first operand in order to preserve them. I guess a FIXME would do for now if you don't feel like including this.