[llvm-dev] SROA and volatile memcpy/memset
Krzysztof Parzyszek via llvm-dev
llvm-dev at lists.llvm.org
Tue Nov 10 08:41:06 PST 2015
Hi,
I have a customer testcase where SROA splits a volatile memcpy and we
end up generating bad code[1]. While this looks like a bug, simply
preventing SROA from splitting volatile memory intrinsics causes
basictest.ll for SROA to fail. Not only that, but it also seems like
handling of volatile memory transfers was done with some intent.
What are the design decisions in SROA regarding handling of volatile
memcpy/memset?
[1] In our applications, in most cases volatile objects are used to
communicate with external devices. Both, the address and the transfer
size must match what the device is expecting, so breaking up volatile
memcpy/memset in smaller pieces must be done very carefully, if at all.
Generally, target-independent transformations aren't expected to have
that knowledge and so it would be preferable that they leave such memory
traffic alone.
-Krzysztof
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev
mailing list