summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/builtin-object-size-custom-dl.ll32
-rw-r--r--llvm/test/Transforms/InstCombine/gep-custom-dl.ll19
-rw-r--r--llvm/test/Transforms/InstCombine/icmp-custom-dl.ll4
-rw-r--r--llvm/test/Transforms/InstCombine/stdio-custom-dl.ll22
4 files changed, 2 insertions, 75 deletions
diff --git a/llvm/test/Transforms/InstCombine/builtin-object-size-custom-dl.ll b/llvm/test/Transforms/InstCombine/builtin-object-size-custom-dl.ll
deleted file mode 100644
index eec0f768425..00000000000
--- a/llvm/test/Transforms/InstCombine/builtin-object-size-custom-dl.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: opt -instcombine -S < %s | FileCheck %s
-target datalayout = "e-m:o-p:40:64:64:32-i64:64-f80:128-n8:16:32:64-S128"
-
-; check that memory builtins can be handled.
-define i64 @objsize1_custom_idx(i64 %sz) {
-entry:
- %ptr = call i8* @malloc(i64 %sz)
- %ptr2 = getelementptr inbounds i8, i8* %ptr, i32 2
- %calc_size = call i64 @llvm.objectsize.i64.p0i8(i8* %ptr2, i1 false, i1 true, i1 true)
- ret i64 %calc_size
-}
-
-%struct.V = type { [10 x i8], i32, [10 x i8] }
-
-define i32 @objsize2_custom_idx() #0 {
-entry:
- %var = alloca %struct.V, align 4
- %0 = bitcast %struct.V* %var to i8*
- call void @llvm.lifetime.start.p0i8(i64 28, i8* %0) #3
- %buf1 = getelementptr inbounds %struct.V, %struct.V* %var, i32 0, i32 0
- %arrayidx = getelementptr inbounds [10 x i8], [10 x i8]* %buf1, i64 0, i64 1
- %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %arrayidx, i1 false, i1 false, i1 false)
- %conv = trunc i64 %1 to i32
- call void @llvm.lifetime.end.p0i8(i64 28, i8* %0) #3
- ret i32 %conv
-; CHECK: ret i32 27
-}
-
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
-declare i8* @malloc(i64)
-declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1)
diff --git a/llvm/test/Transforms/InstCombine/gep-custom-dl.ll b/llvm/test/Transforms/InstCombine/gep-custom-dl.ll
index fdadc80c60e..bcaadf47d11 100644
--- a/llvm/test/Transforms/InstCombine/gep-custom-dl.ll
+++ b/llvm/test/Transforms/InstCombine/gep-custom-dl.ll
@@ -164,22 +164,3 @@ define i32 @test10() {
%B = ptrtoint double* %A to i32
ret i32 %B
}
-
-@X_as1 = addrspace(1) global [1000 x i8] zeroinitializer, align 16
-
-define i16 @constant_fold_custom_dl() {
-; CHECK-LABEL: @constant_fold_custom_dl(
- ; CHECK: ret i16 ptrtoint
-
-entry:
- %A = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8], [1000 x i8] addrspace(1)* @X_as1, i64 1, i64 0) to i8 addrspace(1)*
- %B = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8], [1000 x i8] addrspace(1)* @X_as1, i64 0, i64 0) to i8 addrspace(1)*
-
- %B2 = ptrtoint i8 addrspace(1)* %B to i16
- %C = sub i16 0, %B2
- %D = getelementptr i8, i8 addrspace(1)* %A, i16 %C
- %E = ptrtoint i8 addrspace(1)* %D to i16
-
- ret i16 %E
-}
-
diff --git a/llvm/test/Transforms/InstCombine/icmp-custom-dl.ll b/llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
index 6b7cb1cdd4b..fcfe07e9be2 100644
--- a/llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
@@ -8,8 +8,8 @@ declare i32 @test58_d(i64 )
define i1 @test59(i8* %foo) {
; CHECK-LABEL: @test59(
; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds i8, i8* [[FOO:%.*]], i32 8
-; CHECK-NEXT: [[TMP1:%.*]] = ptrtoint i8* [[GEP1]] to i40
-; CHECK-NEXT: [[USE:%.*]] = zext i40 [[TMP1]] to i64
+; CHECK-NEXT: [[TMP1:%.*]] = ptrtoint i8* [[GEP1]] to i32
+; CHECK-NEXT: [[USE:%.*]] = zext i32 [[TMP1]] to i64
; CHECK-NEXT: [[CALL:%.*]] = call i32 @test58_d(i64 [[USE]])
; CHECK-NEXT: ret i1 true
;
diff --git a/llvm/test/Transforms/InstCombine/stdio-custom-dl.ll b/llvm/test/Transforms/InstCombine/stdio-custom-dl.ll
deleted file mode 100644
index c4a666db237..00000000000
--- a/llvm/test/Transforms/InstCombine/stdio-custom-dl.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
-
-target datalayout = "e-m:o-p:40:64:64:32-i64:64-f80:128-n8:16:32:64-S128"
-%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
-%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
-@.str = private unnamed_addr constant [5 x i8] c"file\00", align 1
-@.str.1 = private unnamed_addr constant [2 x i8] c"w\00", align 1
-@.str.2 = private unnamed_addr constant [4 x i8] c"str\00", align 1
-
-; Check fwrite is generated with arguments of ptr size, not index size
-define internal void @fputs_test_custom_dl() {
-; CHECK-LABEL: @fputs_test_custom_dl(
-; CHECK-NEXT: [[TMP1:%.*]] = call %struct._IO_FILE* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0))
-;
- %call = call %struct._IO_FILE* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
- %call1 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %struct._IO_FILE* %call)
- ret void
-}
-
-declare %struct._IO_FILE* @fopen(i8*, i8*)
-declare i32 @fputs(i8* nocapture readonly, %struct._IO_FILE* nocapture)
OpenPOWER on IntegriCloud