You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
Analysis
AliasSet
AssumptionCache
BasicAA
BlockFrequencyInfo
BranchProbabilityInfo
CFLAliasAnalysis
CallGraph
ConstantFolding
CostModel
Delinearization
DemandedBits
DependenceAnalysis
DivergenceAnalysis
DominanceFrontier
Dominators
GlobalsModRef
IVUsers
LazyCallGraph
LazyValueAnalysis
Lint
LoopAccessAnalysis
LoopInfo
MemoryDependenceAnalysis
MemorySSA
PostDominators
ProfileSummary
RegionInfo
ScalarEvolution
2007-07-15-NegativeStride.ll
2007-08-06-MisinterpretBranch.ll
2007-08-06-Unsigned.ll
2007-09-27-LargeStepping.ll
2007-11-14-SignedAddRec.ll
2007-11-18-OrInstruction.ll
2008-02-11-ReversedCondition.ll
2008-02-12-SMAXTripCount.ll
2008-02-15-UMax.ll
2008-05-25-NegativeStepToZero.ll
2008-06-12-BinomialInt64.ll
2008-07-12-UnneededSelect1.ll
2008-07-12-UnneededSelect2.ll
2008-07-19-InfiniteLoop.ll
2008-07-19-WrappingIV.ll
2008-07-29-SGTTripCount.ll
2008-07-29-SMinExpr.ll
2008-08-04-IVOverflow.ll
2008-08-04-LongAddRec.ll
2008-11-02-QuadraticCrash.ll
2008-11-15-CubicOOM.ll
2008-11-18-LessThanOrEqual.ll
2008-11-18-Stride1.ll
2008-11-18-Stride2.ll
2008-12-08-FiniteSGE.ll
2008-12-11-SMaxOverflow.ll
2008-12-14-StrideAndSigned.ll
2008-12-15-DontUseSDiv.ll
2009-01-02-SignedNegativeStride.ll
2009-04-22-TruncCast.ll
2009-05-09-PointerEdgeCount.ll
2009-07-04-GroupConstantsWidthMismatch.ll
2010-09-03-RequiredTransitive.ll
2011-03-09-ExactNoMaxBECount.ll
2011-04-26-FoldAddRec.ll
2011-10-04-ConstEvolve.ll
2012-03-26-LoadConstant.ll
2012-05-18-LoopPredRecurse.ll
2012-05-29-MulAddRec.ll
SolveQuadraticEquation.ll
ZeroStep.ll
and-xor.ll
avoid-assume-hang.ll
avoid-infinite-recursion-0.ll
avoid-infinite-recursion-1.ll
avoid-smax-0.ll
avoid-smax-1.ll
cache_loop_exit_limit.ll
constant_condition.ll
different-loops-recs.ll
div-overflow.ll
do-loop.ll
exhaustive-trip-counts.ll
expander-replace-congruent-ivs.ll
exponential-behavior.ll
ext-antecedent.ll
flags-from-poison-dbg.ll
flags-from-poison.ll
flattened-0.ll
fold.ll
guards.ll
how-far-to-zero.ll
implied-via-addition.ll
implied-via-division.ll
incorrect-nsw.ll
increasing-or-decreasing-iv.ll
infer-prestart-no-wrap.ll
infer-via-ranges.ll
invalidation.ll
latch-dominating-conditions.ll
limit-depth.ll
load-with-range-metadata.ll
load.ll
max-addops-inline.ll
max-addrec-size.ll
max-be-count-not-constant.ll
max-mulops-inline.ll
max-trip-count-address-space.ll
max-trip-count.ll
min-max-exprs.ll
no-wrap-add-exprs.ll
no-wrap-unknown-becount.ll
non-IV-phi.ll
nowrap-preinc-limits.ll
nsw-offset-assume.ll
nsw-offset.ll
nsw.ll
nw-sub-is-not-nw-add.ll
overflow-intrinsics.ll
pointer-sign-bits.ll
pr18606-min-zeros.ll
pr18606.ll
pr22179.ll
pr22641.ll
pr22674.ll
pr22856.ll
pr24757.ll
pr25369.ll
pr27315.ll
pr28705.ll
pr34538.ll
pr3909.ll
predicated-trip-count.ll
range-signedness.ll
returned.ll
scev-aa.ll
scev-canonical-mode.ll
scev-dispositions.ll
scev-expander-existing-value-offset.ll
scev-expander-incorrect-nowrap.ll
scev-expander-reuse-gep.ll
scev-expander-reuse-unroll.ll
scev-expander-reuse-vect.ll
scev-invalid.ll
scev-prestart-nowrap.ll
sext-inreg.ll
sext-iv-0.ll
sext-iv-1.ll
sext-iv-2.ll
sext-mul.ll
sext-to-zext.ll
sext-zero.ll
shift-op.ll
sle.ll
smax-br-phi-idioms.ll
smax.ll
trip-count-pow2.ll
trip-count-switch.ll
trip-count-unknown-stride.ll
trip-count.ll
trip-count10.ll
trip-count11.ll
trip-count12.ll
trip-count13.ll
trip-count14.ll
trip-count2.ll
trip-count3.ll
trip-count4.ll
trip-count5.ll
trip-count6.ll
trip-count7.ll
trip-count8.ll
trip-count9.ll
tripmultiple_calculation.ll
truncate.ll
undefined.ll
unreachable-code.ll
unsimplified-loop.ll
urem-0.ll
zext-signed-addrec.ll
zext-wrap.ll
ScopedNoAliasAA
TypeBasedAliasAnalysis
ValueTracking
alias-analysis-uses.ll
Assembler
Bindings
Bitcode
BugPoint
CodeGen
DebugInfo
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LTO
Linker
MC
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO
Transforms
Unit
Verifier
YAMLParser
tools
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
version.txt.in
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
142 lines
4.0 KiB
LLVM
142 lines
4.0 KiB
LLVM
![]() |
; RUN: opt -S -indvars < %s | FileCheck %s
|
||
|
|
||
|
; Check that SCEV is able to recognize and use guards to prove
|
||
|
; conditions gaurding loop entries and backedges. This isn't intended
|
||
|
; to be a comprehensive test of SCEV's simplification capabilities,
|
||
|
; tests directly testing e.g. if SCEV can elide a sext should go
|
||
|
; elsewhere.
|
||
|
|
||
|
target datalayout = "n8:16:32:64"
|
||
|
|
||
|
declare void @llvm.experimental.guard(i1, ...)
|
||
|
|
||
|
define void @test_1(i1* %cond_buf, i32* %len_buf) {
|
||
|
; CHECK-LABEL: @test_1(
|
||
|
entry:
|
||
|
%len = load i32, i32* %len_buf, !range !{i32 1, i32 2147483648}
|
||
|
br label %loop
|
||
|
|
||
|
loop:
|
||
|
; CHECK: loop:
|
||
|
; CHECK: call void (i1, ...) @llvm.experimental.guard(i1 true) [ "deopt"() ]
|
||
|
; CHECK: %iv.inc.cmp = icmp ult i32 %iv.inc, %len
|
||
|
; CHECK: call void (i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
; CHECK: leave:
|
||
|
|
||
|
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
|
||
|
%iv.inc = add i32 %iv, 1
|
||
|
|
||
|
%iv.cmp = icmp slt i32 %iv, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.cmp) [ "deopt"() ]
|
||
|
|
||
|
%iv.inc.cmp = icmp slt i32 %iv.inc, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
|
||
|
%becond = load volatile i1, i1* %cond_buf
|
||
|
br i1 %becond, label %loop, label %leave
|
||
|
|
||
|
leave:
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_2(i32 %n, i32* %len_buf) {
|
||
|
; CHECK-LABEL: @test_2(
|
||
|
; CHECK: [[LEN_ZEXT:%[^ ]+]] = zext i32 %len to i64
|
||
|
; CHECK: br label %loop
|
||
|
|
||
|
entry:
|
||
|
%len = load i32, i32* %len_buf, !range !{i32 0, i32 2147483648}
|
||
|
br label %loop
|
||
|
|
||
|
loop:
|
||
|
; CHECK: loop:
|
||
|
; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %loop ], [ 0, %entry ]
|
||
|
; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
||
|
; CHECK: %iv.inc.cmp = icmp ult i64 %indvars.iv.next, [[LEN_ZEXT]]
|
||
|
; CHECK: call void (i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
; CHECK: leave:
|
||
|
|
||
|
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
|
||
|
%iv.inc = add i32 %iv, 1
|
||
|
|
||
|
%iv.sext = sext i32 %iv to i64
|
||
|
|
||
|
%iv.inc.cmp = icmp slt i32 %iv.inc, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
|
||
|
%becond = icmp ne i32 %iv, %n
|
||
|
br i1 %becond, label %loop, label %leave
|
||
|
|
||
|
leave:
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_3(i1* %cond_buf, i32* %len_buf) {
|
||
|
; CHECK-LABEL: @test_3(
|
||
|
|
||
|
entry:
|
||
|
%len = load i32, i32* %len_buf
|
||
|
%entry.cond = icmp sgt i32 %len, 0
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %entry.cond) [ "deopt"() ]
|
||
|
br label %loop
|
||
|
|
||
|
loop:
|
||
|
; CHECK: loop:
|
||
|
; CHECK: call void (i1, ...) @llvm.experimental.guard(i1 true) [ "deopt"() ]
|
||
|
; CHECK: %iv.inc.cmp = icmp slt i32 %iv.inc, %len
|
||
|
; CHECK: call void (i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
; CHECK: leave:
|
||
|
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
|
||
|
%iv.inc = add i32 %iv, 1
|
||
|
|
||
|
%iv.cmp = icmp slt i32 %iv, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.cmp) [ "deopt"() ]
|
||
|
|
||
|
%iv.inc.cmp = icmp slt i32 %iv.inc, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
|
||
|
%becond = load volatile i1, i1* %cond_buf
|
||
|
br i1 %becond, label %loop, label %leave
|
||
|
|
||
|
leave:
|
||
|
ret void
|
||
|
}
|
||
|
|
||
|
define void @test_4(i1* %cond_buf, i32* %len_buf) {
|
||
|
; CHECK-LABEL: @test_4(
|
||
|
|
||
|
entry:
|
||
|
%len = load i32, i32* %len_buf
|
||
|
%entry.cond = icmp sgt i32 %len, 0
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %entry.cond) [ "deopt"() ]
|
||
|
br label %loop
|
||
|
|
||
|
loop:
|
||
|
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %be ]
|
||
|
%iv.inc = add i32 %iv, 1
|
||
|
|
||
|
%cond = load volatile i1, i1* %cond_buf
|
||
|
br i1 %cond, label %left, label %be
|
||
|
|
||
|
left:
|
||
|
; Does not dominate the backedge, so cannot be used in the inductive proof
|
||
|
%iv.inc.cmp = icmp slt i32 %iv.inc, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.inc.cmp) [ "deopt"() ]
|
||
|
br label %be
|
||
|
|
||
|
be:
|
||
|
; CHECK: be:
|
||
|
; CHECK-NEXT: %iv.cmp = icmp slt i32 %iv, %len
|
||
|
; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 %iv.cmp) [ "deopt"() ]
|
||
|
; CHECK: leave:
|
||
|
|
||
|
%iv.cmp = icmp slt i32 %iv, %len
|
||
|
call void(i1, ...) @llvm.experimental.guard(i1 %iv.cmp) [ "deopt"() ]
|
||
|
|
||
|
%becond = load volatile i1, i1* %cond_buf
|
||
|
br i1 %becond, label %loop, label %leave
|
||
|
|
||
|
leave:
|
||
|
ret void
|
||
|
}
|