Skip to content

Commit

Permalink
[NewPM] Update LIT tests to pass with both new and legacy PMs
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
  • Loading branch information
mlychkov committed Jan 17, 2022
1 parent c18f43c commit e7ee267
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions clang/test/CodeGenSYCL/kernel-early-optimization-pipeline.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
// Check LLVM optimization pipeline is run by default for SPIR-V compiled for
// SYCL device target, and can be disabled with -fno-sycl-early-optimizations.
//
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-EARLYOPT
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -flegacy-pass-manager -mllvm -debug-pass=Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-EARLYOPT
// CHECK-EARLYOPT: Lower Work Group Scope Code
// CHECK-EARLYOPT: Combine redundant instructions
//
// RUN: %clang_cc1 -O2 -fsycl-is-device -fno-sycl-early-optimizations -triple spir64-unknown-unknown %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NOEARLYOPT
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -flegacy-pass-manager -mllvm -debug-pass=Structure -emit-llvm -fno-sycl-early-optimizations -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NOEARLYOPT
// CHECK-NOEARLYOPT: Lower Work Group Scope Code
// CHECK-NOEARLYOPT-NOT: Combine redundant instructions
//
//
// New pass manager doesn't print all passes tree, only module level.
//
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -fno-legacy-pass-manager -mdebug-pass Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NEWPM-EARLYOPT
// CHECK-NEWPM-EARLYOPT: SYCLMutatePrintfAddrspacePass
// CHECK-NEWPM-EARLYOPT: ConstantMergePass
//
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -fno-legacy-pass-manager -mdebug-pass Structure -emit-llvm -fno-sycl-early-optimizations -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NEWPM-NOEARLYOPT
// CHECK-NEWPM-NOEARLYOPT: SYCLMutatePrintfAddrspacePass
// CHECK-NEWPM-NOEARLYOPT-NOT: ConstantMergePass
2 changes: 1 addition & 1 deletion llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; First test run uses module pass that is not designed for the old pass manager.
; Expect different input till the moment when NewPM is enabled by default.
; RUN: opt < %s -basic-aa -function-attrs -S | FileCheck %s --check-prefix=CHECK-OLD-PM
; RUN: opt < %s -basic-aa -function-attrs -S -enable-new-pm=0 | FileCheck %s --check-prefix=CHECK-OLD-PM
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s --check-prefix=CHECK-FUNC-PASS

; CHECK: define i32 @f() #0
Expand Down

0 comments on commit e7ee267

Please sign in to comment.