diff options
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r-- | llvm/test/CodeGen/X86/O0-pipeline.ll | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/O3-pipeline.ll | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/is-constant.ll | 50 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/object-size.ll | 55 |
4 files changed, 2 insertions, 105 deletions
diff --git a/llvm/test/CodeGen/X86/O0-pipeline.ll b/llvm/test/CodeGen/X86/O0-pipeline.ll index 271aec5fa05..b6e1e459c2d 100644 --- a/llvm/test/CodeGen/X86/O0-pipeline.ll +++ b/llvm/test/CodeGen/X86/O0-pipeline.ll @@ -24,6 +24,7 @@ ; CHECK-NEXT: Module Verifier ; CHECK-NEXT: Lower Garbage Collection Instructions ; CHECK-NEXT: Shadow Stack GC Lowering +; CHECK-NEXT: Lower constant intrinsics ; CHECK-NEXT: Remove unreachable blocks from the CFG ; CHECK-NEXT: Instrument function entry/exit with calls to e.g. mcount() (post inlining) ; CHECK-NEXT: Scalarize Masked Memory Intrinsics diff --git a/llvm/test/CodeGen/X86/O3-pipeline.ll b/llvm/test/CodeGen/X86/O3-pipeline.ll index d7569ccb2da..389c21f0a8f 100644 --- a/llvm/test/CodeGen/X86/O3-pipeline.ll +++ b/llvm/test/CodeGen/X86/O3-pipeline.ll @@ -35,6 +35,7 @@ ; CHECK-NEXT: Expand memcmp() to load/stores ; CHECK-NEXT: Lower Garbage Collection Instructions ; CHECK-NEXT: Shadow Stack GC Lowering +; CHECK-NEXT: Lower constant intrinsics ; CHECK-NEXT: Remove unreachable blocks from the CFG ; CHECK-NEXT: Dominator Tree Construction ; CHECK-NEXT: Natural Loop Information diff --git a/llvm/test/CodeGen/X86/is-constant.ll b/llvm/test/CodeGen/X86/is-constant.ll deleted file mode 100644 index b4c1f351a2a..00000000000 --- a/llvm/test/CodeGen/X86/is-constant.ll +++ /dev/null @@ -1,50 +0,0 @@ -; RUN: llc -O2 < %s | FileCheck %s --check-prefix=CHECK-O2 --check-prefix=CHECK -; RUN: llc -O0 -fast-isel < %s | FileCheck %s --check-prefix=CHECK-O0 --check-prefix=CHECK -; RUN: llc -O0 -fast-isel=0 < %s | FileCheck %s --check-prefix=CHECK-O0 --check-prefix=CHECK -; RUN: llc -O0 -global-isel < %s | FileCheck %s --check-prefix=CHECK-O0 --check-prefix=CHECK - -;; Ensure that an unfoldable is.constant gets lowered reasonably in -;; optimized codegen, in particular, that the "true" branch is -;; eliminated. -;; -;; This isn't asserting any specific output from non-optimized runs, -;; (e.g., currently the not-taken branch does not get eliminated). But -;; it does ensure that lowering succeeds in all 3 codegen paths. - -target triple = "x86_64-unknown-linux-gnu" - -declare i1 @llvm.is.constant.i32(i32 %a) nounwind readnone -declare i1 @llvm.is.constant.i64(i64 %a) nounwind readnone -declare i64 @llvm.objectsize.i64.p0i8(i8*, i1, i1, i1) nounwind readnone - -declare i32 @subfun_1() -declare i32 @subfun_2() - -define i32 @test_branch(i32 %in) nounwind { -; CHECK-LABEL: test_branch: -; CHECK-O2: %bb.0: -; CHECK-O2-NEXT: jmp subfun_2 - %v = call i1 @llvm.is.constant.i32(i32 %in) - br i1 %v, label %True, label %False - -True: - %call1 = tail call i32 @subfun_1() - ret i32 %call1 - -False: - %call2 = tail call i32 @subfun_2() - ret i32 %call2 -} - -;; llvm.objectsize is another tricky case which gets folded to -1 very -;; late in the game. We'd like to ensure that llvm.is.constant of -;; llvm.objectsize is true. -define i1 @test_objectsize(i8* %obj) nounwind { -; CHECK-LABEL: test_objectsize: -; CHECK-O2: %bb.0: -; CHECK-O2: movb $1, %al -; CHECK-O2-NEXT: retq - %os = call i64 @llvm.objectsize.i64.p0i8(i8* %obj, i1 false, i1 false, i1 false) - %v = call i1 @llvm.is.constant.i64(i64 %os) - ret i1 %v -} diff --git a/llvm/test/CodeGen/X86/object-size.ll b/llvm/test/CodeGen/X86/object-size.ll deleted file mode 100644 index b795e0fda8b..00000000000 --- a/llvm/test/CodeGen/X86/object-size.ll +++ /dev/null @@ -1,55 +0,0 @@ -; RUN: llc -O0 < %s | FileCheck %s - -; ModuleID = 'ts.c' -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" -target triple = "x86_64-apple-darwin10.0" - -@p = common global i8* null, align 8 ; <i8**> [#uses=4] -@.str = private constant [3 x i8] c"Hi\00" ; <[3 x i8]*> [#uses=1] - -define void @bar() nounwind ssp { -entry: - %tmp = load i8*, i8** @p ; <i8*> [#uses=1] - %0 = call i64 @llvm.objectsize.i64.p0i8(i8* %tmp, i1 0) ; <i64> [#uses=1] - %cmp = icmp ne i64 %0, -1 ; <i1> [#uses=1] -; CHECK: movq $-1, [[RAX:%r..]] -; CHECK: cmpq $-1, [[RAX]] - br i1 %cmp, label %cond.true, label %cond.false - -cond.true: ; preds = %entry - %tmp1 = load i8*, i8** @p ; <i8*> [#uses=1] - %tmp2 = load i8*, i8** @p ; <i8*> [#uses=1] - %1 = call i64 @llvm.objectsize.i64.p0i8(i8* %tmp2, i1 1) ; <i64> [#uses=1] - %call = call i8* @__strcpy_chk(i8* %tmp1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i64 %1) ssp ; <i8*> [#uses=1] - br label %cond.end - -cond.false: ; preds = %entry - %tmp3 = load i8*, i8** @p ; <i8*> [#uses=1] - %call4 = call i8* @__inline_strcpy_chk(i8* %tmp3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0)) ssp ; <i8*> [#uses=1] - br label %cond.end - -cond.end: ; preds = %cond.false, %cond.true - %cond = phi i8* [ %call, %cond.true ], [ %call4, %cond.false ] ; <i8*> [#uses=0] - ret void -} - -declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) nounwind readonly - -declare i8* @__strcpy_chk(i8*, i8*, i64) ssp - -define internal i8* @__inline_strcpy_chk(i8* %__dest, i8* %__src) nounwind ssp { -entry: - %retval = alloca i8* ; <i8**> [#uses=2] - %__dest.addr = alloca i8* ; <i8**> [#uses=3] - %__src.addr = alloca i8* ; <i8**> [#uses=2] - store i8* %__dest, i8** %__dest.addr - store i8* %__src, i8** %__src.addr - %tmp = load i8*, i8** %__dest.addr ; <i8*> [#uses=1] - %tmp1 = load i8*, i8** %__src.addr ; <i8*> [#uses=1] - %tmp2 = load i8*, i8** %__dest.addr ; <i8*> [#uses=1] - %0 = call i64 @llvm.objectsize.i64.p0i8(i8* %tmp2, i1 1) ; <i64> [#uses=1] - %call = call i8* @__strcpy_chk(i8* %tmp, i8* %tmp1, i64 %0) ssp ; <i8*> [#uses=1] - store i8* %call, i8** %retval - %1 = load i8*, i8** %retval ; <i8*> [#uses=1] - ret i8* %1 -} |