Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
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
2010-12-20-Boolean.ll
2011-01-14-Thread.ll
2011-02-01-Vector.ll
2011-09-05-InsertExtractValue.ll
2011-10-27-BinOpCrash.ll
2011-11-23-MaskedBitsCrash.ll
2013-04-19-ConstantFoldingCrash.ll
AndOrXor.ll
add-mask.ll
addsub.ll
and-icmps-same-ops.ll
assume.ll
bitcast-vector-fold.ll
bitreverse-fold.ll
bitreverse.ll
bswap.ll
call-callconv.ll
call.ll
cast.ll
compare.ll
dead-code-removal.ll
div.ll
exact-nsw-nuw.ll
exp-intrinsic.ll
exp2-intrinsic.ll
extract-element.ll
fast-math.ll
fdiv.ll
floating-point-arithmetic.ll
floating-point-compare.ll
fold-builtin-fma.ll
fold-intrinsics.ll
gep.ll
icmp-bool-constant.ll
icmp-constant.ll
icmp-ranges.ll.REMOVED.git-id
implies.ll
insertelement.ll
load-relative-32.ll
load-relative.ll
load.ll
log-intrinsic.ll
log2-intrinsic.ll
logic-of-fcmps.ll
maxmin.ll
mul.ll
negate.ll
noalias-ptr.ll
or-icmps-same-ops.ll
or.ll
past-the-end.ll
phi.ll
pr28725.ll
pr33957.ll
ptr_diff.ll
reassociate.ll
rem.ll
require-dominator.ll
returned.ll
select.ll
shift-128-kb.ll
shift-knownbits.ll
shr-nop.ll
shufflevector.ll
signed-div-rem.ll
simplify-nested-bitcast.ll
undef.ll
vec-cmp.ll
vector_gep.ll
vector_ptr_bitcast.ll
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
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
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
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
linux-packaging-mono/external/llvm/test/Transforms/InstSimplify/call-callconv.ll

49 lines
1.5 KiB
LLVM
Raw Normal View History

; RUN: opt < %s -instcombine -S | FileCheck %s
; Verify that the non-default calling conv doesn't prevent the libcall simplification
@.str = private unnamed_addr constant [4 x i8] c"abc\00", align 1
define arm_aapcscc i32 @_abs(i32 %i) nounwind readnone {
; CHECK: _abs
%call = tail call arm_aapcscc i32 @abs(i32 %i) nounwind readnone
ret i32 %call
; CHECK: %[[ISPOS:.*]] = icmp sgt i32 %i, -1
; CHECK: %[[NEG:.*]] = sub i32 0, %i
; CHECK: %[[RET:.*]] = select i1 %[[ISPOS]], i32 %i, i32 %[[NEG]]
; CHECK: ret i32 %[[RET]]
}
declare arm_aapcscc i32 @abs(i32) nounwind readnone
define arm_aapcscc i32 @_labs(i32 %i) nounwind readnone {
; CHECK: _labs
%call = tail call arm_aapcscc i32 @labs(i32 %i) nounwind readnone
ret i32 %call
; CHECK: %[[ISPOS:.*]] = icmp sgt i32 %i, -1
; CHECK: %[[NEG:.*]] = sub i32 0, %i
; CHECK: %[[RET:.*]] = select i1 %[[ISPOS]], i32 %i, i32 %[[NEG]]
; CHECK: ret i32 %[[RET]]
}
declare arm_aapcscc i32 @labs(i32) nounwind readnone
define arm_aapcscc i32 @_strlen1() {
; CHECK: _strlen1
%call = tail call arm_aapcscc i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0))
ret i32 %call
; CHECK: ret i32 3
}
declare arm_aapcscc i32 @strlen(i8*)
define arm_aapcscc zeroext i1 @_strlen2(i8* %str) {
; CHECK: _strlen2
%call = tail call arm_aapcscc i32 @strlen(i8* %str)
%cmp = icmp ne i32 %call, 0
ret i1 %cmp
; CHECK: %[[STRLENFIRST:.*]] = load i8, i8* %str
; CHECK: %[[CMP:.*]] = icmp ne i8 %[[STRLENFIRST]], 0
; CHECK: ret i1 %[[CMP]]
}