diff options
Diffstat (limited to 'test/Feature')
-rw-r--r-- | test/Feature/OperandBundles/pr26510.ll | 27 | ||||
-rw-r--r-- | test/Feature/constexpr.ll | 10 | ||||
-rw-r--r-- | test/Feature/constpointer.ll | 8 | ||||
-rw-r--r-- | test/Feature/globalvars.ll | 6 | ||||
-rw-r--r-- | test/Feature/intrinsic-noduplicate.ll | 10 | ||||
-rw-r--r-- | test/Feature/optnone-llc.ll | 3 | ||||
-rw-r--r-- | test/Feature/strip_names.ll | 26 | ||||
-rw-r--r-- | test/Feature/testconstants.ll | 2 |
8 files changed, 72 insertions, 20 deletions
diff --git a/test/Feature/OperandBundles/pr26510.ll b/test/Feature/OperandBundles/pr26510.ll new file mode 100644 index 0000000000000..08bd92aa6fa30 --- /dev/null +++ b/test/Feature/OperandBundles/pr26510.ll @@ -0,0 +1,27 @@ +; RUN: opt -S -globals-aa -functionattrs < %s | FileCheck %s +; RUN: opt -S -O3 < %s | FileCheck %s + +; Apart from checking for the direct cause of the bug, we also check +; if any problematic aliasing rules have accidentally snuck into -O3. +; +; Since the "abc" operand bundle is not a special operand bundle that +; LLVM knows about, all of the stores and loads in @test below have to +; stay. + +declare void @foo() readnone + +; CHECK-LABEL: define i8* @test(i8* %p) +; CHECK: %a = alloca i8*, align 8 +; CHECK: store i8* %p, i8** %a, align 8 +; CHECK: call void @foo() [ "abc"(i8** %a) ] +; CHECK: %reload = load i8*, i8** %a, align 8 +; CHECK: ret i8* %reload +; CHECK: } + +define i8* @test(i8* %p) { + %a = alloca i8*, align 8 + store i8* %p, i8** %a, align 8 + call void @foo() ["abc" (i8** %a)] + %reload = load i8*, i8** %a, align 8 + ret i8* %reload +} diff --git a/test/Feature/constexpr.ll b/test/Feature/constexpr.ll index ee958ce1e38b0..14040cf03d5cb 100644 --- a/test/Feature/constexpr.ll +++ b/test/Feature/constexpr.ll @@ -10,8 +10,8 @@ ;; Test constant cast expressions ;;------------------------------- -global i64 u0x00001 ; hexadecimal unsigned integer constants -global i64 s0x0012312 ; hexadecimal signed integer constants +@0 = global i64 u0x00001 ; hexadecimal unsigned integer constants +@1 = global i64 s0x0012312 ; hexadecimal signed integer constants @t2 = global i32* @t1 ;; Forward reference without cast @t3 = global i32* bitcast (i32* @t1 to i32*) ;; Forward reference with cast @@ -22,9 +22,9 @@ global i64 s0x0012312 ; hexadecimal signed integer constants @t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr @t9 = global i32 bitcast (float bitcast (i32 8 to float) to i32) ;; Nested cast expression -global i32* bitcast (float* @4 to i32*) ;; Forward numeric reference -global float* @4 ;; Duplicate forward numeric reference -global float 0.0 +@2 = global i32* bitcast (float* @4 to i32*) ;; Forward numeric reference +@3 = global float* @4 ;; Duplicate forward numeric reference +@4 = global float 0.0 ;;--------------------------------------------------- diff --git a/test/Feature/constpointer.ll b/test/Feature/constpointer.ll index 5c1bed194bd0e..bd967272cf5b4 100644 --- a/test/Feature/constpointer.ll +++ b/test/Feature/constpointer.ll @@ -16,10 +16,10 @@ @t2 = global i32* @t1 -global float * @2 ;; Forward numeric reference -global float * @2 ;; Duplicate forward numeric reference -global float 0.0 -global float * @2 ;; Numeric reference +@0 = global float * @2 ;; Forward numeric reference +@1 = global float * @2 ;; Duplicate forward numeric reference +@2 = global float 0.0 +@3 = global float * @2 ;; Numeric reference @fptr = global void() * @f ;; Forward ref method defn diff --git a/test/Feature/globalvars.ll b/test/Feature/globalvars.ll index 710a87998a867..99bb6071cde3f 100644 --- a/test/Feature/globalvars.ll +++ b/test/Feature/globalvars.ll @@ -4,7 +4,7 @@ @MyVar = external global i32 ; <i32*> [#uses=1] @MyIntList = external global { i32*, i32 } ; <{ \2*, i32 }*> [#uses=1] -external global i32 ; <i32*>:0 [#uses=0] +@0 = external global i32 ; <i32*>:0 [#uses=0] @AConst = constant i32 123 ; <i32*> [#uses=0] @AString = constant [4 x i8] c"test" ; <[4 x i8]*> [#uses=0] @ZeroInit = global { [100 x i32], [40 x float] } zeroinitializer ; <{ [100 x i32], [40 x float] }*> [#uses=0] @@ -16,5 +16,5 @@ define i32 @foo(i32 %blah) { ret i32 %blah } -hidden dllexport global i32 42 -dllexport global i32 42 +@1 = hidden dllexport global i32 42 +@2 = dllexport global i32 42 diff --git a/test/Feature/intrinsic-noduplicate.ll b/test/Feature/intrinsic-noduplicate.ll index 9a2b0aba5bd48..4f2ae1c698c90 100644 --- a/test/Feature/intrinsic-noduplicate.ll +++ b/test/Feature/intrinsic-noduplicate.ll @@ -1,9 +1,9 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s -; Make sure LLVM knows about the noduplicate attribute on the -; llvm.cuda.syncthreads intrinsic. +; Make sure LLVM knows about the convergent attribute on the +; llvm.nvvm.barrier0 intrinsic. -declare void @llvm.cuda.syncthreads() +declare void @llvm.nvvm.barrier0() -; CHECK: declare void @llvm.cuda.syncthreads() #[[ATTRNUM:[0-9]+]] -; CHECK: attributes #[[ATTRNUM]] = { noduplicate nounwind } +; CHECK: declare void @llvm.nvvm.barrier0() #[[ATTRNUM:[0-9]+]] +; CHECK: attributes #[[ATTRNUM]] = { convergent nounwind } diff --git a/test/Feature/optnone-llc.ll b/test/Feature/optnone-llc.ll index 94f61efea4aad..69dc5291226ac 100644 --- a/test/Feature/optnone-llc.ll +++ b/test/Feature/optnone-llc.ll @@ -1,4 +1,3 @@ -; RUN: llc -O0 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-O0 ; RUN: llc -O1 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox ; RUN: llc -O2 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox ; RUN: llc -O3 -debug %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LLC-Ox @@ -44,8 +43,8 @@ attributes #0 = { optnone noinline } ; LLC-Ox-DAG: Skipping pass 'Machine code sinking' ; LLC-Ox-DAG: Skipping pass 'Machine Common Subexpression Elimination' ; LLC-Ox-DAG: Skipping pass 'Machine Copy Propagation Pass' +; LLC-Ox-DAG: Skipping pass 'Machine Instruction Scheduler' ; LLC-Ox-DAG: Skipping pass 'Machine Loop Invariant Code Motion' -; LLC-Ox-DAG: Skipping pass 'Merge disjoint stack slots' ; LLC-Ox-DAG: Skipping pass 'Optimize machine instruction PHIs' ; LLC-Ox-DAG: Skipping pass 'Peephole Optimizations' ; LLC-Ox-DAG: Skipping pass 'Post{{.*}}RA{{.*}}{{[Ss]}}cheduler' diff --git a/test/Feature/strip_names.ll b/test/Feature/strip_names.ll new file mode 100644 index 0000000000000..18c9821544c20 --- /dev/null +++ b/test/Feature/strip_names.ll @@ -0,0 +1,26 @@ +; RUN: opt < %s -S | FileCheck %s +; RUN: opt < %s | opt -S -discard-value-names | FileCheck --check-prefix=NONAME %s + + +; CHECK: @GlobalValueName +; CHECK: @foo(i32 %in) +; CHECK: somelabel: +; CHECK: %GV = load i32, i32* @GlobalValueName +; CHECK: %add = add i32 %in, %GV +; CHECK: ret i32 %add + +; NONAME: @GlobalValueName +; NONAME: @foo(i32) +; NONAME-NOT: somelabel: +; NONAME: %2 = load i32, i32* @GlobalValueName +; NONAME: %3 = add i32 %0, %2 +; NONAME: ret i32 %3 + +@GlobalValueName = global i32 0 + +define i32 @foo(i32 %in) { +somelabel: + %GV = load i32, i32* @GlobalValueName + %add = add i32 %in, %GV + ret i32 %add +} diff --git a/test/Feature/testconstants.ll b/test/Feature/testconstants.ll index 81d67f9329871..a8368652610c5 100644 --- a/test/Feature/testconstants.ll +++ b/test/Feature/testconstants.ll @@ -4,7 +4,7 @@ @somestr = constant [11 x i8] c"hello world" ; <[11 x i8]*> [#uses=1] @array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1] -constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0] +@0 = constant { i32, i32 } { i32 4, i32 3 } ; <{ i32, i32 }*>:0 [#uses=0] define [2 x i32]* @testfunction(i32 %i0, i32 %j0) { ret [2 x i32]* @array |