brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.9 KiB · c49296e Raw
104 lines · plain
1; Simple checks of -exec-on-ir-change=cat functionality2;3; Simple functionality check.4; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-SIMPLE5;6; Check that only the passes that change the IR are printed and that the7; others (including g) are filtered out.8; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs=f  2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FUNC-FILTER9;10; Check that the reporting of IRs respects -print-module-scope11; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-PRINT-MOD-SCOPE12;13; Check that the reporting of IRs respects -print-module-scope14; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FUNC-FILTER-MOD-SCOPE15;16; Check that reporting of multiple functions happens17; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-FUNC18;19; Check that the reporting of IRs respects -filter-passes20; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-PASSES21;22; Check that the reporting of IRs respects -filter-passes with multiple passes23; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-PASSES24;25; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs26; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES27;28; Check that the reporting of IRs respects -filter-passes, -filter-print-funcs and -print-module-scope29; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES-MOD-SCOPE30;31; Check that repeated passes that change the IR are printed and that the32; others (including g) are filtered out.  Note that the second time33; instsimplify is run on f, it does not change the IR34; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,instsimplify" -filter-print-funcs=f  2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-MULT-PASSES-FILTER-FUNC35;36 37define i32 @g() {38entry:39  %a = add i32 2, 340  ret i32 %a41}42 43define i32 @f() {44entry:45  %a = add i32 2, 346  ret i32 %a47}48 49; CHECK-SIMPLE: ; ModuleID = {{.+}}50; CHECK-SIMPLE: cat:{{.*}}Initial IR51; CHECK-SIMPLE: define i32 @g()52; CHECK-SIMPLE: cat:{{.*}}InstSimplifyPass53; CHECK-SIMPLE: define i32 @f()54; CHECK-SIMPLE: cat:{{.*}}InstSimplifyPass55 56; CHECK-FUNC-FILTER: define i32 @f()57; CHECK-FUNC-FILTER: cat:{{.*}}Initial IR58; CHECK-FUNC-FILTER: define i32 @f()59; CHECK-FUNC-FILTER: cat:{{.*}}InstSimplifyPass60 61; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}62; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}Initial IR63; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}64; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}InstSimplifyPass65; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}66; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}InstSimplifyPass67 68; CHECK-FUNC-FILTER-MOD-SCOPE: ; ModuleID = {{.+}}69; CHECK-FUNC-FILTER-MOD-SCOPE: cat:{{.*}}Initial IR70; CHECK-FUNC-FILTER-MOD-SCOPE: ModuleID = {{.+}}71; CHECK-FUNC-FILTER-MOD-SCOPE: cat:{{.*}}InstSimplifyPass72 73; CHECK-FILTER-MULT-FUNC: define i32 @g()74; CHECK-FILTER-MULT-FUNC: cat:{{.*}}Initial IR75; CHECK-FILTER-MULT-FUNC: define i32 @g()76; CHECK-FILTER-MULT-FUNC: cat:{{.*}}InstSimplifyPass77; CHECK-FILTER-MULT-FUNC: define i32 @f()78; CHECK-FILTER-MULT-FUNC: cat:{{.*}}InstSimplifyPass79 80; CHECK-FILTER-PASSES: define i32 @g()81; CHECK-FILTER-PASSES: cat:{{.*}}Initial IR82 83; CHECK-FILTER-MULT-PASSES: define i32 @g()84; CHECK-FILTER-MULT-PASSES: cat:{{.*}}Initial IR85; CHECK-FILTER-MULT-PASSES: define i32 @g()86; CHECK-FILTER-MULT-PASSES: cat:{{.*}}InstSimplifyPass87; CHECK-FILTER-MULT-PASSES: define i32 @f()88; CHECK-FILTER-MULT-PASSES: cat:{{.*}}InstSimplifyPass89 90; CHECK-FILTER-FUNC-PASSES: define i32 @f()91; CHECK-FILTER-FUNC-PASSES: cat:{{.*}}Initial IR92; CHECK-FILTER-FUNC-PASSES: define i32 @f()93; CHECK-FILTER-FUNC-PASSES: cat:{{.*}}InstSimplifyPass94 95; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: ; ModuleID = {{.+}}96; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: cat:{{.*}}Initial IR97; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: ModuleID = {{.+}}98; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: cat:{{.*}}InstSimplifyPass99 100; CHECK-MULT-PASSES-FILTER-FUNC: define i32 @f()101; CHECK-MULT-PASSES-FILTER-FUNC: cat:{{.*}}Initial IR102; CHECK-MULT-PASSES-FILTER-FUNC: define i32 @f()103; CHECK-MULT-PASSES-FILTER-FUNC: cat:{{.*}}InstSimplifyPass104