mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[IRCE] Make IRCE a Function pass.
Summary: Make InductiveRangeCheckElimination a FunctionPass. Reviewers: reames, mkazantsev Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73592
This commit is contained in:
parent
9d09a8e119
commit
88ae466cc3
@ -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<IRCEPass> {
|
||||
public:
|
||||
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
|
||||
LoopStandardAnalysisResults &AR, LPMUpdater &U);
|
||||
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -183,6 +183,7 @@ FUNCTION_PASS("gvn-hoist", GVNHoistPass())
|
||||
FUNCTION_PASS("instcombine", InstCombinePass())
|
||||
FUNCTION_PASS("instsimplify", InstSimplifyPass())
|
||||
FUNCTION_PASS("invalidate<all>", 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("loop-deletion", LoopDeletionPass())
|
||||
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<ddg>", DDGAnalysisPrinterPass(dbgs()))
|
||||
|
@ -242,20 +242,25 @@ public:
|
||||
bool run(Loop *L, function_ref<void(Loop *, bool)> 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<BranchProbabilityInfoWrapperPass>();
|
||||
getLoopAnalysisUsage(AU);
|
||||
AU.addRequired<DominatorTreeWrapperPass>();
|
||||
AU.addPreserved<DominatorTreeWrapperPass>();
|
||||
AU.addRequired<LoopInfoWrapperPass>();
|
||||
AU.addPreserved<LoopInfoWrapperPass>();
|
||||
AU.addRequired<ScalarEvolutionWrapperPass>();
|
||||
AU.addPreserved<ScalarEvolutionWrapperPass>();
|
||||
}
|
||||
|
||||
bool runOnLoop(Loop *L, LPPassManager &LPM) override;
|
||||
bool runOnFunction(Function &F) override;
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
@ -265,7 +270,9 @@ char IRCELegacyPass::ID = 0;
|
||||
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 @@ IntersectUnsignedRange(ScalarEvolution &SE,
|
||||
return Ret;
|
||||
}
|
||||
|
||||
PreservedAnalyses IRCEPass::run(Loop &L, LoopAnalysisManager &AM,
|
||||
LoopStandardAnalysisResults &AR,
|
||||
LPMUpdater &U) {
|
||||
Function *F = L.getHeader()->getParent();
|
||||
const auto &FAM =
|
||||
AM.getResult<FunctionAnalysisManagerLoopProxy>(L, AR).getManager();
|
||||
auto *BPI = FAM.getCachedResult<BranchProbabilityAnalysis>(*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<ScalarEvolutionAnalysis>(F);
|
||||
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
|
||||
LoopInfo &LI = AM.getResult<LoopAnalysis>(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<Loop *, 4> 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<ScalarEvolutionWrapperPass>().getSE();
|
||||
@ -1776,10 +1798,27 @@ bool IRCELegacyPass::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
|
||||
auto &LI = getAnalysis<LoopInfoWrapperPass>().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<Loop *, 4> 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(
|
||||
|
@ -1488,6 +1488,10 @@ void llvm::appendLoopsToWorklist(RangeT &&Loops,
|
||||
template void llvm::appendLoopsToWorklist<ArrayRef<Loop *> &>(
|
||||
ArrayRef<Loop *> &Loops, SmallPriorityWorklist<Loop *, 4> &Worklist);
|
||||
|
||||
template void
|
||||
llvm::appendLoopsToWorklist<Loop &>(Loop &L,
|
||||
SmallPriorityWorklist<Loop *, 4> &Worklist);
|
||||
|
||||
void llvm::appendLoopsToWorklist(LoopInfo &LI,
|
||||
SmallPriorityWorklist<Loop *, 4> &Worklist) {
|
||||
appendReversedLoopsToWorklist(LI, Worklist);
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -irce -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -passes='require<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; test that the pre and post loops have loop metadata which disables any further
|
||||
; loop optimizations.
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -S -irce -irce-print-changed-loops=true < %s | FileCheck %s
|
||||
; RUN: opt -S -passes='require<branch-prob>,loop(irce)' -irce-print-changed-loops=true < %s | FileCheck %s
|
||||
; RUN: opt -S -passes='require<branch-prob>,irce' -irce-print-changed-loops=true < %s | FileCheck %s
|
||||
|
||||
; CHECK-NOT: irce
|
||||
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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"
|
||||
|
@ -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<branch-prob>,loop(irce)' -verify < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -irce-print-changed-loops -S -verify-loop-info -passes='require<branch-prob>,irce' -verify < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK-NOT: constrained loop
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -verify-loop-info -irce -S < %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,loop(irce)' -S < %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,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
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -S -verify-loop-info -irce < %s | FileCheck %s
|
||||
; RUN: opt -S -verify-loop-info -passes='require<branch-prob>,loop(irce)' < %s | FileCheck %s
|
||||
; RUN: opt -S -verify-loop-info -passes='require<branch-prob>,irce' < %s | FileCheck %s
|
||||
|
||||
define void @f_0(i32 *%arr, i32 *%a_len_ptr, i32 %n, i1* %cond_buf) {
|
||||
; CHECK-LABEL: @f_0(
|
||||
|
@ -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<branch-prob>,loop(irce)' < %s -S | FileCheck %s
|
||||
; RUN: opt -passes='require<branch-prob>,irce' < %s -S | FileCheck %s
|
||||
|
||||
; REQUIRES: asserts
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,loop(irce)' -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
|
||||
|
||||
define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
|
||||
entry:
|
||||
|
@ -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<branch-prob>,loop(irce)' -S
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S
|
||||
|
||||
; Make sure that IRCE doesn't apply in case of empty ranges.
|
||||
; (i + 30 < 40) if i in [-30, 10).
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
; CHECK: irce: in function test_01u: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; TODO: opt -irce-print-changed-loops -verify-loop-info -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK-NOT: constrained Loop
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,loop(irce)' -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,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) {
|
||||
|
@ -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<branch-prob>,loop(irce)' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,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) {
|
||||
|
@ -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<branch-prob>,loop(irce)' < %s 2>&1 | FileCheck %s
|
||||
; TODO: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK-NOT: constrained Loop
|
||||
|
||||
|
@ -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<branch-prob>,loop(irce)' < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -irce-print-range-checks -irce-print-changed-loops -verify-loop-info -passes='require<branch-prob>,irce' < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: loop has 1 inductive range checks:
|
||||
; CHECK-NEXT: InductiveRangeCheck:
|
||||
|
@ -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<branch-prob>,loop(irce)' -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,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:
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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:
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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:
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,loop(irce)' -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
|
||||
|
||||
define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
|
||||
entry:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; RUN: opt -verify-loop-info -irce -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,loop(irce)' -S < %s | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -passes='require<branch-prob>,irce' -S < %s | FileCheck %s
|
||||
|
||||
define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) {
|
||||
entry:
|
||||
|
@ -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<branch-prob>,loop(irce)' < %s | FileCheck %s
|
||||
; RUN: opt -irce-skip-profitability-checks -S -verify-loop-info -passes='require<branch-prob>,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(
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -irce-print-changed-loops -verify-loop-info -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK-NOT: constrained Loop at depth
|
||||
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
|
@ -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<branch-prob>,loop(irce)' -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' -S < %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: irce: in function test_01: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
; CHECK: irce: in function test_02: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting>
|
||||
|
@ -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<branch-prob>,loop(irce)' -irce-allow-narrow-latch=true -S < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,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() {
|
||||
|
@ -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<branch-prob>,loop(irce)' < %s 2>&1 | FileCheck %s
|
||||
; RUN: opt -verify-loop-info -irce-print-changed-loops -passes='require<branch-prob>,irce' < %s 2>&1 | FileCheck %s
|
||||
|
||||
; This test checks if we update the LoopInfo correctly in the presence
|
||||
; of parents, uncles and cousins.
|
||||
|
Loading…
Reference in New Issue
Block a user