;; Test that the -print-pipeline-passes option correctly prints some explicitly specified pipelines. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(adce),function(adce)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-0 ; CHECK-0: function(adce),function(adce) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='module(rpo-function-attrs,require,function(float2int,lower-constant-intrinsics,loop(loop-rotate)),invalidate)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-1 ; CHECK-1: rpo-function-attrs,require,function(float2int,lower-constant-intrinsics,loop(loop-rotate)),invalidate ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='repeat<5>(function(mem2reg)),invalidate' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-2 ; CHECK-2: repeat<5>(function(mem2reg)),invalidate ;; Test that we get ClassName printed when there is no ClassName to pass-name mapping (as is the case for the BitcodeWriterPass). ; RUN: opt -o /dev/null -disable-verify -print-pipeline-passes -passes='function(mem2reg)' < %s -disable-pipeline-verification | FileCheck %s --match-full-lines --check-prefixes=CHECK-3 ; CHECK-3: function(mem2reg),BitcodeWriterPass ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop-mssa(indvars))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-4 ; CHECK-4: function(loop-mssa(indvars)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(argpromotion,require,no-op-cgscc,devirt<7>(inline,no-op-cgscc)),function(loop(require))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-5 ; CHECK-5: cgscc(argpromotion,require,no-op-cgscc,devirt<7>(inline,no-op-cgscc)),function(loop(require)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(ee-instrument<>,ee-instrument)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-6 ; CHECK-6: function(ee-instrument<>,ee-instrument) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='loop(simple-loop-unswitch,simple-loop-unswitch)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-7 ; CHECK-7: function(loop(simple-loop-unswitch,simple-loop-unswitch)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(mldst-motion,mldst-motion)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-8 ; CHECK-8: function(mldst-motion,mldst-motion) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(lower-matrix-intrinsics<>,lower-matrix-intrinsics)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-9 ; CHECK-9: function(lower-matrix-intrinsics<>,lower-matrix-intrinsics) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop-unroll<>,loop-unroll,loop-unroll)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-10 ; CHECK-10: function(loop-unroll,loop-unroll,loop-unroll) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(gvn<>,gvn,gvn)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-11 ; CHECK-11: function(gvn<>,gvn,gvn) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(early-cse<>,early-cse)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-12 ; CHECK-12: function(early-cse<>,early-cse) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='msan,module(msan,msan<>,msan)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-13 ; CHECK-13: msan,msan,msan,msan ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='module(hwasan<>,hwasan)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-14 ; CHECK-14: hwasan<>,hwasan ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='module(loop-extract<>,loop-extract)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-16 ; CHECK-16: loop-extract<>,loop-extract ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(print,print)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-17 ; CHECK-17: function(print,print) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(simplifycfg,simplifycfg)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-18 ; CHECK-18: function(simplifycfg,simplifycfg) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop-vectorize,loop-vectorize)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-19 ; CHECK-19: function(loop-vectorize,loop-vectorize) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='inliner-wrapper,inliner-wrapper-no-mandatory-first' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-20 ; CHECK-20: cgscc(inline,inline),cgscc(inline) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='scc-oz-module-inliner' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-21 ; CHECK-21: require,function(invalidate),require,cgscc(devirt<4>(inline,{{.*}},instcombine{{.*}})) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(function(no-op-function)),function(no-op-function)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-22 ; CHECK-22: cgscc(function(no-op-function)),function(no-op-function) ;; Test that the loop-nest-pass lnicm is printed with the other loop-passes in the pipeline. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop-mssa(licm,loop-rotate,loop-deletion,lnicm,loop-rotate))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-23 ; CHECK-23: function(loop-mssa(licm,loop-rotate,loop-deletion,lnicm,loop-rotate)) ;; Test that -debugify and -check-debugify is printed correctly. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='debugify,no-op-function,check-debugify' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-24 ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -enable-debugify -passes='no-op-function' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-24 ; CHECK-24: debugify,function(no-op-function),check-debugify ;; Test that LICM & LNICM with options. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop-mssa(licm,licm,lnicm,lnicm))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-25 ; CHECK-25: function(loop-mssa(licm,licm,lnicm,lnicm)) ;; Test coro-cond. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='coro-cond(no-op-module)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-26 ; CHECK-26: coro-cond(no-op-module) ;; Test that -print-pipeline-passes is parsable (implicitly done with -print-pipeline-passes) for various default pipelines. ; RUN: opt -disable-output -passes='default' < %s ; RUN: opt -disable-output -passes='default' < %s ; RUN: opt -disable-output -passes='default' < %s ; RUN: opt -disable-output -passes='default' < %s ;; Test SeparateConstOffsetFromGEPPass option. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='separate-const-offset-from-gep' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-27 ; CHECK-27: function(separate-const-offset-from-gep) ;; Test InstCombine options - the first pass checks default settings, and the second checks customized options. ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(instcombine,instcombine)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-28 ; CHECK-28: function(instcombine,instcombine) ;; Test function-attrs ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(function-attrs)' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-29 ; CHECK-29: cgscc(function-attrs) ;; Test cgscc -> function adaptor ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(function(no-op-function))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-30 ; CHECK-30: cgscc(function(no-op-function)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(function(no-op-function))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-31 ; CHECK-31: cgscc(function(no-op-function)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='cgscc(function(no-op-function))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-32 ; CHECK-32: cgscc(function(no-op-function)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='function(loop(loop-rotate))' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-33 ; CHECK-33: function(loop(loop-rotate)) ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='globaldce' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-34 ; CHECK-34: globaldce ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='globaldce' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-35 ; CHECK-35: globaldce ; RUN: opt -disable-output -disable-verify -print-pipeline-passes -passes='speculative-execution' < %s | FileCheck %s --match-full-lines --check-prefixes=CHECK-36 ; CHECK-36: function(speculative-execution)