For cases where we cannot insert an addrspacecast, we can still expand
like a memcpy if we know the address spaces cannot alias. Normally
non-aliasing memmoves are optimized to memcpy, but we cannot rely on
that for lowering. If a target has aliasing address spaces that cannot
be casted between, we still have to give up lowering this.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM in principle.
llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp | ||
---|---|---|
401–410 | Nit: The comments matching the variable names don't look particularly useful. I'd remove most of leam, maybe leaving the CanOverlap. |
Comment Actions
llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp | ||
---|---|---|
401–410 | I just copy-pasted from the other place here that does this |
I would suggest to move this peace of code to the caller to preserve logical structure of the code (createMemMoveLoop suggest to create a mem move not mem copy). Not insisting though...