2019-03-15 05:44:58 +08:00
|
|
|
// RUN: mlir-opt %s -cse -canonicalize -print-ir-before=cse -o /dev/null 2>&1 | FileCheck -check-prefix=BEFORE %s
|
|
|
|
// RUN: mlir-opt %s -cse -canonicalize -print-ir-before-all -o /dev/null 2>&1 | FileCheck -check-prefix=BEFORE_ALL %s
|
|
|
|
// RUN: mlir-opt %s -cse -canonicalize -print-ir-after=cse -o /dev/null 2>&1 | FileCheck -check-prefix=AFTER %s
|
|
|
|
// RUN: mlir-opt %s -cse -canonicalize -print-ir-after-all -o /dev/null 2>&1 | FileCheck -check-prefix=AFTER_ALL %s
|
|
|
|
// RUN: mlir-opt %s -cse -canonicalize -print-ir-before=cse -print-ir-module-scope -o /dev/null 2>&1 | FileCheck -check-prefix=BEFORE_MODULE %s
|
|
|
|
|
|
|
|
func @foo() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func @bar() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE: *** IR Dump Before{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE: *** IR Dump Before{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE-NEXT: func @bar()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE-NOT: *** IR Dump Before{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE-NOT: *** IR Dump After
|
|
|
|
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_ALL: *** IR Dump Before{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_ALL-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_ALL: *** IR Dump Before{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_ALL-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_ALL: *** IR Dump Before{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_ALL-NEXT: func @bar()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_ALL: *** IR Dump Before{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_ALL-NEXT: func @bar()
|
|
|
|
// BEFORE_ALL-NOT: *** IR Dump After
|
|
|
|
|
|
|
|
// AFTER-NOT: *** IR Dump Before
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER: *** IR Dump After{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER: *** IR Dump After{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER-NEXT: func @bar()
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER-NOT: *** IR Dump After{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
|
|
|
|
// AFTER_ALL-NOT: *** IR Dump Before
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER_ALL: *** IR Dump After{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER_ALL-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER_ALL: *** IR Dump After{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER_ALL-NEXT: func @foo()
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER_ALL: *** IR Dump After{{.*}}CSE ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER_ALL-NEXT: func @bar()
|
2019-04-02 18:48:45 +08:00
|
|
|
// AFTER_ALL: *** IR Dump After{{.*}}Canonicalizer ***
|
2019-03-15 05:44:58 +08:00
|
|
|
// AFTER_ALL-NEXT: func @bar()
|
|
|
|
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_MODULE: *** IR Dump Before{{.*}}CSE *** (function: foo)
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_MODULE: func @foo()
|
|
|
|
// BEFORE_MODULE: func @bar()
|
2019-04-02 18:48:45 +08:00
|
|
|
// BEFORE_MODULE: *** IR Dump Before{{.*}}CSE *** (function: bar)
|
2019-03-15 05:44:58 +08:00
|
|
|
// BEFORE_MODULE: func @foo()
|
|
|
|
// BEFORE_MODULE: func @bar()
|