From dce4a407a24b04eebc6a376f8e62b41aaa7b071f Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Thu, 29 May 2014 02:49:00 -0700 Subject: Update LLVM for 3.5 rebase (r209712). Change-Id: I149556c940fb7dc92d075273c87ff584f400941f --- test/Other/extract-alias.ll | 6 ++--- test/Other/optimization-remarks-inline.ll | 40 +++++++++++++++++++++++++++++++ test/Other/pass-pipeline-parsing.ll | 36 ++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 test/Other/optimization-remarks-inline.ll (limited to 'test/Other') diff --git a/test/Other/extract-alias.ll b/test/Other/extract-alias.ll index d1e4af5..dbc650e 100644 --- a/test/Other/extract-alias.ll +++ b/test/Other/extract-alias.ll @@ -14,7 +14,7 @@ ; DELETE: @zed = global i32 0 ; DELETE: @zeda0 = alias i32* @zed ; DELETE-NEXT: @a0foo = alias i32* ()* @foo -; DELETE-NEXT: @a0a0bar = alias void ()* @a0bar +; DELETE-NEXT: @a0a0bar = alias void ()* @bar ; DELETE-NEXT: @a0bar = alias void ()* @bar ; DELETE: declare i32* @foo() ; DELETE: define void @bar() { @@ -25,7 +25,7 @@ ; ALIAS: @zed = external global i32 ; ALIAS: @zeda0 = alias i32* @zed -; ALIASRE: @a0a0bar = alias void ()* @a0bar +; ALIASRE: @a0a0bar = alias void ()* @bar ; ALIASRE: @a0bar = alias void ()* @bar ; ALIASRE: declare void @bar() @@ -39,7 +39,7 @@ define i32* @foo() { ret i32* @zeda0 } -@a0a0bar = alias void ()* @a0bar +@a0a0bar = alias void ()* @bar @a0bar = alias void ()* @bar diff --git a/test/Other/optimization-remarks-inline.ll b/test/Other/optimization-remarks-inline.ll new file mode 100644 index 0000000..566b206 --- /dev/null +++ b/test/Other/optimization-remarks-inline.ll @@ -0,0 +1,40 @@ +; RUN: opt < %s -inline -pass-remarks='inline' -S 2>&1 | FileCheck %s +; RUN: opt < %s -inline -pass-remarks='inl.*' -S 2>&1 | FileCheck %s +; RUN: opt < %s -inline -pass-remarks='vector' -pass-remarks='inl' -S 2>&1 | FileCheck %s + +; These two should not yield an inline remark for the same reason. +; In the first command, we only ask for vectorizer remarks, in the +; second one we ask for the inliner, but we then ask for the vectorizer +; (thus overriding the first flag). +; RUN: opt < %s -inline -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s +; RUN: opt < %s -inline -pass-remarks='inl' -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s + +; RUN: opt < %s -inline -S 2>&1 | FileCheck --check-prefix=REMARKS %s +; RUN: not opt < %s -pass-remarks='(' 2>&1 | FileCheck --check-prefix=BAD-REGEXP %s + +define i32 @foo(i32 %x, i32 %y) #0 { +entry: + %x.addr = alloca i32, align 4 + %y.addr = alloca i32, align 4 + store i32 %x, i32* %x.addr, align 4 + store i32 %y, i32* %y.addr, align 4 + %0 = load i32* %x.addr, align 4 + %1 = load i32* %y.addr, align 4 + %add = add nsw i32 %0, %1 + ret i32 %add +} + +define i32 @bar(i32 %j) #0 { +entry: + %j.addr = alloca i32, align 4 + store i32 %j, i32* %j.addr, align 4 + %0 = load i32* %j.addr, align 4 + %1 = load i32* %j.addr, align 4 + %sub = sub nsw i32 %1, 2 + %call = call i32 @foo(i32 %0, i32 %sub) +; CHECK: foo inlined into bar +; REMARKS-NOT: foo inlined into bar + ret i32 %call +} + +; BAD-REGEXP: Invalid regular expression '(' in -pass-remarks: diff --git a/test/Other/pass-pipeline-parsing.ll b/test/Other/pass-pipeline-parsing.ll index ba33610..4ec4162 100644 --- a/test/Other/pass-pipeline-parsing.ll +++ b/test/Other/pass-pipeline-parsing.ll @@ -105,6 +105,42 @@ ; RUN: | FileCheck %s --check-prefix=CHECK-UNBALANCED10 ; CHECK-UNBALANCED10: unable to parse pass pipeline description +; RUN: opt -disable-output -debug-pass-manager -debug-cgscc-pass-manager \ +; RUN: -passes=no-op-cgscc,no-op-cgscc %s 2>&1 \ +; RUN: | FileCheck %s --check-prefix=CHECK-TWO-NOOP-CG +; CHECK-TWO-NOOP-CG: Starting module pass manager +; CHECK-TWO-NOOP-CG: Running module pass: ModuleToPostOrderCGSCCPassAdaptor +; CHECK-TWO-NOOP-CG: Starting CGSCC pass manager +; CHECK-TWO-NOOP-CG: Running CGSCC pass: NoOpCGSCCPass +; CHECK-TWO-NOOP-CG: Running CGSCC pass: NoOpCGSCCPass +; CHECK-TWO-NOOP-CG: Finished CGSCC pass manager +; CHECK-TWO-NOOP-CG: Finished module pass manager + +; RUN: opt -disable-output -debug-pass-manager -debug-cgscc-pass-manager \ +; RUN: -passes='module(function(no-op-function),cgscc(no-op-cgscc,function(no-op-function),no-op-cgscc),function(no-op-function))' %s 2>&1 \ +; RUN: | FileCheck %s --check-prefix=CHECK-NESTED-MP-CG-FP +; CHECK-NESTED-MP-CG-FP: Starting module pass manager +; CHECK-NESTED-MP-CG-FP: Starting module pass manager +; CHECK-NESTED-MP-CG-FP: Running module pass: ModuleToFunctionPassAdaptor +; CHECK-NESTED-MP-CG-FP: Starting function pass manager +; CHECK-NESTED-MP-CG-FP: Running function pass: NoOpFunctionPass +; CHECK-NESTED-MP-CG-FP: Finished function pass manager +; CHECK-NESTED-MP-CG-FP: Running module pass: ModuleToPostOrderCGSCCPassAdaptor +; CHECK-NESTED-MP-CG-FP: Starting CGSCC pass manager +; CHECK-NESTED-MP-CG-FP: Running CGSCC pass: NoOpCGSCCPass +; CHECK-NESTED-MP-CG-FP: Running CGSCC pass: CGSCCToFunctionPassAdaptor +; CHECK-NESTED-MP-CG-FP: Starting function pass manager +; CHECK-NESTED-MP-CG-FP: Running function pass: NoOpFunctionPass +; CHECK-NESTED-MP-CG-FP: Finished function pass manager +; CHECK-NESTED-MP-CG-FP: Running CGSCC pass: NoOpCGSCCPass +; CHECK-NESTED-MP-CG-FP: Finished CGSCC pass manager +; CHECK-NESTED-MP-CG-FP: Running module pass: ModuleToFunctionPassAdaptor +; CHECK-NESTED-MP-CG-FP: Starting function pass manager +; CHECK-NESTED-MP-CG-FP: Running function pass: NoOpFunctionPass +; CHECK-NESTED-MP-CG-FP: Finished function pass manager +; CHECK-NESTED-MP-CG-FP: Finished module pass manager +; CHECK-NESTED-MP-CG-FP: Finished module pass manager + define void @f() { ret void } -- cgit v1.1