Previously it was only being done if shouldAlignPointerArgs() returned
true, which right now is only true for ARM targets.
Updating the argument alignment attributes of memcpy/memset intrinsics
if the underlying object has larger alignment can be beneficial even
if CGP didn't increase alignment (as can be seen from the test changes),
so invert the loop and if condition.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
2222–2233 | Re-format it. | |
llvm/test/CodeGen/X86/memset-2.ll | ||
13–23 | Not sure if the use of movaps is a good idea considering the test in below file. | |
llvm/test/CodeGen/X86/memset64-on-x86-32.ll | ||
18–55 | Are they intent to use movl/q here? | |
llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll | ||
13–15 | No ATTR1 to match with it. Just removing the #1 instead? |
llvm/test/CodeGen/X86/memset-2.ll | ||
---|---|---|
13–23 | I guess the real fix would be to not use null as the destination. I'm not sure what the test is actually checking, but I could change it to be an argument? | |
llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll | ||
13–15 | Yeah will regen with --scrub-attributes |
llvm/test/CodeGen/X86/memset-2.ll | ||
---|---|---|
13–23 | How about change 0 to 1? | |
llvm/test/CodeGen/X86/memset64-on-x86-32.ll | ||
56 | Ditto here. Change 0 to 4? |
llvm/test/CodeGen/X86/memset-2.ll | ||
---|---|---|
13–23 | I've added an argument instead of using null as the base - that seems to restore the previous behaviour of calling memset. | |
llvm/test/CodeGen/X86/memset64-on-x86-32.ll | ||
18–55 | Will change the null argument to a function input - this mostly restores the old codegen. |
llvm/lib/CodeGen/CodeGenPrepare.cpp | ||
---|---|---|
2257 | Is this change putting this code inside the for loop? We don't need to run this more than once per call. |
Re-format it.