diff --git a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h --- a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h @@ -15,14 +15,12 @@ #define LLVM_TRANSFORMS_SCALAR_INDUCTIVERANGECHECKELIMINATION_H #include "llvm/IR/PassManager.h" -#include "llvm/Transforms/Scalar/LoopPassManager.h" namespace llvm { class IRCEPass : public PassInfoMixin { public: - PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, - LoopStandardAnalysisResults &AR, LPMUpdater &U); + PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; } // end namespace llvm diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -183,6 +183,7 @@ FUNCTION_PASS("instcombine", InstCombinePass()) FUNCTION_PASS("instsimplify", InstSimplifyPass()) FUNCTION_PASS("invalidate", InvalidateAllAnalysesPass()) +FUNCTION_PASS("irce", IRCEPass()) FUNCTION_PASS("float2int", Float2IntPass()) FUNCTION_PASS("no-op-function", NoOpFunctionPass()) FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass()) @@ -313,7 +314,6 @@ LOOP_PASS("simplify-cfg", LoopSimplifyCFGPass()) LOOP_PASS("strength-reduce", LoopStrengthReducePass()) LOOP_PASS("indvars", IndVarSimplifyPass()) -LOOP_PASS("irce", IRCEPass()) LOOP_PASS("unroll-full", LoopFullUnrollPass()) LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs())) LOOP_PASS("print", DDGAnalysisPrinterPass(dbgs())) diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp --- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -242,20 +242,25 @@ bool run(Loop *L, function_ref LPMAddNewLoop); }; -class IRCELegacyPass : public LoopPass { +class IRCELegacyPass : public FunctionPass { public: static char ID; - IRCELegacyPass() : LoopPass(ID) { + IRCELegacyPass() : FunctionPass(ID) { initializeIRCELegacyPassPass(*PassRegistry::getPassRegistry()); } void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); - getLoopAnalysisUsage(AU); + AU.addRequired(); + AU.addPreserved(); + AU.addRequired(); + AU.addPreserved(); + AU.addRequired(); + AU.addPreserved(); } - bool runOnLoop(Loop *L, LPPassManager &LPM) override; + bool runOnFunction(Function &F) override; }; } // end anonymous namespace @@ -265,7 +270,9 @@ INITIALIZE_PASS_BEGIN(IRCELegacyPass, "irce", "Inductive range check elimination", false, false) INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfoWrapperPass) -INITIALIZE_PASS_DEPENDENCY(LoopPass) +INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) +INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass) INITIALIZE_PASS_END(IRCELegacyPass, "irce", "Inductive range check elimination", false, false) @@ -1747,27 +1754,42 @@ return Ret; } -PreservedAnalyses IRCEPass::run(Loop &L, LoopAnalysisManager &AM, - LoopStandardAnalysisResults &AR, - LPMUpdater &U) { - Function *F = L.getHeader()->getParent(); - const auto &FAM = - AM.getResult(L, AR).getManager(); - auto *BPI = FAM.getCachedResult(*F); - InductiveRangeCheckElimination IRCE(AR.SE, BPI, AR.DT, AR.LI); - auto LPMAddNewLoop = [&U](Loop *NL, bool IsSubloop) { +PreservedAnalyses IRCEPass::run(Function &F, FunctionAnalysisManager &AM) { + auto &SE = AM.getResult(F); + auto &DT = AM.getResult(F); + LoopInfo &LI = AM.getResult(F); + + BranchProbabilityInfo BPI; + BPI.calculate(F, LI); + InductiveRangeCheckElimination IRCE(SE, &BPI, DT, LI); + + bool Changed = false; + + for (const auto &L : LI) { + Changed |= simplifyLoop(L, &DT, &LI, &SE, nullptr, nullptr, + /*PreserveLCSSA=*/false); + Changed |= formLCSSARecursively(*L, DT, &LI, &SE); + } + + SmallPriorityWorklist Worklist; + appendLoopsToWorklist(LI, Worklist); + auto LPMAddNewLoop = [&Worklist](Loop *NL, bool IsSubloop) { if (!IsSubloop) - U.addSiblingLoops(NL); + appendLoopsToWorklist(*NL, Worklist); }; - bool Changed = IRCE.run(&L, LPMAddNewLoop); + + while (!Worklist.empty()) { + Loop *L = Worklist.pop_back_val(); + Changed |= IRCE.run(L, LPMAddNewLoop); + } + if (!Changed) return PreservedAnalyses::all(); - return getLoopPassPreservedAnalyses(); } -bool IRCELegacyPass::runOnLoop(Loop *L, LPPassManager &LPM) { - if (skipLoop(L)) +bool IRCELegacyPass::runOnFunction(Function &F) { + if (skipFunction(F)) return false; ScalarEvolution &SE = getAnalysis().getSE(); @@ -1776,10 +1798,27 @@ auto &DT = getAnalysis().getDomTree(); auto &LI = getAnalysis().getLoopInfo(); InductiveRangeCheckElimination IRCE(SE, &BPI, DT, LI); - auto LPMAddNewLoop = [&LPM](Loop *NL, bool /* IsSubLoop */) { - LPM.addLoop(*NL); + + bool Changed = false; + + for (const auto &L : LI) { + Changed |= simplifyLoop(L, &DT, &LI, &SE, nullptr, nullptr, + /*PreserveLCSSA=*/false); + Changed |= formLCSSARecursively(*L, DT, &LI, &SE); + } + + SmallPriorityWorklist Worklist; + appendLoopsToWorklist(LI, Worklist); + auto LPMAddNewLoop = [&](Loop *NL, bool IsSubloop) { + if (!IsSubloop) + appendLoopsToWorklist(*NL, Worklist); }; - return IRCE.run(L, LPMAddNewLoop); + + while (!Worklist.empty()) { + Loop *L = Worklist.pop_back_val(); + Changed |= IRCE.run(L, LPMAddNewLoop); + } + return Changed; } bool InductiveRangeCheckElimination::run( diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -1488,6 +1488,10 @@ template void llvm::appendLoopsToWorklist &>( ArrayRef &Loops, SmallPriorityWorklist &Worklist); +template void +llvm::appendLoopsToWorklist(Loop &L, + SmallPriorityWorklist &Worklist); + void llvm::appendLoopsToWorklist(LoopInfo &LI, SmallPriorityWorklist &Worklist) { appendReversedLoopsToWorklist(LI, Worklist); diff --git a/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll b/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll --- a/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll +++ b/llvm/test/Transforms/IRCE/add-metadata-pre-post-loops.ll @@ -1,5 +1,5 @@ ; RUN: opt -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; test that the pre and post loops have loop metadata which disables any further ; loop optimizations. diff --git a/llvm/test/Transforms/IRCE/bad-loop-structure.ll b/llvm/test/Transforms/IRCE/bad-loop-structure.ll --- a/llvm/test/Transforms/IRCE/bad-loop-structure.ll +++ b/llvm/test/Transforms/IRCE/bad-loop-structure.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -irce -irce-print-changed-loops=true < %s | FileCheck %s -; RUN: opt -S -passes='require,loop(irce)' -irce-print-changed-loops=true < %s | FileCheck %s +; RUN: opt -S -passes='require,irce' -irce-print-changed-loops=true < %s | FileCheck %s ; CHECK-NOT: irce diff --git a/llvm/test/Transforms/IRCE/bad_expander.ll b/llvm/test/Transforms/IRCE/bad_expander.ll --- a/llvm/test/Transforms/IRCE/bad_expander.ll +++ b/llvm/test/Transforms/IRCE/bad_expander.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll b/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll --- a/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll +++ b/llvm/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll @@ -1,5 +1,5 @@ ; RUN: opt -irce-print-changed-loops -S -verify-loop-info -irce -verify < %s 2>&1 | FileCheck %s -; RUN: opt -irce-print-changed-loops -S -verify-loop-info -passes='require,loop(irce)' -verify < %s 2>&1 | FileCheck %s +; RUN: opt -irce-print-changed-loops -S -verify-loop-info -passes='require,irce' -verify < %s 2>&1 | FileCheck %s ; CHECK-NOT: constrained loop diff --git a/llvm/test/Transforms/IRCE/bug-mismatched-types.ll b/llvm/test/Transforms/IRCE/bug-mismatched-types.ll --- a/llvm/test/Transforms/IRCE/bug-mismatched-types.ll +++ b/llvm/test/Transforms/IRCE/bug-mismatched-types.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -S < %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -S < %s +; RUN: opt -verify-loop-info -passes='require,irce' -S < %s ; These test cases don't check the correctness of the transform, but ; that -irce does not crash in the presence of certain things in diff --git a/llvm/test/Transforms/IRCE/clamp.ll b/llvm/test/Transforms/IRCE/clamp.ll --- a/llvm/test/Transforms/IRCE/clamp.ll +++ b/llvm/test/Transforms/IRCE/clamp.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; The test demonstrates that incorrect behavior of Clamp may lead to incorrect ; calculation of post-loop exit condition. diff --git a/llvm/test/Transforms/IRCE/conjunctive-checks.ll b/llvm/test/Transforms/IRCE/conjunctive-checks.ll --- a/llvm/test/Transforms/IRCE/conjunctive-checks.ll +++ b/llvm/test/Transforms/IRCE/conjunctive-checks.ll @@ -1,5 +1,5 @@ ; RUN: opt -S -verify-loop-info -irce < %s | FileCheck %s -; RUN: opt -S -verify-loop-info -passes='require,loop(irce)' < %s | FileCheck %s +; RUN: opt -S -verify-loop-info -passes='require,irce' < %s | FileCheck %s define void @f_0(i32 *%arr, i32 *%a_len_ptr, i32 %n, i1* %cond_buf) { ; CHECK-LABEL: @f_0( diff --git a/llvm/test/Transforms/IRCE/correct-loop-info.ll b/llvm/test/Transforms/IRCE/correct-loop-info.ll --- a/llvm/test/Transforms/IRCE/correct-loop-info.ll +++ b/llvm/test/Transforms/IRCE/correct-loop-info.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -irce < %s -S | FileCheck %s -; RUN: opt -passes='require,loop(irce)' < %s -S | FileCheck %s +; RUN: opt -passes='require,irce' < %s -S | FileCheck %s ; REQUIRES: asserts diff --git a/llvm/test/Transforms/IRCE/decrementing-loop.ll b/llvm/test/Transforms/IRCE/decrementing-loop.ll --- a/llvm/test/Transforms/IRCE/decrementing-loop.ll +++ b/llvm/test/Transforms/IRCE/decrementing-loop.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -S < %s | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -S < %s | FileCheck %s define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: diff --git a/llvm/test/Transforms/IRCE/empty_ranges.ll b/llvm/test/Transforms/IRCE/empty_ranges.ll --- a/llvm/test/Transforms/IRCE/empty_ranges.ll +++ b/llvm/test/Transforms/IRCE/empty_ranges.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S ; Make sure that IRCE doesn't apply in case of empty ranges. ; (i + 30 < 40) if i in [-30, 10). diff --git a/llvm/test/Transforms/IRCE/eq_ne.ll b/llvm/test/Transforms/IRCE/eq_ne.ll --- a/llvm/test/Transforms/IRCE/eq_ne.ll +++ b/llvm/test/Transforms/IRCE/eq_ne.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop
,%in.bounds ; CHECK: irce: in function test_01u: constrained Loop at depth 1 containing: %loop
,%in.bounds diff --git a/llvm/test/Transforms/IRCE/low-becount.ll b/llvm/test/Transforms/IRCE/low-becount.ll --- a/llvm/test/Transforms/IRCE/low-becount.ll +++ b/llvm/test/Transforms/IRCE/low-becount.ll @@ -1,7 +1,7 @@ ; RUN: opt -irce-print-changed-loops -verify-loop-info -irce -S < %s 2>&1 | FileCheck %s -; +; ; TODO: new-pm version should be enabled after we decide on branch-probability handling for loop passes -; TODO: opt -irce-print-changed-loops -verify-loop-info -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; TODO: opt -irce-print-changed-loops -verify-loop-info -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK-NOT: constrained Loop diff --git a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll --- a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll +++ b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -S < %s | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -S < %s | FileCheck %s define void @multiple_access_no_preloop( i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) { diff --git a/llvm/test/Transforms/IRCE/non_known_positive_end.ll b/llvm/test/Transforms/IRCE/non_known_positive_end.ll --- a/llvm/test/Transforms/IRCE/non_known_positive_end.ll +++ b/llvm/test/Transforms/IRCE/non_known_positive_end.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s ; Make sure that we can pick up both range checks. define void @test_01(i32 *%arr, i32* %a_len_ptr, i32* %size_ptr) { diff --git a/llvm/test/Transforms/IRCE/not-likely-taken.ll b/llvm/test/Transforms/IRCE/not-likely-taken.ll --- a/llvm/test/Transforms/IRCE/not-likely-taken.ll +++ b/llvm/test/Transforms/IRCE/not-likely-taken.ll @@ -1,7 +1,7 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce < %s 2>&1 | FileCheck %s ; ; TODO: new-pm version should be enabled after we decide on branch-probability handling for loop passes -; TODO: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' < %s 2>&1 | FileCheck %s +; TODO: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' < %s 2>&1 | FileCheck %s ; CHECK-NOT: constrained Loop diff --git a/llvm/test/Transforms/IRCE/only-lower-check.ll b/llvm/test/Transforms/IRCE/only-lower-check.ll --- a/llvm/test/Transforms/IRCE/only-lower-check.ll +++ b/llvm/test/Transforms/IRCE/only-lower-check.ll @@ -1,5 +1,5 @@ ; RUN: opt -irce-print-range-checks -irce-print-changed-loops -verify-loop-info -irce < %s 2>&1 | FileCheck %s -; RUN: opt -irce-print-range-checks -irce-print-changed-loops -verify-loop-info -passes='require,loop(irce)' < %s 2>&1 | FileCheck %s +; RUN: opt -irce-print-range-checks -irce-print-changed-loops -verify-loop-info -passes='require,irce' < %s 2>&1 | FileCheck %s ; CHECK: irce: loop has 1 inductive range checks: ; CHECK-NEXT: InductiveRangeCheck: diff --git a/llvm/test/Transforms/IRCE/only-upper-check.ll b/llvm/test/Transforms/IRCE/only-upper-check.ll --- a/llvm/test/Transforms/IRCE/only-upper-check.ll +++ b/llvm/test/Transforms/IRCE/only-upper-check.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s ; CHECK: irce: loop has 1 inductive range checks: ; CHECK-NEXT:InductiveRangeCheck: diff --git a/llvm/test/Transforms/IRCE/pre_post_loops.ll b/llvm/test/Transforms/IRCE/pre_post_loops.ll --- a/llvm/test/Transforms/IRCE/pre_post_loops.ll +++ b/llvm/test/Transforms/IRCE/pre_post_loops.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop
,%in.bounds ; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop
,%in.bounds diff --git a/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll b/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll --- a/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll +++ b/llvm/test/Transforms/IRCE/range_intersect_miscompile.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK-LABEL: irce: in function test_01: constrained Loop at depth 1 containing: ; CHECK-LABEL: irce: in function test_02: constrained Loop at depth 1 containing: diff --git a/llvm/test/Transforms/IRCE/ranges_of_different_types.ll b/llvm/test/Transforms/IRCE/ranges_of_different_types.ll --- a/llvm/test/Transforms/IRCE/ranges_of_different_types.ll +++ b/llvm/test/Transforms/IRCE/ranges_of_different_types.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; Make sure we can eliminate range check with signed latch, unsigned IRC and ; positive offset. The safe iteration space is: diff --git a/llvm/test/Transforms/IRCE/rc-negative-bound.ll b/llvm/test/Transforms/IRCE/rc-negative-bound.ll --- a/llvm/test/Transforms/IRCE/rc-negative-bound.ll +++ b/llvm/test/Transforms/IRCE/rc-negative-bound.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK-NOT: irce: in function test_01: constrained Loop ; CHECK-NOT: irce: in function test_02: constrained Loop diff --git a/llvm/test/Transforms/IRCE/single-access-no-preloop.ll b/llvm/test/Transforms/IRCE/single-access-no-preloop.ll --- a/llvm/test/Transforms/IRCE/single-access-no-preloop.ll +++ b/llvm/test/Transforms/IRCE/single-access-no-preloop.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -S < %s | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -S < %s | FileCheck %s define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: diff --git a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll --- a/llvm/test/Transforms/IRCE/single-access-with-preloop.ll +++ b/llvm/test/Transforms/IRCE/single-access-with-preloop.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s -; RUN: opt -verify-loop-info -passes='require,loop(irce)' -S < %s | FileCheck %s +; RUN: opt -verify-loop-info -passes='require,irce' -S < %s | FileCheck %s define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) { entry: diff --git a/llvm/test/Transforms/IRCE/skip-profitability-checks.ll b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll --- a/llvm/test/Transforms/IRCE/skip-profitability-checks.ll +++ b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll @@ -1,5 +1,5 @@ ; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -irce < %s | FileCheck %s -; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -passes='require,loop(irce)' < %s | FileCheck %s +; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -passes='require,irce' < %s | FileCheck %s define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) { ; CHECK-LABEL: @single_access_no_preloop_no_offset( diff --git a/llvm/test/Transforms/IRCE/stride_more_than_1.ll b/llvm/test/Transforms/IRCE/stride_more_than_1.ll --- a/llvm/test/Transforms/IRCE/stride_more_than_1.ll +++ b/llvm/test/Transforms/IRCE/stride_more_than_1.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop
,%in.bounds ; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop
,%in.bounds diff --git a/llvm/test/Transforms/IRCE/unhandled.ll b/llvm/test/Transforms/IRCE/unhandled.ll --- a/llvm/test/Transforms/IRCE/unhandled.ll +++ b/llvm/test/Transforms/IRCE/unhandled.ll @@ -1,5 +1,5 @@ ; RUN: opt -irce-print-changed-loops -verify-loop-info -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -irce-print-changed-loops -verify-loop-info -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -irce-print-changed-loops -verify-loop-info -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK-NOT: constrained Loop at depth diff --git a/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll b/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll --- a/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll +++ b/llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop
,%in.bounds ; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop
,%in.bounds diff --git a/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll b/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll --- a/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll +++ b/llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -S < %s 2>&1 | FileCheck %s ; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop
,%in.bounds ; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop
,%in.bounds diff --git a/llvm/test/Transforms/IRCE/wide_indvar.ll b/llvm/test/Transforms/IRCE/wide_indvar.ll --- a/llvm/test/Transforms/IRCE/wide_indvar.ll +++ b/llvm/test/Transforms/IRCE/wide_indvar.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce -irce-allow-narrow-latch=true -S < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' -irce-allow-narrow-latch=true -S < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' -irce-allow-narrow-latch=true -S < %s 2>&1 | FileCheck %s ; Check that we can remove trivially non-failing range check. define i32 @test_increasing_slt_slt_wide_simple_no_postloop() { diff --git a/llvm/test/Transforms/IRCE/with-parent-loops.ll b/llvm/test/Transforms/IRCE/with-parent-loops.ll --- a/llvm/test/Transforms/IRCE/with-parent-loops.ll +++ b/llvm/test/Transforms/IRCE/with-parent-loops.ll @@ -1,5 +1,5 @@ ; RUN: opt -verify-loop-info -irce-print-changed-loops -irce < %s 2>&1 | FileCheck %s -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,loop(irce)' < %s 2>&1 | FileCheck %s +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require,irce' < %s 2>&1 | FileCheck %s ; This test checks if we update the LoopInfo correctly in the presence ; of parents, uncles and cousins.