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
libcxx
libcxxabi
libunwind
lld
lldb
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
Analysis
Assembler
Bindings
Bitcode
BugPoint
CodeGen
DebugInfo
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LTO
Linker
MC
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO
Transforms
ADCE
AddDiscriminators
AlignmentFromAssumptions
ArgumentPromotion
AtomicExpand
BDCE
BranchFolding
CallSiteSplitting
CalledValuePropagation
CodeExtractor
CodeGenPrepare
ConstProp
ConstantHoisting
ConstantMerge
Coroutines
CorrelatedValuePropagation
CrossDSOCFI
DCE
DeadArgElim
DeadStoreElimination
DivRemPairs
EarlyCSE
EliminateAvailableExternally
EntryExitInstrumenter
ExpandMemCmp
Float2Int
ForcedFunctionAttrs
FunctionAttrs
FunctionImport
GCOVProfiling
GVN
GVNHoist
GVNSink
GlobalDCE
GlobalMerge
GlobalOpt
GlobalSplit
GuardWidening
IPConstantProp
IRCE
IndVarSimplify
IndirectBrExpand
InferAddressSpaces
InferFunctionAttrs
Inline
InstCombine
InstMerge
InstNamer
InstSimplify
InterleavedAccess
Internalize
JumpThreading
LCSSA
LICM
LoadStoreVectorizer
LoopDataPrefetch
LoopDeletion
LoopDistribute
LoopIdiom
LoopInterchange
LoopLoadElim
LoopPredication
LoopReroll
LoopRotate
LoopSimplify
LoopSimplifyCFG
LoopStrengthReduce
LoopUnroll
LoopUnswitch
LoopVectorize
LoopVersioning
LoopVersioningLICM
LowerAtomic
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerSwitch
LowerTypeTests
Mem2Reg
MemCpyOpt
MergeFunc
MergeICmps
MetaRenamer
NameAnonGlobals
NaryReassociate
NewGVN
ObjCARC
PGOProfile
PartiallyInlineLibCalls
PhaseOrdering
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH
Reassociate
Reg2Mem
RewriteStatepointsForGC
SCCP
SLPVectorizer
SROA
SafeStack
SampleProfile
Scalarizer
SeparateConstOffsetFromGEP
SimpleLoopUnswitch
SimplifyCFG
AArch64
AMDGPU
ARM
Hexagon
Mips
PowerPC
SPARC
X86
2002-05-21-PHIElimination.ll
2002-09-24-PHIAssertion.ll
2003-03-07-DominateProblem.ll
2003-08-05-InvokeCrash.ll
2003-08-17-BranchFold.ll
2003-08-17-BranchFoldOrdering.ll
2003-08-17-FoldSwitch-dbg.ll
2003-08-17-FoldSwitch.ll
2004-12-10-SimplifyCFGCrash.ll
2005-06-16-PHICrash.ll
2005-08-01-PHIUpdateFail.ll
2005-10-02-InvokeSimplify.ll
2005-12-03-IncorrectPHIFold.ll
2006-02-17-InfiniteUnroll.ll
2006-06-12-InfLoop.ll
2006-08-03-Crash.ll
2006-10-19-UncondDiv.ll
2006-12-08-Ptr-ICmp-Branch.ll
2007-11-22-InvokeNoUnwind.ll
2007-12-21-Crash.ll
2008-01-02-hoist-fp-add.ll
2008-05-16-PHIBlockMerge.ll
2008-07-13-InfLoopMiscompile.ll
2008-09-08-MultiplePred.ll
2008-09-17-SpeculativeHoist.ll
2008-10-03-SpeculativelyExecuteBeforePHI.ll
2008-12-06-SingleEntryPhi.ll
2008-12-16-DCECond.ll
2009-01-18-PHIPropCrash.ll
2009-05-12-externweak.ll
2010-03-30-InvokeCrash.ll
2011-03-08-UnreachableUse.ll
2011-09-05-TrivialLPad.ll
BrUnwind.ll
ConditionalTrappingConstantExpr.ll
CoveredLookupTable.ll
DeadSetCC.ll
EmptyBlockMerge.ll
EqualPHIEdgeBlockMerge.ll
ForwardSwitchConditionToPHI.ll
HoistCode.ll
InfLoop.ll
MagicPointer.ll
PHINode.ll
PR16069.ll
PR17073.ll
PR25267.ll
PR27615-simplify-cond-br.ll
PR29163.ll
PR30210.ll
PR9946.ll
PhiBlockMerge.ll
PhiBlockMerge2.ll
PhiEliminate.ll
PhiEliminate2.ll
PhiEliminate3.ll
PhiNoEliminate.ll
SpeculativeExec.ll
UncondBranchToReturn.ll
UnreachableEliminate.ll
assume.ll
attr-convergent.ll
attr-noduplicate.ll
basictest.ll
branch-cond-merge.ll
branch-cond-prop.ll
branch-fold-dbg.ll
branch-fold-test.ll
branch-fold-threshold.ll
branch-fold.ll
branch-phi-thread.ll
bug-25299.ll
clamp.ll
combine-parallel-mem-md.ll
common-dest-folding.ll
critedge-assume.ll
dbginfo.ll
dce-cond-after-folding-terminator.ll
div-rem-pairs.ll
duplicate-landingpad.ll
duplicate-phis.ll
empty-catchpad.ll
empty-cleanuppad.ll
extract-cost.ll
gepcost.ll
guards.ll
hoist-common-code.ll
hoist-dbgvalue.ll
hoist-with-range.ll
implied-and-or.ll
implied-cond-matching-false-dest.ll
implied-cond-matching-imm.ll
implied-cond-matching.ll
implied-cond.ll
indirectbr.ll
inline-asm-sink.ll
invoke.ll
invoke_unwind.ll
iterative-simplify.ll
lifetime.ll
merge-cleanuppads.ll
merge-cond-stores-2.ll
merge-cond-stores.ll
multiple-phis.ll
no-md-sink.ll
no_speculative_loads_with_asan.ll
no_speculative_loads_with_tsan.ll
noreturn-call.ll
phi-undef-loadstore.ll
pr33605.ll
pr34131.ll
pr35774.ll
preserve-branchweights-partial.ll
preserve-branchweights-switch-create.ll
preserve-branchweights.ll
preserve-llvm-loop-metadata.ll
preserve-load-metadata-2.ll
preserve-load-metadata-3.ll
preserve-load-metadata.ll
preserve-make-implicit-on-switch-to-br.ll
preserve-store-alignment.ll
rangereduce.ll
remove-debug-2.ll
remove-debug.ll
return-merge.ll
seh-nounwind.ll
select-gep.ll
sink-common-code.ll
speculate-call.ll
speculate-dbgvalue.ll
speculate-math.ll
speculate-store.ll
speculate-vector-ops.ll
speculate-with-offset.ll
statepoint-invoke-unwind.ll
suppress-zero-branch-weights.ll
switch-dead-default.ll
switch-masked-bits.ll
switch-on-const-select.ll
switch-range-to-icmp.ll
switch-simplify-crash.ll
switch-to-br.ll
switch-to-icmp.ll
switch-to-select-multiple-edge-per-block-phi.ll
switch-to-select-two-case.ll
switch_create.ll
switch_switch_fold.ll
switch_thread.ll
switch_undef.ll
trap-debugloc.ll
trapping-load-unreachable.ll
two-entry-phi-return.ll
unreachable-blocks.ll
unreachable-cleanuppad.ll
volatile-phioper.ll
wineh-unreachable.ll
Sink
SpeculateAroundPHIs
SpeculativeExecution
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG
TailCallElim
ThinLTOBitcodeWriter
Util
WholeProgramDevirt
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
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
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
122 lines
5.1 KiB
LLVM
122 lines
5.1 KiB
LLVM
![]() |
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||
|
; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=2 -S | FileCheck %s
|
||
|
|
||
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||
|
target triple = "x86_64-unknown-linux-gnu"
|
||
|
|
||
|
define i32 @test1(i32 %a, i32 %b, i32 %c) nounwind {
|
||
|
; CHECK-LABEL: @test1(
|
||
|
; CHECK-NEXT: entry:
|
||
|
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[B:%.*]], 0
|
||
|
; CHECK-NEXT: br i1 [[TMP1]], label [[BB1:%.*]], label [[BB3:%.*]]
|
||
|
; CHECK: bb1:
|
||
|
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[C:%.*]], 1
|
||
|
; CHECK-NEXT: [[TMP3:%.*]] = add i32 [[A:%.*]], 1
|
||
|
; CHECK-NEXT: [[TMP3_A:%.*]] = select i1 [[TMP2]], i32 [[TMP3]], i32 [[A]]
|
||
|
; CHECK-NEXT: br label [[BB3]]
|
||
|
; CHECK: bb3:
|
||
|
; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ [[B]], [[ENTRY:%.*]] ], [ [[TMP3_A]], [[BB1]] ]
|
||
|
; CHECK-NEXT: [[TMP5:%.*]] = sub i32 [[TMP4]], 1
|
||
|
; CHECK-NEXT: ret i32 [[TMP5]]
|
||
|
;
|
||
|
entry:
|
||
|
%tmp1 = icmp eq i32 %b, 0
|
||
|
br i1 %tmp1, label %bb1, label %bb3
|
||
|
|
||
|
bb1: ; preds = %entry
|
||
|
%tmp2 = icmp sgt i32 %c, 1
|
||
|
br i1 %tmp2, label %bb2, label %bb3
|
||
|
|
||
|
bb2: ; preds = bb1
|
||
|
%tmp3 = add i32 %a, 1
|
||
|
br label %bb3
|
||
|
|
||
|
bb3: ; preds = %bb2, %entry
|
||
|
%tmp4 = phi i32 [ %b, %entry ], [ %a, %bb1 ], [ %tmp3, %bb2 ]
|
||
|
%tmp5 = sub i32 %tmp4, 1
|
||
|
ret i32 %tmp5
|
||
|
}
|
||
|
|
||
|
define i8* @test4(i1* %dummy, i8* %a, i8* %b) {
|
||
|
; Test that we don't speculate an arbitrarily large number of unfolded constant
|
||
|
; expressions.
|
||
|
; CHECK-LABEL: @test4(
|
||
|
; CHECK-NEXT: entry:
|
||
|
; CHECK-NEXT: [[COND1:%.*]] = load volatile i1, i1* [[DUMMY:%.*]]
|
||
|
; CHECK-NEXT: br i1 [[COND1]], label [[IF:%.*]], label [[END:%.*]]
|
||
|
; CHECK: if:
|
||
|
; CHECK-NEXT: [[COND2:%.*]] = load volatile i1, i1* [[DUMMY]]
|
||
|
; CHECK-NEXT: br i1 [[COND2]], label [[THEN:%.*]], label [[END]]
|
||
|
; CHECK: then:
|
||
|
; CHECK-NEXT: br label [[END]]
|
||
|
; CHECK: end:
|
||
|
; CHECK-NEXT: [[X1:%.*]] = phi i8* [ [[A:%.*]], [[ENTRY:%.*]] ], [ [[B:%.*]], [[IF]] ], [ inttoptr (i64 1 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X2:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 2 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X3:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 3 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X4:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 4 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X5:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 5 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X6:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 6 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X7:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 7 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X8:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 8 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X9:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 9 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: [[X10:%.*]] = phi i8* [ [[A]], [[ENTRY]] ], [ [[B]], [[IF]] ], [ inttoptr (i64 10 to i8*), [[THEN]] ]
|
||
|
; CHECK-NEXT: ret i8* [[X10]]
|
||
|
;
|
||
|
|
||
|
entry:
|
||
|
%cond1 = load volatile i1, i1* %dummy
|
||
|
br i1 %cond1, label %if, label %end
|
||
|
|
||
|
if:
|
||
|
%cond2 = load volatile i1, i1* %dummy
|
||
|
br i1 %cond2, label %then, label %end
|
||
|
|
||
|
then:
|
||
|
br label %end
|
||
|
|
||
|
end:
|
||
|
%x1 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 1 to i8*), %then ]
|
||
|
%x2 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 2 to i8*), %then ]
|
||
|
%x3 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 3 to i8*), %then ]
|
||
|
%x4 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 4 to i8*), %then ]
|
||
|
%x5 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 5 to i8*), %then ]
|
||
|
%x6 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 6 to i8*), %then ]
|
||
|
%x7 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 7 to i8*), %then ]
|
||
|
%x8 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 8 to i8*), %then ]
|
||
|
%x9 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 9 to i8*), %then ]
|
||
|
%x10 = phi i8* [ %a, %entry ], [ %b, %if ], [ inttoptr (i64 10 to i8*), %then ]
|
||
|
|
||
|
ret i8* %x10
|
||
|
}
|
||
|
|
||
|
define i32* @test5(i32 %a, i32 %b, i32 %c, i32* dereferenceable(10) %ptr1,
|
||
|
; CHECK-LABEL: @test5(
|
||
|
; CHECK-NEXT: entry:
|
||
|
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[B:%.*]], 0
|
||
|
; CHECK-NEXT: br i1 [[TMP1]], label [[BB1:%.*]], label [[BB3:%.*]]
|
||
|
; CHECK: bb1:
|
||
|
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[C:%.*]], 1
|
||
|
; CHECK-NEXT: [[TMP3:%.*]] = load i32*, i32** [[PTR3:%.*]]
|
||
|
; CHECK-NEXT: [[TMP3_PTR2:%.*]] = select i1 [[TMP2]], i32* [[TMP3]], i32* [[PTR2:%.*]]
|
||
|
; CHECK-NEXT: ret i32* [[TMP3_PTR2]]
|
||
|
; CHECK: bb3:
|
||
|
; CHECK-NEXT: ret i32* [[PTR1:%.*]]
|
||
|
;
|
||
|
i32* dereferenceable(10) %ptr2, i32** dereferenceable(10) %ptr3) nounwind {
|
||
|
entry:
|
||
|
%tmp1 = icmp eq i32 %b, 0
|
||
|
br i1 %tmp1, label %bb1, label %bb3
|
||
|
|
||
|
bb1: ; preds = %entry
|
||
|
%tmp2 = icmp sgt i32 %c, 1
|
||
|
br i1 %tmp2, label %bb2, label %bb3
|
||
|
|
||
|
bb2: ; preds = bb1
|
||
|
%tmp3 = load i32*, i32** %ptr3, !dereferenceable !{i64 10}
|
||
|
br label %bb3
|
||
|
|
||
|
bb3: ; preds = %bb2, %entry
|
||
|
%tmp4 = phi i32* [ %ptr1, %entry ], [ %ptr2, %bb1 ], [ %tmp3, %bb2 ]
|
||
|
ret i32* %tmp4
|
||
|
}
|