diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index c9f2eaac8e7a..08bf1729bf27 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -78,20 +78,20 @@ static const std::pair AllocationFnData[] = { {LibFunc_valloc, {MallocLike, 1, 0, -1, -1}}, {LibFunc_Znwj, {OpNewLike, 1, 0, -1, -1}}, // new(unsigned int) {LibFunc_ZnwjRKSt9nothrow_t, {MallocLike, 2, 0, -1, -1}}, // new(unsigned int, nothrow) - {LibFunc_ZnwjSt11align_val_t, {OpNewLike, 2, 0, -1, -1}}, // new(unsigned int, align_val_t) - {LibFunc_ZnwjSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, -1}}, // new(unsigned int, align_val_t, nothrow) + {LibFunc_ZnwjSt11align_val_t, {OpNewLike, 2, 0, -1, 1}}, // new(unsigned int, align_val_t) + {LibFunc_ZnwjSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, 1}}, // new(unsigned int, align_val_t, nothrow) {LibFunc_Znwm, {OpNewLike, 1, 0, -1, -1}}, // new(unsigned long) {LibFunc_ZnwmRKSt9nothrow_t, {MallocLike, 2, 0, -1, -1}}, // new(unsigned long, nothrow) - {LibFunc_ZnwmSt11align_val_t, {OpNewLike, 2, 0, -1, -1}}, // new(unsigned long, align_val_t) - {LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, -1}}, // new(unsigned long, align_val_t, nothrow) + {LibFunc_ZnwmSt11align_val_t, {OpNewLike, 2, 0, -1, 1}}, // new(unsigned long, align_val_t) + {LibFunc_ZnwmSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, 1}}, // new(unsigned long, align_val_t, nothrow) {LibFunc_Znaj, {OpNewLike, 1, 0, -1, -1}}, // new[](unsigned int) {LibFunc_ZnajRKSt9nothrow_t, {MallocLike, 2, 0, -1, -1}}, // new[](unsigned int, nothrow) - {LibFunc_ZnajSt11align_val_t, {OpNewLike, 2, 0, -1, -1}}, // new[](unsigned int, align_val_t) - {LibFunc_ZnajSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, -1}}, // new[](unsigned int, align_val_t, nothrow) + {LibFunc_ZnajSt11align_val_t, {OpNewLike, 2, 0, -1, 1}}, // new[](unsigned int, align_val_t) + {LibFunc_ZnajSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, 1}}, // new[](unsigned int, align_val_t, nothrow) {LibFunc_Znam, {OpNewLike, 1, 0, -1, -1}}, // new[](unsigned long) {LibFunc_ZnamRKSt9nothrow_t, {MallocLike, 2, 0, -1, -1}}, // new[](unsigned long, nothrow) - {LibFunc_ZnamSt11align_val_t, {OpNewLike, 2, 0, -1, -1}}, // new[](unsigned long, align_val_t) - {LibFunc_ZnamSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, -1}}, // new[](unsigned long, align_val_t, nothrow) + {LibFunc_ZnamSt11align_val_t, {OpNewLike, 2, 0, -1, 1}}, // new[](unsigned long, align_val_t) + {LibFunc_ZnamSt11align_val_tRKSt9nothrow_t, {MallocLike, 3, 0, -1, 1}}, // new[](unsigned long, align_val_t, nothrow) {LibFunc_msvc_new_int, {OpNewLike, 1, 0, -1, -1}}, // new(unsigned int) {LibFunc_msvc_new_int_nothrow, {MallocLike, 2, 0, -1, -1}}, // new(unsigned int, nothrow) {LibFunc_msvc_new_longlong, {OpNewLike, 1, 0, -1, -1}}, // new(unsigned long long) diff --git a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll index 2f5d1320a2f2..3adfab914175 100644 --- a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll +++ b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll @@ -12,7 +12,7 @@ declare noalias i8* @strdup(i8*) declare noalias i8* @aligned_alloc(i64, i64) declare noalias align 16 i8* @memalign(i64, i64) ; new[](unsigned int, align_val_t) -declare noalias i8* @_ZnajSt11align_val_t(i65 %size, i64 %align) +declare noalias i8* @_ZnajSt11align_val_t(i64 %size, i64 %align) @.str = private unnamed_addr constant [6 x i8] c"hello\00", align 1 @@ -347,10 +347,10 @@ bb: define noalias i8* @op_new_align() { ; CHECK-LABEL: @op_new_align( -; CHECK-NEXT: [[CALL:%.*]] = tail call i8* @_ZnajSt11align_val_t(i65 32, i64 32) +; CHECK-NEXT: [[CALL:%.*]] = tail call align 32 dereferenceable_or_null(32) i8* @_ZnajSt11align_val_t(i64 32, i64 32) ; CHECK-NEXT: ret i8* [[CALL]] ; - %call = tail call i8* @_ZnajSt11align_val_t(i65 32, i64 32) + %call = tail call i8* @_ZnajSt11align_val_t(i64 32, i64 32) ret i8* %call }