Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
aec6884e
"git@repo.hca.bsc.es:lalbano/llvm-bpevl.git" did not exist on "9d47ce784d5db964cc2a46d81dde3439f0a693a3"
Commit
aec6884e
authored
5 years ago
by
David Bolvansky
Browse files
Options
Downloads
Patches
Plain Diff
[NFC] Added tests for D66651
llvm-svn: 370046
parent
f035b75d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
+181
-0
181 additions, 0 deletions
llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
with
181 additions
and
0 deletions
llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
0 → 100644
+
181
−
0
View file @
aec6884e
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -instcombine -S < %s | FileCheck %s
declare
noalias
i8
*
@malloc
(
i64
)
declare
noalias
i8
*
@calloc
(
i64
,
i64
)
declare
noalias
i8
*
@realloc
(
i8
*
nocapture
,
i64
)
declare
noalias
nonnull
i8
*
@_Znam
(
i64
)
; throwing version of 'new'
define
noalias
i8
*
@malloc_nonconstant_size
(
i64
%n
)
{
; CHECK-LABEL: @malloc_nonconstant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@malloc
(
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@malloc_constant_size
()
{
; CHECK-LABEL: @malloc_constant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i64 40)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@malloc
(
i64
40
)
ret
i8
*
%call
}
define
noalias
i8
*
@malloc_constant_size2
()
{
; CHECK-LABEL: @malloc_constant_size2(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable_or_null(80) i8* @malloc(i64 40)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
dereferenceable_or_null
(
80
)
i8
*
@malloc
(
i64
40
)
ret
i8
*
%call
}
define
noalias
i8
*
@malloc_constant_size3
()
{
; CHECK-LABEL: @malloc_constant_size3(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable(80) i8* @malloc(i64 40)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
dereferenceable
(
80
)
i8
*
@malloc
(
i64
40
)
ret
i8
*
%call
}
define
noalias
i8
*
@malloc_constant_zero_size
()
{
; CHECK-LABEL: @malloc_constant_zero_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@malloc
(
i64
0
)
ret
i8
*
%call
}
define
noalias
i8
*
@realloc_nonconstant_size
(
i8
*
%p
,
i64
%n
)
{
; CHECK-LABEL: @realloc_nonconstant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @realloc(i8* [[P:%.*]], i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@realloc
(
i8
*
%p
,
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@realloc_constant_zero_size
(
i8
*
%p
)
{
; CHECK-LABEL: @realloc_constant_zero_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @realloc(i8* [[P:%.*]], i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@realloc
(
i8
*
%p
,
i64
0
)
ret
i8
*
%call
}
define
noalias
i8
*
@realloc_constant_size
(
i8
*
%p
)
{
; CHECK-LABEL: @realloc_constant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @realloc(i8* [[P:%.*]], i64 40)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@realloc
(
i8
*
%p
,
i64
40
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_nonconstant_size
(
i64
%n
)
{
; CHECK-LABEL: @calloc_nonconstant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 1, i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
1
,
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_nonconstant_size2
(
i64
%n
)
{
; CHECK-LABEL: @calloc_nonconstant_size2(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 [[N:%.*]], i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
%n
,
i64
0
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_nonconstant_size3
(
i64
%n
)
{
; CHECK-LABEL: @calloc_nonconstant_size3(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 [[N:%.*]], i64 [[N]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
%n
,
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_constant_zero_size
()
{
; CHECK-LABEL: @calloc_constant_zero_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 0, i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
0
,
i64
0
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_constant_zero_size2
(
i64
%n
)
{
; CHECK-LABEL: @calloc_constant_zero_size2(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 [[N:%.*]], i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
%n
,
i64
0
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_constant_zero_size3
(
i64
%n
)
{
; CHECK-LABEL: @calloc_constant_zero_size3(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 0, i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
0
,
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_constant_size
()
{
; CHECK-LABEL: @calloc_constant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 16, i64 8)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
16
,
i64
8
)
ret
i8
*
%call
}
define
noalias
i8
*
@calloc_constant_size_overflow
()
{
; CHECK-LABEL: @calloc_constant_size_overflow(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 2000000000000, i64 80000000000)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
noalias
i8
*
@calloc
(
i64
2000000000000
,
i64
80000000000
)
ret
i8
*
%call
}
define
noalias
i8
*
@op_new_nonconstant_size
(
i64
%n
)
{
; CHECK-LABEL: @op_new_nonconstant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call i8* @_Znam(i64 [[N:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
i8
*
@_Znam
(
i64
%n
)
ret
i8
*
%call
}
define
noalias
i8
*
@op_new_constant_zero_size
()
{
; CHECK-LABEL: @op_new_constant_zero_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call i8* @_Znam(i64 40)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
i8
*
@_Znam
(
i64
40
)
ret
i8
*
%call
}
define
noalias
i8
*
@op_new_constant_size
()
{
; CHECK-LABEL: @op_new_constant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call i8* @_Znam(i64 0)
; CHECK-NEXT: ret i8* [[CALL]]
;
%call
=
tail
call
i8
*
@_Znam
(
i64
0
)
ret
i8
*
%call
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment