537 changes: 254 additions & 283 deletions llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/alloc-realloc-free.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ define dso_local void @test() local_unnamed_addr #0 {
}

declare dso_local noalias noundef i8* @malloc(i64 noundef) local_unnamed_addr #1
declare dso_local noalias noundef i8* @realloc(i8* nocapture, i64 noundef) local_unnamed_addr #2
declare dso_local void @free(i8* nocapture noundef) local_unnamed_addr #2
declare dso_local noalias noundef i8* @realloc(i8* nocapture allocptr, i64 noundef) local_unnamed_addr #2
declare dso_local void @free(i8* nocapture allocptr noundef) local_unnamed_addr #2
declare void @llvm.dbg.value(metadata, metadata, metadata) #3

attributes #0 = { mustprogress nounwind uwtable willreturn }
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/realloc-free.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ define dso_local void @_Z3fooPv(i8* nocapture %0) local_unnamed_addr #0 {
ret void
}

declare dso_local noalias noundef i8* @realloc(i8* nocapture, i64 noundef) local_unnamed_addr #1
declare dso_local void @free(i8* nocapture noundef) local_unnamed_addr #2
declare dso_local noalias noundef i8* @realloc(i8* allocptr nocapture, i64 noundef) local_unnamed_addr #1
declare dso_local void @free(i8* allocptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nounwind uwtable willreturn }
attributes #1 = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn allockind("realloc") }
Expand Down
8 changes: 1 addition & 7 deletions llvm/test/Transforms/NewGVN/calloc-load-removal.ll
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; RUN: opt -S -passes=newgvn < %s | FileCheck %s
; RUN: opt -S -passes=newgvn -disable-simplify-libcalls < %s | FileCheck %s -check-prefix=CHECK_NO_LIBCALLS
; Check that loads from calloc are recognized as being zero.

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
Expand All @@ -15,11 +14,6 @@ define i32 @test1() {
; CHECK-LABEL: @test1(
; CHECK-NOT: %3 = load i32, i32* %2, align 4
; CHECK: ret i32 0

; CHECK_NO_LIBCALLS-LABEL: @test1(
; CHECK_NO_LIBCALLS: load
; CHECK_NO_LIBCALLS: ret i32 %

}

declare noalias i8* @calloc(i64, i64)
declare noalias i8* @calloc(i64, i64) mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
17 changes: 2 additions & 15 deletions llvm/test/Transforms/NewGVN/malloc-load-removal.ll
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
; RUN: opt -S -passes=newgvn < %s | FileCheck %s
; RUN: opt -S -passes=newgvn -disable-simplify-libcalls < %s | FileCheck %s -check-prefix=CHECK_NO_LIBCALLS
; PR13694

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"

declare i8* @malloc(i64) nounwind
declare i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"

define noalias i8* @test1() nounwind uwtable ssp {
entry:
Expand All @@ -24,10 +23,6 @@ if.end: ; preds = %if.then, %entry
; CHECK-LABEL: @test1(
; CHECK-NOT: load
; CHECK-NOT: icmp

; CHECK_NO_LIBCALLS-LABEL: @test1(
; CHECK_NO_LIBCALLS: load
; CHECK_NO_LIBCALLS: icmp
}

declare i8* @_Znwm(i64) nounwind
Expand All @@ -49,13 +44,9 @@ if.end: ; preds = %if.then, %entry
; CHECK-LABEL: @test2(
; CHECK-NOT: load
; CHECK-NOT: icmp

; CHECK_NO_LIBCALLS-LABEL: @test2(
; CHECK_NO_LIBCALLS: load
; CHECK_NO_LIBCALLS: icmp
}

declare i8* @aligned_alloc(i64, i64) nounwind
declare i8* @aligned_alloc(i64 allocalign, i64) nounwind allockind("alloc,uninitialized,aligned") allocsize(1) "alloc-family"="malloc"

define noalias i8* @test3() nounwind uwtable ssp {
entry:
Expand All @@ -74,8 +65,4 @@ if.end: ; preds = %if.then, %entry
; CHECK-LABEL: @test3(
; CHECK-NOT: load
; CHECK-NOT: icmp

; CHECK_NO_LIBCALLS-LABEL: @test3(
; CHECK_NO_LIBCALLS: load
; CHECK_NO_LIBCALLS: icmp
}