summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/zero-string.ll
diff options
context:
space:
mode:
authorDavid Bolvansky <david.bolvansky@gmail.com>2018-05-22 20:27:36 +0000
committerDavid Bolvansky <david.bolvansky@gmail.com>2018-05-22 20:27:36 +0000
commit1f343fa0e0fe95055ff29c571821c5f91215daeb (patch)
treef3c18fd19c52fa1fa9051ce0e54d619fba04801e /llvm/test/Transforms/InstCombine/zero-string.ll
parent3ad27e92bcd4b761a174eca003cfcad6ad36a436 (diff)
downloadbcm5719-llvm-1f343fa0e0fe95055ff29c571821c5f91215daeb.tar.gz
bcm5719-llvm-1f343fa0e0fe95055ff29c571821c5f91215daeb.zip
[InstCombine] Remove calloc transformations
Summary: Previous patch does not care if a value is changed between calloc and strlen. This needs to be removed from InstCombine and maybe moved to DSE later after some rework. Reviewers: efriedma Reviewed By: efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47218 llvm-svn: 333022
Diffstat (limited to 'llvm/test/Transforms/InstCombine/zero-string.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/zero-string.ll63
1 files changed, 0 insertions, 63 deletions
diff --git a/llvm/test/Transforms/InstCombine/zero-string.ll b/llvm/test/Transforms/InstCombine/zero-string.ll
index 60df54e38f4..e69de29bb2d 100644
--- a/llvm/test/Transforms/InstCombine/zero-string.ll
+++ b/llvm/test/Transforms/InstCombine/zero-string.ll
@@ -1,63 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -S | FileCheck %s
-
-declare i32 @strlen(i8* nocapture)
-declare noalias i8* @calloc(i32, i32)
-declare noalias i8* @malloc(i32)
-
-define i32 @calloc_strlen() {
-; CHECK-LABEL: @calloc_strlen(
-; CHECK-NEXT: ret i32 0
-;
- %call = tail call noalias i8* @calloc(i32 10, i32 1)
- %call1 = tail call i32 @strlen(i8* %call)
- ret i32 %call1
-}
-
-define i32 @calloc_strlen_not_const_nmemb(i32 %n) {
-; CHECK-LABEL: @calloc_strlen_not_const_nmemb(
-; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i32 [[N:%.*]], i32 10)
-; CHECK-NEXT: [[CALL1:%.*]] = tail call i32 @strlen(i8* [[CALL]])
-; CHECK-NEXT: ret i32 [[CALL1]]
-;
- %call = tail call noalias i8* @calloc(i32 %n, i32 10)
- %call1 = tail call i32 @strlen(i8* %call) #4
- ret i32 %call1
-}
-
-
-define i32 @calloc_strlen_not_const_size(i32 %size) {
-; CHECK-LABEL: @calloc_strlen_not_const_size(
-; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i32 1, i32 [[SIZE:%.*]])
-; CHECK-NEXT: [[CALL1:%.*]] = tail call i32 @strlen(i8* [[CALL]])
-; CHECK-NEXT: ret i32 [[CALL1]]
-;
- %call = tail call noalias i8* @calloc(i32 1, i32 %size)
- %call1 = tail call i32 @strlen(i8* %call) #4
- ret i32 %call1
-}
-
-
-define i32 @calloc_strlen_not_const_args(i32 %n, i32 %size) {
-; CHECK-LABEL: @calloc_strlen_not_const_args(
-; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i32 [[N:%.*]], i32 [[SIZE:%.*]])
-; CHECK-NEXT: [[CALL1:%.*]] = tail call i32 @strlen(i8* [[CALL]])
-; CHECK-NEXT: ret i32 [[CALL1]]
-;
- %call = tail call noalias i8* @calloc(i32 %n, i32 %size)
- %call1 = tail call i32 @strlen(i8* %call) #4
- ret i32 %call1
-}
-
-
-define i32 @malloc_strlen() {
-; CHECK-LABEL: @malloc_strlen(
-; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i32 10)
-; CHECK-NEXT: [[CALL1:%.*]] = tail call i32 @strlen(i8* [[CALL]])
-; CHECK-NEXT: ret i32 [[CALL1]]
-;
- %call = tail call noalias i8* @malloc(i32 10)
- %call1 = tail call i32 @strlen(i8* %call)
- ret i32 %call1
-}
-
OpenPOWER on IntegriCloud