This currently does not make much of a difference (only one tests is
affected), but it is helpful e.g. for the out-of-tree CHERI target where
Builder.CreateMemCpy() can add attributes other than parameter alignment.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D135075
}
static Value *mergeAttributesAndFlags(CallInst *NewCI, const CallInst &Old) {
- NewCI->setAttributes(Old.getAttributes());
+ NewCI->setAttributes(AttributeList::get(
+ NewCI->getContext(), {NewCI->getAttributes(), Old.getAttributes()}));
NewCI->removeRetAttrs(AttributeFuncs::typeIncompatible(NewCI->getType()));
return copyFlags(Old, NewCI);
}
define void @test_nobuiltin(i8* %dst, i64 %len) {
; CHECK-LABEL: @test_nobuiltin(
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[DST:%.*]], i8 0, i64 [[LEN:%.*]], i1 false) #1
+; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* align 1 [[DST:%.*]], i8 0, i64 [[LEN:%.*]], i1 false)
; CHECK-NEXT: ret void
;
call i8* @__memset_chk(i8* %dst, i32 0, i64 %len, i64 -1) nobuiltin