This was added back in D7908, to align memcpy args. It should be limited when optimizing for size to prevent extra unnecessary padding being added. It seems to only currently be used under arm.
Details
Diff Detail
Event Timeline
llvm/test/CodeGen/ARM/memcpy-no-inline.ll | ||
---|---|---|
59–85 | I understand the logic of this patch, but I am struggling with the tests. To make the differences clear I am wondering if these tests should test more or if they should be llc .. | llvm-objdump -d .. tests so that we can actually see codesize? |
I've updated the test with all the output - and just shown the diffs here. With that test, if the array is no longer aligned then a series of load/stores will be needed, an LDM will have too-high alignment requirements.
llvm/lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
2130 | Not sure I understand the placement of this check. Increasing the alignment of an alloca or a MemIntrinsic doesn't directly increase codesize. And increasing the alignment of a global variable only increases codeisze if we're forced to insert extra padding. |
Not sure I understand the placement of this check. Increasing the alignment of an alloca or a MemIntrinsic doesn't directly increase codesize. And increasing the alignment of a global variable only increases codeisze if we're forced to insert extra padding.