[SimplifyLibCalls] Don't change alignment when creating memset
authorsstefan1 <sstipanovic@s-energize.com>
Tue, 20 Apr 2021 17:55:11 +0000 (19:55 +0200)
committersstefan1 <sstipanovic@s-energize.com>
Wed, 21 Apr 2021 18:34:13 +0000 (20:34 +0200)
commit656ebd519e3fd52050e1c8abeacafcf94d1fa260
tree1d20b2705dccc7fc42116000360dc22f5e50d437
parent10d7924581f8f29c558d089c2546321de26f8849
[SimplifyLibCalls] Don't change alignment when creating memset

Fix for PR49984
This was discovered during Attributor testing.
Memset was always created with alignment of 1
and in case when strncpy alignment was changed
it triggered an assertion in the AttrBuilder.
Memset will now be created with appropriate alignment.

Differential Revision: https://reviews.llvm.org/D100875
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/strncpy-1.ll