From 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 24 Nov 2014 09:08:18 +0000 Subject: Vendor import of llvm RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_350/final@216957 --- test/Analysis/BasicAA/2007-11-05-SizeCrash.ll | 2 +- .../BasicAA/2007-12-08-OutOfBoundsCrash.ll | 2 +- .../BasicAA/2014-03-18-Maxlookup-reached.ll | 36 + test/Analysis/BasicAA/cs-cs.ll | 236 + test/Analysis/BasicAA/noalias-bugs.ll | 2 +- test/Analysis/BasicAA/pr18573.ll | 53 + test/Analysis/BlockFrequencyInfo/bad_input.ll | 50 + test/Analysis/BlockFrequencyInfo/basic.ll | 55 +- .../Analysis/BlockFrequencyInfo/double_backedge.ll | 27 + test/Analysis/BlockFrequencyInfo/double_exit.ll | 165 + test/Analysis/BlockFrequencyInfo/irreducible.ll | 421 + .../BlockFrequencyInfo/loop_with_branch.ll | 44 + .../nested_loop_with_branches.ll | 59 + test/Analysis/BranchProbabilityInfo/loop.ll | 42 +- test/Analysis/BranchProbabilityInfo/pr18705.ll | 58 + test/Analysis/CostModel/AArch64/lit.local.cfg | 2 + test/Analysis/CostModel/AArch64/select.ll | 38 + test/Analysis/CostModel/AArch64/store.ll | 22 + test/Analysis/CostModel/ARM/cast.ll | 34 +- test/Analysis/CostModel/ARM/lit.local.cfg | 3 +- test/Analysis/CostModel/PowerPC/ext.ll | 21 + test/Analysis/CostModel/PowerPC/insert_extract.ll | 4 +- test/Analysis/CostModel/PowerPC/lit.local.cfg | 3 +- test/Analysis/CostModel/PowerPC/load_store.ll | 11 + .../CostModel/X86/alternate-shuffle-cost.ll | 347 + test/Analysis/CostModel/X86/cast.ll | 97 +- test/Analysis/CostModel/X86/cmp.ll | 4 +- test/Analysis/CostModel/X86/intrinsic-cost.ll | 28 + test/Analysis/CostModel/X86/lit.local.cfg | 3 +- test/Analysis/CostModel/X86/scalarize.ll | 41 + test/Analysis/CostModel/X86/vdiv-cost.ll | 92 + test/Analysis/CostModel/X86/vselect-cost.ll | 126 + test/Analysis/CostModel/X86/vshift-cost.ll | 167 + test/Analysis/Delinearization/a.ll | 11 - test/Analysis/Delinearization/gcd_multiply_expr.ll | 153 + test/Analysis/Delinearization/himeno_1.ll | 10 - test/Analysis/Delinearization/himeno_2.ll | 10 - .../iv_times_constant_in_subscript.ll | 45 + test/Analysis/Delinearization/lit.local.cfg | 2 +- .../multidim_ivs_and_integer_offsets_3d.ll | 10 - .../multidim_ivs_and_integer_offsets_nts_3d.ll | 10 - .../multidim_ivs_and_parameteric_offsets_3d.ll | 10 - .../Delinearization/multidim_only_ivs_2d.ll | 17 +- .../Delinearization/multidim_only_ivs_2d_nested.ll | 2 + .../Delinearization/multidim_only_ivs_3d.ll | 10 - .../Delinearization/multidim_only_ivs_3d_cast.ll | 10 - ...tidim_two_accesses_different_delinearization.ll | 43 + test/Analysis/Delinearization/undef.ll | 38 + test/Analysis/DependenceAnalysis/Banerjee.ll | 107 +- test/Analysis/DependenceAnalysis/GCD.ll | 83 +- test/Analysis/LazyCallGraph/basic.ll | 176 + test/Analysis/Lint/address-spaces.ll | 25 + .../ScalarEvolution/2009-04-22-TruncCast.ll | 2 +- .../ScalarEvolution/2012-03-26-LoadConstant.ll | 2 +- .../ScalarEvolution/2012-05-18-LoopPredRecurse.ll | 2 +- test/Analysis/ScalarEvolution/and-xor.ll | 18 +- test/Analysis/ScalarEvolution/fold.ll | 26 + test/Analysis/ScalarEvolution/max-trip-count.ll | 109 + test/Analysis/ScalarEvolution/nsw-offset.ll | 2 +- test/Analysis/ScalarEvolution/trip-count-pow2.ll | 53 + test/Analysis/ScalarEvolution/trip-count-switch.ll | 30 + test/Analysis/ScalarEvolution/xor-and.ll | 13 - test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll | 4 +- test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll | 18 +- test/Assembler/2007-09-10-AliasFwdRef.ll | 4 +- test/Assembler/2009-04-25-AliasGEP.ll | 8 - test/Assembler/ConstantExprFoldSelect.ll | 8 + test/Assembler/addrspacecast-alias.ll | 7 + test/Assembler/alias-redefinition.ll | 7 + test/Assembler/atomic.ll | 12 +- test/Assembler/functionlocal-metadata.ll | 2 +- test/Assembler/getInt.ll | 3 + test/Assembler/half-constprop.ll | 2 +- test/Assembler/half-conv.ll | 2 +- test/Assembler/inalloca.ll | 16 + test/Assembler/internal-hidden-alias.ll | 6 + test/Assembler/internal-hidden-function.ll | 7 + test/Assembler/internal-hidden-variable.ll | 4 + test/Assembler/internal-protected-alias.ll | 6 + test/Assembler/internal-protected-function.ll | 7 + test/Assembler/internal-protected-variable.ll | 4 + test/Assembler/invalid-comdat.ll | 4 + test/Assembler/invalid-comdat2.ll | 5 + test/Assembler/invalid-name.ll | 6 + test/Assembler/invalid_cast3.ll | 7 + test/Assembler/private-hidden-alias.ll | 6 + test/Assembler/private-hidden-function.ll | 7 + test/Assembler/private-hidden-variable.ll | 4 + test/Assembler/private-protected-alias.ll | 6 + test/Assembler/private-protected-function.ll | 7 + test/Assembler/private-protected-variable.ll | 4 + test/Assembler/upgrade-loop-metadata.ll | 41 + test/Bindings/Ocaml/target.ml | 9 +- test/Bindings/Ocaml/vmcore.ml | 27 +- test/Bindings/llvm-c/lit.local.cfg | 5 +- test/Bitcode/aggregateInstructions.3.2.ll | 33 + test/Bitcode/aggregateInstructions.3.2.ll.bc | Bin 0 -> 452 bytes test/Bitcode/atomic.ll | 17 + test/Bitcode/attributes.ll | 32 +- test/Bitcode/binaryFloatInstructions.3.2.ll | 120 + test/Bitcode/binaryFloatInstructions.3.2.ll.bc | Bin 0 -> 992 bytes test/Bitcode/binaryIntInstructions.3.2.ll | 177 + test/Bitcode/binaryIntInstructions.3.2.ll.bc | Bin 0 -> 1324 bytes test/Bitcode/bitwiseInstructions.3.2.ll | 68 + test/Bitcode/bitwiseInstructions.3.2.ll.bc | Bin 0 -> 612 bytes test/Bitcode/calling-conventions.3.2.ll | 150 + test/Bitcode/calling-conventions.3.2.ll.bc | Bin 0 -> 1236 bytes test/Bitcode/cmpxchg-upgrade.ll | 23 + test/Bitcode/cmpxchg-upgrade.ll.bc | Bin 0 -> 360 bytes test/Bitcode/conversionInstructions.3.2.ll | 104 + test/Bitcode/conversionInstructions.3.2.ll.bc | Bin 0 -> 996 bytes ...eprecated-linker_private-linker_private_weak.ll | 17 + test/Bitcode/drop-debug-info.ll | 4 +- test/Bitcode/global-variables.3.2.ll | 41 + test/Bitcode/global-variables.3.2.ll.bc | Bin 0 -> 536 bytes test/Bitcode/inalloca.ll | 18 + test/Bitcode/linkage-types-3.2.ll | 128 + test/Bitcode/linkage-types-3.2.ll.bc | Bin 0 -> 964 bytes .../local-linkage-default-visibility.3.4.ll | 79 + .../local-linkage-default-visibility.3.4.ll.bc | Bin 0 -> 924 bytes test/Bitcode/memInstructions.3.2.ll | 328 + test/Bitcode/memInstructions.3.2.ll.bc | Bin 0 -> 1728 bytes test/Bitcode/miscInstructions.3.2.ll | 126 + test/Bitcode/miscInstructions.3.2.ll.bc | Bin 0 -> 908 bytes test/Bitcode/old-aliases.ll | 22 + test/Bitcode/old-aliases.ll.bc | Bin 0 -> 368 bytes test/Bitcode/pr18704.ll | 158 + test/Bitcode/pr18704.ll.bc | Bin 0 -> 880 bytes test/Bitcode/select.ll | 2 +- test/Bitcode/tailcall.ll | 17 + test/Bitcode/terminatorInstructions.3.2.ll | 47 + test/Bitcode/terminatorInstructions.3.2.ll.bc | Bin 0 -> 568 bytes test/Bitcode/upgrade-global-ctors.ll | 3 + test/Bitcode/upgrade-global-ctors.ll.bc | Bin 0 -> 316 bytes test/Bitcode/upgrade-loop-metadata.ll | 37 + test/Bitcode/upgrade-loop-metadata.ll.bc | Bin 0 -> 640 bytes test/Bitcode/variableArgumentIntrinsic.3.2.ll | 33 + test/Bitcode/variableArgumentIntrinsic.3.2.ll.bc | Bin 0 -> 456 bytes test/Bitcode/vectorInstructions.3.2.ll | 34 + test/Bitcode/vectorInstructions.3.2.ll.bc | Bin 0 -> 500 bytes test/Bitcode/visibility-styles.3.2.ll | 23 + test/Bitcode/visibility-styles.3.2.ll.bc | Bin 0 -> 372 bytes test/Bitcode/weak-cmpxchg-upgrade.ll | 15 + test/Bitcode/weak-cmpxchg-upgrade.ll.bc | Bin 0 -> 332 bytes test/BugPoint/compile-custom.ll | 12 + test/BugPoint/compile-custom.ll.py | 10 + test/CMakeLists.txt | 6 +- test/CodeGen/AArch64/128bit_load_store.ll | 53 + .../aarch64-address-type-promotion-assertion.ll | 55 + .../AArch64/aarch64-address-type-promotion.ll | 28 + test/CodeGen/AArch64/aarch64-neon-v1i1-setcc.ll | 69 + test/CodeGen/AArch64/adc.ll | 33 +- test/CodeGen/AArch64/addsub-shifted.ll | 18 +- test/CodeGen/AArch64/addsub.ll | 22 +- test/CodeGen/AArch64/addsub_ext.ll | 8 +- test/CodeGen/AArch64/alloca.ll | 121 +- test/CodeGen/AArch64/analyze-branch.ll | 4 +- test/CodeGen/AArch64/arm64-2011-03-09-CPSRSpill.ll | 47 + .../AArch64/arm64-2011-03-17-AsmPrinterCrash.ll | 45 + .../arm64-2011-03-21-Unaligned-Frame-Index.ll | 12 + test/CodeGen/AArch64/arm64-2011-04-21-CPSRBug.ll | 26 + .../CodeGen/AArch64/arm64-2011-10-18-LdStOptBug.ll | 31 + .../AArch64/arm64-2012-01-11-ComparisonDAGCrash.ll | 40 + .../arm64-2012-05-07-DAGCombineVectorExtract.ll | 20 + .../AArch64/arm64-2012-05-07-MemcpyAlignBug.ll | 21 + .../AArch64/arm64-2012-05-09-LOADgot-bug.ll | 22 + .../CodeGen/AArch64/arm64-2012-05-22-LdStOptBug.ll | 50 + test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll | 67 + .../AArch64/arm64-2012-07-11-InstrEmitterBug.ll | 56 + .../CodeGen/AArch64/arm64-2013-01-13-ffast-fcmp.ll | 19 + .../CodeGen/AArch64/arm64-2013-01-23-frem-crash.ll | 15 + .../CodeGen/AArch64/arm64-2013-01-23-sext-crash.ll | 37 + test/CodeGen/AArch64/arm64-2013-02-12-shufv8i8.ll | 11 + test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll | 67 + .../AArch64/arm64-AnInfiniteLoopInDAGCombine.ll | 23 + test/CodeGen/AArch64/arm64-EXT-undef-mask.ll | 23 + test/CodeGen/AArch64/arm64-aapcs.ll | 125 + test/CodeGen/AArch64/arm64-abi-varargs.ll | 191 + test/CodeGen/AArch64/arm64-abi.ll | 239 + test/CodeGen/AArch64/arm64-abi_align.ll | 532 + test/CodeGen/AArch64/arm64-addp.ll | 32 + test/CodeGen/AArch64/arm64-addr-mode-folding.ll | 171 + test/CodeGen/AArch64/arm64-addr-type-promotion.ll | 82 + test/CodeGen/AArch64/arm64-addrmode.ll | 72 + .../AArch64/arm64-alloc-no-stack-realign.ll | 21 + .../AArch64/arm64-alloca-frame-pointer-offset.ll | 29 + test/CodeGen/AArch64/arm64-andCmpBrToTBZ.ll | 72 + test/CodeGen/AArch64/arm64-ands-bad-peephole.ll | 31 + test/CodeGen/AArch64/arm64-anyregcc-crash.ll | 19 + test/CodeGen/AArch64/arm64-anyregcc.ll | 363 + test/CodeGen/AArch64/arm64-arith-saturating.ll | 153 + test/CodeGen/AArch64/arm64-arith.ll | 270 + .../arm64-arm64-dead-def-elimination-flag.ll | 16 + test/CodeGen/AArch64/arm64-atomic-128.ll | 228 + test/CodeGen/AArch64/arm64-atomic.ll | 335 + test/CodeGen/AArch64/arm64-basic-pic.ll | 54 + .../AArch64/arm64-big-endian-bitconverts.ll | 1101 + test/CodeGen/AArch64/arm64-big-endian-eh.ll | 73 + test/CodeGen/AArch64/arm64-big-endian-varargs.ll | 58 + .../AArch64/arm64-big-endian-vector-callee.ll | 848 + .../AArch64/arm64-big-endian-vector-caller.ll | 1100 + test/CodeGen/AArch64/arm64-big-imm-offsets.ll | 14 + test/CodeGen/AArch64/arm64-big-stack.ll | 21 + test/CodeGen/AArch64/arm64-bitfield-extract.ll | 532 + test/CodeGen/AArch64/arm64-blockaddress.ll | 30 + test/CodeGen/AArch64/arm64-build-vector.ll | 59 + test/CodeGen/AArch64/arm64-call-tailcalls.ll | 91 + test/CodeGen/AArch64/arm64-cast-opt.ll | 31 + test/CodeGen/AArch64/arm64-ccmp-heuristics.ll | 190 + test/CodeGen/AArch64/arm64-ccmp.ll | 289 + test/CodeGen/AArch64/arm64-clrsb.ll | 36 + test/CodeGen/AArch64/arm64-coalesce-ext.ll | 17 + test/CodeGen/AArch64/arm64-code-model-large-abs.ll | 72 + .../AArch64/arm64-collect-loh-garbage-crash.ll | 37 + test/CodeGen/AArch64/arm64-collect-loh-str.ll | 23 + test/CodeGen/AArch64/arm64-collect-loh.ll | 53 + test/CodeGen/AArch64/arm64-complex-copy-noneon.ll | 21 + test/CodeGen/AArch64/arm64-complex-ret.ll | 7 + test/CodeGen/AArch64/arm64-const-addr.ll | 23 + test/CodeGen/AArch64/arm64-convert-v4f64.ll | 33 + test/CodeGen/AArch64/arm64-copy-tuple.ll | 146 + test/CodeGen/AArch64/arm64-crc32.ll | 71 + test/CodeGen/AArch64/arm64-crypto.ll | 135 + test/CodeGen/AArch64/arm64-cse.ll | 59 + test/CodeGen/AArch64/arm64-csel.ll | 230 + test/CodeGen/AArch64/arm64-cvt.ll | 401 + .../AArch64/arm64-dagcombiner-convergence.ll | 19 + .../AArch64/arm64-dagcombiner-dead-indexed-load.ll | 32 + .../AArch64/arm64-dagcombiner-indexed-load.ll | 46 + .../AArch64/arm64-dagcombiner-load-slicing.ll | 102 + test/CodeGen/AArch64/arm64-dead-def-frame-index.ll | 18 + .../CodeGen/AArch64/arm64-dead-register-def-bug.ll | 32 + test/CodeGen/AArch64/arm64-dup.ll | 323 + test/CodeGen/AArch64/arm64-early-ifcvt.ll | 423 + test/CodeGen/AArch64/arm64-elf-calls.ll | 20 + test/CodeGen/AArch64/arm64-elf-constpool.ll | 13 + test/CodeGen/AArch64/arm64-elf-globals.ll | 115 + test/CodeGen/AArch64/arm64-ext.ll | 118 + test/CodeGen/AArch64/arm64-extend-int-to-fp.ll | 19 + test/CodeGen/AArch64/arm64-extend.ll | 15 + test/CodeGen/AArch64/arm64-extern-weak.ll | 51 + test/CodeGen/AArch64/arm64-extload-knownzero.ll | 28 + test/CodeGen/AArch64/arm64-extract.ll | 58 + test/CodeGen/AArch64/arm64-extract_subvector.ll | 51 + .../CodeGen/AArch64/arm64-fast-isel-addr-offset.ll | 47 + test/CodeGen/AArch64/arm64-fast-isel-alloca.ll | 25 + test/CodeGen/AArch64/arm64-fast-isel-br.ll | 155 + test/CodeGen/AArch64/arm64-fast-isel-call.ll | 100 + test/CodeGen/AArch64/arm64-fast-isel-conversion.ll | 442 + test/CodeGen/AArch64/arm64-fast-isel-fcmp.ll | 146 + test/CodeGen/AArch64/arm64-fast-isel-gv.ll | 38 + test/CodeGen/AArch64/arm64-fast-isel-icmp.ll | 214 + test/CodeGen/AArch64/arm64-fast-isel-indirectbr.ll | 36 + test/CodeGen/AArch64/arm64-fast-isel-intrinsic.ll | 148 + .../CodeGen/AArch64/arm64-fast-isel-materialize.ll | 27 + test/CodeGen/AArch64/arm64-fast-isel-noconvert.ll | 68 + test/CodeGen/AArch64/arm64-fast-isel-rem.ll | 44 + test/CodeGen/AArch64/arm64-fast-isel-ret.ll | 63 + test/CodeGen/AArch64/arm64-fast-isel-select.ll | 63 + test/CodeGen/AArch64/arm64-fast-isel.ll | 95 + test/CodeGen/AArch64/arm64-fastcc-tailcall.ll | 24 + .../arm64-fastisel-gep-promote-before-add.ll | 18 + test/CodeGen/AArch64/arm64-fcmp-opt.ll | 204 + test/CodeGen/AArch64/arm64-fcopysign.ll | 51 + .../arm64-fixed-point-scalar-cvt-dagcombine.ll | 15 + test/CodeGen/AArch64/arm64-fmadd.ll | 92 + test/CodeGen/AArch64/arm64-fmax.ll | 34 + test/CodeGen/AArch64/arm64-fminv.ll | 101 + test/CodeGen/AArch64/arm64-fmuladd.ll | 88 + test/CodeGen/AArch64/arm64-fold-address.ll | 79 + test/CodeGen/AArch64/arm64-fold-lsl.ll | 79 + test/CodeGen/AArch64/arm64-fp-contract-zero.ll | 14 + test/CodeGen/AArch64/arm64-fp-imm.ll | 32 + test/CodeGen/AArch64/arm64-fp.ll | 8 + test/CodeGen/AArch64/arm64-fp128-folding.ll | 17 + test/CodeGen/AArch64/arm64-fp128.ll | 273 + test/CodeGen/AArch64/arm64-frame-index.ll | 11 + test/CodeGen/AArch64/arm64-frameaddr.ll | 15 + test/CodeGen/AArch64/arm64-global-address.ll | 14 + test/CodeGen/AArch64/arm64-hello.ll | 38 + test/CodeGen/AArch64/arm64-i16-subreg-extract.ll | 12 + test/CodeGen/AArch64/arm64-icmp-opt.ll | 17 + test/CodeGen/AArch64/arm64-illegal-float-ops.ll | 295 + test/CodeGen/AArch64/arm64-indexed-memory.ll | 351 + .../CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll | 40 + test/CodeGen/AArch64/arm64-indexed-vector-ldst.ll | 6174 ++ test/CodeGen/AArch64/arm64-inline-asm-error-I.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm-error-J.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm-error-K.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm-error-L.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm-error-M.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm-error-N.ll | 11 + .../AArch64/arm64-inline-asm-zero-reg-error.ll | 11 + test/CodeGen/AArch64/arm64-inline-asm.ll | 230 + test/CodeGen/AArch64/arm64-join-reserved.ll | 17 + test/CodeGen/AArch64/arm64-jumptable.ll | 35 + test/CodeGen/AArch64/arm64-large-frame.ll | 69 + test/CodeGen/AArch64/arm64-ld1.ll | 1345 + test/CodeGen/AArch64/arm64-ldp.ll | 149 + test/CodeGen/AArch64/arm64-ldur.ll | 67 + test/CodeGen/AArch64/arm64-ldxr-stxr.ll | 270 + test/CodeGen/AArch64/arm64-leaf.ll | 13 + test/CodeGen/AArch64/arm64-long-shift.ll | 59 + test/CodeGen/AArch64/arm64-memcpy-inline.ll | 112 + test/CodeGen/AArch64/arm64-memset-inline.ll | 27 + test/CodeGen/AArch64/arm64-memset-to-bzero.ll | 108 + test/CodeGen/AArch64/arm64-misched-basic-A53.ll | 203 + test/CodeGen/AArch64/arm64-misched-basic-A57.ll | 112 + .../AArch64/arm64-misched-forwarding-A53.ll | 22 + test/CodeGen/AArch64/arm64-movi.ll | 202 + test/CodeGen/AArch64/arm64-mul.ll | 90 + test/CodeGen/AArch64/arm64-named-reg-alloc.ll | 14 + test/CodeGen/AArch64/arm64-named-reg-notareg.ll | 13 + test/CodeGen/AArch64/arm64-neg.ll | 71 + test/CodeGen/AArch64/arm64-neon-2velem-high.ll | 341 + test/CodeGen/AArch64/arm64-neon-2velem.ll | 2853 + test/CodeGen/AArch64/arm64-neon-3vdiff.ll | 1829 + test/CodeGen/AArch64/arm64-neon-aba-abd.ll | 236 + test/CodeGen/AArch64/arm64-neon-across.ll | 460 + test/CodeGen/AArch64/arm64-neon-add-pairwise.ll | 100 + test/CodeGen/AArch64/arm64-neon-add-sub.ll | 237 + .../AArch64/arm64-neon-compare-instructions.ll | 1191 + test/CodeGen/AArch64/arm64-neon-copy.ll | 1445 + .../AArch64/arm64-neon-copyPhysReg-tuple.ll | 48 + test/CodeGen/AArch64/arm64-neon-mul-div.ll | 797 + .../AArch64/arm64-neon-scalar-by-elem-mul.ll | 124 + test/CodeGen/AArch64/arm64-neon-select_cc.ll | 206 + test/CodeGen/AArch64/arm64-neon-simd-ldst-one.ll | 482 + test/CodeGen/AArch64/arm64-neon-simd-shift.ll | 663 + test/CodeGen/AArch64/arm64-neon-simd-vget.ll | 225 + test/CodeGen/AArch64/arm64-neon-v1i1-setcc.ll | 74 + .../AArch64/arm64-neon-vector-list-spill.ll | 175 + test/CodeGen/AArch64/arm64-patchpoint.ll | 171 + test/CodeGen/AArch64/arm64-pic-local-symbol.ll | 22 + test/CodeGen/AArch64/arm64-platform-reg.ll | 26 + test/CodeGen/AArch64/arm64-popcnt.ll | 43 + test/CodeGen/AArch64/arm64-prefetch.ll | 88 + test/CodeGen/AArch64/arm64-promote-const.ll | 255 + test/CodeGen/AArch64/arm64-redzone.ll | 18 + test/CodeGen/AArch64/arm64-reg-copy-noneon.ll | 20 + .../AArch64/arm64-register-offset-addressing.ll | 145 + test/CodeGen/AArch64/arm64-register-pairing.ll | 53 + .../AArch64/arm64-regress-f128csel-flags.ll | 27 + .../AArch64/arm64-regress-interphase-shift.ll | 33 + test/CodeGen/AArch64/arm64-return-vector.ll | 11 + test/CodeGen/AArch64/arm64-returnaddr.ll | 26 + test/CodeGen/AArch64/arm64-rev.ll | 235 + test/CodeGen/AArch64/arm64-rounding.ll | 208 + test/CodeGen/AArch64/arm64-scaled_iv.ll | 38 + test/CodeGen/AArch64/arm64-scvt.ll | 830 + .../AArch64/arm64-setcc-int-to-fp-combine.ll | 27 + test/CodeGen/AArch64/arm64-shifted-sext.ll | 277 + test/CodeGen/AArch64/arm64-shrink-v1i64.ll | 14 + .../CodeGen/AArch64/arm64-simd-scalar-to-vector.ll | 22 + test/CodeGen/AArch64/arm64-simplest-elf.ll | 18 + test/CodeGen/AArch64/arm64-sincos.ll | 42 + .../CodeGen/AArch64/arm64-sitofp-combine-chains.ll | 22 + test/CodeGen/AArch64/arm64-sli-sri-opt.ll | 41 + test/CodeGen/AArch64/arm64-smaxv.ll | 74 + test/CodeGen/AArch64/arm64-sminv.ll | 74 + test/CodeGen/AArch64/arm64-spill-lr.ll | 74 + test/CodeGen/AArch64/arm64-spill.ll | 15 + .../AArch64/arm64-sqshl-uqshl-i64Contant.ll | 19 + test/CodeGen/AArch64/arm64-st1.ll | 676 + test/CodeGen/AArch64/arm64-stack-no-frame.ll | 20 + test/CodeGen/AArch64/arm64-stackmap.ll | 288 + test/CodeGen/AArch64/arm64-stackpointer.ll | 24 + test/CodeGen/AArch64/arm64-stacksave.ll | 20 + test/CodeGen/AArch64/arm64-stp.ll | 101 + test/CodeGen/AArch64/arm64-strict-align.ll | 26 + test/CodeGen/AArch64/arm64-stur.ll | 98 + test/CodeGen/AArch64/arm64-subsections.ll | 5 + test/CodeGen/AArch64/arm64-subvector-extend.ll | 141 + .../AArch64/arm64-swizzle-tbl-i16-layout.ll | 36 + test/CodeGen/AArch64/arm64-tbl.ll | 132 + test/CodeGen/AArch64/arm64-this-return.ll | 83 + test/CodeGen/AArch64/arm64-tls-darwin.ll | 18 + test/CodeGen/AArch64/arm64-tls-dynamic-together.ll | 18 + test/CodeGen/AArch64/arm64-tls-dynamics.ll | 135 + test/CodeGen/AArch64/arm64-tls-execs.ll | 63 + test/CodeGen/AArch64/arm64-trap.ll | 8 + test/CodeGen/AArch64/arm64-trn.ll | 134 + test/CodeGen/AArch64/arm64-trunc-store.ll | 75 + test/CodeGen/AArch64/arm64-umaxv.ll | 92 + test/CodeGen/AArch64/arm64-uminv.ll | 92 + test/CodeGen/AArch64/arm64-umov.ll | 33 + test/CodeGen/AArch64/arm64-unaligned_ldst.ll | 41 + test/CodeGen/AArch64/arm64-uzp.ll | 107 + test/CodeGen/AArch64/arm64-vaargs.ll | 20 + test/CodeGen/AArch64/arm64-vabs.ll | 804 + test/CodeGen/AArch64/arm64-vadd.ll | 941 + test/CodeGen/AArch64/arm64-vaddlv.ll | 26 + test/CodeGen/AArch64/arm64-vaddv.ll | 245 + test/CodeGen/AArch64/arm64-variadic-aapcs.ll | 143 + test/CodeGen/AArch64/arm64-vbitwise.ll | 91 + test/CodeGen/AArch64/arm64-vclz.ll | 109 + test/CodeGen/AArch64/arm64-vcmp.ll | 236 + test/CodeGen/AArch64/arm64-vcnt.ll | 56 + test/CodeGen/AArch64/arm64-vcombine.ll | 17 + test/CodeGen/AArch64/arm64-vcvt.ll | 686 + test/CodeGen/AArch64/arm64-vcvt_f.ll | 82 + test/CodeGen/AArch64/arm64-vcvt_f32_su32.ll | 73 + test/CodeGen/AArch64/arm64-vcvt_n.ll | 49 + test/CodeGen/AArch64/arm64-vcvt_su32_f32.ll | 34 + test/CodeGen/AArch64/arm64-vcvtxd_f32_f64.ll | 11 + test/CodeGen/AArch64/arm64-vecCmpBr.ll | 207 + test/CodeGen/AArch64/arm64-vecFold.ll | 145 + test/CodeGen/AArch64/arm64-vector-ext.ll | 16 + test/CodeGen/AArch64/arm64-vector-imm.ll | 134 + test/CodeGen/AArch64/arm64-vector-insertion.ll | 33 + test/CodeGen/AArch64/arm64-vector-ldst.ll | 601 + test/CodeGen/AArch64/arm64-vext.ll | 464 + test/CodeGen/AArch64/arm64-vext_reverse.ll | 172 + test/CodeGen/AArch64/arm64-vfloatintrinsics.ll | 375 + test/CodeGen/AArch64/arm64-vhadd.ll | 249 + test/CodeGen/AArch64/arm64-vhsub.ll | 125 + test/CodeGen/AArch64/arm64-virtual_base.ll | 51 + test/CodeGen/AArch64/arm64-vmax.ll | 679 + test/CodeGen/AArch64/arm64-vminmaxnm.ll | 68 + test/CodeGen/AArch64/arm64-vmovn.ll | 242 + test/CodeGen/AArch64/arm64-vmul.ll | 2036 + test/CodeGen/AArch64/arm64-volatile.ll | 27 + test/CodeGen/AArch64/arm64-vpopcnt.ll | 68 + test/CodeGen/AArch64/arm64-vqadd.ll | 332 + test/CodeGen/AArch64/arm64-vqsub.ll | 147 + test/CodeGen/AArch64/arm64-vselect.ll | 25 + test/CodeGen/AArch64/arm64-vsetcc_fp.ll | 11 + test/CodeGen/AArch64/arm64-vshift.ll | 1926 + test/CodeGen/AArch64/arm64-vshr.ll | 63 + test/CodeGen/AArch64/arm64-vshuffle.ll | 115 + test/CodeGen/AArch64/arm64-vsqrt.ll | 232 + test/CodeGen/AArch64/arm64-vsra.ll | 150 + test/CodeGen/AArch64/arm64-vsub.ll | 417 + test/CodeGen/AArch64/arm64-weak-reference.ll | 10 + test/CodeGen/AArch64/arm64-xaluo.ll | 524 + test/CodeGen/AArch64/arm64-zero-cycle-regmov.ll | 17 + test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll | 49 + test/CodeGen/AArch64/arm64-zext.ll | 11 + test/CodeGen/AArch64/arm64-zextload-unscaled.ll | 40 + test/CodeGen/AArch64/arm64-zip.ll | 107 + test/CodeGen/AArch64/asm-large-immediate.ll | 10 + test/CodeGen/AArch64/assertion-rc-mismatch.ll | 24 + test/CodeGen/AArch64/atomic-ops.ll | 499 +- test/CodeGen/AArch64/basic-pic.ll | 12 +- test/CodeGen/AArch64/bitfield-insert-0.ll | 2 +- test/CodeGen/AArch64/bitfield-insert.ll | 25 +- test/CodeGen/AArch64/bitfield.ll | 10 +- test/CodeGen/AArch64/blockaddress.ll | 6 +- test/CodeGen/AArch64/bool-loads.ll | 22 +- test/CodeGen/AArch64/branch-relax-asm.ll | 35 + test/CodeGen/AArch64/breg.ll | 4 +- test/CodeGen/AArch64/callee-save.ll | 18 +- test/CodeGen/AArch64/cmpxchg-idioms.ll | 93 + test/CodeGen/AArch64/code-model-large-abs.ll | 2 +- test/CodeGen/AArch64/compare-branch.ll | 2 +- test/CodeGen/AArch64/compiler-ident.ll | 12 + test/CodeGen/AArch64/complex-fp-to-int.ll | 141 + test/CodeGen/AArch64/complex-int-to-fp.ll | 164 + test/CodeGen/AArch64/cond-sel.ll | 38 +- test/CodeGen/AArch64/cpus.ll | 14 + test/CodeGen/AArch64/directcond.ll | 26 +- test/CodeGen/AArch64/dp-3source.ll | 2 +- test/CodeGen/AArch64/dp1.ll | 2 +- test/CodeGen/AArch64/dp2.ll | 24 +- test/CodeGen/AArch64/eliminate-trunc.ll | 39 + test/CodeGen/AArch64/extern-weak.ll | 28 +- test/CodeGen/AArch64/extract.ll | 6 +- test/CodeGen/AArch64/f16-convert.ll | 251 + test/CodeGen/AArch64/fast-isel-mul.ll | 40 + test/CodeGen/AArch64/fastcc-reserved.ll | 16 +- test/CodeGen/AArch64/fastcc.ll | 47 +- test/CodeGen/AArch64/fcmp.ll | 2 +- test/CodeGen/AArch64/fcvt-fixed.ll | 6 +- test/CodeGen/AArch64/fcvt-int.ll | 4 +- test/CodeGen/AArch64/flags-multiuse.ll | 4 +- test/CodeGen/AArch64/floatdp_1source.ll | 2 +- test/CodeGen/AArch64/floatdp_2source.ll | 2 +- test/CodeGen/AArch64/fp-cond-sel.ll | 23 +- test/CodeGen/AArch64/fp-dp3.ll | 58 +- test/CodeGen/AArch64/fp128-folding.ll | 4 +- test/CodeGen/AArch64/fp128.ll | 279 - test/CodeGen/AArch64/fpimm.ll | 6 +- test/CodeGen/AArch64/frameaddr.ll | 4 +- test/CodeGen/AArch64/free-zext.ll | 14 + test/CodeGen/AArch64/func-argpassing.ll | 67 +- test/CodeGen/AArch64/func-calls.ll | 61 +- test/CodeGen/AArch64/funcptr_cast.ll | 13 + test/CodeGen/AArch64/global-alignment.ll | 26 +- test/CodeGen/AArch64/global-merge-1.ll | 26 + test/CodeGen/AArch64/global-merge-2.ll | 51 + test/CodeGen/AArch64/global-merge-3.ll | 51 + test/CodeGen/AArch64/global-merge-4.ll | 73 + test/CodeGen/AArch64/global-merge.ll | 30 + test/CodeGen/AArch64/got-abuse.ll | 6 +- test/CodeGen/AArch64/half.ll | 83 + test/CodeGen/AArch64/hints.ll | 67 + test/CodeGen/AArch64/i1-contents.ll | 55 + test/CodeGen/AArch64/i128-align.ll | 6 +- test/CodeGen/AArch64/i128-fast-isel-fallback.ll | 18 + test/CodeGen/AArch64/illegal-float-ops.ll | 2 +- test/CodeGen/AArch64/init-array.ll | 4 +- .../CodeGen/AArch64/inline-asm-constraints-badI.ll | 4 +- .../CodeGen/AArch64/inline-asm-constraints-badK.ll | 2 +- .../AArch64/inline-asm-constraints-badK2.ll | 2 +- .../CodeGen/AArch64/inline-asm-constraints-badL.ll | 2 +- test/CodeGen/AArch64/inline-asm-constraints.ll | 137 - test/CodeGen/AArch64/inline-asm-modifiers.ll | 147 - test/CodeGen/AArch64/inlineasm-ldr-pseudo.ll | 26 + test/CodeGen/AArch64/intrinsics-memory-barrier.ll | 57 + test/CodeGen/AArch64/jump-table.ll | 22 +- test/CodeGen/AArch64/large-consts.ll | 9 +- test/CodeGen/AArch64/large-frame.ll | 119 - test/CodeGen/AArch64/ldst-opt.ll | 767 + test/CodeGen/AArch64/ldst-regoffset.ll | 80 +- test/CodeGen/AArch64/ldst-unscaledimm.ll | 6 +- test/CodeGen/AArch64/ldst-unsignedimm.ll | 62 +- test/CodeGen/AArch64/lit.local.cfg | 10 +- test/CodeGen/AArch64/literal_pools.ll | 103 - test/CodeGen/AArch64/literal_pools_float.ll | 46 + test/CodeGen/AArch64/local_vars.ll | 21 +- test/CodeGen/AArch64/logical-imm.ll | 2 +- test/CodeGen/AArch64/logical_shifted_reg.ll | 6 +- test/CodeGen/AArch64/mature-mc-support.ll | 12 + test/CodeGen/AArch64/memcpy-f128.ll | 19 + test/CodeGen/AArch64/movw-consts.ll | 32 +- test/CodeGen/AArch64/movw-shift-encoding.ll | 9 +- test/CodeGen/AArch64/mul-lohi.ll | 19 + test/CodeGen/AArch64/mul_pow2.ll | 123 + test/CodeGen/AArch64/neon-2velem-high.ll | 331 - test/CodeGen/AArch64/neon-2velem.ll | 2550 - test/CodeGen/AArch64/neon-3vdiff.ll | 1806 - test/CodeGen/AArch64/neon-aba-abd.ll | 236 - test/CodeGen/AArch64/neon-across.ll | 476 - test/CodeGen/AArch64/neon-add-pairwise.ll | 92 - test/CodeGen/AArch64/neon-add-sub.ll | 237 - test/CodeGen/AArch64/neon-bitcast.ll | 12 +- test/CodeGen/AArch64/neon-bitwise-instructions.ll | 890 +- test/CodeGen/AArch64/neon-bsl.ll | 222 - test/CodeGen/AArch64/neon-compare-instructions.ll | 957 +- test/CodeGen/AArch64/neon-copy.ll | 615 - test/CodeGen/AArch64/neon-crypto.ll | 149 - test/CodeGen/AArch64/neon-diagnostics.ll | 2 +- test/CodeGen/AArch64/neon-extract.ll | 122 +- test/CodeGen/AArch64/neon-facge-facgt.ll | 56 - test/CodeGen/AArch64/neon-fma.ll | 50 +- test/CodeGen/AArch64/neon-fpround_f128.ll | 18 + test/CodeGen/AArch64/neon-frsqrt-frecp.ll | 54 - test/CodeGen/AArch64/neon-halving-add-sub.ll | 207 - test/CodeGen/AArch64/neon-idiv.ll | 13 + test/CodeGen/AArch64/neon-max-min-pairwise.ll | 310 - test/CodeGen/AArch64/neon-max-min.ll | 310 - test/CodeGen/AArch64/neon-misc-scalar.ll | 60 - test/CodeGen/AArch64/neon-misc.ll | 1799 - test/CodeGen/AArch64/neon-mla-mls.ll | 24 +- test/CodeGen/AArch64/neon-mov.ll | 127 +- test/CodeGen/AArch64/neon-mul-div.ll | 181 - test/CodeGen/AArch64/neon-or-combine.ll | 29 + test/CodeGen/AArch64/neon-perm.ll | 1919 +- test/CodeGen/AArch64/neon-rounding-halving-add.ll | 105 - test/CodeGen/AArch64/neon-rounding-shift.ll | 121 - test/CodeGen/AArch64/neon-saturating-add-sub.ll | 241 - .../AArch64/neon-saturating-rounding-shift.ll | 121 - test/CodeGen/AArch64/neon-saturating-shift.ll | 121 - test/CodeGen/AArch64/neon-scalar-abs.ll | 61 - test/CodeGen/AArch64/neon-scalar-add-sub.ll | 50 - test/CodeGen/AArch64/neon-scalar-by-elem-fma.ll | 48 +- test/CodeGen/AArch64/neon-scalar-by-elem-mul.ll | 124 - test/CodeGen/AArch64/neon-scalar-compare.ll | 343 - test/CodeGen/AArch64/neon-scalar-copy.ll | 84 +- test/CodeGen/AArch64/neon-scalar-cvt.ll | 137 - test/CodeGen/AArch64/neon-scalar-extract-narrow.ll | 104 - test/CodeGen/AArch64/neon-scalar-fabd.ll | 26 - test/CodeGen/AArch64/neon-scalar-fcvt.ll | 255 - test/CodeGen/AArch64/neon-scalar-fp-compare.ll | 328 - test/CodeGen/AArch64/neon-scalar-mul.ll | 143 - test/CodeGen/AArch64/neon-scalar-neg.ll | 61 - test/CodeGen/AArch64/neon-scalar-recip.ll | 116 - .../CodeGen/AArch64/neon-scalar-reduce-pairwise.ll | 247 - test/CodeGen/AArch64/neon-scalar-rounding-shift.ll | 39 - .../AArch64/neon-scalar-saturating-add-sub.ll | 242 - .../neon-scalar-saturating-rounding-shift.ll | 94 - .../AArch64/neon-scalar-saturating-shift.ll | 88 - test/CodeGen/AArch64/neon-scalar-shift-imm.ll | 531 - test/CodeGen/AArch64/neon-scalar-shift.ll | 38 - test/CodeGen/AArch64/neon-shift-left-long.ll | 10 + test/CodeGen/AArch64/neon-shift.ll | 171 - test/CodeGen/AArch64/neon-simd-ldst-multi-elem.ll | 2314 - test/CodeGen/AArch64/neon-simd-ldst-one.ll | 2113 - test/CodeGen/AArch64/neon-simd-ldst.ll | 164 - .../AArch64/neon-simd-post-ldst-multi-elem.ll | 354 - test/CodeGen/AArch64/neon-simd-post-ldst-one.ll | 319 - test/CodeGen/AArch64/neon-simd-shift.ll | 1556 - test/CodeGen/AArch64/neon-simd-tbl.ll | 828 - test/CodeGen/AArch64/neon-simd-vget.ll | 225 - test/CodeGen/AArch64/neon-truncStore-extLoad.ll | 57 + test/CodeGen/AArch64/nzcv-save.ll | 18 + test/CodeGen/AArch64/pic-eh-stubs.ll | 5 +- test/CodeGen/AArch64/ragreedy-csr.ll | 297 + test/CodeGen/AArch64/rbit.ll | 20 + test/CodeGen/AArch64/regress-bitcast-formals.ll | 2 +- test/CodeGen/AArch64/regress-f128csel-flags.ll | 2 +- test/CodeGen/AArch64/regress-fp128-livein.ll | 2 +- test/CodeGen/AArch64/regress-tail-livereg.ll | 16 +- test/CodeGen/AArch64/regress-tblgen-chains.ll | 13 +- .../AArch64/regress-w29-reserved-with-fp.ll | 15 - test/CodeGen/AArch64/regress-wzr-allocatable.ll | 41 - test/CodeGen/AArch64/returnaddr.ll | 2 +- test/CodeGen/AArch64/setcc-takes-i32.ll | 2 +- test/CodeGen/AArch64/sibling-call.ll | 14 +- test/CodeGen/AArch64/sincos-expansion.ll | 2 +- test/CodeGen/AArch64/sincospow-vector-expansion.ll | 96 + test/CodeGen/AArch64/tail-call.ll | 34 +- test/CodeGen/AArch64/tls-dynamic-together.ll | 18 - test/CodeGen/AArch64/tls-dynamics.ll | 121 - test/CodeGen/AArch64/tls-execs.ll | 63 - test/CodeGen/AArch64/trunc-v1i64.ll | 63 + test/CodeGen/AArch64/tst-br.ll | 12 +- test/CodeGen/AArch64/variadic.ll | 199 - test/CodeGen/AArch64/zero-reg.ll | 9 +- test/CodeGen/ARM/2006-11-10-CycleInDAG.ll | 2 +- test/CodeGen/ARM/2007-04-03-PEIBug.ll | 5 +- test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll | 2 +- test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll | 5 +- test/CodeGen/ARM/2008-03-05-SxtInRegBug.ll | 7 +- test/CodeGen/ARM/2008-07-17-Fdiv.ll | 2 +- test/CodeGen/ARM/2008-07-24-CodeGenPrepCrash.ll | 2 +- test/CodeGen/ARM/2008-11-18-ScavengerAssert.ll | 2 +- test/CodeGen/ARM/2009-03-09-AddrModeBug.ll | 2 +- test/CodeGen/ARM/2009-04-06-AsmModifier.ll | 5 +- test/CodeGen/ARM/2009-04-08-AggregateAddr.ll | 2 +- test/CodeGen/ARM/2009-04-08-FREM.ll | 2 +- test/CodeGen/ARM/2009-04-08-FloatUndef.ll | 2 +- test/CodeGen/ARM/2009-04-09-RegScavengerAsm.ll | 2 +- test/CodeGen/ARM/2009-05-11-CodePlacementCrash.ll | 3 +- test/CodeGen/ARM/2009-05-18-InlineAsmMem.ll | 4 +- test/CodeGen/ARM/2009-07-09-asm-p-constraint.ll | 2 +- test/CodeGen/ARM/2009-07-22-SchedulerAssert.ll | 2 +- test/CodeGen/ARM/2009-08-23-linkerprivate.ll | 8 - test/CodeGen/ARM/2009-08-31-TwoRegShuffle.ll | 3 +- test/CodeGen/ARM/2009-09-10-postdec.ll | 2 +- test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll | 2 +- test/CodeGen/ARM/2009-09-24-spill-align.ll | 2 +- test/CodeGen/ARM/2009-11-02-NegativeLane.ll | 2 +- test/CodeGen/ARM/2009-11-07-SubRegAsmPrinting.ll | 2 +- test/CodeGen/ARM/2010-03-04-stm-undef-addr.ll | 2 +- test/CodeGen/ARM/2010-04-09-NeonSelect.ll | 4 +- test/CodeGen/ARM/2010-04-14-SplitVector.ll | 2 +- test/CodeGen/ARM/2010-05-18-PostIndexBug.ll | 18 +- test/CodeGen/ARM/2010-05-20-NEONSpillCrash.ll | 2 +- test/CodeGen/ARM/2010-05-21-BuildVector.ll | 2 +- test/CodeGen/ARM/2010-06-11-vmovdrr-bitcast.ll | 4 +- test/CodeGen/ARM/2010-06-29-SubregImpDefs.ll | 2 +- test/CodeGen/ARM/2010-07-26-GlobalMerge.ll | 2 +- test/CodeGen/ARM/2010-08-04-StackVariable.ll | 4 +- test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll | 285 - test/CodeGen/ARM/2010-10-25-ifcvt-ldm.ll | 4 +- test/CodeGen/ARM/2010-12-07-PEIBug.ll | 6 +- test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll | 6 +- test/CodeGen/ARM/2011-02-04-AntidepMultidef.ll | 20 +- test/CodeGen/ARM/2011-03-15-LdStMultipleBug.ll | 6 +- test/CodeGen/ARM/2011-04-12-AlignBug.ll | 8 +- test/CodeGen/ARM/2011-06-09-TailCallByVal.ll | 2 +- test/CodeGen/ARM/2011-06-16-TailCallByVal.ll | 4 +- test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll | 6 +- test/CodeGen/ARM/2011-10-26-memset-inline.ll | 8 +- test/CodeGen/ARM/2011-10-26-memset-with-neon.ll | 2 +- .../ARM/2011-11-07-PromoteVectorLoadStore.ll | 2 +- test/CodeGen/ARM/2011-11-09-BitcastVectorDouble.ll | 2 +- .../ARM/2011-11-09-IllegalVectorFPIntConvert.ll | 2 +- test/CodeGen/ARM/2011-11-29-128bitArithmetics.ll | 2 +- test/CodeGen/ARM/2012-04-10-DAGCombine.ll | 2 +- test/CodeGen/ARM/2012-05-04-vmov.ll | 8 +- test/CodeGen/ARM/2012-05-10-PreferVMOVtoVDUP32.ll | 2 +- test/CodeGen/ARM/2012-08-23-legalize-vmull.ll | 2 +- test/CodeGen/ARM/2012-09-18-ARMv4ISelBug.ll | 2 +- .../ARM/2012-09-25-InlineAsmScalarToVectorConv.ll | 2 +- .../ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll | 2 +- test/CodeGen/ARM/2012-11-14-subs_carry.ll | 2 +- .../ARM/2013-04-05-Small-ByVal-Structs-PR15293.ll | 4 +- test/CodeGen/ARM/2013-04-16-AAPCS-C4-vs-VFP.ll | 2 +- .../2013-05-02-AAPCS-ByVal-Structs-C4-C5-VFP.ll | 6 +- test/CodeGen/ARM/2013-05-05-IfConvertBug.ll | 33 +- test/CodeGen/ARM/2013-05-07-ByteLoadSameAddress.ll | 2 +- test/CodeGen/ARM/2013-07-29-vector-or-combine.ll | 2 +- .../ARM/2014-01-09-pseudo_expand_implicit_reg.ll | 56 + .../CodeGen/ARM/2014-02-05-vfp-regs-after-stack.ll | 22 + .../ARM/2014-02-21-byval-reg-split-alignment.ll | 114 + test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll | 50 + .../ARM/2014-07-18-earlyclobber-str-post.ll | 13 + test/CodeGen/ARM/DbgValueOtherTargets.test | 2 +- test/CodeGen/ARM/Windows/aapcs.ll | 16 + test/CodeGen/ARM/Windows/alloca.ll | 22 + test/CodeGen/ARM/Windows/chkstk-movw-movt-isel.ll | 27 + test/CodeGen/ARM/Windows/chkstk.ll | 24 + test/CodeGen/ARM/Windows/dllimport.ll | 61 + test/CodeGen/ARM/Windows/frame-register.ll | 22 + test/CodeGen/ARM/Windows/global-minsize.ll | 16 + test/CodeGen/ARM/Windows/hard-float.ll | 10 + .../Windows/integer-floating-point-conversion.ll | 74 + test/CodeGen/ARM/Windows/long-calls.ll | 18 + test/CodeGen/ARM/Windows/mangling.ll | 9 + test/CodeGen/ARM/Windows/memset.ll | 18 + test/CodeGen/ARM/Windows/mov32t-bundling.ll | 28 + test/CodeGen/ARM/Windows/movw-movt-relocations.ll | 27 + test/CodeGen/ARM/Windows/no-aeabi.ll | 32 + test/CodeGen/ARM/Windows/no-arm-mode.ll | 5 + test/CodeGen/ARM/Windows/no-ehabi.ll | 21 + test/CodeGen/ARM/Windows/pic.ll | 16 + test/CodeGen/ARM/Windows/read-only-data.ll | 15 + test/CodeGen/ARM/Windows/structors.ll | 12 + test/CodeGen/ARM/Windows/vla.ll | 31 + test/CodeGen/ARM/a15-mla.ll | 3 +- test/CodeGen/ARM/a15.ll | 2 +- test/CodeGen/ARM/aapcs-hfa-code.ll | 111 + test/CodeGen/ARM/aapcs-hfa.ll | 164 + test/CodeGen/ARM/addrmode.ll | 5 +- test/CodeGen/ARM/addrspacecast.ll | 2 +- test/CodeGen/ARM/argaddr.ll | 2 +- test/CodeGen/ARM/arm-abi-attr.ll | 28 + test/CodeGen/ARM/arm-and-tst-peephole.ll | 9 +- test/CodeGen/ARM/arm-asm.ll | 2 +- test/CodeGen/ARM/arm-modifier.ll | 2 +- test/CodeGen/ARM/arm-negative-stride.ll | 2 +- test/CodeGen/ARM/arm-ttype-target2.ll | 2 +- test/CodeGen/ARM/atomic-64bit.ll | 224 +- test/CodeGen/ARM/atomic-cmp.ll | 5 +- test/CodeGen/ARM/atomic-cmpxchg.ll | 50 + test/CodeGen/ARM/atomic-load-store.ll | 39 +- test/CodeGen/ARM/atomic-op.ll | 39 + test/CodeGen/ARM/atomic-ops-v8.ll | 467 +- test/CodeGen/ARM/atomicrmw_minmax.ll | 4 +- test/CodeGen/ARM/available_externally.ll | 6 +- test/CodeGen/ARM/bfc.ll | 2 +- test/CodeGen/ARM/bfi.ll | 2 +- test/CodeGen/ARM/bfx.ll | 2 +- test/CodeGen/ARM/bic.ll | 2 +- test/CodeGen/ARM/big-endian-eh-unwind.ll | 73 + test/CodeGen/ARM/big-endian-neon-bitconv.ll | 392 + test/CodeGen/ARM/big-endian-neon-extend.ll | 81 + test/CodeGen/ARM/big-endian-neon-trunc-store.ll | 26 + test/CodeGen/ARM/big-endian-ret-f64.ll | 12 + test/CodeGen/ARM/big-endian-vector-callee.ll | 1172 + test/CodeGen/ARM/big-endian-vector-caller.ll | 1369 + test/CodeGen/ARM/bits.ll | 2 +- test/CodeGen/ARM/bswap16.ll | 42 + test/CodeGen/ARM/build-attributes-encoding.s | 10 +- test/CodeGen/ARM/build-attributes.ll | 468 + test/CodeGen/ARM/cache-intrinsic.ll | 26 + test/CodeGen/ARM/call-tc.ll | 8 +- test/CodeGen/ARM/call.ll | 12 +- test/CodeGen/ARM/carry.ll | 2 +- test/CodeGen/ARM/clz.ll | 2 +- test/CodeGen/ARM/cmpxchg-idioms.ll | 107 + test/CodeGen/ARM/cmpxchg-weak.ll | 43 + test/CodeGen/ARM/coalesce-dbgvalue.ll | 2 +- test/CodeGen/ARM/compare-call.ll | 6 +- test/CodeGen/ARM/constantfp.ll | 12 +- test/CodeGen/ARM/crash-O0.ll | 2 +- test/CodeGen/ARM/cse-ldrlit.ll | 61 + test/CodeGen/ARM/ctz.ll | 2 +- test/CodeGen/ARM/dagcombine-concatvector.ll | 11 +- test/CodeGen/ARM/data-in-code-annotations.ll | 2 +- test/CodeGen/ARM/debug-frame-large-stack.ll | 99 + test/CodeGen/ARM/debug-frame-no-debug.ll | 97 + test/CodeGen/ARM/debug-frame-vararg.ll | 142 + test/CodeGen/ARM/debug-frame.ll | 575 + test/CodeGen/ARM/debug-info-arg.ll | 2 +- test/CodeGen/ARM/debug-info-blocks.ll | 9 +- test/CodeGen/ARM/debug-info-qreg.ll | 10 +- test/CodeGen/ARM/debug-info-s16-reg.ll | 6 +- test/CodeGen/ARM/debug-info-sreg2.ll | 14 +- test/CodeGen/ARM/debug-segmented-stacks.ll | 82 + test/CodeGen/ARM/default-float-abi.ll | 22 + test/CodeGen/ARM/divmod-eabi.ll | 5 +- test/CodeGen/ARM/dwarf-eh.ll | 71 + test/CodeGen/ARM/dyn-stackalloc.ll | 2 +- test/CodeGen/ARM/ehabi-filters.ll | 2 +- test/CodeGen/ARM/ehabi-handlerdata-nounwind.ll | 61 + test/CodeGen/ARM/ehabi-handlerdata.ll | 59 + test/CodeGen/ARM/ehabi-no-landingpad.ll | 3 +- test/CodeGen/ARM/ehabi-unwind.ll | 5 +- test/CodeGen/ARM/ehabi.ll | 253 +- test/CodeGen/ARM/extload-knownzero.ll | 2 +- test/CodeGen/ARM/extloadi1.ll | 3 +- test/CodeGen/ARM/fadds.ll | 23 +- test/CodeGen/ARM/fast-isel-call.ll | 2 - test/CodeGen/ARM/fast-isel-crash2.ll | 4 +- test/CodeGen/ARM/fast-isel-frameaddr.ll | 16 +- test/CodeGen/ARM/fast-isel-inline-asm.ll | 18 + test/CodeGen/ARM/fast-isel-intrinsic.ll | 42 +- test/CodeGen/ARM/fast-isel-static.ll | 8 +- test/CodeGen/ARM/fast-tail-call.ll | 2 +- test/CodeGen/ARM/fastcc-vfp.ll | 40 + test/CodeGen/ARM/fastisel-thumb-litpool.ll | 11 + test/CodeGen/ARM/fdivs.ll | 8 +- test/CodeGen/ARM/fixunsdfdi.ll | 7 +- test/CodeGen/ARM/fmacs.ll | 10 +- test/CodeGen/ARM/fmdrr-fmrrd.ll | 8 +- test/CodeGen/ARM/fmscs.ll | 6 +- test/CodeGen/ARM/fmuls.ll | 23 +- test/CodeGen/ARM/fnegs.ll | 23 +- test/CodeGen/ARM/fnmacs.ll | 6 +- test/CodeGen/ARM/fnmscs.ll | 23 +- test/CodeGen/ARM/fnmul.ll | 10 +- test/CodeGen/ARM/fnmuls.ll | 8 +- test/CodeGen/ARM/fold-const.ll | 2 +- test/CodeGen/ARM/fold-stack-adjust.ll | 66 +- test/CodeGen/ARM/formal.ll | 2 +- test/CodeGen/ARM/fp-arg-shuffle.ll | 2 +- test/CodeGen/ARM/fp-fast.ll | 3 +- test/CodeGen/ARM/fp.ll | 2 +- test/CodeGen/ARM/fp16.ll | 51 +- test/CodeGen/ARM/fp_convert.ll | 23 +- test/CodeGen/ARM/fpcmp-opt.ll | 4 +- test/CodeGen/ARM/fpcmp.ll | 2 +- test/CodeGen/ARM/fpconsts.ll | 2 +- test/CodeGen/ARM/fpconv.ll | 4 +- test/CodeGen/ARM/fpmem.ll | 2 +- test/CodeGen/ARM/fpow.ll | 2 +- test/CodeGen/ARM/fptoint.ll | 2 +- test/CodeGen/ARM/frame-register.ll | 38 + test/CodeGen/ARM/fsubs.ll | 19 +- test/CodeGen/ARM/func-argpassing-endian.ll | 122 + test/CodeGen/ARM/global-merge-1.ll | 85 + test/CodeGen/ARM/half.ll | 74 + test/CodeGen/ARM/hello.ll | 21 +- test/CodeGen/ARM/hfa-in-contiguous-registers.ll | 94 + test/CodeGen/ARM/hints.ll | 69 + test/CodeGen/ARM/iabs.ll | 2 +- test/CodeGen/ARM/ifconv-kills.ll | 2 +- test/CodeGen/ARM/ifcvt-branch-weight-bug.ll | 63 + test/CodeGen/ARM/ifcvt-branch-weight.ll | 42 + test/CodeGen/ARM/ifcvt1.ll | 4 +- test/CodeGen/ARM/ifcvt10.ll | 2 +- test/CodeGen/ARM/ifcvt2.ll | 2 +- test/CodeGen/ARM/ifcvt3.ll | 14 +- test/CodeGen/ARM/ifcvt4.ll | 2 +- test/CodeGen/ARM/ifcvt9.ll | 2 +- test/CodeGen/ARM/illegal-vector-bitcast.ll | 4 +- test/CodeGen/ARM/imm.ll | 5 +- test/CodeGen/ARM/indirect-hidden.ll | 22 + test/CodeGen/ARM/indirect-reg-input.ll | 2 +- test/CodeGen/ARM/indirectbr-3.ll | 2 +- test/CodeGen/ARM/indirectbr.ll | 11 +- test/CodeGen/ARM/inline-diagnostics.ll | 16 + test/CodeGen/ARM/inlineasm-64bit.ll | 4 +- test/CodeGen/ARM/inlineasm-imm-arm.ll | 2 +- test/CodeGen/ARM/inlineasm-ldr-pseudo.ll | 17 + .../ARM/inlineasm-switch-mode-oneway-from-arm.ll | 18 + .../ARM/inlineasm-switch-mode-oneway-from-thumb.ll | 18 + test/CodeGen/ARM/inlineasm-switch-mode.ll | 22 + test/CodeGen/ARM/inlineasm.ll | 2 +- test/CodeGen/ARM/inlineasm2.ll | 2 +- test/CodeGen/ARM/inlineasm3.ll | 3 +- test/CodeGen/ARM/inlineasm4.ll | 2 +- test/CodeGen/ARM/insn-sched1.ll | 11 +- test/CodeGen/ARM/integer_insertelement.ll | 2 +- test/CodeGen/ARM/interrupt-attr.ll | 56 +- test/CodeGen/ARM/intrinsics-crypto.ll | 58 +- test/CodeGen/ARM/intrinsics-memory-barrier.ll | 55 + test/CodeGen/ARM/intrinsics-overflow.ll | 57 + test/CodeGen/ARM/intrinsics-v8.ll | 4 +- test/CodeGen/ARM/ispositive.ll | 2 +- test/CodeGen/ARM/jump_tables.ll | 32 + test/CodeGen/ARM/large-stack.ll | 2 +- test/CodeGen/ARM/ldaex-stlex.ll | 92 + test/CodeGen/ARM/ldm.ll | 4 +- test/CodeGen/ARM/ldr.ll | 2 +- test/CodeGen/ARM/ldr_ext.ll | 2 +- test/CodeGen/ARM/ldr_frame.ll | 5 +- test/CodeGen/ARM/ldr_post.ll | 4 +- test/CodeGen/ARM/ldr_pre.ll | 4 +- test/CodeGen/ARM/ldrd.ll | 8 +- test/CodeGen/ARM/ldstrex-m.ll | 59 + test/CodeGen/ARM/ldstrex.ll | 28 +- test/CodeGen/ARM/lit.local.cfg | 3 +- test/CodeGen/ARM/load.ll | 13 +- test/CodeGen/ARM/long-setcc.ll | 7 +- test/CodeGen/ARM/long.ll | 2 +- test/CodeGen/ARM/longMAC.ll | 35 +- test/CodeGen/ARM/long_shift.ll | 58 +- test/CodeGen/ARM/lsr-scale-addr-mode.ll | 5 +- test/CodeGen/ARM/lsr-unfolded-offset.ll | 4 +- test/CodeGen/ARM/machine-licm.ll | 10 +- test/CodeGen/ARM/mature-mc-support.ll | 12 + test/CodeGen/ARM/mem.ll | 8 +- test/CodeGen/ARM/memcpy-inline.ll | 34 +- test/CodeGen/ARM/memfunc.ll | 3 +- test/CodeGen/ARM/metadata-default.ll | 16 + test/CodeGen/ARM/metadata-short-enums.ll | 16 + test/CodeGen/ARM/metadata-short-wchar.ll | 16 + test/CodeGen/ARM/minsize-imms.ll | 57 + test/CodeGen/ARM/minsize-litpools.ll | 26 + test/CodeGen/ARM/misched-copy-arm.ll | 2 +- test/CodeGen/ARM/mls.ll | 5 +- test/CodeGen/ARM/movt-movw-global.ll | 8 +- test/CodeGen/ARM/movt.ll | 2 +- test/CodeGen/ARM/mul.ll | 14 +- test/CodeGen/ARM/mul_const.ll | 2 +- test/CodeGen/ARM/mulhi.ll | 6 +- test/CodeGen/ARM/mult-alt-generic-arm.ll | 2 +- test/CodeGen/ARM/mvn.ll | 16 +- test/CodeGen/ARM/named-reg-alloc.ll | 14 + test/CodeGen/ARM/named-reg-notareg.ll | 13 + test/CodeGen/ARM/neon_arith1.ll | 5 +- test/CodeGen/ARM/neon_cmp.ll | 3 +- test/CodeGen/ARM/neon_div.ll | 3 +- test/CodeGen/ARM/neon_fpconv.ll | 2 +- test/CodeGen/ARM/neon_ld1.ll | 2 +- test/CodeGen/ARM/neon_ld2.ll | 4 +- test/CodeGen/ARM/neon_minmax.ll | 2 +- test/CodeGen/ARM/neon_shift.ll | 2 +- test/CodeGen/ARM/neon_vabs.ll | 2 +- test/CodeGen/ARM/none-macho.ll | 99 + test/CodeGen/ARM/noreturn.ll | 17 + test/CodeGen/ARM/null-streamer.ll | 7 + test/CodeGen/ARM/optimize-dmbs-v7.ll | 74 + test/CodeGen/ARM/optselect-regclass.ll | 3 +- test/CodeGen/ARM/out-of-registers.ll | 42 + test/CodeGen/ARM/pack.ll | 2 +- test/CodeGen/ARM/phi.ll | 4 +- test/CodeGen/ARM/popcnt.ll | 2 +- test/CodeGen/ARM/prefetch-thumb.ll | 22 - test/CodeGen/ARM/prefetch.ll | 28 +- test/CodeGen/ARM/rbit.ll | 20 + test/CodeGen/ARM/reg_sequence.ll | 12 +- test/CodeGen/ARM/ret0.ll | 2 +- test/CodeGen/ARM/ret_arg1.ll | 2 +- test/CodeGen/ARM/ret_arg2.ll | 2 +- test/CodeGen/ARM/ret_arg3.ll | 3 +- test/CodeGen/ARM/ret_arg4.ll | 2 +- test/CodeGen/ARM/ret_arg5.ll | 2 +- test/CodeGen/ARM/ret_f32_arg2.ll | 2 +- test/CodeGen/ARM/ret_f32_arg5.ll | 2 +- test/CodeGen/ARM/ret_f64_arg2.ll | 2 +- test/CodeGen/ARM/ret_f64_arg_reg_split.ll | 2 +- test/CodeGen/ARM/ret_f64_arg_split.ll | 2 +- test/CodeGen/ARM/ret_f64_arg_stack.ll | 2 +- test/CodeGen/ARM/ret_i128_arg2.ll | 2 +- test/CodeGen/ARM/ret_i64_arg2.ll | 2 +- test/CodeGen/ARM/ret_i64_arg3.ll | 2 +- test/CodeGen/ARM/ret_i64_arg_split.ll | 2 +- test/CodeGen/ARM/ret_void.ll | 2 +- test/CodeGen/ARM/returned-ext.ll | 4 +- test/CodeGen/ARM/returned-trunc-tail-calls.ll | 2 +- test/CodeGen/ARM/rev.ll | 2 +- test/CodeGen/ARM/saxpy10-a9.ll | 135 + test/CodeGen/ARM/sbfx.ll | 2 +- test/CodeGen/ARM/segmented-stacks-dynamic.ll | 64 + test/CodeGen/ARM/segmented-stacks.ll | 249 + test/CodeGen/ARM/select-imm.ll | 10 +- test/CodeGen/ARM/select-undef.ll | 3 +- test/CodeGen/ARM/select.ll | 10 +- test/CodeGen/ARM/setcc-sentinals.ll | 4 +- .../ARM/sjljehprepare-lower-empty-struct.ll | 31 + test/CodeGen/ARM/smml.ll | 3 +- test/CodeGen/ARM/smul.ll | 4 +- test/CodeGen/ARM/spill-q.ll | 2 +- test/CodeGen/ARM/ssp-data-layout.ll | 528 + test/CodeGen/ARM/stack-frame.ll | 9 +- test/CodeGen/ARM/stackpointer.ll | 25 + test/CodeGen/ARM/str_post.ll | 2 +- test/CodeGen/ARM/str_pre.ll | 8 +- test/CodeGen/ARM/str_trunc.ll | 12 +- test/CodeGen/ARM/struct-byval-frame-index.ll | 2 +- test/CodeGen/ARM/struct_byval_arm_t1_t2.ll | 2 +- test/CodeGen/ARM/sub.ll | 21 +- test/CodeGen/ARM/subreg-remat.ll | 2 +- test/CodeGen/ARM/sxt_rot.ll | 2 +- test/CodeGen/ARM/t2-imm.ll | 2 +- test/CodeGen/ARM/tail-call.ll | 21 + test/CodeGen/ARM/taildup-branch-weight.ll | 54 + test/CodeGen/ARM/this-return.ll | 4 +- test/CodeGen/ARM/thumb-litpool.ll | 15 + test/CodeGen/ARM/thumb2-it-block.ll | 4 +- test/CodeGen/ARM/tls-models.ll | 32 +- test/CodeGen/ARM/tls1.ll | 2 +- test/CodeGen/ARM/tls2.ll | 4 +- test/CodeGen/ARM/trap.ll | 1 + test/CodeGen/ARM/trunc_ldr.ll | 10 +- test/CodeGen/ARM/truncstore-dag-combine.ll | 7 +- test/CodeGen/ARM/tst_teq.ll | 7 +- test/CodeGen/ARM/twoaddrinstr.ll | 2 +- test/CodeGen/ARM/unaligned_load_store.ll | 11 +- test/CodeGen/ARM/unaligned_load_store_vector.ll | 2 +- test/CodeGen/ARM/undefined.ll | 14 + test/CodeGen/ARM/unord.ll | 10 +- test/CodeGen/ARM/uxt_rot.ll | 14 +- test/CodeGen/ARM/v1-constant-fold.ll | 4 +- test/CodeGen/ARM/va_arg.ll | 4 +- test/CodeGen/ARM/vaba.ll | 2 +- test/CodeGen/ARM/vabd.ll | 2 +- test/CodeGen/ARM/vabs.ll | 10 +- test/CodeGen/ARM/vadd.ll | 2 +- test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll | 31 + test/CodeGen/ARM/vargs.ll | 3 +- test/CodeGen/ARM/vbits.ll | 2 +- test/CodeGen/ARM/vbsl.ll | 2 +- test/CodeGen/ARM/vceq.ll | 2 +- test/CodeGen/ARM/vcge.ll | 10 +- test/CodeGen/ARM/vcgt.ll | 12 +- test/CodeGen/ARM/vcnt.ll | 2 +- test/CodeGen/ARM/vcombine.ll | 39 +- test/CodeGen/ARM/vcvt.ll | 2 +- test/CodeGen/ARM/vdup.ll | 35 +- test/CodeGen/ARM/vector-spilling.ll | 34 + test/CodeGen/ARM/vext.ll | 2 +- test/CodeGen/ARM/vfcmp.ll | 2 +- test/CodeGen/ARM/vfp-libcalls.ll | 11 + test/CodeGen/ARM/vfp-regs-dwarf.ll | 44 + test/CodeGen/ARM/vhadd.ll | 2 +- test/CodeGen/ARM/vhsub.ll | 2 +- test/CodeGen/ARM/vicmp.ll | 2 +- test/CodeGen/ARM/vld1.ll | 6 +- test/CodeGen/ARM/vld2.ll | 2 +- test/CodeGen/ARM/vld3.ll | 4 +- test/CodeGen/ARM/vld4.ll | 2 +- test/CodeGen/ARM/vlddup.ll | 2 +- test/CodeGen/ARM/vldlane.ll | 6 +- test/CodeGen/ARM/vldm-sched-a9.ll | 10 +- test/CodeGen/ARM/vminmax.ll | 2 +- test/CodeGen/ARM/vmla.ll | 2 +- test/CodeGen/ARM/vmls.ll | 2 +- test/CodeGen/ARM/vmov.ll | 2 +- test/CodeGen/ARM/vmul.ll | 2 +- test/CodeGen/ARM/vneg.ll | 2 +- test/CodeGen/ARM/vpadal.ll | 2 +- test/CodeGen/ARM/vpadd.ll | 13 +- test/CodeGen/ARM/vpminmax.ll | 2 +- test/CodeGen/ARM/vqadd.ll | 2 +- test/CodeGen/ARM/vqshl.ll | 2 +- test/CodeGen/ARM/vqshrn.ll | 2 +- test/CodeGen/ARM/vqsub.ll | 2 +- test/CodeGen/ARM/vrec.ll | 2 +- test/CodeGen/ARM/vrev.ll | 10 +- test/CodeGen/ARM/vsel.ll | 8 +- test/CodeGen/ARM/vselect_imax.ll | 2 +- test/CodeGen/ARM/vshift.ll | 34 +- test/CodeGen/ARM/vshiftins.ll | 2 +- test/CodeGen/ARM/vshl.ll | 2 +- test/CodeGen/ARM/vshll.ll | 101 +- test/CodeGen/ARM/vshrn.ll | 49 +- test/CodeGen/ARM/vsra.ll | 36 +- test/CodeGen/ARM/vst1.ll | 2 +- test/CodeGen/ARM/vst2.ll | 2 +- test/CodeGen/ARM/vst3.ll | 2 +- test/CodeGen/ARM/vst4.ll | 2 +- test/CodeGen/ARM/vstlane.ll | 2 +- test/CodeGen/ARM/vsub.ll | 2 +- test/CodeGen/ARM/vtbl.ll | 2 +- test/CodeGen/ARM/vtrn.ll | 2 +- test/CodeGen/ARM/vuzp.ll | 2 +- test/CodeGen/ARM/vzip.ll | 2 +- test/CodeGen/ARM/warn-stack.ll | 2 +- test/CodeGen/ARM/weak.ll | 6 +- test/CodeGen/ARM/weak2.ll | 5 +- test/CodeGen/ARM/widen-vmovs.ll | 6 +- test/CodeGen/ARM/zero-cycle-zero.ll | 70 + test/CodeGen/ARM/zextload_demandedbits.ll | 2 +- test/CodeGen/CPP/atomic.ll | 89 + test/CodeGen/CPP/attributes.ll | 7 + test/CodeGen/CPP/lit.local.cfg | 3 +- .../Generic/2007-04-08-MultipleFrameIndices.ll | 2 +- .../CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll | 2 +- test/CodeGen/Generic/2007-04-27-LargeMemObject.ll | 2 +- test/CodeGen/Generic/2007-12-17-InvokeAsm.ll | 2 +- test/CodeGen/Generic/2008-02-20-MatchingMem.ll | 2 +- test/CodeGen/Generic/2014-02-05-OpaqueConstants.ll | 19 + test/CodeGen/Generic/MachineBranchProb.ll | 3 + test/CodeGen/Generic/asm-large-immediate.ll | 2 +- test/CodeGen/Generic/inline-asm-mem-clobber.ll | 2 +- test/CodeGen/Generic/inline-asm-special-strings.ll | 2 +- test/CodeGen/Generic/no-target.ll | 3 + test/CodeGen/Generic/print-after.ll | 2 +- test/CodeGen/Generic/select.ll | 1 - test/CodeGen/Generic/stop-after.ll | 2 +- test/CodeGen/Hexagon/hwloop-dbg.ll | 8 +- test/CodeGen/Hexagon/lit.local.cfg | 3 +- test/CodeGen/Hexagon/packetize_cond_inst.ll | 2 +- test/CodeGen/MSP430/fp.ll | 12 + test/CodeGen/MSP430/lit.local.cfg | 3 +- test/CodeGen/MSP430/misched-msp430.ll | 20 + test/CodeGen/Mips/2008-07-16-SignExtInReg.ll | 6 +- test/CodeGen/Mips/2008-08-01-AsmInline.ll | 2 +- test/CodeGen/Mips/2009-11-16-CstPoolLoad.ll | 8 +- test/CodeGen/Mips/2010-07-20-Switch.ll | 8 +- test/CodeGen/Mips/2013-11-18-fp64-const0.ll | 2 +- test/CodeGen/Mips/Fast-ISel/loadstore2.ll | 83 + test/CodeGen/Mips/Fast-ISel/nullvoid.ll | 9 + test/CodeGen/Mips/Fast-ISel/simplestore.ll | 15 + test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll | 38 + test/CodeGen/Mips/Fast-ISel/simplestorei.ll | 65 + test/CodeGen/Mips/abicalls.ll | 16 + test/CodeGen/Mips/abiflags-xx.ll | 5 + test/CodeGen/Mips/abiflags32.ll | 17 + test/CodeGen/Mips/addi.ll | 2 +- test/CodeGen/Mips/align16.ll | 8 +- test/CodeGen/Mips/alloca16.ll | 4 +- test/CodeGen/Mips/analyzebranch.ll | 35 +- test/CodeGen/Mips/atomic.ll | 672 +- test/CodeGen/Mips/atomicops.ll | 3 +- test/CodeGen/Mips/blez_bgez.ll | 2 +- test/CodeGen/Mips/blockaddr.ll | 16 +- test/CodeGen/Mips/bswap.ll | 83 +- test/CodeGen/Mips/buildpairextractelementf64.ll | 34 +- test/CodeGen/Mips/cache-intrinsic.ll | 26 + test/CodeGen/Mips/call-optimization.ll | 91 + test/CodeGen/Mips/cconv/arguments-float.ll | 222 + test/CodeGen/Mips/cconv/arguments-fp128.ll | 51 + .../Mips/cconv/arguments-hard-float-varargs.ll | 157 + test/CodeGen/Mips/cconv/arguments-hard-float.ll | 211 + test/CodeGen/Mips/cconv/arguments-hard-fp128.ll | 49 + test/CodeGen/Mips/cconv/arguments.ll | 170 + test/CodeGen/Mips/cconv/callee-saved-float.ll | 111 + test/CodeGen/Mips/cconv/callee-saved-fpxx.ll | 58 + test/CodeGen/Mips/cconv/callee-saved-fpxx1.ll | 24 + test/CodeGen/Mips/cconv/callee-saved.ll | 167 + test/CodeGen/Mips/cconv/memory-layout.ll | 140 + test/CodeGen/Mips/cconv/reserved-space.ll | 39 + test/CodeGen/Mips/cconv/return-float.ll | 48 + test/CodeGen/Mips/cconv/return-hard-float.ll | 59 + test/CodeGen/Mips/cconv/return-hard-fp128.ll | 31 + test/CodeGen/Mips/cconv/return.ll | 66 + test/CodeGen/Mips/cconv/stack-alignment.ll | 28 + test/CodeGen/Mips/cfi_offset.ll | 41 + test/CodeGen/Mips/ci2.ll | 39 + test/CodeGen/Mips/cmov.ll | 710 +- test/CodeGen/Mips/const-mult.ll | 3 +- test/CodeGen/Mips/const4a.ll | 4 +- test/CodeGen/Mips/const6.ll | 2 +- test/CodeGen/Mips/const6a.ll | 2 +- test/CodeGen/Mips/countleading.ll | 90 + test/CodeGen/Mips/ctlz.ll | 2 +- test/CodeGen/Mips/divrem.ll | 363 +- test/CodeGen/Mips/dsp-r1.ll | 2 +- test/CodeGen/Mips/eh-dwarf-cfa.ll | 2 + test/CodeGen/Mips/eh-return32.ll | 14 +- test/CodeGen/Mips/eh-return64.ll | 16 +- test/CodeGen/Mips/ehframe-indirect.ll | 34 + test/CodeGen/Mips/elf_eflags.ll | 86 + test/CodeGen/Mips/ex2.ll | 9 +- test/CodeGen/Mips/f16abs.ll | 2 +- test/CodeGen/Mips/fabs.ll | 50 +- test/CodeGen/Mips/fastcc.ll | 97 + test/CodeGen/Mips/fcmp.ll | 783 + test/CodeGen/Mips/fcopysign-f32-f64.ll | 1 + test/CodeGen/Mips/fcopysign.ll | 3 +- test/CodeGen/Mips/fixdfsf.ll | 4 +- test/CodeGen/Mips/fmadd1.ll | 323 +- test/CodeGen/Mips/fneg.ll | 27 +- test/CodeGen/Mips/fp-indexed-ls.ll | 194 +- test/CodeGen/Mips/fp16instrinsmc.ll | 4 +- test/CodeGen/Mips/fp16mix.ll | 20 +- test/CodeGen/Mips/fp16static.ll | 2 +- test/CodeGen/Mips/fp64a.ll | 197 + test/CodeGen/Mips/fpbr.ll | 93 +- test/CodeGen/Mips/fpneeded.ll | 16 +- test/CodeGen/Mips/fpnotneeded.ll | 16 +- test/CodeGen/Mips/fptr2.ll | 2 +- test/CodeGen/Mips/fpxx.ll | 221 + test/CodeGen/Mips/global-address.ll | 8 +- test/CodeGen/Mips/helloworld.ll | 9 +- test/CodeGen/Mips/hf16_1.ll | 4 +- test/CodeGen/Mips/hf16call32.ll | 2 +- test/CodeGen/Mips/hf16call32_body.ll | 2 +- test/CodeGen/Mips/hf1_body.ll | 2 +- test/CodeGen/Mips/hfptrcall.ll | 2 +- test/CodeGen/Mips/i32k.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-I-1.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-J.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-L.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-N.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-O.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-bad-P.ll | 2 +- test/CodeGen/Mips/inlineasm-cnstrnt-reg.ll | 19 +- test/CodeGen/Mips/inlineasm-cnstrnt-reg64.ll | 4 +- test/CodeGen/Mips/inlineasm-operand-code.ll | 28 +- test/CodeGen/Mips/inlineasm_constraint.ll | 30 +- test/CodeGen/Mips/int-to-float-conversion.ll | 1 + test/CodeGen/Mips/l3mc.ll | 114 + test/CodeGen/Mips/largefr1.ll | 74 - test/CodeGen/Mips/largeimmprinting.ll | 4 +- test/CodeGen/Mips/lcb2.ll | 133 + test/CodeGen/Mips/lcb3c.ll | 59 + test/CodeGen/Mips/lcb4a.ll | 69 + test/CodeGen/Mips/lcb5.ll | 240 + test/CodeGen/Mips/lit.local.cfg | 3 +- test/CodeGen/Mips/llvm-ir/call.ll | 166 + test/CodeGen/Mips/llvm-ir/indirectbr.ll | 34 + test/CodeGen/Mips/llvm-ir/ret.ll | 205 + test/CodeGen/Mips/load-store-left-right.ll | 434 +- test/CodeGen/Mips/longbranch.ll | 188 +- test/CodeGen/Mips/madd-msub.ll | 241 +- test/CodeGen/Mips/mature-mc-support.ll | 32 + test/CodeGen/Mips/mbrsize4a.ll | 37 + test/CodeGen/Mips/micromips-atomic.ll | 18 + test/CodeGen/Mips/micromips-directives.ll | 16 + test/CodeGen/Mips/micromips-jal.ll | 48 + .../Mips/micromips-load-effective-address.ll | 29 + test/CodeGen/Mips/mips16-hf-attr.ll | 45 + test/CodeGen/Mips/mips16_32_1.ll | 5 +- test/CodeGen/Mips/mips16_32_10.ll | 9 +- test/CodeGen/Mips/mips16_32_3.ll | 21 +- test/CodeGen/Mips/mips16_32_4.ll | 24 +- test/CodeGen/Mips/mips16_32_5.ll | 18 +- test/CodeGen/Mips/mips16_32_6.ll | 15 +- test/CodeGen/Mips/mips16_32_7.ll | 21 +- test/CodeGen/Mips/mips16_32_8.ll | 9 +- test/CodeGen/Mips/mips16_32_9.ll | 12 +- test/CodeGen/Mips/mips16_fpret.ll | 8 +- test/CodeGen/Mips/mips16ex.ll | 4 +- test/CodeGen/Mips/mips16fpe.ll | 2 +- test/CodeGen/Mips/mips32r6/compatibility.ll | 9 + test/CodeGen/Mips/mips64-f128.ll | 358 +- test/CodeGen/Mips/mips64-fp-indexed-ls.ll | 110 - test/CodeGen/Mips/mips64-sret.ll | 25 +- test/CodeGen/Mips/mips64countleading.ll | 19 - test/CodeGen/Mips/mips64directive.ll | 1 + test/CodeGen/Mips/mips64ext.ll | 3 +- test/CodeGen/Mips/mips64fpimm0.ll | 1 + test/CodeGen/Mips/mips64fpldst.ll | 6 +- test/CodeGen/Mips/mips64imm.ll | 1 + test/CodeGen/Mips/mips64instrs.ll | 126 +- test/CodeGen/Mips/mips64intldst.ll | 6 +- test/CodeGen/Mips/mips64lea.ll | 1 + test/CodeGen/Mips/mips64load-store-left-right.ll | 73 - test/CodeGen/Mips/mips64muldiv.ll | 56 +- test/CodeGen/Mips/mips64r6/compatibility.ll | 9 + test/CodeGen/Mips/mno-ldc1-sdc1.ll | 274 +- test/CodeGen/Mips/msa/2r_vector_scalar.ll | 69 +- test/CodeGen/Mips/msa/3r-s.ll | 86 +- test/CodeGen/Mips/msa/arithmetic_float.ll | 3 +- test/CodeGen/Mips/msa/basic_operations.ll | 388 +- test/CodeGen/Mips/msa/basic_operations_float.ll | 160 +- test/CodeGen/Mips/msa/bitwise.ll | 5 +- test/CodeGen/Mips/msa/compare.ll | 34 +- test/CodeGen/Mips/msa/compare_float.ll | 28 +- test/CodeGen/Mips/msa/elm_copy.ll | 136 +- test/CodeGen/Mips/msa/elm_insv.ll | 138 +- test/CodeGen/Mips/msa/elm_shift_slide.ll | 32 +- test/CodeGen/Mips/msa/frameindex.ll | 309 + .../Mips/msa/llvm-stress-s449609655-simplified.ll | 2 +- test/CodeGen/Mips/msa/shift-dagcombine.ll | 3 +- test/CodeGen/Mips/msa/shuffle.ll | 46 +- test/CodeGen/Mips/msa/special.ll | 44 +- test/CodeGen/Mips/msa/vec.ll | 168 +- test/CodeGen/Mips/nacl-align.ll | 96 + test/CodeGen/Mips/nacl-branch-delay.ll | 71 + test/CodeGen/Mips/nacl-reserved-regs.ll | 51 + test/CodeGen/Mips/no-odd-spreg.ll | 58 + test/CodeGen/Mips/nomips16.ll | 2 +- test/CodeGen/Mips/null-streamer.ll | 7 + test/CodeGen/Mips/null.ll | 2 +- test/CodeGen/Mips/o32_cc.ll | 288 +- test/CodeGen/Mips/octeon.ll | 29 + test/CodeGen/Mips/octeon_popcnt.ll | 47 + test/CodeGen/Mips/optimize-fp-math.ll | 1 + test/CodeGen/Mips/optimize-pic-o0.ll | 33 + test/CodeGen/Mips/powif64_16.ll | 2 +- test/CodeGen/Mips/prevent-hoisting.ll | 144 + test/CodeGen/Mips/remat-immed-load.ll | 1 + test/CodeGen/Mips/rotate.ll | 2 +- test/CodeGen/Mips/s2rem.ll | 92 + test/CodeGen/Mips/sel1c.ll | 2 +- test/CodeGen/Mips/sel2c.ll | 2 +- test/CodeGen/Mips/select.ll | 800 +- test/CodeGen/Mips/selectcc.ll | 14 +- test/CodeGen/Mips/sint-fp-store_pattern.ll | 1 + test/CodeGen/Mips/sr1.ll | 60 + test/CodeGen/Mips/start-asm-file.ll | 91 + test/CodeGen/Mips/tail16.ll | 20 + test/CodeGen/Mips/tls-alias.ll | 4 +- test/CodeGen/Mips/tls.ll | 6 +- test/CodeGen/Mips/trap1.ll | 2 +- test/CodeGen/Mips/unalignedload.ll | 82 +- test/CodeGen/Mips/zeroreg.ll | 98 +- test/CodeGen/NVPTX/access-non-generic.ll | 91 + test/CodeGen/NVPTX/addrspacecast-gvar.ll | 9 + test/CodeGen/NVPTX/addrspacecast.ll | 99 + test/CodeGen/NVPTX/aggr-param.ll | 20 + test/CodeGen/NVPTX/arg-lowering.ll | 13 + test/CodeGen/NVPTX/arithmetic-fp-sm20.ll | 12 +- test/CodeGen/NVPTX/arithmetic-int.ll | 26 +- test/CodeGen/NVPTX/atomics.ll | 182 + test/CodeGen/NVPTX/bfe.ll | 32 + test/CodeGen/NVPTX/bug17709.ll | 2 +- test/CodeGen/NVPTX/call-with-alloca-buffer.ll | 66 + test/CodeGen/NVPTX/compare-int.ll | 40 +- test/CodeGen/NVPTX/convert-fp.ll | 28 +- test/CodeGen/NVPTX/convert-int-sm20.ll | 8 +- test/CodeGen/NVPTX/div-ri.ll | 8 + test/CodeGen/NVPTX/envreg.ll | 139 + test/CodeGen/NVPTX/fma.ll | 4 +- test/CodeGen/NVPTX/fp-contract.ll | 33 + test/CodeGen/NVPTX/fp-literals.ll | 7 +- test/CodeGen/NVPTX/fp16.ll | 45 + test/CodeGen/NVPTX/gvar-init.ll | 5 + test/CodeGen/NVPTX/half.ll | 70 + test/CodeGen/NVPTX/imad.ll | 9 + test/CodeGen/NVPTX/implicit-def.ll | 2 +- test/CodeGen/NVPTX/inline-asm.ll | 7 + test/CodeGen/NVPTX/intrinsic-old.ll | 2 +- test/CodeGen/NVPTX/intrinsics.ll | 2 +- test/CodeGen/NVPTX/isspacep.ll | 35 + test/CodeGen/NVPTX/ld-addrspace.ll | 48 +- test/CodeGen/NVPTX/ld-generic.ll | 16 +- test/CodeGen/NVPTX/ldparam-v4.ll | 10 + test/CodeGen/NVPTX/ldu-i8.ll | 6 +- test/CodeGen/NVPTX/ldu-ldg.ll | 40 + test/CodeGen/NVPTX/ldu-reg-plus-offset.ll | 6 +- test/CodeGen/NVPTX/lit.local.cfg | 3 +- test/CodeGen/NVPTX/local-stack-frame.ll | 18 +- test/CodeGen/NVPTX/managed.ll | 11 + test/CodeGen/NVPTX/misaligned-vector-ldst.ll | 77 + test/CodeGen/NVPTX/mulwide.ll | 46 + test/CodeGen/NVPTX/noduplicate-syncthreads.ll | 74 + test/CodeGen/NVPTX/nvvm-reflect.ll | 16 +- test/CodeGen/NVPTX/pr13291-i1-store.ll | 4 +- test/CodeGen/NVPTX/rotate.ll | 58 + test/CodeGen/NVPTX/shift-parts.ll | 38 + test/CodeGen/NVPTX/st-addrspace.ll | 48 +- test/CodeGen/NVPTX/st-generic.ll | 16 +- test/CodeGen/NVPTX/surf-read-cuda.ll | 53 + test/CodeGen/NVPTX/surf-read.ll | 20 + test/CodeGen/NVPTX/surf-write-cuda.ll | 42 + test/CodeGen/NVPTX/surf-write.ll | 16 + test/CodeGen/NVPTX/symbol-naming.ll | 31 + test/CodeGen/NVPTX/tex-read-cuda.ll | 46 + test/CodeGen/NVPTX/tex-read.ll | 20 + test/CodeGen/NVPTX/texsurf-queries.ll | 103 + test/CodeGen/NVPTX/vec-param-load.ll | 6 +- test/CodeGen/NVPTX/vector-call.ll | 12 + test/CodeGen/NVPTX/weak-global.ll | 9 + test/CodeGen/NVPTX/weak-linkage.ll | 12 + .../PowerPC/2007-04-24-InlineAsm-I-Modifier.ll | 4 +- .../PowerPC/2007-05-03-InlineAsm-S-Constraint.ll | 2 +- .../CodeGen/PowerPC/2007-11-16-landingpad-split.ll | 3 +- test/CodeGen/PowerPC/2008-07-10-SplatMiscompile.ll | 1 - test/CodeGen/PowerPC/2008-12-12-EH.ll | 9 - test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll | 8 - test/CodeGen/PowerPC/Atomics-32.ll | 48 +- test/CodeGen/PowerPC/Atomics-64.ll | 32 +- test/CodeGen/PowerPC/Frames-alloca.ll | 8 +- test/CodeGen/PowerPC/Frames-large.ll | 16 +- test/CodeGen/PowerPC/Frames-small.ll | 16 +- test/CodeGen/PowerPC/aa-tbaa.ll | 41 + test/CodeGen/PowerPC/alias.ll | 31 + test/CodeGen/PowerPC/anon_aggr.ll | 28 +- test/CodeGen/PowerPC/atomic-1.ll | 3 +- test/CodeGen/PowerPC/atomic-2.ll | 3 +- test/CodeGen/PowerPC/available-externally.ll | 9 +- test/CodeGen/PowerPC/bdzlr.ll | 9 +- test/CodeGen/PowerPC/cc.ll | 4 +- test/CodeGen/PowerPC/coalesce-ext.ll | 2 +- test/CodeGen/PowerPC/complex-return.ll | 4 +- test/CodeGen/PowerPC/crash.ll | 17 + test/CodeGen/PowerPC/crbit-asm.ll | 59 + test/CodeGen/PowerPC/crbits.ll | 192 + test/CodeGen/PowerPC/ctrloop-large-ec.ll | 2 +- test/CodeGen/PowerPC/ctrloop-le.ll | 3 + test/CodeGen/PowerPC/ctrloop-lt.ll | 3 + test/CodeGen/PowerPC/ctrloop-sh.ll | 72 + test/CodeGen/PowerPC/dbg.ll | 5 +- test/CodeGen/PowerPC/early-ret2.ll | 8 +- test/CodeGen/PowerPC/fast-isel-conversion-p5.ll | 23 - test/CodeGen/PowerPC/fast-isel-conversion.ll | 104 + test/CodeGen/PowerPC/float-to-int.ll | 49 + test/CodeGen/PowerPC/fold-zero.ll | 13 +- test/CodeGen/PowerPC/func-addr.ll | 17 + test/CodeGen/PowerPC/hello-reloc.s | 68 +- test/CodeGen/PowerPC/i1-to-double.ll | 21 + test/CodeGen/PowerPC/i32-to-float.ll | 25 + test/CodeGen/PowerPC/i64-to-float.ll | 25 + test/CodeGen/PowerPC/indexed-load.ll | 22 + test/CodeGen/PowerPC/inlineasm-copy.ll | 2 +- test/CodeGen/PowerPC/jaggedstructs.ll | 2 +- test/CodeGen/PowerPC/lit.local.cfg | 3 +- test/CodeGen/PowerPC/lsa.ll | 2 +- test/CodeGen/PowerPC/mature-mc-support.ll | 27 + test/CodeGen/PowerPC/mcm-10.ll | 3 +- test/CodeGen/PowerPC/mcm-11.ll | 3 +- test/CodeGen/PowerPC/mcm-obj-2.ll | 4 +- test/CodeGen/PowerPC/named-reg-alloc-r0.ll | 15 + test/CodeGen/PowerPC/named-reg-alloc-r1-64.ll | 18 + test/CodeGen/PowerPC/named-reg-alloc-r1.ll | 20 + test/CodeGen/PowerPC/named-reg-alloc-r13-64.ll | 18 + test/CodeGen/PowerPC/named-reg-alloc-r13.ll | 18 + test/CodeGen/PowerPC/named-reg-alloc-r2-64.ll | 17 + test/CodeGen/PowerPC/named-reg-alloc-r2.ll | 18 + test/CodeGen/PowerPC/optcmp.ll | 2 +- test/CodeGen/PowerPC/ppc32-i1-vaarg.ll | 20 + test/CodeGen/PowerPC/ppc32-lshrti3.ll | 39 + test/CodeGen/PowerPC/ppc32-pic.ll | 21 + test/CodeGen/PowerPC/ppc32-vacopy.ll | 2 +- test/CodeGen/PowerPC/ppc64-altivec-abi.ll | 25 + test/CodeGen/PowerPC/ppc64-byval-align.ll | 56 + test/CodeGen/PowerPC/ppc64-calls.ll | 12 +- test/CodeGen/PowerPC/ppc64-smallarg.ll | 59 + test/CodeGen/PowerPC/ppc64le-aggregates.ll | 329 + test/CodeGen/PowerPC/ppc64le-calls.ll | 17 + test/CodeGen/PowerPC/ppc64le-crsave.ll | 28 + test/CodeGen/PowerPC/ppc64le-localentry.ll | 46 + test/CodeGen/PowerPC/ppc64le-smallarg.ll | 59 + test/CodeGen/PowerPC/ppcf128-endian.ll | 154 + test/CodeGen/PowerPC/pr17168.ll | 2 +- test/CodeGen/PowerPC/pr18663-2.ll | 153 + test/CodeGen/PowerPC/pr18663.ll | 298 + test/CodeGen/PowerPC/pr20442.ll | 79 + test/CodeGen/PowerPC/private.ll | 28 +- test/CodeGen/PowerPC/pwr7-gt-nop.ll | 31 + test/CodeGen/PowerPC/resolvefi-basereg.ll | 362 + test/CodeGen/PowerPC/resolvefi-disp.ll | 71 + test/CodeGen/PowerPC/rlwimi-and.ll | 2 +- test/CodeGen/PowerPC/rlwimi-dyn-and.ll | 48 + test/CodeGen/PowerPC/sdag-ppcf128.ll | 2 +- test/CodeGen/PowerPC/sections.ll | 4 + test/CodeGen/PowerPC/setcc_no_zext.ll | 4 + test/CodeGen/PowerPC/seteq-0.ll | 7 +- test/CodeGen/PowerPC/sjlj.ll | 4 +- test/CodeGen/PowerPC/splat-bug.ll | 18 + test/CodeGen/PowerPC/srl-mask.ll | 16 + test/CodeGen/PowerPC/stack-realign.ll | 53 +- test/CodeGen/PowerPC/stfiwx.ll | 35 +- test/CodeGen/PowerPC/structsinmem.ll | 2 +- test/CodeGen/PowerPC/structsinregs.ll | 2 +- test/CodeGen/PowerPC/subsumes-pred-regs.ll | 2 +- test/CodeGen/PowerPC/svr4-redzone.ll | 2 +- test/CodeGen/PowerPC/tls-2.ll | 15 - test/CodeGen/PowerPC/tls-gd.ll | 23 - test/CodeGen/PowerPC/tls-ie.ll | 22 - test/CodeGen/PowerPC/tls-ld-2.ll | 24 - test/CodeGen/PowerPC/tls-ld.ll | 24 - test/CodeGen/PowerPC/tls-pic.ll | 55 + test/CodeGen/PowerPC/tls.ll | 33 +- test/CodeGen/PowerPC/toc-load-sched-bug.ll | 534 + test/CodeGen/PowerPC/unaligned.ll | 8 +- test/CodeGen/PowerPC/unwind-dw2-g.ll | 2 +- test/CodeGen/PowerPC/varargs-struct-float.ll | 4 +- test/CodeGen/PowerPC/vec_cmp.ll | 118 +- test/CodeGen/PowerPC/vec_misaligned.ll | 10 +- test/CodeGen/PowerPC/vec_mul.ll | 17 + test/CodeGen/PowerPC/vec_shuffle_le.ll | 209 + test/CodeGen/PowerPC/vec_urem_const.ll | 13 + test/CodeGen/PowerPC/vperm-instcombine.ll | 17 + test/CodeGen/PowerPC/vperm-lowering.ll | 66 + test/CodeGen/PowerPC/vsx-args.ll | 26 + test/CodeGen/PowerPC/vsx-fma-m.ll | 238 + test/CodeGen/PowerPC/vsx-self-copy.ll | 27 + test/CodeGen/PowerPC/vsx-spill.ll | 49 + test/CodeGen/PowerPC/vsx.ll | 651 + test/CodeGen/PowerPC/vtable-reloc.ll | 11 + test/CodeGen/PowerPC/weak_def_can_be_hidden.ll | 24 +- test/CodeGen/R600/32-bit-local-address-space.ll | 64 +- test/CodeGen/R600/64bit-kernel-args.ll | 4 +- test/CodeGen/R600/add.ll | 127 +- test/CodeGen/R600/add_i64.ll | 39 +- test/CodeGen/R600/address-space.ll | 11 +- test/CodeGen/R600/and.ll | 115 +- test/CodeGen/R600/anyext.ll | 14 + test/CodeGen/R600/array-ptr-calc-i32.ll | 44 + test/CodeGen/R600/array-ptr-calc-i64.ll | 2 +- test/CodeGen/R600/atomic_cmp_swap_local.ll | 37 + test/CodeGen/R600/atomic_load_add.ll | 45 +- test/CodeGen/R600/atomic_load_sub.ll | 45 +- test/CodeGen/R600/basic-branch.ll | 15 + test/CodeGen/R600/basic-loop.ll | 18 + test/CodeGen/R600/bfi_int.ll | 2 +- test/CodeGen/R600/big_alu.ll | 12 +- test/CodeGen/R600/bitcast.ll | 67 +- test/CodeGen/R600/bswap.ll | 50 + test/CodeGen/R600/call.ll | 33 + test/CodeGen/R600/cayman-loop-bug.ll | 32 + test/CodeGen/R600/cf-stack-bug.ll | 227 + test/CodeGen/R600/codegen-prepare-addrmode-sext.ll | 19 + test/CodeGen/R600/concat_vectors.ll | 249 + test/CodeGen/R600/copy-illegal-type.ll | 166 + test/CodeGen/R600/ctlz_zero_undef.ll | 70 + test/CodeGen/R600/ctpop.ll | 284 + test/CodeGen/R600/ctpop64.ll | 122 + test/CodeGen/R600/cttz_zero_undef.ll | 70 + test/CodeGen/R600/cvt_f32_ubyte.ll | 175 + test/CodeGen/R600/default-fp-mode.ll | 29 + test/CodeGen/R600/elf.r600.ll | 2 +- test/CodeGen/R600/extload.ll | 94 +- test/CodeGen/R600/extract_vector_elt_i16.ll | 29 + test/CodeGen/R600/fabs.ll | 11 + test/CodeGen/R600/fadd.ll | 37 +- test/CodeGen/R600/fceil.ll | 131 + test/CodeGen/R600/fceil64.ll | 103 + test/CodeGen/R600/fcmp64.ll | 2 +- test/CodeGen/R600/fconst64.ll | 4 +- test/CodeGen/R600/fcopysign.f32.ll | 50 + test/CodeGen/R600/fcopysign.f64.ll | 37 + test/CodeGen/R600/fdiv.ll | 77 +- test/CodeGen/R600/ffloor.ll | 104 + test/CodeGen/R600/fma.ll | 72 +- test/CodeGen/R600/fnearbyint.ll | 57 + test/CodeGen/R600/fneg.ll | 13 +- test/CodeGen/R600/fp16_to_fp.ll | 28 + test/CodeGen/R600/fp32_to_fp16.ll | 14 + test/CodeGen/R600/fp_to_sint.ll | 213 +- test/CodeGen/R600/fp_to_uint.f64.ll | 9 + test/CodeGen/R600/fp_to_uint.ll | 210 +- test/CodeGen/R600/fsub64.ll | 7 +- test/CodeGen/R600/ftrunc.ll | 119 + test/CodeGen/R600/gep-address-space.ll | 16 +- test/CodeGen/R600/gv-const-addrspace-fail.ll | 58 + test/CodeGen/R600/gv-const-addrspace.ll | 97 + test/CodeGen/R600/half.ll | 61 + test/CodeGen/R600/icmp64.ll | 92 + test/CodeGen/R600/indirect-private-64.ll | 89 + test/CodeGen/R600/infinite-loop-evergreen.ll | 10 + test/CodeGen/R600/infinite-loop.ll | 17 + test/CodeGen/R600/input-mods.ll | 26 + test/CodeGen/R600/insert_vector_elt.ll | 203 +- test/CodeGen/R600/insert_vector_elt_f64.ll | 36 + test/CodeGen/R600/jump-address.ll | 2 +- test/CodeGen/R600/kernel-args.ll | 32 +- test/CodeGen/R600/large-alloca.ll | 14 + test/CodeGen/R600/large-constant-initializer.ll | 18 + test/CodeGen/R600/lds-output-queue.ll | 4 +- test/CodeGen/R600/lds-size.ll | 2 +- test/CodeGen/R600/lit.local.cfg | 3 +- test/CodeGen/R600/llvm.AMDGPU.abs.ll | 48 + test/CodeGen/R600/llvm.AMDGPU.barrier.global.ll | 28 + test/CodeGen/R600/llvm.AMDGPU.barrier.local.ll | 12 +- test/CodeGen/R600/llvm.AMDGPU.bfe.i32.ll | 426 + test/CodeGen/R600/llvm.AMDGPU.bfe.u32.ll | 554 + test/CodeGen/R600/llvm.AMDGPU.bfi.ll | 41 + test/CodeGen/R600/llvm.AMDGPU.bfm.ll | 40 + test/CodeGen/R600/llvm.AMDGPU.brev.ll | 27 + test/CodeGen/R600/llvm.AMDGPU.clamp.ll | 28 + test/CodeGen/R600/llvm.AMDGPU.cvt_f32_ubyte.ll | 42 + test/CodeGen/R600/llvm.AMDGPU.div_fixup.ll | 27 + test/CodeGen/R600/llvm.AMDGPU.div_fmas.ll | 27 + test/CodeGen/R600/llvm.AMDGPU.div_scale.ll | 48 + test/CodeGen/R600/llvm.AMDGPU.fract.ll | 27 + test/CodeGen/R600/llvm.AMDGPU.imad24.ll | 21 + test/CodeGen/R600/llvm.AMDGPU.imax.ll | 29 +- test/CodeGen/R600/llvm.AMDGPU.imin.ll | 29 +- test/CodeGen/R600/llvm.AMDGPU.imul24.ll | 15 + test/CodeGen/R600/llvm.AMDGPU.kill.ll | 12 +- test/CodeGen/R600/llvm.AMDGPU.legacy.rsq.ll | 13 + test/CodeGen/R600/llvm.AMDGPU.rcp.f64.ll | 30 + test/CodeGen/R600/llvm.AMDGPU.rcp.ll | 65 + test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.f64.ll | 11 + test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.ll | 14 + test/CodeGen/R600/llvm.AMDGPU.rsq.ll | 13 + test/CodeGen/R600/llvm.AMDGPU.trig_preop.ll | 29 + test/CodeGen/R600/llvm.AMDGPU.umad24.ll | 19 + test/CodeGen/R600/llvm.AMDGPU.umax.ll | 44 +- test/CodeGen/R600/llvm.AMDGPU.umin.ll | 44 +- test/CodeGen/R600/llvm.AMDGPU.umul24.ll | 17 + test/CodeGen/R600/llvm.SI.gather4.ll | 508 + test/CodeGen/R600/llvm.SI.getlod.ll | 44 + test/CodeGen/R600/llvm.SI.image.ll | 49 + test/CodeGen/R600/llvm.SI.image.sample.ll | 289 + test/CodeGen/R600/llvm.SI.image.sample.o.ll | 289 + test/CodeGen/R600/llvm.SI.sample-masked.ll | 16 +- test/CodeGen/R600/llvm.SI.sample.ll | 6 +- test/CodeGen/R600/llvm.SI.sampled.ll | 4 +- test/CodeGen/R600/llvm.SI.sendmsg.ll | 8 +- test/CodeGen/R600/llvm.SI.tbuffer.store.ll | 26 +- test/CodeGen/R600/llvm.amdgpu.dp4.ll | 11 + test/CodeGen/R600/llvm.amdgpu.kilp.ll | 20 + test/CodeGen/R600/llvm.amdgpu.lrp.ll | 12 + test/CodeGen/R600/llvm.cos.ll | 43 +- test/CodeGen/R600/llvm.exp2.ll | 79 + test/CodeGen/R600/llvm.log2.ll | 79 + test/CodeGen/R600/llvm.pow.ll | 29 +- test/CodeGen/R600/llvm.rint.f64.ll | 45 + test/CodeGen/R600/llvm.rint.ll | 77 +- test/CodeGen/R600/llvm.sin.ll | 66 +- test/CodeGen/R600/llvm.sqrt.ll | 2 +- test/CodeGen/R600/llvm.trunc.ll | 13 + test/CodeGen/R600/load-i1.ll | 107 + test/CodeGen/R600/load.ll | 187 +- test/CodeGen/R600/load64.ll | 20 +- test/CodeGen/R600/local-64.ll | 158 + test/CodeGen/R600/local-atomics.ll | 254 + test/CodeGen/R600/local-atomics64.ll | 251 + test/CodeGen/R600/local-memory-two-objects.ll | 15 +- test/CodeGen/R600/local-memory.ll | 8 +- test/CodeGen/R600/loop-idiom.ll | 54 + test/CodeGen/R600/mad_int24.ll | 17 +- test/CodeGen/R600/mad_uint24.ll | 73 +- test/CodeGen/R600/mubuf.ll | 98 + test/CodeGen/R600/mul.ll | 75 +- test/CodeGen/R600/mul_int24.ll | 17 +- test/CodeGen/R600/mul_uint24.ll | 69 +- test/CodeGen/R600/mulhu.ll | 2 +- .../R600/no-initializer-constant-addrspace.ll | 20 + test/CodeGen/R600/or.ll | 150 +- test/CodeGen/R600/parallelandifcollapse.ll | 6 + test/CodeGen/R600/parallelorifcollapse.ll | 5 + test/CodeGen/R600/private-memory-atomics.ll | 31 + test/CodeGen/R600/private-memory-broken.ll | 20 + test/CodeGen/R600/private-memory.ll | 236 +- test/CodeGen/R600/pv.ll | 6 +- ...-infinite-loop-bug-while-reorganizing-vector.ll | 59 + test/CodeGen/R600/register-count-comments.ll | 20 + test/CodeGen/R600/reorder-stores.ll | 104 + test/CodeGen/R600/rotl.i64.ll | 34 + test/CodeGen/R600/rotl.ll | 54 + test/CodeGen/R600/rotr.i64.ll | 58 + test/CodeGen/R600/rotr.ll | 67 +- test/CodeGen/R600/rsq.ll | 28 + test/CodeGen/R600/saddo.ll | 62 + test/CodeGen/R600/salu-to-valu.ll | 90 + test/CodeGen/R600/scalar_to_vector.ll | 80 + .../R600/schedule-vs-if-nested-loop-failure.ll | 162 + test/CodeGen/R600/sdiv.ll | 90 +- test/CodeGen/R600/select-i1.ll | 14 + test/CodeGen/R600/select-vectors.ll | 155 + test/CodeGen/R600/select.ll | 17 +- test/CodeGen/R600/select64.ll | 50 + test/CodeGen/R600/selectcc-opt.ll | 34 +- test/CodeGen/R600/selectcc.ll | 19 + test/CodeGen/R600/setcc-equivalent.ll | 31 + test/CodeGen/R600/setcc-opt.ll | 15 + test/CodeGen/R600/setcc.ll | 26 +- test/CodeGen/R600/setcc64.ll | 26 +- test/CodeGen/R600/seto.ll | 3 +- test/CodeGen/R600/setuo.ll | 3 +- test/CodeGen/R600/sext-in-reg.ll | 524 + test/CodeGen/R600/sgpr-control-flow.ll | 27 + test/CodeGen/R600/sgpr-copy-duplicate-operand.ll | 2 +- test/CodeGen/R600/sgpr-copy.ll | 6 +- test/CodeGen/R600/shl.ll | 117 +- test/CodeGen/R600/si-annotate-cf-assertion.ll | 3 +- test/CodeGen/R600/si-sgpr-spill.ll | 890 +- test/CodeGen/R600/sign_extend.ll | 63 +- .../R600/simplify-demanded-bits-build-pair.ll | 38 + test/CodeGen/R600/sint_to_fp.ll | 22 + test/CodeGen/R600/sint_to_fp64.ll | 32 +- test/CodeGen/R600/smrd.ll | 98 + test/CodeGen/R600/sra.ll | 130 + test/CodeGen/R600/srem.ll | 50 + test/CodeGen/R600/srl.ll | 126 + test/CodeGen/R600/ssubo.ll | 64 + test/CodeGen/R600/store-v3i32.ll | 12 + test/CodeGen/R600/store-v3i64.ll | 28 + test/CodeGen/R600/store-vector-ptrs.ll | 3 +- test/CodeGen/R600/store.ll | 92 +- test/CodeGen/R600/sub.ll | 71 +- test/CodeGen/R600/trunc-store-i1.ll | 32 + test/CodeGen/R600/trunc.ll | 29 +- test/CodeGen/R600/uaddo.ll | 69 + test/CodeGen/R600/udivrem.ll | 358 + test/CodeGen/R600/udivrem64.ll | 82 + test/CodeGen/R600/uint_to_fp.f64.ll | 36 + test/CodeGen/R600/uint_to_fp.ll | 76 +- test/CodeGen/R600/unaligned-load-store.ll | 2 +- .../R600/unhandled-loop-condition-assertion.ll | 114 + test/CodeGen/R600/unroll.ll | 37 + test/CodeGen/R600/usubo.ll | 66 + test/CodeGen/R600/v1i64-kernel-arg.ll | 17 + test/CodeGen/R600/v_cndmask.ll | 14 + test/CodeGen/R600/valu-i1.ll | 39 + test/CodeGen/R600/vector-alloca.ll | 75 + test/CodeGen/R600/vop-shrink.ll | 41 + test/CodeGen/R600/vtx-schedule.ll | 4 +- test/CodeGen/R600/work-item-intrinsics.ll | 26 +- test/CodeGen/R600/xor.ll | 104 +- test/CodeGen/R600/zero_extend.ll | 16 +- test/CodeGen/SPARC/2009-08-28-PIC.ll | 40 +- test/CodeGen/SPARC/2011-01-11-Call.ll | 8 +- test/CodeGen/SPARC/2011-01-11-FrameAddr.ll | 44 +- test/CodeGen/SPARC/2011-01-19-DelaySlot.ll | 27 +- test/CodeGen/SPARC/64abi.ll | 63 +- test/CodeGen/SPARC/64bit.ll | 32 +- test/CodeGen/SPARC/64cond.ll | 7 +- test/CodeGen/SPARC/64spill.ll | 116 + test/CodeGen/SPARC/atomics.ll | 155 + test/CodeGen/SPARC/constpool.ll | 16 +- test/CodeGen/SPARC/ctpop.ll | 25 +- test/CodeGen/SPARC/exception.ll | 85 +- test/CodeGen/SPARC/fp128.ll | 19 +- test/CodeGen/SPARC/globals.ll | 10 +- test/CodeGen/SPARC/inlineasm.ll | 45 + test/CodeGen/SPARC/leafproc.ll | 18 +- test/CodeGen/SPARC/lit.local.cfg | 3 +- test/CodeGen/SPARC/mature-mc-support.ll | 20 + test/CodeGen/SPARC/missinglabel.ll | 23 + test/CodeGen/SPARC/obj-relocs.ll | 31 + test/CodeGen/SPARC/parts.ll | 14 + test/CodeGen/SPARC/rem.ll | 4 +- test/CodeGen/SPARC/setjmp.ll | 2 +- test/CodeGen/SPARC/spillsize.ll | 25 + test/CodeGen/SPARC/sret-secondary.ll | 8 + test/CodeGen/SPARC/tls.ll | 54 +- test/CodeGen/SPARC/trap.ll | 11 + test/CodeGen/SystemZ/Large/branch-range-01.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-02.py | 2 +- test/CodeGen/SystemZ/Large/branch-range-03.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-04.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-05.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-06.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-09.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-10.py | 4 +- test/CodeGen/SystemZ/Large/branch-range-11.py | 8 +- test/CodeGen/SystemZ/Large/branch-range-12.py | 8 +- test/CodeGen/SystemZ/Large/lit.local.cfg | 3 +- test/CodeGen/SystemZ/atomic-load-01.ll | 5 +- test/CodeGen/SystemZ/atomic-load-02.ll | 5 +- test/CodeGen/SystemZ/atomic-load-03.ll | 8 +- test/CodeGen/SystemZ/atomic-load-04.ll | 8 +- test/CodeGen/SystemZ/atomic-store-01.ll | 5 +- test/CodeGen/SystemZ/atomic-store-02.ll | 5 +- test/CodeGen/SystemZ/atomic-store-03.ll | 8 +- test/CodeGen/SystemZ/atomic-store-04.ll | 8 +- test/CodeGen/SystemZ/atomicrmw-add-05.ll | 64 + test/CodeGen/SystemZ/atomicrmw-add-06.ll | 64 + test/CodeGen/SystemZ/atomicrmw-and-05.ll | 64 + test/CodeGen/SystemZ/atomicrmw-and-06.ll | 64 + test/CodeGen/SystemZ/atomicrmw-or-05.ll | 64 + test/CodeGen/SystemZ/atomicrmw-or-06.ll | 64 + test/CodeGen/SystemZ/atomicrmw-sub-05.ll | 69 + test/CodeGen/SystemZ/atomicrmw-sub-06.ll | 69 + test/CodeGen/SystemZ/atomicrmw-xor-05.ll | 64 + test/CodeGen/SystemZ/atomicrmw-xor-06.ll | 64 + test/CodeGen/SystemZ/cmpxchg-01.ll | 6 +- test/CodeGen/SystemZ/cmpxchg-02.ll | 6 +- test/CodeGen/SystemZ/cmpxchg-03.ll | 36 +- test/CodeGen/SystemZ/cmpxchg-04.ll | 27 +- test/CodeGen/SystemZ/cond-store-01.ll | 7 +- test/CodeGen/SystemZ/cond-store-02.ll | 7 +- test/CodeGen/SystemZ/cond-store-03.ll | 4 +- test/CodeGen/SystemZ/cond-store-04.ll | 4 +- test/CodeGen/SystemZ/fp-cmp-04.ll | 61 +- test/CodeGen/SystemZ/fp-conv-06.ll | 4 +- test/CodeGen/SystemZ/fp-conv-08.ll | 4 +- test/CodeGen/SystemZ/fp-conv-10.ll | 4 +- test/CodeGen/SystemZ/fp-conv-12.ll | 4 +- test/CodeGen/SystemZ/fp-conv-13.ll | 64 + test/CodeGen/SystemZ/fp-conv-14.ll | 63 + test/CodeGen/SystemZ/frame-08.ll | 4 +- test/CodeGen/SystemZ/frame-11.ll | 13 +- test/CodeGen/SystemZ/frame-13.ll | 13 +- test/CodeGen/SystemZ/frame-14.ll | 14 +- test/CodeGen/SystemZ/insert-06.ll | 14 + test/CodeGen/SystemZ/int-abs-01.ll | 64 + test/CodeGen/SystemZ/int-cmp-05.ll | 17 +- test/CodeGen/SystemZ/int-cmp-06.ll | 30 +- test/CodeGen/SystemZ/int-cmp-44.ll | 92 +- test/CodeGen/SystemZ/int-cmp-45.ll | 2 +- test/CodeGen/SystemZ/int-cmp-47.ll | 109 + test/CodeGen/SystemZ/int-neg-02.ll | 133 + test/CodeGen/SystemZ/lit.local.cfg | 3 +- test/CodeGen/SystemZ/mature-mc-support.ll | 15 + test/CodeGen/SystemZ/risbg-01.ll | 26 +- test/CodeGen/SystemZ/rnsbg-01.ll | 11 + test/CodeGen/SystemZ/rosbg-01.ll | 11 + test/CodeGen/SystemZ/rxsbg-01.ll | 11 + test/CodeGen/SystemZ/selectcc-01.ll | 178 + test/CodeGen/SystemZ/selectcc-02.ll | 178 + test/CodeGen/SystemZ/selectcc-03.ll | 187 + test/CodeGen/SystemZ/serialize-01.ll | 21 + test/CodeGen/SystemZ/shift-04.ll | 101 + test/CodeGen/SystemZ/shift-10.ll | 19 +- test/CodeGen/SystemZ/spill-01.ll | 2 +- test/CodeGen/Thumb/2009-06-18-ThumbCommuteMul.ll | 4 +- test/CodeGen/Thumb/2010-06-18-SibCallCrash.ll | 2 +- test/CodeGen/Thumb/2010-07-15-debugOrdering.ll | 2 +- .../Thumb/2014-06-10-thumb1-ldst-opt-bug.ll | 18 + test/CodeGen/Thumb/DbgValueOtherTargets.test | 2 +- test/CodeGen/Thumb/barrier.ll | 6 +- test/CodeGen/Thumb/cortex-m0-unaligned-access.ll | 13 + test/CodeGen/Thumb/fastcc.ll | 36 + test/CodeGen/Thumb/fpconv.ll | 2 +- test/CodeGen/Thumb/fpow.ll | 2 +- test/CodeGen/Thumb/inlineasm-imm-thumb.ll | 2 +- test/CodeGen/Thumb/inlineasm-thumb.ll | 3 +- test/CodeGen/Thumb/ispositive.ll | 2 +- test/CodeGen/Thumb/ldr_ext.ll | 4 +- test/CodeGen/Thumb/ldr_frame.ll | 2 +- test/CodeGen/Thumb/lit.local.cfg | 3 +- test/CodeGen/Thumb/long-setcc.ll | 9 +- test/CodeGen/Thumb/long.ll | 20 +- test/CodeGen/Thumb/long_shift.ll | 2 +- test/CodeGen/Thumb/mature-mc-support.ll | 12 + test/CodeGen/Thumb/mul.ll | 14 +- test/CodeGen/Thumb/rev.ll | 2 +- test/CodeGen/Thumb/segmented-stacks-dynamic.ll | 65 + test/CodeGen/Thumb/segmented-stacks.ll | 261 + test/CodeGen/Thumb/sjljehprepare-lower-vector.ll | 23 + .../Thumb/stack-coloring-without-frame-ptr.ll | 2 +- test/CodeGen/Thumb/stack-frame.ll | 5 +- test/CodeGen/Thumb/thumb-imm.ll | 6 +- test/CodeGen/Thumb/thumb-ldm.ll | 43 + test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll | 38 + test/CodeGen/Thumb/trap.ll | 2 +- test/CodeGen/Thumb/triple.ll | 7 + test/CodeGen/Thumb/tst_teq.ll | 5 +- test/CodeGen/Thumb/unord.ll | 11 +- test/CodeGen/Thumb/vargs.ll | 11 +- test/CodeGen/Thumb2/2009-08-01-WrongLDRBOpc.ll | 2 +- test/CodeGen/Thumb2/2009-08-06-SpDecBug.ll | 2 +- test/CodeGen/Thumb2/2009-09-28-ITBlockBug.ll | 2 +- test/CodeGen/Thumb2/2010-04-15-DynAllocBug.ll | 2 +- test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll | 2 +- test/CodeGen/Thumb2/2010-11-22-EpilogueBug.ll | 2 +- .../Thumb2/2011-06-07-TwoAddrEarlyClobber.ll | 2 +- .../Thumb2/2011-12-16-T2SizeReduceAssert.ll | 23 +- test/CodeGen/Thumb2/bfi.ll | 2 +- test/CodeGen/Thumb2/bfx.ll | 2 +- test/CodeGen/Thumb2/buildvector-crash.ll | 2 +- test/CodeGen/Thumb2/carry.ll | 2 +- test/CodeGen/Thumb2/cortex-fp.ll | 10 +- test/CodeGen/Thumb2/cross-rc-coalescing-2.ll | 2 +- test/CodeGen/Thumb2/div.ll | 8 +- test/CodeGen/Thumb2/ifcvt-neon.ll | 2 +- test/CodeGen/Thumb2/large-stack.ll | 6 +- test/CodeGen/Thumb2/ldr-str-imm12.ll | 2 +- test/CodeGen/Thumb2/lit.local.cfg | 3 +- test/CodeGen/Thumb2/longMACt.ll | 2 +- test/CodeGen/Thumb2/mul_const.ll | 2 +- test/CodeGen/Thumb2/segmented-stacks.ll | 34 + test/CodeGen/Thumb2/tail-call-r9.ll | 2 +- test/CodeGen/Thumb2/thumb2-adc.ll | 2 +- test/CodeGen/Thumb2/thumb2-add.ll | 2 +- test/CodeGen/Thumb2/thumb2-add2.ll | 2 +- test/CodeGen/Thumb2/thumb2-add3.ll | 2 +- test/CodeGen/Thumb2/thumb2-add4.ll | 2 +- test/CodeGen/Thumb2/thumb2-add5.ll | 2 +- test/CodeGen/Thumb2/thumb2-add6.ll | 2 +- test/CodeGen/Thumb2/thumb2-and.ll | 2 +- test/CodeGen/Thumb2/thumb2-and2.ll | 2 +- test/CodeGen/Thumb2/thumb2-asr.ll | 2 +- test/CodeGen/Thumb2/thumb2-asr2.ll | 2 +- test/CodeGen/Thumb2/thumb2-bcc.ll | 2 +- test/CodeGen/Thumb2/thumb2-bfc.ll | 2 +- test/CodeGen/Thumb2/thumb2-bic.ll | 2 +- test/CodeGen/Thumb2/thumb2-branch.ll | 2 +- test/CodeGen/Thumb2/thumb2-cbnz.ll | 2 +- test/CodeGen/Thumb2/thumb2-clz.ll | 2 +- test/CodeGen/Thumb2/thumb2-cmn.ll | 2 +- test/CodeGen/Thumb2/thumb2-cmn2.ll | 2 +- test/CodeGen/Thumb2/thumb2-cmp.ll | 2 +- test/CodeGen/Thumb2/thumb2-cmp2.ll | 2 +- test/CodeGen/Thumb2/thumb2-eor.ll | 2 +- test/CodeGen/Thumb2/thumb2-eor2.ll | 2 +- test/CodeGen/Thumb2/thumb2-ifcvt2.ll | 6 +- test/CodeGen/Thumb2/thumb2-ifcvt3.ll | 6 +- test/CodeGen/Thumb2/thumb2-jtb.ll | 2 +- test/CodeGen/Thumb2/thumb2-ldm.ll | 2 + test/CodeGen/Thumb2/thumb2-ldr.ll | 2 +- test/CodeGen/Thumb2/thumb2-ldr_ext.ll | 18 +- test/CodeGen/Thumb2/thumb2-ldr_post.ll | 2 +- test/CodeGen/Thumb2/thumb2-ldr_pre.ll | 12 +- test/CodeGen/Thumb2/thumb2-ldrb.ll | 2 +- test/CodeGen/Thumb2/thumb2-ldrh.ll | 2 +- test/CodeGen/Thumb2/thumb2-lsl.ll | 2 +- test/CodeGen/Thumb2/thumb2-lsl2.ll | 2 +- test/CodeGen/Thumb2/thumb2-lsr.ll | 2 +- test/CodeGen/Thumb2/thumb2-lsr2.ll | 2 +- test/CodeGen/Thumb2/thumb2-lsr3.ll | 2 +- test/CodeGen/Thumb2/thumb2-mla.ll | 5 +- test/CodeGen/Thumb2/thumb2-mls.ll | 2 +- test/CodeGen/Thumb2/thumb2-mov.ll | 2 +- test/CodeGen/Thumb2/thumb2-mul.ll | 2 +- test/CodeGen/Thumb2/thumb2-mulhi.ll | 2 +- test/CodeGen/Thumb2/thumb2-mvn.ll | 2 +- test/CodeGen/Thumb2/thumb2-mvn2.ll | 2 +- test/CodeGen/Thumb2/thumb2-neg.ll | 2 +- test/CodeGen/Thumb2/thumb2-orn.ll | 3 +- test/CodeGen/Thumb2/thumb2-orn2.ll | 3 +- test/CodeGen/Thumb2/thumb2-orr.ll | 2 +- test/CodeGen/Thumb2/thumb2-orr2.ll | 3 +- test/CodeGen/Thumb2/thumb2-pack.ll | 2 +- test/CodeGen/Thumb2/thumb2-rev.ll | 2 +- test/CodeGen/Thumb2/thumb2-rev16.ll | 2 +- test/CodeGen/Thumb2/thumb2-ror.ll | 4 +- test/CodeGen/Thumb2/thumb2-rsb.ll | 2 +- test/CodeGen/Thumb2/thumb2-rsb2.ll | 2 +- test/CodeGen/Thumb2/thumb2-sbc.ll | 2 +- test/CodeGen/Thumb2/thumb2-select.ll | 3 +- test/CodeGen/Thumb2/thumb2-select_xform.ll | 2 +- test/CodeGen/Thumb2/thumb2-shifter.ll | 4 +- test/CodeGen/Thumb2/thumb2-smla.ll | 4 +- test/CodeGen/Thumb2/thumb2-smul.ll | 2 +- test/CodeGen/Thumb2/thumb2-spill-q.ll | 2 +- test/CodeGen/Thumb2/thumb2-str.ll | 2 +- test/CodeGen/Thumb2/thumb2-str_post.ll | 2 +- test/CodeGen/Thumb2/thumb2-str_pre.ll | 2 +- test/CodeGen/Thumb2/thumb2-strb.ll | 2 +- test/CodeGen/Thumb2/thumb2-strh.ll | 2 +- test/CodeGen/Thumb2/thumb2-sub.ll | 2 +- test/CodeGen/Thumb2/thumb2-sub2.ll | 2 +- test/CodeGen/Thumb2/thumb2-sub3.ll | 2 +- test/CodeGen/Thumb2/thumb2-sub4.ll | 2 +- test/CodeGen/Thumb2/thumb2-sub5.ll | 3 +- test/CodeGen/Thumb2/thumb2-sxt-uxt.ll | 2 +- test/CodeGen/Thumb2/thumb2-sxt_rot.ll | 3 +- test/CodeGen/Thumb2/thumb2-teq.ll | 2 +- test/CodeGen/Thumb2/thumb2-teq2.ll | 2 +- test/CodeGen/Thumb2/thumb2-tst.ll | 2 +- test/CodeGen/Thumb2/thumb2-tst2.ll | 2 +- test/CodeGen/Thumb2/thumb2-uxt_rot.ll | 4 +- test/CodeGen/Thumb2/thumb2-uxtb.ll | 4 +- test/CodeGen/Thumb2/tls1.ll | 2 +- test/CodeGen/Thumb2/tls2.ll | 4 +- test/CodeGen/Thumb2/tpsoft.ll | 54 + test/CodeGen/Thumb2/v8_IT_3.ll | 8 +- test/CodeGen/Thumb2/v8_IT_5.ll | 7 +- test/CodeGen/Thumb2/v8_IT_6.ll | 100 + test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll | 2 +- test/CodeGen/X86/2006-07-20-InlineAsm.ll | 2 +- test/CodeGen/X86/2006-07-31-SingleRegClass.ll | 2 +- test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll | 10 +- test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll | 2 +- test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll | 2 +- test/CodeGen/X86/2007-05-05-Personality.ll | 17 +- test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll | 67 - test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll | 30 - test/CodeGen/X86/2007-10-17-IllegalAsm.ll | 87 - .../CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll | 2 +- test/CodeGen/X86/2007-11-04-LiveVariablesBug.ll | 2 +- .../X86/2007-11-04-rip-immediate-constant.ll | 2 +- test/CodeGen/X86/2008-02-06-LoadFoldingBug.ll | 3 +- test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll | 2 +- test/CodeGen/X86/2008-02-26-AsmDirectMemOp.ll | 2 +- test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll | 8 +- test/CodeGen/X86/2008-03-14-SpillerCrash.ll | 2 +- test/CodeGen/X86/2008-04-02-unnamedEH.ll | 6 +- test/CodeGen/X86/2008-04-08-CoalescerCrash.ll | 2 +- test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll | 2 +- test/CodeGen/X86/2008-08-31-EH_RETURN64.ll | 2 +- test/CodeGen/X86/2008-09-18-inline-asm-2.ll | 6 +- test/CodeGen/X86/2008-10-17-Asm64bitRConstraint.ll | 4 +- test/CodeGen/X86/2008-10-20-AsmDoubleInI32.ll | 4 +- test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll | 10 - .../X86/2009-02-12-InlineAsm-nieZ-constraints.ll | 2 +- test/CodeGen/X86/2009-04-13-2AddrAssert-2.ll | 2 +- test/CodeGen/X86/2009-05-08-InlineAsmIOffset.ll | 2 +- test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll | 4 +- test/CodeGen/X86/2009-08-23-linkerprivate.ll | 8 - test/CodeGen/X86/2009-09-19-earlyclobber.ll | 2 +- test/CodeGen/X86/2009-11-16-UnfoldMemOpBug.ll | 2 +- test/CodeGen/X86/2009-12-01-EarlyClobberBug.ll | 2 +- test/CodeGen/X86/2010-01-08-Atomic64Bug.ll | 4 +- .../X86/2010-05-05-LocalAllocEarlyClobber.ll | 2 +- test/CodeGen/X86/2010-05-26-DotDebugLoc.ll | 4 +- .../X86/2010-06-15-FastAllocEarlyCLobber.ll | 2 +- test/CodeGen/X86/2010-06-25-asm-RA-crash.ll | 2 +- .../CodeGen/X86/2010-06-28-FastAllocTiedOperand.ll | 2 +- .../CodeGen/X86/2010-06-28-matched-g-constraint.ll | 2 +- test/CodeGen/X86/2010-07-02-asm-alignstack.ll | 2 +- test/CodeGen/X86/2010-07-06-asm-RIP.ll | 2 +- test/CodeGen/X86/2010-07-13-indirectXconstraint.ll | 2 +- test/CodeGen/X86/2010-08-04-StackVariable.ll | 2 +- test/CodeGen/X86/2010-09-16-EmptyFilename.ll | 2 +- test/CodeGen/X86/2010-10-08-cmpxchg8b.ll | 3 +- test/CodeGen/X86/2010-12-02-MC-Set.ll | 27 - test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll | 20 +- test/CodeGen/X86/2011-05-09-loaduse.ll | 2 +- test/CodeGen/X86/2011-10-11-SpillDead.ll | 2 +- test/CodeGen/X86/2011-10-19-widen_vselect.ll | 18 +- test/CodeGen/X86/2011-12-28-vselecti8.ll | 19 +- test/CodeGen/X86/2012-08-17-legalizer-crash.ll | 2 +- test/CodeGen/X86/2012-11-30-handlemove-dbg.ll | 6 +- test/CodeGen/X86/2012-11-30-misched-dbg.ll | 23 +- .../X86/2013-10-14-FastISel-incorrect-vreg.ll | 8 +- test/CodeGen/X86/2014-05-29-factorial.ll | 24 + test/CodeGen/X86/2014-05-30-CombineAddNSW.ll | 20 + test/CodeGen/X86/3addr-16bit.ll | 6 +- test/CodeGen/X86/Atomics-64.ll | 62 +- test/CodeGen/X86/GC/lit.local.cfg | 3 +- test/CodeGen/X86/GC/ocaml-gc.ll | 6 +- test/CodeGen/X86/MachineBranchProb.ll | 34 + test/CodeGen/X86/MachineSink-DbgValue.ll | 4 +- test/CodeGen/X86/MergeConsecutiveStores.ll | 1 + test/CodeGen/X86/add-of-carry.ll | 2 +- .../X86/address-type-promotion-constantexpr.ll | 16 + test/CodeGen/X86/alias-error.ll | 5 - test/CodeGen/X86/aliases.ll | 31 +- test/CodeGen/X86/anyregcc-crash.ll | 4 +- test/CodeGen/X86/anyregcc.ll | 184 +- test/CodeGen/X86/asm-block-labels.ll | 2 +- test/CodeGen/X86/asm-global-imm.ll | 2 +- test/CodeGen/X86/atom-bypass-slow-division-64.ll | 4 +- test/CodeGen/X86/atom-cmpb.ll | 36 + test/CodeGen/X86/atom-fixup-lea4.ll | 23 + test/CodeGen/X86/atomic-load-store-wide.ll | 2 +- test/CodeGen/X86/atomic-minmax-i6432.ll | 65 +- test/CodeGen/X86/atomic-ops-ancient-64.ll | 44 + test/CodeGen/X86/atomic128.ll | 316 + test/CodeGen/X86/atomic16.ll | 79 +- test/CodeGen/X86/atomic32.ll | 82 +- test/CodeGen/X86/atomic64.ll | 43 +- test/CodeGen/X86/atomic6432.ll | 94 +- test/CodeGen/X86/atomic8.ll | 81 +- test/CodeGen/X86/atomic_op.ll | 21 +- test/CodeGen/X86/avoid_complex_am.ll | 40 + test/CodeGen/X86/avx-blend.ll | 120 +- test/CodeGen/X86/avx-cvt-2.ll | 43 + test/CodeGen/X86/avx-intel-ocl.ll | 62 +- test/CodeGen/X86/avx-intrinsics-x86.ll | 24 - test/CodeGen/X86/avx-shift.ll | 4 +- test/CodeGen/X86/avx-shuffle.ll | 43 +- test/CodeGen/X86/avx-splat.ll | 9 +- test/CodeGen/X86/avx-trunc.ll | 8 +- test/CodeGen/X86/avx-vbroadcast.ll | 63 + test/CodeGen/X86/avx-vperm2f128.ll | 2 +- test/CodeGen/X86/avx-vshufp.ll | 10 +- test/CodeGen/X86/avx-vzeroupper.ll | 37 +- test/CodeGen/X86/avx.ll | 136 + test/CodeGen/X86/avx1-logical-load-folding.ll | 60 + test/CodeGen/X86/avx2-blend.ll | 11 + test/CodeGen/X86/avx2-gather.ll | 16 + test/CodeGen/X86/avx2-intrinsics-x86.ll | 8 +- test/CodeGen/X86/avx2-shift.ll | 33 + test/CodeGen/X86/avx2-shuffle.ll | 18 + test/CodeGen/X86/avx2-vbroadcast.ll | 228 +- test/CodeGen/X86/avx2-vector-shifts.ll | 65 +- test/CodeGen/X86/avx512-arith.ll | 139 +- test/CodeGen/X86/avx512-build-vector.ll | 12 + test/CodeGen/X86/avx512-cmp.ll | 67 +- test/CodeGen/X86/avx512-cvt.ll | 74 +- test/CodeGen/X86/avx512-gather-scatter-intrin.ll | 206 +- test/CodeGen/X86/avx512-inc-dec.ll | 13 + test/CodeGen/X86/avx512-insert-extract.ll | 113 +- test/CodeGen/X86/avx512-intrinsics.ll | 495 +- test/CodeGen/X86/avx512-mask-op.ll | 49 +- test/CodeGen/X86/avx512-mov.ll | 60 +- test/CodeGen/X86/avx512-nontemporal.ll | 19 + test/CodeGen/X86/avx512-select.ll | 19 + test/CodeGen/X86/avx512-shuffle.ll | 110 +- test/CodeGen/X86/avx512-trunc-ext.ll | 31 +- test/CodeGen/X86/avx512-vbroadcast.ll | 19 +- test/CodeGen/X86/avx512-vec-cmp.ll | 87 +- test/CodeGen/X86/avx512-vselect-crash.ll | 11 + test/CodeGen/X86/avx512-zext-load-crash.ll | 14 + test/CodeGen/X86/barrier-sse.ll | 11 +- test/CodeGen/X86/blend-msb.ll | 31 +- test/CodeGen/X86/block-placement.ll | 2 +- test/CodeGen/X86/bmi.ll | 17 + test/CodeGen/X86/br-fold.ll | 18 +- test/CodeGen/X86/bswap-vector.ll | 166 +- test/CodeGen/X86/bt.ll | 2 +- test/CodeGen/X86/cache-intrinsic.ll | 26 + test/CodeGen/X86/call-imm.ll | 2 + test/CodeGen/X86/cas.ll | 2 +- test/CodeGen/X86/catch.ll | 21 + test/CodeGen/X86/cfi.ll | 27 + test/CodeGen/X86/cfstring.ll | 6 +- test/CodeGen/X86/cmov.ll | 4 +- test/CodeGen/X86/cmp.ll | 58 +- test/CodeGen/X86/cmpxchg-i1.ll | 87 + test/CodeGen/X86/cmpxchg-i128-i1.ll | 83 + test/CodeGen/X86/cmpxchg16b.ll | 2 +- test/CodeGen/X86/coalescer-remat.ll | 3 +- test/CodeGen/X86/codegen-prepare-addrmode-sext.ll | 323 + test/CodeGen/X86/codegen-prepare-cast.ll | 4 + test/CodeGen/X86/codegen-prepare-crash.ll | 14 + test/CodeGen/X86/codegen-prepare-extload.ll | 2 +- test/CodeGen/X86/codegen-prepare.ll | 1 + test/CodeGen/X86/coff-comdat.ll | 92 + test/CodeGen/X86/coff-comdat2.ll | 9 + test/CodeGen/X86/coff-comdat3.ll | 8 + test/CodeGen/X86/combine-64bit-vec-binop.ll | 273 + test/CodeGen/X86/combine-avx-intrinsics.ll | 119 + test/CodeGen/X86/combine-avx2-intrinsics.ll | 164 + test/CodeGen/X86/combine-or.ll | 281 + test/CodeGen/X86/combine-sse2-intrinsics.ll | 53 + test/CodeGen/X86/combine-sse41-intrinsics.ll | 182 + test/CodeGen/X86/combine-vec-shuffle-2.ll | 253 + test/CodeGen/X86/combine-vec-shuffle-3.ll | 380 + test/CodeGen/X86/combine-vec-shuffle-4.ll | 237 + test/CodeGen/X86/combine-vec-shuffle-5.ll | 257 + test/CodeGen/X86/combine-vec-shuffle.ll | 253 + test/CodeGen/X86/computeKnownBits_urem.ll | 14 + test/CodeGen/X86/const-base-addr.ll | 24 + .../X86/constant-hoisting-shift-immediate.ll | 25 + test/CodeGen/X86/constant-pool-remat-0.ll | 2 +- test/CodeGen/X86/constant-pool-sharing.ll | 11 +- test/CodeGen/X86/crash.ll | 6 +- test/CodeGen/X86/cse-add-with-overflow.ll | 43 + test/CodeGen/X86/ctpop-combine.ll | 2 +- test/CodeGen/X86/cvt16.ll | 89 + test/CodeGen/X86/dagcombine-and-setcc.ll | 47 + test/CodeGen/X86/darwin-no-dead-strip.ll | 12 +- .../X86/dbg-changes-codegen-branch-folding.ll | 109 + test/CodeGen/X86/dbg-changes-codegen.ll | 83 + test/CodeGen/X86/divide-by-constant.ll | 8 +- test/CodeGen/X86/dll-linkage.ll | 14 - test/CodeGen/X86/dllexport-x86_64.ll | 108 + test/CodeGen/X86/dllexport.ll | 130 +- test/CodeGen/X86/dllimport-x86_64.ll | 48 + test/CodeGen/X86/dllimport.ll | 59 + test/CodeGen/X86/dwarf-comp-dir.ll | 6 +- test/CodeGen/X86/dynamic-alloca-in-entry.ll | 19 + test/CodeGen/X86/elf-comdat.ll | 11 + test/CodeGen/X86/elf-comdat2.ll | 12 + test/CodeGen/X86/exedepsfix-broadcast.ll | 128 + test/CodeGen/X86/expand-opaque-const.ll | 21 + test/CodeGen/X86/extract-store.ll | 22 + test/CodeGen/X86/f16c-intrinsics.ll | 14 + test/CodeGen/X86/fast-isel-args-fail.ll | 2 +- test/CodeGen/X86/fast-isel-args-fail2.ll | 10 + test/CodeGen/X86/fast-isel-args.ll | 24 + test/CodeGen/X86/fast-isel-branch_weights.ll | 19 + test/CodeGen/X86/fast-isel-cmp-branch2.ll | 294 + test/CodeGen/X86/fast-isel-cmp-branch3.ll | 470 + test/CodeGen/X86/fast-isel-cmp.ll | 689 + test/CodeGen/X86/fast-isel-fold-mem.ll | 12 + test/CodeGen/X86/fast-isel-select-cmov.ll | 62 + test/CodeGen/X86/fast-isel-select-cmov2.ll | 255 + test/CodeGen/X86/fast-isel-select-cmp.ll | 50 + test/CodeGen/X86/fast-isel-select-pseudo-cmov.ll | 138 + test/CodeGen/X86/fast-isel-select-sse.ll | 391 + test/CodeGen/X86/fast-isel-select.ll | 16 + test/CodeGen/X86/fast-isel-sse12-fptoint.ll | 54 + test/CodeGen/X86/fast-isel-x86.ll | 6 +- test/CodeGen/X86/fast-isel.ll | 4 +- test/CodeGen/X86/fastcall-correct-mangling.ll | 25 +- test/CodeGen/X86/float-asmprint.ll | 5 +- test/CodeGen/X86/fma-do-not-commute.ll | 30 + test/CodeGen/X86/fma.ll | 33 + test/CodeGen/X86/fma3-intrinsics.ll | 4 +- test/CodeGen/X86/fold-call-oper.ll | 48 + test/CodeGen/X86/fold-load-vec.ll | 2 +- test/CodeGen/X86/fold-vector-sext-crash.ll | 12 + test/CodeGen/X86/fold-vector-sext-zext.ll | 291 + test/CodeGen/X86/fold-xmm-zero.ll | 2 +- test/CodeGen/X86/frameaddr.ll | 44 + test/CodeGen/X86/gcc_except_table.ll | 39 +- test/CodeGen/X86/global-sections.ll | 106 +- test/CodeGen/X86/haddsub-2.ll | 802 + test/CodeGen/X86/haddsub-undef.ll | 325 + test/CodeGen/X86/half.ll | 69 + test/CodeGen/X86/hidden-vis-pic.ll | 7 +- test/CodeGen/X86/i64-mem-copy.ll | 2 +- test/CodeGen/X86/i8-umulo.ll | 24 + test/CodeGen/X86/inalloca-ctor.ll | 34 + test/CodeGen/X86/inalloca-invoke.ll | 54 + test/CodeGen/X86/inalloca-stdcall.ll | 26 + test/CodeGen/X86/inalloca.ll | 65 + test/CodeGen/X86/indirect-hidden.ll | 43 + test/CodeGen/X86/inline-asm-flag-clobber.ll | 2 +- test/CodeGen/X86/inline-asm-fpstack.ll | 2 +- test/CodeGen/X86/inline-asm-h.ll | 2 +- test/CodeGen/X86/inline-asm-modifier-n.ll | 2 +- test/CodeGen/X86/inline-asm-modifier-q.ll | 2 +- test/CodeGen/X86/inline-asm-mrv.ll | 8 +- test/CodeGen/X86/inline-asm-q-regs.ll | 2 +- test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll | 17 + test/CodeGen/X86/inline-asm-stack-realign.ll | 16 + test/CodeGen/X86/inline-asm-stack-realign2.ll | 16 + test/CodeGen/X86/inline-asm-stack-realign3.ll | 29 + test/CodeGen/X86/inline-asm-tied.ll | 2 +- test/CodeGen/X86/inline-asm-x-scalar.ll | 2 +- test/CodeGen/X86/inline-asm.ll | 17 +- test/CodeGen/X86/ins_split_regalloc.ll | 33 + test/CodeGen/X86/isel-sink.ll | 1 + test/CodeGen/X86/jump_table_alias.ll | 33 + test/CodeGen/X86/jump_table_bitcast.ll | 46 + test/CodeGen/X86/jump_tables.ll | 272 + test/CodeGen/X86/large-constants.ll | 67 + test/CodeGen/X86/libcall-sret.ll | 28 + test/CodeGen/X86/lit.local.cfg | 5 +- test/CodeGen/X86/live-out-reg-info.ll | 2 +- test/CodeGen/X86/load-slice.ll | 2 +- test/CodeGen/X86/lower-bitcast.ll | 188 + test/CodeGen/X86/lower-vec-shift.ll | 125 + test/CodeGen/X86/lsr-interesting-step.ll | 14 +- test/CodeGen/X86/lsr-normalization.ll | 9 +- test/CodeGen/X86/lzcnt-tzcnt.ll | 447 + test/CodeGen/X86/machine-cp.ll | 26 +- test/CodeGen/X86/macho-comdat.ll | 6 + test/CodeGen/X86/masked-iv-safe.ll | 6 +- test/CodeGen/X86/mature-mc-support.ll | 18 + test/CodeGen/X86/memcmp.ll | 22 +- test/CodeGen/X86/memset-2.ll | 4 +- test/CodeGen/X86/merge_store.ll | 1 + test/CodeGen/X86/misched-aa-colored.ll | 189 + test/CodeGen/X86/misched-aa-mmos.ll | 37 + test/CodeGen/X86/misched-matmul.ll | 2 +- test/CodeGen/X86/mod128.ll | 26 + test/CodeGen/X86/movbe.ll | 45 +- test/CodeGen/X86/ms-inline-asm.ll | 35 +- test/CodeGen/X86/mul128_sext_loop.ll | 32 + test/CodeGen/X86/mult-alt-generic-i686.ll | 2 +- test/CodeGen/X86/mult-alt-generic-x86_64.ll | 2 +- test/CodeGen/X86/mult-alt-x86.ll | 2 +- test/CodeGen/X86/multiple-loop-post-inc.ll | 2 +- test/CodeGen/X86/musttail-indirect.ll | 124 + test/CodeGen/X86/musttail-thiscall.ll | 31 + test/CodeGen/X86/musttail.ll | 90 + test/CodeGen/X86/named-reg-alloc.ll | 14 + test/CodeGen/X86/named-reg-notareg.ll | 13 + test/CodeGen/X86/negate-add-zero.ll | 17 +- test/CodeGen/X86/no-cfi.ll | 34 - test/CodeGen/X86/no-elf-compact-unwind.ll | 48 - test/CodeGen/X86/nocx16.ll | 2 +- test/CodeGen/X86/null-streamer.ll | 18 + test/CodeGen/X86/opaque-constant-asm.ll | 13 + test/CodeGen/X86/osx-private-labels.ll | 71 + test/CodeGen/X86/patchpoint.ll | 76 +- test/CodeGen/X86/peep-test-4.ll | 76 +- test/CodeGen/X86/peephole-multiple-folds.ll | 29 + test/CodeGen/X86/personality.ll | 15 +- test/CodeGen/X86/personality_size.ll | 4 +- test/CodeGen/X86/pic.ll | 3 +- test/CodeGen/X86/pr10420.ll | 67 - test/CodeGen/X86/pr14090.ll | 70 - test/CodeGen/X86/pr1462.ll | 3 +- test/CodeGen/X86/pr16031.ll | 2 +- test/CodeGen/X86/pr19049.ll | 7 + test/CodeGen/X86/pr20020.ll | 73 + test/CodeGen/X86/pr20088.ll | 9 + test/CodeGen/X86/pr5145.ll | 16 +- test/CodeGen/X86/preserve_allcc64.ll | 104 + test/CodeGen/X86/preserve_mostcc64.ll | 86 + test/CodeGen/X86/private-2.ll | 2 +- test/CodeGen/X86/pshufd-combine-crash.ll | 14 + test/CodeGen/X86/ragreedy-bug.ll | 292 + test/CodeGen/X86/ragreedy-hoist-spill.ll | 389 + .../CodeGen/X86/ragreedy-last-chance-recoloring.ll | 181 + test/CodeGen/X86/rdpmc.ll | 22 + test/CodeGen/X86/rdtsc.ll | 53 +- test/CodeGen/X86/remat-invalid-liveness.ll | 85 + test/CodeGen/X86/ret-mmx.ll | 1 + test/CodeGen/X86/rot16.ll | 2 +- test/CodeGen/X86/rotate4.ll | 134 + test/CodeGen/X86/saddo-redundant-add.ll | 34 + test/CodeGen/X86/segmented-stacks-dynamic.ll | 12 +- test/CodeGen/X86/segmented-stacks.ll | 140 +- test/CodeGen/X86/select.ll | 8 + test/CodeGen/X86/setjmp-spills.ll | 141 + test/CodeGen/X86/shift-combine-crash.ll | 57 + test/CodeGen/X86/shift-double.ll | 2 +- test/CodeGen/X86/shift-parts.ll | 8 +- test/CodeGen/X86/shift-pcmp.ll | 30 + test/CodeGen/X86/shl_undef.ll | 6 +- test/CodeGen/X86/shrink-compare.ll | 8 +- test/CodeGen/X86/shuffle-combine-crash.ll | 30 + test/CodeGen/X86/sibcall-5.ll | 9 +- test/CodeGen/X86/sibcall.ll | 4 +- test/CodeGen/X86/sqrt.ll | 26 + test/CodeGen/X86/sse-scalar-fp-arith-2.ll | 423 + test/CodeGen/X86/sse-scalar-fp-arith.ll | 310 + test/CodeGen/X86/sse1.ll | 14 + test/CodeGen/X86/sse2-blend.ll | 22 +- test/CodeGen/X86/sse2-intrinsics-x86.ll | 34 + test/CodeGen/X86/sse2-vector-shifts.ll | 180 +- test/CodeGen/X86/sse2.ll | 24 +- test/CodeGen/X86/sse3-avx-addsub-2.ll | 318 + test/CodeGen/X86/sse3-avx-addsub.ll | 296 + test/CodeGen/X86/sse3.ll | 2 +- test/CodeGen/X86/sse41-blend.ll | 70 +- test/CodeGen/X86/sse41.ll | 487 +- test/CodeGen/X86/ssp-data-layout.ll | 510 + test/CodeGen/X86/stack-align-memcpy.ll | 27 +- test/CodeGen/X86/stack-protector-dbginfo.ll | 4 +- test/CodeGen/X86/stack-protector.ll | 597 +- test/CodeGen/X86/stackmap-fast-isel.ll | 165 + test/CodeGen/X86/stackmap-liveness.ll | 176 + test/CodeGen/X86/stackmap-nops.ll | 230 + test/CodeGen/X86/stackmap.ll | 333 +- test/CodeGen/X86/stackpointer.ll | 28 + test/CodeGen/X86/stdcall-notailcall.ll | 10 +- test/CodeGen/X86/stdcall.ll | 4 +- test/CodeGen/X86/sunkaddr-ext.ll | 26 + test/CodeGen/X86/swizzle-2.ll | 515 + test/CodeGen/X86/swizzle-avx2.ll | 91 + test/CodeGen/X86/tbm-intrinsics-x86_64.ll | 2 +- test/CodeGen/X86/testb-je-fusion.ll | 20 + test/CodeGen/X86/tls.ll | 87 + test/CodeGen/X86/v2f32.ll | 2 +- test/CodeGen/X86/v4i32load-crash.ll | 5 +- test/CodeGen/X86/vbinop-simplify-bug.ll | 23 + test/CodeGen/X86/vec_cast2.ll | 27 + test/CodeGen/X86/vec_extract-sse4.ll | 30 +- test/CodeGen/X86/vec_fabs.ll | 30 +- test/CodeGen/X86/vec_fpext.ll | 6 + test/CodeGen/X86/vec_return.ll | 2 +- test/CodeGen/X86/vec_round.ll | 2 +- test/CodeGen/X86/vec_setcc-2.ll | 96 + test/CodeGen/X86/vec_setcc.ll | 18 +- test/CodeGen/X86/vec_shift5.ll | 160 + test/CodeGen/X86/vec_shift6.ll | 134 + test/CodeGen/X86/vec_shuf-insert.ll | 29 + test/CodeGen/X86/vec_shuffle-40.ll | 22 + test/CodeGen/X86/vec_shuffle-41.ll | 21 + test/CodeGen/X86/vec_splat.ll | 16 + test/CodeGen/X86/vec_split.ll | 33 + test/CodeGen/X86/vector-gep.ll | 33 +- test/CodeGen/X86/vector-idiv.ll | 218 + test/CodeGen/X86/vector-shuffle-128-v16.ll | 196 + test/CodeGen/X86/vector-shuffle-128-v2.ll | 219 + test/CodeGen/X86/vector-shuffle-128-v4.ll | 170 + test/CodeGen/X86/vector-shuffle-128-v8.ll | 493 + test/CodeGen/X86/vector-shuffle-combining.ll | 119 + test/CodeGen/X86/viabs.ll | 87 + test/CodeGen/X86/vselect-2.ll | 33 + test/CodeGen/X86/vselect.ll | 278 + test/CodeGen/X86/vshift-6.ll | 36 + test/CodeGen/X86/warn-stack.ll | 2 +- test/CodeGen/X86/weak_def_can_be_hidden.ll | 24 +- test/CodeGen/X86/widen_cast-4.ll | 25 +- test/CodeGen/X86/widen_cast-6.ll | 6 +- test/CodeGen/X86/widen_conversions.ll | 18 + test/CodeGen/X86/widen_load-2.ll | 2 +- test/CodeGen/X86/widen_shuffle-1.ll | 4 +- test/CodeGen/X86/win32_sret.ll | 181 +- test/CodeGen/X86/win64_alloca_dynalloca.ll | 6 +- test/CodeGen/X86/win64_eh.ll | 170 + test/CodeGen/X86/win_chkstk.ll | 6 +- test/CodeGen/X86/win_cst_pool.ll | 66 + .../X86/x86-64-double-precision-shift-left.ll | 77 + .../X86/x86-64-double-precision-shift-right.ll | 74 + test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll | 67 + test/CodeGen/X86/x86-64-double-shifts-var.ll | 57 + test/CodeGen/X86/x86-64-frameaddr.ll | 15 - test/CodeGen/X86/x86-64-sret-return-2.ll | 18 + test/CodeGen/X86/x86-64-static-relo-movl.ll | 24 + test/CodeGen/X86/x86-frameaddr.ll | 9 - test/CodeGen/X86/x86-frameaddr2.ll | 9 - test/CodeGen/X86/x86-setcc-int-to-fp-combine.ll | 56 + test/CodeGen/X86/x86-shifts.ll | 2 +- test/CodeGen/X86/x86-upgrade-avx-vbroadcast.ll | 41 + test/CodeGen/X86/xaluo.ll | 743 + test/CodeGen/X86/zlib-longest-match.ll | 240 + test/CodeGen/XCore/align.ll | 15 + test/CodeGen/XCore/atomic.ll | 76 + test/CodeGen/XCore/bigstructret.ll | 39 +- test/CodeGen/XCore/byVal.ll | 2 +- test/CodeGen/XCore/call.ll | 10 + test/CodeGen/XCore/codemodel.ll | 213 + test/CodeGen/XCore/dwarf_debug.ll | 39 + test/CodeGen/XCore/epilogue_prologue.ll | 249 +- test/CodeGen/XCore/exception.ll | 3 +- test/CodeGen/XCore/globals.ll | 53 +- test/CodeGen/XCore/inline-asm.ll | 21 + test/CodeGen/XCore/linkage.ll | 12 + test/CodeGen/XCore/lit.local.cfg | 3 +- test/CodeGen/XCore/llvm-intrinsics.ll | 361 + test/CodeGen/XCore/load.ll | 2 +- test/CodeGen/XCore/memcpy.ll | 32 + test/CodeGen/XCore/resources.ll | 16 + test/CodeGen/XCore/resources_combine.ll | 93 + test/CodeGen/XCore/scavenging.ll | 69 +- test/DebugInfo/2009-11-05-DeadGlobalVariable.ll | 6 +- .../DebugInfo/2009-11-06-NamelessGlobalVariable.ll | 2 +- test/DebugInfo/2009-11-10-CurrentFn.ll | 2 +- test/DebugInfo/2010-01-19-DbgScope.ll | 35 - test/DebugInfo/2010-03-19-DbgDeclare.ll | 4 +- test/DebugInfo/2010-03-24-MemberFn.ll | 2 +- test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll | 20 +- test/DebugInfo/2010-04-19-FramePtr.ll | 4 +- test/DebugInfo/2010-05-10-MultipleCU.ll | 19 +- test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll | 9 +- test/DebugInfo/2010-07-19-Crash.ll | 2 +- test/DebugInfo/AArch64/cfi-frame.ll | 58 - test/DebugInfo/AArch64/dwarfdump.ll | 10 +- test/DebugInfo/AArch64/eh_frame.s | 4 +- test/DebugInfo/AArch64/eh_frame_personality.ll | 4 +- test/DebugInfo/AArch64/lit.local.cfg | 3 +- test/DebugInfo/AArch64/struct_by_value.ll | 70 + test/DebugInfo/AArch64/variable-loc.ll | 101 - test/DebugInfo/ARM/PR16736.ll | 2 +- test/DebugInfo/ARM/lit.local.cfg | 3 +- test/DebugInfo/ARM/sectionorder.ll | 17 + test/DebugInfo/ARM/tls.ll | 28 + test/DebugInfo/COFF/asan-module-ctor.ll | 91 + .../COFF/asan-module-without-functions.ll | 53 + test/DebugInfo/COFF/asm.ll | 184 + test/DebugInfo/COFF/lit.local.cfg | 2 + test/DebugInfo/COFF/multifile.ll | 257 + test/DebugInfo/COFF/multifunction.ll | 378 + test/DebugInfo/COFF/simple.ll | 167 + .../COFF/tail-call-without-lexical-scopes.ll | 78 + test/DebugInfo/Inputs/arange-overlap.cc | 26 + test/DebugInfo/Inputs/arange-overlap.elf-x86_64 | Bin 0 -> 9824 bytes test/DebugInfo/Inputs/arm-relocs.elf-arm | Bin 0 -> 3012 bytes test/DebugInfo/Inputs/dwarfdump-line-dwo.cc | 10 + .../DebugInfo/Inputs/dwarfdump-line-dwo.elf-x86-64 | Bin 0 -> 1377 bytes test/DebugInfo/Inputs/fission-ranges.cc | 17 + test/DebugInfo/Inputs/fission-ranges.elf-x86_64 | Bin 0 -> 8693 bytes test/DebugInfo/Inputs/llvm-symbolizer-dwo-test | Bin 0 -> 9579 bytes test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc | 18 + test/DebugInfo/Inputs/llvm-symbolizer-test.c | 18 + .../Inputs/llvm-symbolizer-test.elf-x86-64 | Bin 0 -> 10693 bytes .../Inputs/shared-object-stripped.elf-i386 | Bin 0 -> 1280 bytes test/DebugInfo/Mips/delay-slot.ll | 75 + test/DebugInfo/Mips/lit.local.cfg | 2 + test/DebugInfo/PR20038.ll | 168 + test/DebugInfo/PowerPC/lit.local.cfg | 3 +- test/DebugInfo/PowerPC/tls-fission.ll | 2 +- test/DebugInfo/PowerPC/tls.ll | 2 +- test/DebugInfo/Sparc/gnu-window-save.ll | 71 + test/DebugInfo/Sparc/lit.local.cfg | 2 + test/DebugInfo/SystemZ/eh_frame.s | 53 +- test/DebugInfo/SystemZ/eh_frame_personality.s | 4 +- test/DebugInfo/SystemZ/lit.local.cfg | 3 +- test/DebugInfo/SystemZ/variable-loc.ll | 29 +- test/DebugInfo/X86/2010-08-10-DbgConstant.ll | 3 +- test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll | 18 +- test/DebugInfo/X86/2011-12-16-BadStructRef.ll | 22 +- test/DebugInfo/X86/DW_AT_byte_size.ll | 6 +- test/DebugInfo/X86/DW_AT_linkage_name.ll | 116 + test/DebugInfo/X86/DW_AT_location-reference.ll | 48 +- test/DebugInfo/X86/DW_AT_object_pointer.ll | 5 +- test/DebugInfo/X86/DW_AT_specification.ll | 23 +- test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll | 11 +- test/DebugInfo/X86/DW_TAG_friend.ll | 4 +- test/DebugInfo/X86/aligned_stack_var.ll | 2 +- test/DebugInfo/X86/arange.ll | 46 + test/DebugInfo/X86/arguments.ll | 11 +- test/DebugInfo/X86/array.ll | 101 + test/DebugInfo/X86/array2.ll | 107 + test/DebugInfo/X86/block-capture.ll | 38 +- test/DebugInfo/X86/byvalstruct.ll | 5 +- test/DebugInfo/X86/c-type-units.ll | 29 + test/DebugInfo/X86/coff_debug_info_type.ll | 41 + test/DebugInfo/X86/coff_relative_names.ll | 6 +- test/DebugInfo/X86/concrete_out_of_line.ll | 59 +- test/DebugInfo/X86/cu-ranges-odr.ll | 96 + test/DebugInfo/X86/cu-ranges.ll | 73 + test/DebugInfo/X86/data_member_location.ll | 11 +- test/DebugInfo/X86/dbg-asm.s | 22 + test/DebugInfo/X86/dbg-at-specficiation.ll | 2 +- test/DebugInfo/X86/dbg-byval-parameter.ll | 2 +- test/DebugInfo/X86/dbg-const-int.ll | 10 +- test/DebugInfo/X86/dbg-const.ll | 2 +- test/DebugInfo/X86/dbg-declare-arg.ll | 2 +- test/DebugInfo/X86/dbg-declare.ll | 6 +- test/DebugInfo/X86/dbg-large-unsigned-const.ll | 62 - test/DebugInfo/X86/dbg-merge-loc-entry.ll | 2 +- test/DebugInfo/X86/dbg-subrange.ll | 8 +- test/DebugInfo/X86/dbg-value-const-byref.ll | 106 + test/DebugInfo/X86/dbg-value-inlined-parameter.ll | 50 +- test/DebugInfo/X86/dbg-value-isel.ll | 2 +- test/DebugInfo/X86/dbg-value-location.ll | 20 +- test/DebugInfo/X86/dbg-value-terminator.ll | 58 +- test/DebugInfo/X86/dbg_value_direct.ll | 5 +- test/DebugInfo/X86/debug-dead-local-var.ll | 51 + .../X86/debug-info-block-captured-self.ll | 26 +- test/DebugInfo/X86/debug-info-blocks.ll | 37 +- test/DebugInfo/X86/debug-info-static-member.ll | 42 +- test/DebugInfo/X86/debug-loc-asan.ll | 186 + test/DebugInfo/X86/debug-loc-offset.ll | 153 + test/DebugInfo/X86/debug-ranges-offset.ll | 241 + test/DebugInfo/X86/decl-derived-member.ll | 144 + test/DebugInfo/X86/discriminator.ll | 63 + .../DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll | 4 +- test/DebugInfo/X86/dwarf-aranges.ll | 21 +- test/DebugInfo/X86/dwarf-public-names.ll | 22 +- test/DebugInfo/X86/dwarf-pubnames-split.ll | 4 +- test/DebugInfo/X86/eh_symbol.ll | 24 - test/DebugInfo/X86/elf-names.ll | 12 +- test/DebugInfo/X86/empty-and-one-elem-array.ll | 2 +- test/DebugInfo/X86/empty-array.ll | 8 +- test/DebugInfo/X86/ending-run.ll | 12 +- test/DebugInfo/X86/enum-class.ll | 4 +- test/DebugInfo/X86/enum-fwd-decl.ll | 4 +- test/DebugInfo/X86/fission-cu.ll | 46 +- test/DebugInfo/X86/fission-hash.ll | 4 +- test/DebugInfo/X86/fission-ranges.ll | 59 +- test/DebugInfo/X86/formal_parameter.ll | 84 + test/DebugInfo/X86/generate-odr-hash.ll | 270 +- test/DebugInfo/X86/gnu-public-names-empty.ll | 6 +- test/DebugInfo/X86/gnu-public-names.ll | 289 +- test/DebugInfo/X86/inline-member-function.ll | 95 + test/DebugInfo/X86/inline-seldag-test.ll | 77 + test/DebugInfo/X86/instcombine-instrinsics.ll | 157 +- test/DebugInfo/X86/lexical_block.ll | 59 + test/DebugInfo/X86/line-info.ll | 4 +- test/DebugInfo/X86/linkage-name.ll | 12 +- test/DebugInfo/X86/lit.local.cfg | 3 +- test/DebugInfo/X86/low-pc-cu.ll | 40 +- test/DebugInfo/X86/misched-dbg-value.ll | 45 +- test/DebugInfo/X86/multiple-aranges.ll | 14 +- test/DebugInfo/X86/multiple-at-const-val.ll | 4 +- test/DebugInfo/X86/nondefault-subrange-array.ll | 10 +- test/DebugInfo/X86/objc-fwd-decl.ll | 4 +- test/DebugInfo/X86/objc-property-void.ll | 104 + test/DebugInfo/X86/op_deref.ll | 23 +- test/DebugInfo/X86/parameters.ll | 8 +- test/DebugInfo/X86/pointer-type-size.ll | 4 +- test/DebugInfo/X86/pr11300.ll | 17 +- test/DebugInfo/X86/pr12831.ll | 12 +- test/DebugInfo/X86/pr13303.ll | 2 +- test/DebugInfo/X86/pr19307.ll | 147 + test/DebugInfo/X86/pr9951.ll | 27 - test/DebugInfo/X86/prologue-stack.ll | 2 +- test/DebugInfo/X86/ref_addr_relocation.ll | 2 +- test/DebugInfo/X86/reference-argument.ll | 2 +- test/DebugInfo/X86/rvalue-ref.ll | 2 +- test/DebugInfo/X86/sret.ll | 393 + .../X86/stmt-list-multiple-compile-units.ll | 48 +- test/DebugInfo/X86/stmt-list.ll | 2 +- test/DebugInfo/X86/stringpool.ll | 4 +- test/DebugInfo/X86/struct-loc.ll | 4 +- test/DebugInfo/X86/subrange-type.ll | 2 +- test/DebugInfo/X86/subreg.ll | 6 +- test/DebugInfo/X86/subregisters.ll | 117 + test/DebugInfo/X86/template.ll | 4 +- test/DebugInfo/X86/tls-fission.ll | 32 - test/DebugInfo/X86/tls.ll | 119 +- test/DebugInfo/X86/type_units_with_addresses.ll | 151 + test/DebugInfo/X86/union-template.ll | 4 +- test/DebugInfo/X86/vector.ll | 4 +- test/DebugInfo/X86/vla.ll | 2 +- test/DebugInfo/arm-relocs.test | 5 + test/DebugInfo/array.ll | 2 +- test/DebugInfo/constant-pointers.ll | 51 + test/DebugInfo/cross-cu-inlining.ll | 130 + test/DebugInfo/cross-cu-linkonce.ll | 73 + test/DebugInfo/cu-line-tables.ll | 51 + test/DebugInfo/cu-range-hole.ll | 74 + test/DebugInfo/cu-ranges.ll | 71 + test/DebugInfo/dead-argument-order.ll | 81 + test/DebugInfo/debug-info-qualifiers.ll | 100 + test/DebugInfo/dwarf-public-names.ll | 22 +- test/DebugInfo/dwarfdump-inlining.test | 28 - test/DebugInfo/dwarfdump-line-dwo.test | 6 + test/DebugInfo/dwarfdump-ranges.test | 10 + test/DebugInfo/dwarfdump-test.test | 56 - test/DebugInfo/dwarfdump-zlib.test | 12 +- test/DebugInfo/empty.ll | 31 + test/DebugInfo/enum.ll | 4 +- test/DebugInfo/global.ll | 7 +- test/DebugInfo/incorrect-variable-debugloc.ll | 391 + test/DebugInfo/inline-no-debug-info.ll | 69 + test/DebugInfo/inline-scopes.ll | 130 + test/DebugInfo/inlined-arguments.ll | 10 +- test/DebugInfo/inlined-vars.ll | 12 +- test/DebugInfo/llvm-symbolizer-zlib.test | 7 + test/DebugInfo/llvm-symbolizer.test | 92 +- test/DebugInfo/lto-comp-dir.ll | 84 + test/DebugInfo/member-order.ll | 4 +- test/DebugInfo/member-pointers.ll | 6 +- test/DebugInfo/missing-abstract-variable.ll | 191 + test/DebugInfo/namespace.ll | 52 +- test/DebugInfo/namespace_function_definition.ll | 44 + .../namespace_inline_function_definition.ll | 92 + test/DebugInfo/restrict.ll | 53 + test/DebugInfo/sugared-constants.ll | 82 + test/DebugInfo/template-recursive-void.ll | 4 +- test/DebugInfo/tu-composite.ll | 4 +- test/DebugInfo/tu-member-pointer.ll | 4 +- test/DebugInfo/two-cus-from-same-file.ll | 7 +- test/DebugInfo/typedef.ll | 32 + test/DebugInfo/unconditional-branch.ll | 64 + test/DebugInfo/varargs.ll | 99 + test/DebugInfo/version.ll | 4 +- test/ExecutionEngine/MCJIT/eh-lg-pic.ll | 2 +- test/ExecutionEngine/MCJIT/lit.local.cfg | 4 +- test/ExecutionEngine/MCJIT/load-object-a.ll | 24 + .../MCJIT/non-extern-addend-smallcodemodel.ll | 25 + test/ExecutionEngine/MCJIT/non-extern-addend.ll | 21 +- .../MCJIT/remote/Inputs/cross-module-b.ll | 2 +- .../MCJIT/remote/Inputs/multi-module-b.ll | 2 +- .../MCJIT/remote/Inputs/multi-module-c.ll | 2 +- .../ExecutionEngine/MCJIT/remote/cross-module-a.ll | 7 +- .../MCJIT/remote/cross-module-sm-pic-a.ll | 2 +- test/ExecutionEngine/MCJIT/remote/lit.local.cfg | 7 +- .../ExecutionEngine/MCJIT/remote/multi-module-a.ll | 4 +- .../MCJIT/remote/multi-module-sm-pic-a.ll | 2 +- .../MCJIT/remote/simpletest-remote.ll | 6 +- test/ExecutionEngine/MCJIT/remote/stubs-remote.ll | 2 +- .../MCJIT/remote/test-common-symbols-remote.ll | 2 +- .../MCJIT/remote/test-data-align-remote.ll | 4 +- .../remote/test-fp-no-external-funcs-remote.ll | 6 +- .../remote/test-global-init-nonzero-remote.ll | 4 +- .../MCJIT/remote/test-ptr-reloc-remote.ll | 2 +- .../RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s | 27 + test/ExecutionEngine/RuntimeDyld/ARM/lit.local.cfg | 3 + .../RuntimeDyld/Inputs/arm_secdiff_reloc.o | Bin 616 -> 0 bytes .../RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s | 32 + test/ExecutionEngine/RuntimeDyld/X86/lit.local.cfg | 3 + .../RuntimeDyld/arm_secdiff_reloc.test | 1 - test/ExecutionEngine/lit.local.cfg | 8 + test/Feature/alias2.ll | 28 + test/Feature/aliases.ll | 15 +- test/Feature/comdat.ll | 21 + test/Feature/globalvars.ll | 2 + test/Feature/instructions.ll | 2 + test/Feature/intrinsic-noduplicate.ll | 9 + test/Feature/intrinsics.ll | 5 +- test/Feature/linker_private_linkages.ll | 6 - test/Feature/optnone-llc.ll | 54 + test/Feature/optnone-opt.ll | 74 + .../check-multiple-prefixes-nomatch-2.txt | 10 + test/FileCheck/implicit-check-not.txt | 44 + .../AddressSanitizer/X86/asm_attr.ll | 20 + .../AddressSanitizer/X86/asm_mov.ll | 146 + .../Instrumentation/AddressSanitizer/X86/asm_mov.s | 64 + .../X86/asm_mov_no_instrumentation.s | 24 + .../AddressSanitizer/X86/asm_swap_intel.s | 59 + .../AddressSanitizer/X86/bug_11395.ll | 2 +- .../AddressSanitizer/X86/lit.local.cfg | 3 +- .../AddressSanitizer/asan-vs-gvn.ll | 2 +- test/Instrumentation/AddressSanitizer/basic.ll | 68 +- .../AddressSanitizer/coverage-dbg.ll | 67 + test/Instrumentation/AddressSanitizer/coverage.ll | 65 +- .../Instrumentation/AddressSanitizer/debug_info.ll | 7 +- .../AddressSanitizer/different_scale_and_offset.ll | 41 - .../do-not-instrument-internal-globals.ll | 6 +- .../do-not-instrument-llvm-metadata.ll | 12 + .../AddressSanitizer/do-not-touch-comdat-global.ll | 14 + .../AddressSanitizer/do-not-touch-odr-global.ll | 11 +- .../AddressSanitizer/do-not-touch-threadlocal.ll | 4 +- test/Instrumentation/AddressSanitizer/freebsd.ll | 29 + .../AddressSanitizer/global_metadata.ll | 71 + .../AddressSanitizer/instrument-no-return.ll | 2 +- .../AddressSanitizer/instrument_global.ll | 5 +- .../instrument_initializer_metadata.ll | 10 +- .../AddressSanitizer/instrument_load_then_store.ll | 4 +- .../instrumentation-with-call-threshold.ll | 30 + .../keep-instrumented_functions.ll | 2 +- .../AddressSanitizer/lifetime-uar.ll | 2 +- test/Instrumentation/AddressSanitizer/lifetime.ll | 2 +- .../AddressSanitizer/stack-poisoning.ll | 43 + .../AddressSanitizer/stack_layout.ll | 49 + test/Instrumentation/AddressSanitizer/test64.ll | 18 +- test/Instrumentation/AddressSanitizer/ubsan.ll | 52 + test/Instrumentation/BoundsChecking/phi.ll | 55 +- test/Instrumentation/BoundsChecking/simple.ll | 24 +- test/Instrumentation/DataFlowSanitizer/load.ll | 188 +- .../DataFlowSanitizer/prefix-rename.ll | 8 + test/Instrumentation/DataFlowSanitizer/store.ll | 179 +- test/Instrumentation/DataFlowSanitizer/union.ll | 52 + test/Instrumentation/MemorySanitizer/atomics.ll | 16 +- .../MemorySanitizer/check_access_address.ll | 28 + .../MemorySanitizer/do-not-emit-module-limits.ll | 21 + .../instrumentation-with-call-threshold.ll | 53 + .../MemorySanitizer/missing_origin.ll | 19 + test/Instrumentation/MemorySanitizer/msan_basic.ll | 243 +- .../MemorySanitizer/mul_by_constant.ll | 94 + .../MemorySanitizer/store-origin.ll | 73 + .../MemorySanitizer/vector_arith.ll | 65 + .../Instrumentation/MemorySanitizer/vector_pack.ll | 60 + .../MemorySanitizer/vector_shift.ll | 100 + .../MemorySanitizer/wrap_indirect_calls.ll | 32 +- test/Instrumentation/ThreadSanitizer/atomic.ll | 50 +- test/Instrumentation/ThreadSanitizer/tsan_basic.ll | 6 +- .../Instrumentation/ThreadSanitizer/vptr_update.ll | 27 + test/LTO/attrs.ll | 15 + test/LTO/current-section.ll | 4 + test/LTO/jump-table-type.ll | 23 + test/LTO/keep-used-puts-during-instcombine.ll | 36 + test/LTO/linkonce_odr_func.ll | 8 +- test/LTO/lit.local.cfg | 3 +- test/LTO/no-undefined-puts-when-implemented.ll | 40 + test/LTO/private-symbol.ll | 7 + test/LTO/symver-asm.ll | 16 + test/LTO/triple-init.ll | 16 + test/Linker/2011-08-22-ResolveAlias2.ll | 108 +- test/Linker/Inputs/alias.ll | 3 + test/Linker/Inputs/comdat.ll | 20 + test/Linker/Inputs/comdat2.ll | 2 + test/Linker/Inputs/comdat3.ll | 2 + test/Linker/Inputs/comdat4.ll | 5 + test/Linker/Inputs/comdat5.ll | 15 + test/Linker/Inputs/datalayout-a.ll | 1 + test/Linker/Inputs/datalayout-b.ll | 1 + test/Linker/Inputs/old_global_ctors.3.4.bc | Bin 0 -> 368 bytes test/Linker/Inputs/targettriple-a.ll | 1 + test/Linker/Inputs/targettriple-b.ll | 1 + test/Linker/Inputs/type-unique-simple2-a.ll | 2 +- test/Linker/Inputs/type-unique-simple2-b.ll | 2 +- test/Linker/alias.ll | 16 + test/Linker/comdat.ll | 32 + test/Linker/comdat2.ll | 7 + test/Linker/comdat3.ll | 5 + test/Linker/comdat4.ll | 5 + test/Linker/comdat5.ll | 7 + test/Linker/comdat6.ll | 13 + test/Linker/comdat7.ll | 9 + test/Linker/comdat8.ll | 10 + test/Linker/datalayout.ll | 14 + test/Linker/debug-info-version-a.ll | 16 + test/Linker/debug-info-version-b.ll | 10 + test/Linker/dllstorage-a.ll | 4 + test/Linker/dllstorage-b.ll | 3 + test/Linker/func-attrs-a.ll | 14 + test/Linker/func-attrs-b.ll | 8 + test/Linker/global_ctors.ll | 29 + test/Linker/targettriple.ll | 14 + test/Linker/type-unique-odr-a.ll | 102 + test/Linker/type-unique-odr-b.ll | 86 + test/Linker/type-unique-simple-a.ll | 4 +- test/Linker/type-unique-simple-b.ll | 2 +- test/Linker/type-unique-simple2-a.ll | 129 + test/Linker/type-unique-simple2-b.ll | 88 + test/Linker/type-unique-simple2.ll | 2 +- test/Linker/unnamed-addr1-a.ll | 11 + test/Linker/unnamed-addr1-b.ll | 6 + test/MC/AArch64/alias-logicalimm.s | 41 + test/MC/AArch64/arm64-adr.s | 31 + test/MC/AArch64/arm64-advsimd.s | 1997 + test/MC/AArch64/arm64-aliases.s | 753 + test/MC/AArch64/arm64-arithmetic-encoding.s | 615 + test/MC/AArch64/arm64-arm64-fixup.s | 10 + test/MC/AArch64/arm64-basic-a64-instructions.s | 18 + test/MC/AArch64/arm64-be-datalayout.s | 4 + test/MC/AArch64/arm64-bitfield-encoding.s | 38 + test/MC/AArch64/arm64-branch-encoding.s | 159 + test/MC/AArch64/arm64-condbr-without-dots.s | 37 + test/MC/AArch64/arm64-crypto.s | 66 + test/MC/AArch64/arm64-diagno-predicate.s | 24 + test/MC/AArch64/arm64-diags.s | 428 + test/MC/AArch64/arm64-directive_loh.s | 93 + test/MC/AArch64/arm64-elf-reloc-condbr.s | 10 + test/MC/AArch64/arm64-elf-relocs.s | 249 + test/MC/AArch64/arm64-fp-encoding.s | 443 + test/MC/AArch64/arm64-large-relocs.s | 38 + test/MC/AArch64/arm64-leaf-compact-unwind.s | 208 + test/MC/AArch64/arm64-logical-encoding.s | 224 + test/MC/AArch64/arm64-mapping-across-sections.s | 28 + test/MC/AArch64/arm64-mapping-within-section.s | 23 + test/MC/AArch64/arm64-memory.s | 634 + test/MC/AArch64/arm64-nv-cond.s | 11 + test/MC/AArch64/arm64-optional-hash.s | 31 + test/MC/AArch64/arm64-separator.s | 20 + test/MC/AArch64/arm64-simd-ldst.s | 2404 + test/MC/AArch64/arm64-small-data-fixups.s | 24 + test/MC/AArch64/arm64-spsel-sysreg.s | 24 + test/MC/AArch64/arm64-system-encoding.s | 623 + test/MC/AArch64/arm64-target-specific-sysreg.s | 10 + test/MC/AArch64/arm64-tls-modifiers-darwin.s | 13 + test/MC/AArch64/arm64-tls-relocs.s | 320 + test/MC/AArch64/arm64-v128_lo-diagnostics.s | 11 + test/MC/AArch64/arm64-variable-exprs.s | 40 + test/MC/AArch64/arm64-vector-lists.s | 20 + test/MC/AArch64/arm64-verbose-vector-case.s | 19 + test/MC/AArch64/basic-a64-diagnostics.s | 912 +- test/MC/AArch64/basic-a64-instructions.s | 1848 +- test/MC/AArch64/dot-req-case-insensitive.s | 18 + test/MC/AArch64/dot-req-diagnostics.s | 37 + test/MC/AArch64/dot-req.s | 37 + test/MC/AArch64/elf-globaladdress.ll | 2 +- test/MC/AArch64/elf-reloc-addend.s | 8 - test/MC/AArch64/elf-reloc-condbr.s | 10 - test/MC/AArch64/gicv3-regs.s | 220 +- test/MC/AArch64/ldr-pseudo-diagnostics.s | 14 + test/MC/AArch64/ldr-pseudo-obj-errors.s | 13 + test/MC/AArch64/ldr-pseudo.s | 319 + test/MC/AArch64/lit.local.cfg | 5 +- test/MC/AArch64/neon-2velem.s | 2 +- test/MC/AArch64/neon-3vdiff.s | 2 +- test/MC/AArch64/neon-across.s | 2 +- test/MC/AArch64/neon-compare-instructions.s | 100 +- test/MC/AArch64/neon-crypto.s | 5 +- test/MC/AArch64/neon-diagnostics.s | 740 +- test/MC/AArch64/neon-extract.s | 6 +- test/MC/AArch64/neon-mov.s | 143 +- test/MC/AArch64/neon-perm.s | 2 +- test/MC/AArch64/neon-scalar-compare.s | 10 +- test/MC/AArch64/neon-scalar-dup.s | 44 +- test/MC/AArch64/neon-scalar-fp-compare.s | 20 + test/MC/AArch64/neon-simd-copy.s | 72 +- test/MC/AArch64/neon-simd-ldst-multi-elem.s | 786 +- test/MC/AArch64/neon-simd-ldst-one-elem.s | 514 +- test/MC/AArch64/neon-simd-misc.s | 6 +- test/MC/AArch64/neon-simd-post-ldst-multi-elem.s | 426 +- test/MC/AArch64/neon-sxtl.s | 26 + test/MC/AArch64/neon-tbl.s | 97 +- test/MC/AArch64/neon-uxtl.s | 26 + test/MC/AArch64/noneon-diagnostics.s | 13 +- test/MC/AArch64/optional-hash.s | 17 + test/MC/AArch64/tls-relocs.s | 301 +- test/MC/AArch64/trace-regs.s | 765 +- .../MC/ARM/2013-03-18-Br-to-label-named-like-reg.s | 5 +- test/MC/ARM/AlignedBundling/lit.local.cfg | 3 +- test/MC/ARM/Windows/mov32t-range.s | 37 + test/MC/ARM/Windows/multiple-text-sections.s | 58 + test/MC/ARM/Windows/text-attributes.s | 30 + test/MC/ARM/arm-elf-symver.s | 143 + test/MC/ARM/arm-ldrd.s | 2 +- test/MC/ARM/arm-memory-instructions.s | 11 + test/MC/ARM/arm-qualifier-diagnostics.s | 15 + test/MC/ARM/arm-thumb-cpus-default.s | 23 +- test/MC/ARM/arm-thumb-cpus.s | 23 +- test/MC/ARM/arm_addrmode2.s | 8 + test/MC/ARM/arm_fixups.s | 16 +- test/MC/ARM/arm_word_directive.s | 6 - test/MC/ARM/basic-arm-instructions.s | 21 +- test/MC/ARM/basic-thumb-instructions.s | 25 +- test/MC/ARM/basic-thumb2-instructions.s | 60 +- test/MC/ARM/big-endian-arm-fixup.s | 107 + test/MC/ARM/big-endian-thumb-fixup.s | 63 + test/MC/ARM/big-endian-thumb2-fixup.s | 49 + test/MC/ARM/bkpt.s | 32 + test/MC/ARM/cmp-immediate-fixup-error.s | 7 + test/MC/ARM/cmp-immediate-fixup-error2.s | 7 + test/MC/ARM/cmp-immediate-fixup.s | 9 + test/MC/ARM/cmp-immediate-fixup2.s | 9 + test/MC/ARM/coff-debugging-secrel.ll | 49 + test/MC/ARM/coff-file.s | 47 + test/MC/ARM/coff-function-type-info.ll | 45 + test/MC/ARM/coff-relocations.s | 101 + test/MC/ARM/comment.s | 47 + test/MC/ARM/complex-operands.s | 40 + test/MC/ARM/data-in-code.ll | 10 + test/MC/ARM/diagnostics.s | 26 + test/MC/ARM/directive-align.s | 28 + test/MC/ARM/directive-arch-armv2.s | 30 + test/MC/ARM/directive-arch-armv2a.s | 30 + test/MC/ARM/directive-arch-armv3.s | 30 + test/MC/ARM/directive-arch-armv3m.s | 30 + test/MC/ARM/directive-arch-armv4.s | 38 + test/MC/ARM/directive-arch-armv4t.s | 34 + test/MC/ARM/directive-arch-armv5.s | 30 + test/MC/ARM/directive-arch-armv5t.s | 34 + test/MC/ARM/directive-arch-armv5te.s | 34 + test/MC/ARM/directive-arch-armv6-m.s | 30 + test/MC/ARM/directive-arch-armv6.s | 34 + test/MC/ARM/directive-arch-armv6j.s | 34 + test/MC/ARM/directive-arch-armv6t2.s | 34 + test/MC/ARM/directive-arch-armv6z.s | 38 + test/MC/ARM/directive-arch-armv6zk.s | 38 + test/MC/ARM/directive-arch-armv7-a.s | 38 + test/MC/ARM/directive-arch-armv7-m.s | 34 + test/MC/ARM/directive-arch-armv7-r.s | 38 + test/MC/ARM/directive-arch-armv7.s | 30 + test/MC/ARM/directive-arch-armv7a.s | 38 + test/MC/ARM/directive-arch-armv7m.s | 34 + test/MC/ARM/directive-arch-armv7r.s | 38 + test/MC/ARM/directive-arch-armv8-a.s | 46 + test/MC/ARM/directive-arch-armv8a.s | 46 + test/MC/ARM/directive-arch-iwmmxt.s | 38 + test/MC/ARM/directive-arch-iwmmxt2.s | 38 + test/MC/ARM/directive-arch_extension-crc.s | 57 + test/MC/ARM/directive-arch_extension-crypto.s | 108 + test/MC/ARM/directive-arch_extension-fp.s | 344 + test/MC/ARM/directive-arch_extension-idiv.s | 53 + test/MC/ARM/directive-arch_extension-mp.s | 38 + test/MC/ARM/directive-arch_extension-sec.s | 31 + test/MC/ARM/directive-arch_extension-simd.s | 275 + test/MC/ARM/directive-eabi_attribute-2.s | 98 + test/MC/ARM/directive-eabi_attribute-diagnostics.s | 36 + test/MC/ARM/directive-eabi_attribute-overwrite.s | 17 + test/MC/ARM/directive-even.s | 70 + test/MC/ARM/directive-fpu-multiple.s | 26 +- test/MC/ARM/directive-fpu-softvfp.s | 8 + test/MC/ARM/directive-literals.s | 26 + test/MC/ARM/directive-object_arch-2.s | 22 + test/MC/ARM/directive-object_arch-3.s | 11 + test/MC/ARM/directive-object_arch-diagnostics.s | 23 + test/MC/ARM/directive-object_arch.s | 22 + test/MC/ARM/directive-tlsdescseq-diagnostics.s | 35 + test/MC/ARM/directive-tlsdescseq.s | 33 + test/MC/ARM/directive-word-diagnostics.s | 12 + test/MC/ARM/dot-req-case-insensitive.s | 20 + test/MC/ARM/dwarf-asm-multiple-sections.s | 79 + test/MC/ARM/dwarf-asm-no-code.s | 27 + test/MC/ARM/dwarf-asm-nonstandard-section.s | 57 + test/MC/ARM/dwarf-asm-single-section.s | 56 + test/MC/ARM/dwarf-cfi-initial-state.s | 17 + test/MC/ARM/eh-directive-cantunwind-diagnostics.s | 8 +- test/MC/ARM/eh-directive-fnstart-diagnostics.s | 2 +- test/MC/ARM/eh-directive-movsp-diagnostics.s | 102 + test/MC/ARM/eh-directive-movsp.s | 44 + .../eh-directive-personalityindex-diagnostics.s | 122 + test/MC/ARM/eh-directive-personalityindex.s | 202 + test/MC/ARM/eh-directive-save-diagnoatics.s | 41 - test/MC/ARM/eh-directive-save-diagnostics.s | 41 + test/MC/ARM/eh-directive-setfp.s | 2 +- test/MC/ARM/eh-directive-unwind_raw-diagnostics.s | 73 + test/MC/ARM/eh-directive-unwind_raw.s | 110 + test/MC/ARM/elf-jump24-fixup.s | 2 +- test/MC/ARM/elf-thumbfunc-reloc.ll | 6 +- test/MC/ARM/elf-thumbfunc-reloc.s | 13 +- test/MC/ARM/elf-thumbfunc.s | 12 +- test/MC/ARM/fconst.s | 22 + test/MC/ARM/fixup-cpu-mode.s | 9 + test/MC/ARM/fp-const-errors.s | 22 + test/MC/ARM/gas-compl-copr-reg.s | 14 + test/MC/ARM/inst-arm-suffixes.s | 15 + test/MC/ARM/inst-constant-required.s | 15 + test/MC/ARM/inst-directive-emit.s | 20 + test/MC/ARM/inst-directive.s | 81 + test/MC/ARM/inst-overflow.s | 14 + test/MC/ARM/inst-thumb-overflow-2.s | 13 + test/MC/ARM/inst-thumb-overflow.s | 13 + test/MC/ARM/inst-thumb-suffixes.s | 13 + test/MC/ARM/invalid-vector-index.s | 5 + test/MC/ARM/ldr-pseudo-darwin.s | 247 + test/MC/ARM/ldr-pseudo-obj-errors.s | 17 + test/MC/ARM/ldr-pseudo-parse-errors.s | 10 + test/MC/ARM/ldr-pseudo.s | 221 + test/MC/ARM/ldrd-strd-gnu-arm-bad-imm.s | 9 + test/MC/ARM/ldrd-strd-gnu-arm.s | 20 + test/MC/ARM/ldrd-strd-gnu-sp.s | 9 + test/MC/ARM/ldrd-strd-gnu-thumb-bad-regs.s | 10 + test/MC/ARM/ldrd-strd-gnu-thumb.s | 20 + test/MC/ARM/lit.local.cfg | 3 +- test/MC/ARM/ltorg-darwin.s | 151 + test/MC/ARM/ltorg.s | 138 + test/MC/ARM/macho-relocs-with-addend.s | 34 + test/MC/ARM/mul-v4.s | 39 + test/MC/ARM/neon-vld-encoding.s | 4 +- test/MC/ARM/neon-vld-vst-align.s | 8354 ++ test/MC/ARM/not-armv4.s | 8 + test/MC/ARM/pool.s | 19 + test/MC/ARM/simple-fp-encoding.s | 43 + test/MC/ARM/symbol-variants-errors.s | 23 + test/MC/ARM/symbol-variants.s | 91 + test/MC/ARM/target-expressions.s | 80 + test/MC/ARM/thumb-far-jump.s | 26 + test/MC/ARM/thumb-st_other.s | 19 + test/MC/ARM/thumb-types.s | 108 + test/MC/ARM/thumb2-cbn-to-next-inst.s | 33 + test/MC/ARM/thumb2-diagnostics.s | 18 + test/MC/ARM/thumb2-ldrd.s | 15 +- test/MC/ARM/thumb2-mclass.s | 15 +- test/MC/ARM/thumb2-strd.s | 10 + test/MC/ARM/thumb2be-b.w-encoding.s | 9 + test/MC/ARM/thumb2be-beq.w-encoding.s | 9 + test/MC/ARM/thumb2be-movt-encoding.s | 9 + test/MC/ARM/thumb2be-movw-encoding.s | 9 + test/MC/ARM/thumb_set-diagnostics.s | 43 + test/MC/ARM/thumb_set.s | 154 + test/MC/ARM/thumbv7m.s | 45 + test/MC/ARM/udf-arm-diagnostics.s | 19 + test/MC/ARM/udf-arm.s | 11 + test/MC/ARM/udf-thumb-2-diagnostics.s | 25 + test/MC/ARM/udf-thumb-2.s | 13 + test/MC/ARM/udf-thumb-diagnostics.s | 19 + test/MC/ARM/udf-thumb.s | 11 + test/MC/ARM/unwind-stack-diagnostics.s | 30 + test/MC/ARM/variant-diagnostics.s | 13 + test/MC/ARM/vfp-aliases-diagnostics.s | 114 + test/MC/ARM/vfp-aliases.s | 62 + test/MC/ARM/vmov-vmvn-byte-replicate.s | 31 + test/MC/ARM/vmov-vmvn-illegal-cases.s | 30 + test/MC/ARM/vorr-vbic-illegal-cases.s | 42 + test/MC/ARM/xscale-attributes.ll | 39 - test/MC/AsmParser/conditional_asm.s | 69 + test/MC/AsmParser/directive-err-diagnostics.s | 17 + test/MC/AsmParser/directive-err.s | 30 + test/MC/AsmParser/directive_end-2.s | 14 + test/MC/AsmParser/directive_end.s | 11 + test/MC/AsmParser/directive_file.s | 1 + test/MC/AsmParser/directive_fill.s | 46 +- test/MC/AsmParser/directive_line.s | 1 + test/MC/AsmParser/directive_loc.s | 10 +- test/MC/AsmParser/directive_rept-diagnostics.s | 41 + test/MC/AsmParser/directive_rept.s | 30 + test/MC/AsmParser/directive_seh.s | 33 +- test/MC/AsmParser/directive_values.s | 12 + .../MC/AsmParser/dot-symbol-assignment-backwards.s | 12 + test/MC/AsmParser/dot-symbol-assignment.s | 31 + test/MC/AsmParser/dot-symbol-non-absolute.s | 9 + test/MC/AsmParser/dot-symbol.s | 5 +- test/MC/AsmParser/exprs.s | 2 +- test/MC/AsmParser/if-diagnostics.s | 29 + test/MC/AsmParser/ifc.s | 5 + test/MC/AsmParser/ifeqs-diagnostics.s | 22 + test/MC/AsmParser/ifeqs.s | 20 + test/MC/AsmParser/invalid-input-assertion.s | 9 + test/MC/AsmParser/lit.local.cfg | 3 +- test/MC/AsmParser/macro-def-in-instantiation.s | 20 + test/MC/AsmParser/macro-err1.s | 2 +- test/MC/AsmParser/macro-irp.s | 2 +- test/MC/AsmParser/macro-qualifier-diagnostics.s | 64 + test/MC/AsmParser/macro-qualifier.s | 16 + .../macros-argument-parsing-diagnostics.s | 24 + test/MC/AsmParser/macros-argument-parsing.s | 91 + test/MC/AsmParser/macros-darwin-vararg.s | 8 + test/MC/AsmParser/macros-darwin.s | 90 +- test/MC/AsmParser/macros-gas.s | 105 + test/MC/AsmParser/macros.s | 93 - test/MC/AsmParser/vararg-default-value.s | 15 + test/MC/AsmParser/vararg.s | 51 + test/MC/COFF/alias.s | 11 +- test/MC/COFF/bad-expr.s | 7 + test/MC/COFF/basic-coff-64.s | 4 +- test/MC/COFF/basic-coff.s | 4 +- test/MC/COFF/bss.s | 2 +- test/MC/COFF/bss_section.ll | 3 + test/MC/COFF/comm.ll | 4 +- test/MC/COFF/comm.s | 25 + test/MC/COFF/directive-section-characteristics.ll | 17 + test/MC/COFF/early-dce.s | 16 + test/MC/COFF/feat00.s | 2 +- test/MC/COFF/file.s | 47 + test/MC/COFF/global_ctors_dtors.ll | 38 +- test/MC/COFF/initialised-data.ll | 7 + test/MC/COFF/invalid-def.s | 5 + test/MC/COFF/invalid-endef.s | 4 + test/MC/COFF/invalid-scl-range.s | 6 + test/MC/COFF/invalid-scl.s | 4 + test/MC/COFF/invalid-type-range.s | 6 + test/MC/COFF/invalid-type.s | 4 + test/MC/COFF/ir-to-imgrel.ll | 6 + test/MC/COFF/linker-options.ll | 2 + test/MC/COFF/linkonce-invalid.s | 14 +- test/MC/COFF/linkonce.s | 57 +- test/MC/COFF/lit.local.cfg | 3 +- test/MC/COFF/lset0.s | 13 +- test/MC/COFF/offset.s | 19 + test/MC/COFF/secidx-diagnostic.s | 8 + test/MC/COFF/secidx.s | 16 + test/MC/COFF/section-comdat-conflict.s | 13 + test/MC/COFF/section-comdat-conflict2.s | 6 + test/MC/COFF/section-comdat.s | 98 +- test/MC/COFF/section-name-encoding.s | 36 +- test/MC/COFF/seh-stackalloc-zero.s | 11 + test/MC/COFF/seh.s | 4 +- test/MC/COFF/symbol-alias.s | 2 +- test/MC/COFF/symbol-fragment-offset-64.s | 4 +- test/MC/COFF/symbol-fragment-offset.s | 4 +- test/MC/COFF/timestamp.s | 4 + test/MC/COFF/tricky-names.ll | 6 +- test/MC/COFF/weak-symbol.ll | 28 +- test/MC/COFF/weak.s | 2 +- .../MC/Disassembler/AArch64/a64-ignored-fields.txt | 1 + test/MC/Disassembler/AArch64/arm64-advsimd.txt | 2283 + test/MC/Disassembler/AArch64/arm64-arithmetic.txt | 526 + .../AArch64/arm64-basic-a64-undefined.txt | 31 + test/MC/Disassembler/AArch64/arm64-bitfield.txt | 29 + test/MC/Disassembler/AArch64/arm64-branch.txt | 75 + .../Disassembler/AArch64/arm64-canonical-form.txt | 21 + test/MC/Disassembler/AArch64/arm64-crc32.txt | 18 + test/MC/Disassembler/AArch64/arm64-crypto.txt | 47 + .../Disassembler/AArch64/arm64-invalid-logical.txt | 6 + test/MC/Disassembler/AArch64/arm64-logical.txt | 223 + test/MC/Disassembler/AArch64/arm64-memory.txt | 564 + .../Disassembler/AArch64/arm64-non-apple-fmov.txt | 7 + test/MC/Disassembler/AArch64/arm64-scalar-fp.txt | 255 + test/MC/Disassembler/AArch64/arm64-system.txt | 62 + .../AArch64/basic-a64-instructions.txt | 1381 +- .../Disassembler/AArch64/basic-a64-undefined.txt | 67 +- .../AArch64/basic-a64-unpredictable.txt | 1 + test/MC/Disassembler/AArch64/gicv3-regs.txt | 221 +- .../AArch64/ldp-offset-predictable.txt | 1 + .../AArch64/ldp-postind.predictable.txt | 1 + .../AArch64/ldp-preind.predictable.txt | 1 + test/MC/Disassembler/AArch64/lit.local.cfg | 3 +- test/MC/Disassembler/AArch64/neon-instructions.txt | 195 +- test/MC/Disassembler/AArch64/trace-regs.txt | 733 +- test/MC/Disassembler/ARM/addrmode2-reencoding.txt | 12 + test/MC/Disassembler/ARM/hex-immediates.txt | 8 +- test/MC/Disassembler/ARM/invalid-thumbv7.txt | 39 - test/MC/Disassembler/ARM/lit.local.cfg | 3 +- test/MC/Disassembler/Mips/lit.local.cfg | 3 +- test/MC/Disassembler/Mips/micromips.txt | 9 + test/MC/Disassembler/Mips/micromips_le.txt | 9 + test/MC/Disassembler/Mips/mips32.txt | 3 + test/MC/Disassembler/Mips/mips32_le.txt | 3 + test/MC/Disassembler/Mips/mips32r2.txt | 3 + test/MC/Disassembler/Mips/mips32r2_le.txt | 3 + test/MC/Disassembler/Mips/mips32r6.txt | 127 + test/MC/Disassembler/Mips/mips64r6.txt | 145 + test/MC/Disassembler/Mips/msa/test_2r.txt | 17 + test/MC/Disassembler/Mips/msa/test_2r_msa64.txt | 3 + test/MC/Disassembler/Mips/msa/test_2rf.txt | 34 + test/MC/Disassembler/Mips/msa/test_3r.txt | 244 + test/MC/Disassembler/Mips/msa/test_3rf.txt | 84 + test/MC/Disassembler/Mips/msa/test_bit.txt | 50 + test/MC/Disassembler/Mips/msa/test_ctrlregs.txt | 35 + test/MC/Disassembler/Mips/msa/test_dlsa.txt | 6 + test/MC/Disassembler/Mips/msa/test_elm.txt | 17 + test/MC/Disassembler/Mips/msa/test_elm_insert.txt | 5 + .../Mips/msa/test_elm_insert_msa64.txt | 3 + test/MC/Disassembler/Mips/msa/test_elm_insve.txt | 6 + test/MC/Disassembler/Mips/msa/test_elm_msa64.txt | 6 + test/MC/Disassembler/Mips/msa/test_i10.txt | 6 + test/MC/Disassembler/Mips/msa/test_i5.txt | 46 + test/MC/Disassembler/Mips/msa/test_i8.txt | 12 + test/MC/Disassembler/Mips/msa/test_lsa.txt | 6 + test/MC/Disassembler/Mips/msa/test_mi10.txt | 28 + test/MC/Disassembler/Mips/msa/test_vec.txt | 9 + test/MC/Disassembler/PowerPC/lit.local.cfg | 3 + .../Disassembler/PowerPC/ppc64-encoding-bookII.txt | 74 + .../PowerPC/ppc64-encoding-bookIII.txt | 107 + .../MC/Disassembler/PowerPC/ppc64-encoding-ext.txt | 2253 + test/MC/Disassembler/PowerPC/ppc64-encoding-fp.txt | 329 + .../MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt | 509 + test/MC/Disassembler/PowerPC/ppc64-encoding.txt | 621 + test/MC/Disassembler/PowerPC/ppc64-operands.txt | 94 + test/MC/Disassembler/PowerPC/vsx.txt | 452 + test/MC/Disassembler/Sparc/lit.local.cfg | 3 + test/MC/Disassembler/Sparc/sparc-fp.txt | 148 + test/MC/Disassembler/Sparc/sparc-mem.txt | 163 + test/MC/Disassembler/Sparc/sparc.txt | 202 + test/MC/Disassembler/SystemZ/insns.txt | 600 + test/MC/Disassembler/SystemZ/lit.local.cfg | 3 +- test/MC/Disassembler/X86/avx-512.txt | 104 + test/MC/Disassembler/X86/fp-stack.txt | 1037 + test/MC/Disassembler/X86/hex-immediates.txt | 2 +- test/MC/Disassembler/X86/lit.local.cfg | 3 +- test/MC/Disassembler/X86/missing-sib.txt | 4 + test/MC/Disassembler/X86/moffs.txt | 86 + test/MC/Disassembler/X86/padlock.txt | 56 + test/MC/Disassembler/X86/prefixes.txt | 4 + test/MC/Disassembler/X86/simple-tests.txt | 12 + test/MC/Disassembler/X86/x86-16.txt | 788 + test/MC/Disassembler/X86/x86-32.txt | 15 + test/MC/Disassembler/XCore/lit.local.cfg | 3 +- test/MC/ELF/ARM/bss-non-zero-value.s | 9 + test/MC/ELF/ARM/gnu-type-hash-diagnostics.s | 9 + test/MC/ELF/ARM/gnu-type-hash.s | 16 + test/MC/ELF/ARM/lit.local.cfg | 3 + test/MC/ELF/abs.s | 2 +- test/MC/ELF/alias-reloc.s | 2 +- test/MC/ELF/alias.s | 24 +- test/MC/ELF/bad-expr.s | 8 + test/MC/ELF/bad-expr2.s | 12 + test/MC/ELF/bad-expr3.s | 10 + test/MC/ELF/basic-elf-32.s | 4 +- test/MC/ELF/cfi-adjust-cfa-offset.s | 2 +- test/MC/ELF/cfi-advance-loc2.s | 2 +- test/MC/ELF/cfi-def-cfa-offset.s | 2 +- test/MC/ELF/cfi-def-cfa-register.s | 2 +- test/MC/ELF/cfi-def-cfa.s | 2 +- test/MC/ELF/cfi-escape.s | 2 +- test/MC/ELF/cfi-offset.s | 2 +- test/MC/ELF/cfi-register.s | 2 +- test/MC/ELF/cfi-rel-offset.s | 2 +- test/MC/ELF/cfi-rel-offset2.s | 2 +- test/MC/ELF/cfi-remember.s | 2 +- test/MC/ELF/cfi-restore.s | 2 +- test/MC/ELF/cfi-same-value.s | 2 +- test/MC/ELF/cfi-sections.s | 4 +- test/MC/ELF/cfi-signal-frame.s | 4 +- test/MC/ELF/cfi-undefined.s | 2 +- test/MC/ELF/cfi-version.ll | 45 + test/MC/ELF/cfi-window-save.s | 2 +- test/MC/ELF/cfi-zero-addr-delta.s | 2 +- test/MC/ELF/cfi.s | 84 +- test/MC/ELF/comdat.s | 8 +- test/MC/ELF/common.s | 18 +- test/MC/ELF/comp-dir.s | 1 - test/MC/ELF/compression.s | 80 + test/MC/ELF/discriminator.s | 61 + test/MC/ELF/dot-symbol-assignment.s | 22 + test/MC/ELF/file-double.s | 12 +- test/MC/ELF/file.s | 2 +- test/MC/ELF/gen-dwarf.s | 32 +- test/MC/ELF/gnu-type-diagnostics.s | 18 + test/MC/ELF/gnu-type.s | 38 + test/MC/ELF/ifunc-reloc.s | 16 + test/MC/ELF/lcomm.s | 4 +- test/MC/ELF/lit.local.cfg | 3 +- test/MC/ELF/local-reloc.s | 2 +- test/MC/ELF/many-section.s | 93319 ------------------- test/MC/ELF/many-sections-2.s | 65408 +------------ test/MC/ELF/many-sections.s | 106 + test/MC/ELF/merge.s | 9 +- test/MC/ELF/no-reloc.s | 19 + test/MC/ELF/nocompression.s | 5 + test/MC/ELF/noexec.s | 2 +- test/MC/ELF/offset.s | 132 + test/MC/ELF/pic-diff.s | 4 +- test/MC/ELF/pr19430.s | 14 + test/MC/ELF/pr9292.s | 8 +- test/MC/ELF/relocation-386.s | 11 +- test/MC/ELF/relocation-pc.s | 4 +- test/MC/ELF/relocation.s | 17 + test/MC/ELF/set.s | 8 +- test/MC/ELF/strtab-suffix-opt.s | 21 + test/MC/ELF/subtraction-error.s | 8 + test/MC/ELF/symref.s | 142 - test/MC/ELF/symver.s | 142 + test/MC/ELF/tls-i386.s | 56 +- test/MC/ELF/tls.s | 26 +- test/MC/ELF/type-propagate.s | 151 + test/MC/ELF/type.s | 197 + test/MC/ELF/undef.s | 79 +- test/MC/ELF/weak.s | 4 +- test/MC/ELF/weakref-reloc.s | 6 +- test/MC/ELF/weakref.s | 44 +- .../MachO/AArch64/darwin-ARM64-local-label-diff.s | 21 + test/MC/MachO/AArch64/darwin-ARM64-reloc.s | 157 + test/MC/MachO/AArch64/lit.local.cfg | 3 + test/MC/MachO/ARM/aliased-symbols.s | 115 + test/MC/MachO/ARM/bad-darwin-ARM-reloc.s | 9 + test/MC/MachO/ARM/bad-darwin-directives.s | 29 + test/MC/MachO/ARM/ios-version-min-load-command.s | 10 + test/MC/MachO/ARM/lit.local.cfg | 3 +- test/MC/MachO/ARM/version-min-diagnostics.s | 49 + test/MC/MachO/ARM/version-min.s | 21 + test/MC/MachO/bad-darwin-x86_64-reloc-expr.s | 6 + test/MC/MachO/bss.s | 2 +- test/MC/MachO/debug_frame.s | 1 + test/MC/MachO/eh-frame-reloc.s | 16 + test/MC/MachO/eh_symbol.s | 14 + test/MC/MachO/gen-dwarf-cpp.s | 13 +- test/MC/MachO/gen-dwarf.s | 14 +- test/MC/MachO/lit.local.cfg | 3 +- test/MC/MachO/osx-version-min-load-command.s | 10 + test/MC/MachO/pr19185.s | 6 + test/MC/MachO/temp-labels.s | 2 +- test/MC/MachO/variable-exprs.s | 8 +- test/MC/MachO/x86_32-scattered-reloc-fallback.s | 27 + test/MC/Mips/abicalls.ll | 15 - test/MC/Mips/cfi.s | 13 + test/MC/Mips/cpload-bad.s | 15 + test/MC/Mips/cpload.s | 33 + test/MC/Mips/cpsetup-bad.s | 14 + test/MC/Mips/cpsetup.s | 78 + test/MC/Mips/do_switch.ll | 39 - test/MC/Mips/do_switch1.s | 75 + test/MC/Mips/do_switch2.s | 77 + test/MC/Mips/do_switch3.s | 82 + test/MC/Mips/eh-frame.s | 8 +- test/MC/Mips/elf-N64.ll | 26 - test/MC/Mips/elf-N64.s | 65 + test/MC/Mips/elf-gprel-32-64.ll | 40 - test/MC/Mips/elf-gprel-32-64.s | 86 + test/MC/Mips/elf-reginfo.ll | 34 - test/MC/Mips/elf-relsym.ll | 39 - test/MC/Mips/elf-relsym.s | 87 + test/MC/Mips/elf-tls.ll | 40 - test/MC/Mips/elf-tls.s | 134 + test/MC/Mips/elf_eflags.ll | 69 - test/MC/Mips/elf_eflags.s | 120 +- test/MC/Mips/elf_eflags_abicalls.s | 6 + test/MC/Mips/elf_eflags_micromips.s | 8 + test/MC/Mips/elf_eflags_mips16.s | 8 + test/MC/Mips/elf_eflags_nan2008.s | 12 + test/MC/Mips/elf_eflags_nanlegacy.s | 15 + test/MC/Mips/elf_eflags_noreorder.s | 6 + test/MC/Mips/elf_eflags_pic0.s | 7 + test/MC/Mips/elf_eflags_pic2.s | 6 + test/MC/Mips/elf_reginfo.s | 32 + test/MC/Mips/elf_st_other.ll | 11 - test/MC/Mips/elf_st_other.s | 35 +- test/MC/Mips/higher-highest-addressing.s | 54 + test/MC/Mips/higher_highest.ll | 32 - test/MC/Mips/hilo-addressing.s | 53 +- test/MC/Mips/lea_64.ll | 18 - test/MC/Mips/lit.local.cfg | 3 +- test/MC/Mips/llvm-mc-fixup-endianness.s | 6 + test/MC/Mips/micromips-16-bit-instructions.s | 27 + test/MC/Mips/micromips-alias.s | 16 + test/MC/Mips/micromips-alu-instructions.s | 2 - test/MC/Mips/micromips-bad-branches.s | 225 + test/MC/Mips/micromips-control-instructions.s | 60 + test/MC/Mips/micromips-diagnostic-fixup.s | 10 + test/MC/Mips/micromips-el-fixup-data.s | 25 + test/MC/Mips/micromips-fpu-instructions.s | 193 + test/MC/Mips/micromips-jump-instructions.s | 6 +- test/MC/Mips/micromips-loadstore-instructions.s | 15 +- test/MC/Mips/micromips-long-branch.ll | 16437 ---- test/MC/Mips/micromips-pc16-fixup.s | 10 + test/MC/Mips/micromips-relocations.s | 12 + test/MC/Mips/mips-abi-bad.s | 20 + test/MC/Mips/mips-alu-instructions.s | 29 + test/MC/Mips/mips-bad-branches.s | 409 + test/MC/Mips/mips-control-instructions.s | 4 +- test/MC/Mips/mips-data-directives.s | 36 + test/MC/Mips/mips-diagnostic-fixup.s | 10 + test/MC/Mips/mips-expansions-bad.s | 6 + test/MC/Mips/mips-expansions.s | 13 + test/MC/Mips/mips-jump-instructions.s | 12 +- test/MC/Mips/mips-noat.s | 29 + test/MC/Mips/mips-pc16-fixup.s | 10 + test/MC/Mips/mips-reginfo-fp32.s | 34 + test/MC/Mips/mips-reginfo-fp64.s | 60 + test/MC/Mips/mips-register-names-invalid.s | 8 + test/MC/Mips/mips-register-names-o32.s | 40 + test/MC/Mips/mips-register-names.s | 71 - test/MC/Mips/mips1/invalid-mips2-wrong-error.s | 16 + test/MC/Mips/mips1/invalid-mips2.s | 24 + test/MC/Mips/mips1/invalid-mips3-wrong-error.s | 23 + test/MC/Mips/mips1/invalid-mips3.s | 65 + test/MC/Mips/mips1/invalid-mips32.s | 10 + test/MC/Mips/mips1/invalid-mips4-wrong-error.s | 23 + test/MC/Mips/mips1/invalid-mips4.s | 89 + test/MC/Mips/mips1/invalid-mips5-wrong-error.s | 46 + test/MC/Mips/mips1/invalid-mips5.s | 90 + test/MC/Mips/mips1/valid-xfail.s | 11 + test/MC/Mips/mips1/valid.s | 113 + test/MC/Mips/mips2/invalid-mips3-wrong-error.s | 18 + test/MC/Mips/mips2/invalid-mips3.s | 49 + test/MC/Mips/mips2/invalid-mips32.s | 44 + test/MC/Mips/mips2/invalid-mips32r2-xfail.s | 11 + test/MC/Mips/mips2/invalid-mips32r2.s | 66 + test/MC/Mips/mips2/invalid-mips4-wrong-error.s | 14 + test/MC/Mips/mips2/invalid-mips4.s | 72 + test/MC/Mips/mips2/invalid-mips5-wrong-error.s | 46 + test/MC/Mips/mips2/invalid-mips5.s | 73 + test/MC/Mips/mips2/valid.s | 138 + test/MC/Mips/mips3/invalid-mips32.s | 10 + test/MC/Mips/mips3/invalid-mips4.s | 30 + test/MC/Mips/mips3/invalid-mips5-wrong-error.s | 46 + test/MC/Mips/mips3/invalid-mips5.s | 32 + test/MC/Mips/mips3/valid.s | 197 + test/MC/Mips/mips32/abiflags.s | 36 + test/MC/Mips/mips32/invalid-mips32r2-xfail.s | 11 + test/MC/Mips/mips32/invalid-mips32r2.s | 34 + test/MC/Mips/mips32/invalid-mips64.s | 9 + test/MC/Mips/mips32/valid-xfail.s | 38 + test/MC/Mips/mips32/valid.s | 166 + test/MC/Mips/mips32r2/abiflags.s | 37 + test/MC/Mips/mips32r2/invalid-mips64r2.s | 10 + test/MC/Mips/mips32r2/invalid.s | 10 + test/MC/Mips/mips32r2/valid-xfail.s | 309 + test/MC/Mips/mips32r2/valid.s | 197 + test/MC/Mips/mips32r6/invalid-mips1-wrong-error.s | 17 + test/MC/Mips/mips32r6/invalid-mips1.s | 24 + test/MC/Mips/mips32r6/invalid-mips2-wrong-error.s | 20 + test/MC/Mips/mips32r6/invalid-mips2.s | 26 + test/MC/Mips/mips32r6/invalid-mips32-wrong-error.s | 20 + test/MC/Mips/mips32r6/invalid-mips32.s | 25 + test/MC/Mips/mips32r6/invalid-mips32r2.s | 15 + test/MC/Mips/mips32r6/invalid-mips4-wrong-error.s | 21 + test/MC/Mips/mips32r6/invalid-mips4.s | 11 + test/MC/Mips/mips32r6/invalid-mips5-wrong-error.s | 11 + test/MC/Mips/mips32r6/invalid-mips5.s | 9 + test/MC/Mips/mips32r6/invalid.s | 14 + test/MC/Mips/mips32r6/relocations.s | 70 + test/MC/Mips/mips32r6/valid-xfail.s | 19 + test/MC/Mips/mips32r6/valid.s | 154 + test/MC/Mips/mips4/invalid-mips32.s | 10 + test/MC/Mips/mips4/invalid-mips5-wrong-error.s | 46 + test/MC/Mips/mips4/invalid-mips5.s | 9 + test/MC/Mips/mips4/invalid-mips64.s | 24 + test/MC/Mips/mips4/invalid-mips64r2-xfail.s | 11 + test/MC/Mips/mips4/invalid-mips64r2.s | 37 + test/MC/Mips/mips4/valid-xfail.s | 49 + test/MC/Mips/mips4/valid.s | 216 + test/MC/Mips/mips5/invalid-mips32.s | 10 + test/MC/Mips/mips5/invalid-mips64.s | 24 + test/MC/Mips/mips5/invalid-mips64r2-xfail.s | 11 + test/MC/Mips/mips5/invalid-mips64r2.s | 43 + test/MC/Mips/mips5/valid-xfail.s | 87 + test/MC/Mips/mips5/valid.s | 218 + test/MC/Mips/mips64-alu-instructions.s | 43 + test/MC/Mips/mips64-expansions.s | 209 + test/MC/Mips/mips64-register-names-n32-n64.s | 49 + test/MC/Mips/mips64-register-names-o32.s | 41 + test/MC/Mips/mips64-register-names.s | 70 - test/MC/Mips/mips64/abiflags.s | 36 + test/MC/Mips/mips64/invalid-mips64r2-xfail.s | 11 + test/MC/Mips/mips64/invalid-mips64r2.s | 29 + test/MC/Mips/mips64/valid-xfail.s | 94 + test/MC/Mips/mips64/valid.s | 235 + test/MC/Mips/mips64eb-fixups.s | 43 + test/MC/Mips/mips64r2/abi-bad.s | 9 + test/MC/Mips/mips64r2/abiflags.s | 36 + test/MC/Mips/mips64r2/invalid.s | 10 + test/MC/Mips/mips64r2/valid-xfail.s | 311 + test/MC/Mips/mips64r2/valid.s | 263 + test/MC/Mips/mips64r6/invalid-mips1-wrong-error.s | 17 + test/MC/Mips/mips64r6/invalid-mips1.s | 27 + test/MC/Mips/mips64r6/invalid-mips2.s | 29 + test/MC/Mips/mips64r6/invalid-mips3-wrong-error.s | 23 + test/MC/Mips/mips64r6/invalid-mips3.s | 33 + test/MC/Mips/mips64r6/invalid-mips32-wrong-error.s | 20 + test/MC/Mips/mips64r6/invalid-mips4-wrong-error.s | 21 + test/MC/Mips/mips64r6/invalid-mips4.s | 14 + test/MC/Mips/mips64r6/invalid-mips5-wrong-error.s | 48 + test/MC/Mips/mips64r6/invalid-mips5.s | 12 + test/MC/Mips/mips64r6/invalid-mips64.s | 54 + test/MC/Mips/mips64r6/invalid.s | 12 + test/MC/Mips/mips64r6/relocations.s | 76 + test/MC/Mips/mips64r6/valid-xfail.s | 19 + test/MC/Mips/mips64r6/valid.s | 173 + test/MC/Mips/mips_abi_flags_xx.s | 45 + test/MC/Mips/mips_abi_flags_xx_set.s | 37 + test/MC/Mips/mips_directives.s | 44 +- test/MC/Mips/mips_directives_bad.s | 59 + test/MC/Mips/mips_gprel16.ll | 33 - test/MC/Mips/mips_gprel16.s | 73 + test/MC/Mips/msa/abiflags.s | 37 + test/MC/Mips/msa/test_2r.s | 20 +- test/MC/Mips/msa/test_2r_msa64.s | 5 + test/MC/Mips/msa/test_2rf.s | 37 +- test/MC/Mips/msa/test_3r.s | 247 +- test/MC/Mips/msa/test_3rf.s | 87 +- test/MC/Mips/msa/test_bit.s | 53 +- test/MC/Mips/msa/test_cbranch.s | 22 +- test/MC/Mips/msa/test_ctrlregs.s | 38 +- test/MC/Mips/msa/test_dlsa.s | 12 + test/MC/Mips/msa/test_elm.s | 20 +- test/MC/Mips/msa/test_elm_insert.s | 8 +- test/MC/Mips/msa/test_elm_insert_msa64.s | 5 + test/MC/Mips/msa/test_elm_insve.s | 9 +- test/MC/Mips/msa/test_elm_msa64.s | 7 + test/MC/Mips/msa/test_i10.s | 10 +- test/MC/Mips/msa/test_i5.s | 49 +- test/MC/Mips/msa/test_i8.s | 15 +- test/MC/Mips/msa/test_lsa.s | 9 +- test/MC/Mips/msa/test_mi10.s | 79 +- test/MC/Mips/msa/test_vec.s | 12 +- test/MC/Mips/nabi-regs.s | 10 +- test/MC/Mips/nacl-mask.s | 319 + test/MC/Mips/nooddspreg-cmdarg.s | 42 + test/MC/Mips/nooddspreg-error.s | 14 + test/MC/Mips/nooddspreg.s | 44 + test/MC/Mips/octeon-instructions.s | 85 + test/MC/Mips/oddspreg.s | 69 + test/MC/Mips/r-mips-got-disp.ll | 19 - test/MC/Mips/r-mips-got-disp.s | 65 + test/MC/Mips/set-at-directive-explicit-at.s | 42 + test/MC/Mips/set-at-directive.s | 218 +- test/MC/Mips/sym-expr.s | 14 + test/MC/Mips/xgot.ll | 29 - test/MC/Mips/xgot.s | 67 + test/MC/PowerPC/deprecated-p7.s | 1 + test/MC/PowerPC/lit.local.cfg | 3 +- test/MC/PowerPC/ppc-llong.s | 2 + test/MC/PowerPC/ppc-machine.s | 1 + test/MC/PowerPC/ppc-nop.s | 8 +- test/MC/PowerPC/ppc-reloc.s | 17 + test/MC/PowerPC/ppc-word.s | 2 + test/MC/PowerPC/ppc64-abiversion.s | 9 + test/MC/PowerPC/ppc64-encoding-bookII.s | 161 +- test/MC/PowerPC/ppc64-encoding-bookIII.s | 178 +- test/MC/PowerPC/ppc64-encoding-ext.s | 5636 +- test/MC/PowerPC/ppc64-encoding-fp.s | 578 +- test/MC/PowerPC/ppc64-encoding-vmx.s | 882 +- test/MC/PowerPC/ppc64-encoding.s | 1216 +- test/MC/PowerPC/ppc64-errors.s | 2 + test/MC/PowerPC/ppc64-fixup-apply.s | 19 +- test/MC/PowerPC/ppc64-fixup-explicit.s | 96 +- test/MC/PowerPC/ppc64-fixups.s | 1123 +- test/MC/PowerPC/ppc64-initial-cfa.s | 27 +- test/MC/PowerPC/ppc64-localentry-error1.s | 11 + test/MC/PowerPC/ppc64-localentry-error2.s | 12 + test/MC/PowerPC/ppc64-localentry.s | 70 + test/MC/PowerPC/ppc64-operands.s | 177 +- test/MC/PowerPC/ppc64-regs.s | 1 + test/MC/PowerPC/vsx.s | 447 + test/MC/Sparc/lit.local.cfg | 3 + test/MC/Sparc/sparc-alu-instructions.s | 128 + test/MC/Sparc/sparc-atomic-instructions.s | 19 + test/MC/Sparc/sparc-ctrl-instructions.s | 278 + test/MC/Sparc/sparc-directive-xword.s | 10 + test/MC/Sparc/sparc-directives.s | 19 + test/MC/Sparc/sparc-fp-instructions.s | 140 + test/MC/Sparc/sparc-mem-instructions.s | 58 + test/MC/Sparc/sparc-nop-data.s | 11 + test/MC/Sparc/sparc-pic.s | 49 + test/MC/Sparc/sparc-relocations.s | 46 + test/MC/Sparc/sparc-vis.s | 4 + test/MC/Sparc/sparc64-alu-instructions.s | 38 + test/MC/Sparc/sparc64-ctrl-instructions.s | 1226 + test/MC/Sparc/sparcv8-instructions.s | 15 + test/MC/Sparc/sparcv9-instructions.s | 23 + test/MC/SystemZ/insn-bad-z196.s | 344 + test/MC/SystemZ/insn-bad.s | 115 + test/MC/SystemZ/insn-good-z196.s | 450 + test/MC/SystemZ/lit.local.cfg | 3 +- test/MC/X86/AlignedBundling/lit.local.cfg | 3 +- test/MC/X86/address-size.s | 16 +- test/MC/X86/avx512-encodings.s | 3182 +- test/MC/X86/fixup-cpu-mode.s | 8 + test/MC/X86/index-operations.s | 146 + test/MC/X86/intel-syntax-avx512.s | 5 + test/MC/X86/intel-syntax-bitwise-ops.s | 22 + test/MC/X86/intel-syntax-directional-label.s | 17 + test/MC/X86/intel-syntax-invalid-basereg.s | 7 + test/MC/X86/intel-syntax-invalid-scale.s | 11 + test/MC/X86/intel-syntax.s | 14 + test/MC/X86/lit.local.cfg | 3 +- test/MC/X86/no-elf-compact-unwind.s | 16 + test/MC/X86/padlock.s | 52 - test/MC/X86/relax-insn.s | 5 + test/MC/X86/reloc-undef-global.s | 20 + test/MC/X86/ret.s | 114 + test/MC/X86/stackmap-nops.ll | 47 + test/MC/X86/variant-diagnostics.s | 11 + test/MC/X86/x86-16.s | 949 + test/MC/X86/x86-32.s | 74 +- test/MC/X86/x86-64.s | 58 +- test/MC/X86/x86-itanium.ll | 6 + test/MC/X86/x86-target-directives.s | 7 + test/MC/X86/x86-windows-itanium-libcalls.ll | 16 + test/MC/X86/x86_64-avx-encoding.s | 2 +- test/MC/X86/x86_64-signed-reloc.s | 16 + test/MC/X86/x86_64-tbm-encoding.s | 6 + test/MC/X86/x86_errors.s | 17 +- test/MC/X86/x86_long_nop.s | 10 + test/MC/X86/x86_nop.s | 1 + test/Makefile | 11 +- test/Object/ARM/lit.local.cfg | 3 +- test/Object/Inputs/COFF/i386.yaml | 16 +- test/Object/Inputs/COFF/long-file-symbol.yaml | 14 + test/Object/Inputs/COFF/weak-external.yaml | 43 + test/Object/Inputs/COFF/x86-64.yaml | 33 +- test/Object/Inputs/absolute.elf-x86-64 | Bin 0 -> 711 bytes test/Object/Inputs/common.coff-i386 | Bin 0 -> 520 bytes test/Object/Inputs/corrupt-archive.a | Bin 0 -> 2698 bytes test/Object/Inputs/darwin-m-test1.mach0-armv7 | Bin 0 -> 432 bytes test/Object/Inputs/darwin-m-test2.macho-i386 | Bin 0 -> 88 bytes test/Object/Inputs/darwin-m-test3.macho-x86-64 | Bin 0 -> 9216 bytes test/Object/Inputs/hello-world.macho-x86_64 | Bin 0 -> 8496 bytes test/Object/Inputs/macho-archive-x86_64.a | Bin 0 -> 1304 bytes test/Object/Inputs/macho-hello-g.macho-x86_64 | Bin 0 -> 8680 bytes .../Object/Inputs/macho-text-data-bss.macho-x86_64 | Bin 0 -> 844 bytes .../Inputs/macho-universal-archive.x86_64.i386 | Bin 0 -> 1656 bytes test/Object/Inputs/no-sections.elf-x86-64 | Bin 0 -> 2912 bytes test/Object/Inputs/program-headers.mips64 | Bin 0 -> 790 bytes .../relocatable-with-section-address.elf-x86-64 | Bin 0 -> 1584 bytes test/Object/Inputs/relocation-dynamic.elf-i386 | Bin 0 -> 1504 bytes test/Object/Inputs/relocation-relocatable.elf-i386 | Bin 0 -> 772 bytes test/Object/Inputs/thumb-symbols.elf.arm | Bin 0 -> 481 bytes test/Object/Inputs/trivial-object-test.coff-x86-64 | Bin 347 -> 437 bytes test/Object/Inputs/trivial-object-test.elf-mipsel | Bin 0 -> 1124 bytes test/Object/Inputs/trivial.ll | 4 + test/Object/Inputs/unwind-section.elf-x86-64 | Bin 0 -> 2369 bytes test/Object/Inputs/weak.elf-x86-64 | Bin 0 -> 896 bytes test/Object/Mips/lit.local.cfg | 3 +- test/Object/X86/archive-ir-asm.ll | 20 + test/Object/X86/lit.local.cfg | 3 +- test/Object/X86/nm-ir.ll | 45 + test/Object/X86/objdump-cfg-invalid-opcode.yaml | 2 +- .../objdump-disassembly-inline-relocations.test | 35 + test/Object/X86/objdump-disassembly-symbolic.test | 20 + test/Object/X86/yaml2obj-elf-x86-rel.yaml | 41 + test/Object/ar-error.test | 6 + test/Object/archive-long-index.test | 28 +- test/Object/archive-symtab.test | 50 +- test/Object/archive-toc.test | 24 +- test/Object/coff-archive-short.test | 2 +- test/Object/coff-archive.test | 2 +- test/Object/directory.ll | 2 +- test/Object/extract.ll | 3 +- test/Object/mangle-ir.ll | 14 + test/Object/nm-archive.test | 11 +- test/Object/nm-darwin-m.test | 53 + test/Object/nm-error.test | 6 +- test/Object/nm-shared-object.test | 40 +- test/Object/nm-trivial-object.test | 131 +- test/Object/nm-universal-binary.test | 35 +- test/Object/obj2yaml-coff-long-file-symbol.test | 3 + test/Object/obj2yaml-coff-weak-external.test | 3 + test/Object/obj2yaml.test | 304 +- test/Object/objdump-no-sectionheaders.test | 6 + test/Object/objdump-relocations.test | 12 +- test/Object/readobj-elf-versioning.test | 4 +- test/Object/readobj-shared-object.test | 18 +- test/Object/simple-archive.test | 2 +- test/Object/size-trivial-macho.test | 89 + test/Object/yaml2obj-coff-multi-doc.test | 91 + .../yaml2obj-elf-file-headers-with-e_flags.yaml | 17 + test/Object/yaml2obj-elf-multi-doc.test | 56 + test/Object/yaml2obj-elf-rel.yaml | 118 + test/Object/yaml2obj-elf-section-basic.yaml | 41 + test/Object/yaml2obj-elf-section-invalid-size.yaml | 26 + test/Object/yaml2obj-elf-symbol-basic.yaml | 2 +- test/Object/yaml2obj-elf-symbol-visibility.yaml | 126 + test/Object/yaml2obj-readobj.test | 3 + test/Other/Inputs/llvm_cov.gcda | Bin 296 -> 0 bytes test/Other/Inputs/llvm_cov.gcno | Bin 984 -> 0 bytes test/Other/X86/lit.local.cfg | 3 +- test/Other/constant-fold-gep.ll | 19 +- test/Other/extract-alias.ll | 6 +- test/Other/llvm-cov.test | 4 - test/Other/llvm-nm-without-aliases.ll | 4 +- test/Other/new-pass-manager.ll | 69 + test/Other/optimization-remarks-inline.ll | 40 + test/Other/pass-pipeline-parsing.ll | 146 + test/TableGen/ForeachLoop.td | 26 +- test/TableGen/GeneralList.td | 1 - test/TableGen/MultiClassDefName.td | 25 + test/TableGen/ValidIdentifiers.td | 16 + test/TableGen/if-empty-list-arg.td | 7 + test/TableGen/intrinsic-long-name.td | 32 + test/TableGen/lisp.td | 1 - test/TableGen/listconcat.td | 18 + test/TableGen/math.td | 10 + test/TableGen/strconcat.td | 14 +- test/Transforms/AddDiscriminators/basic.ll | 59 + test/Transforms/AddDiscriminators/first-only.ll | 82 + test/Transforms/AddDiscriminators/multiple.ll | 71 + .../AddDiscriminators/no-discriminators.ll | 71 + test/Transforms/ArgumentPromotion/basictest.ll | 32 +- test/Transforms/ArgumentPromotion/byval-2.ll | 37 +- test/Transforms/ArgumentPromotion/byval.ll | 33 +- test/Transforms/ArgumentPromotion/dbg.ll | 22 + test/Transforms/ArgumentPromotion/inalloca.ll | 49 + test/Transforms/ArgumentPromotion/tail.ll | 20 + .../ARM/atomic-expansion-v7.ll | 364 + .../ARM/atomic-expansion-v8.ll | 226 + .../AtomicExpandLoadLinked/ARM/cmpxchg-weak.ll | 97 + .../AtomicExpandLoadLinked/ARM/lit.local.cfg | 3 + test/Transforms/BBVectorize/lit.local.cfg | 3 +- test/Transforms/BBVectorize/simple-int.ll | 381 +- .../2007-10-19-InlineAsmDirectives.ll | 2 +- .../CodeGenPrepare/X86/extend-sink-hoist.ll | 64 + test/Transforms/CodeGenPrepare/X86/lit.local.cfg | 3 + .../CodeGenPrepare/X86/sink-addrspacecast.ll | 37 + .../CodeGenPrepare/X86/x86-shuffle-sink.ll | 105 + test/Transforms/ConstProp/loads.ll | 47 + .../ConstantHoisting/AArch64/const-addr.ll | 23 + .../ConstantHoisting/AArch64/large-immediate.ll | 27 + .../ConstantHoisting/AArch64/lit.local.cfg | 2 + .../ConstantHoisting/PowerPC/const-base-addr.ll | 23 + .../ConstantHoisting/PowerPC/lit.local.cfg | 3 + test/Transforms/ConstantHoisting/PowerPC/masks.ll | 66 + test/Transforms/ConstantHoisting/X86/cast-inst.ll | 29 + .../ConstantHoisting/X86/const-base-addr.ll | 24 + .../ConstantHoisting/X86/delete-dead-cast-inst.ll | 22 + .../ConstantHoisting/X86/large-immediate.ll | 36 + test/Transforms/ConstantHoisting/X86/lit.local.cfg | 3 + test/Transforms/ConstantHoisting/X86/phi.ll | 116 + test/Transforms/ConstantHoisting/X86/stackmap.ll | 17 + test/Transforms/ConstantMerge/linker-private.ll | 23 - test/Transforms/DeadArgElim/deadexternal.ll | 2 +- test/Transforms/DeadArgElim/keepalive.ll | 16 + .../DeadStoreElimination/PartialStore.ll | 22 +- .../DeadStoreElimination/cs-cs-aliasing.ll | 74 + test/Transforms/DeadStoreElimination/simple.ll | 26 + test/Transforms/FunctionAttrs/nocapture.ll | 17 +- test/Transforms/FunctionAttrs/readattrs.ll | 20 + test/Transforms/GCOVProfiling/global-ctor.ll | 58 + test/Transforms/GCOVProfiling/linezero.ll | 143 + test/Transforms/GCOVProfiling/version.ll | 4 +- test/Transforms/GVN/2009-03-10-PREOnVoid.ll | 56 +- test/Transforms/GVN/calloc-load-removal.ll | 25 + test/Transforms/GVN/invariant-load.ll | 31 + test/Transforms/GVN/load-pre-nonlocal.ll | 87 + test/Transforms/GVN/rle.ll | 13 + .../GVN/unreachable_block_infinite_loop.ll | 2 +- .../Transforms/GlobalDCE/2009-01-05-DeadAliases.ll | 14 +- test/Transforms/GlobalDCE/global_ctors.ll | 14 + .../GlobalDCE/global_ctors_integration.ll | 45 + .../GlobalOpt/2009-02-15-BitcastAlias.ll | 2 +- test/Transforms/GlobalOpt/2009-03-06-Anonymous.ll | 18 +- test/Transforms/GlobalOpt/alias-resolve.ll | 30 +- .../GlobalOpt/alias-used-address-space.ll | 26 + test/Transforms/GlobalOpt/alias-used-section.ll | 8 + test/Transforms/GlobalOpt/atexit.ll | 2 +- .../GlobalOpt/constantfold-initializers.ll | 38 +- test/Transforms/GlobalOpt/ctor-list-opt.ll | 19 +- test/Transforms/GlobalOpt/fastcc.ll | 46 + test/Transforms/GlobalOpt/memset.ll | 19 +- .../IPConstantProp/2009-09-24-byval-ptr.ll | 2 +- .../2014-06-21-congruent-constant.ll | 57 + test/Transforms/IndVarSimplify/iv-widen.ll | 40 + .../IndVarSimplify/lcssa-preservation.ll | 51 + .../Transforms/IndVarSimplify/lftr-extend-const.ll | 4 +- test/Transforms/IndVarSimplify/lftr-reuse.ll | 10 +- test/Transforms/IndVarSimplify/overflowcheck.ll | 56 + test/Transforms/IndVarSimplify/pr18223.ll | 30 + .../Transforms/IndVarSimplify/tripcount_compute.ll | 31 + test/Transforms/Inline/2010-05-31-ByvalTailcall.ll | 24 - test/Transforms/Inline/always-inline.ll | 11 + test/Transforms/Inline/blockaddress.ll | 5 +- test/Transforms/Inline/byval-tail-call.ll | 38 + test/Transforms/Inline/byval_lifetime.ll | 26 + test/Transforms/Inline/debug-invoke.ll | 37 + test/Transforms/Inline/ignore-debug-info.ll | 55 + test/Transforms/Inline/inline-cold.ll | 200 + test/Transforms/Inline/inline-tail.ll | 185 +- test/Transforms/Inline/inline-vla.ll | 38 + test/Transforms/Inline/inline_invoke.ll | 5 - test/Transforms/Inline/inline_returns_twice.ll | 2 +- test/Transforms/Inline/invoke-cleanup.ll | 39 + test/Transforms/Inline/invoke-combine-clauses.ll | 117 + test/Transforms/Inline/null-function.ll | 9 + test/Transforms/Inline/optimization-remarks.ll | 60 + test/Transforms/Inline/ptr-diff.ll | 2 +- test/Transforms/Inline/switch.ll | 60 + .../InstCombine/2007-09-10-AliasConstFold.ll | 4 +- .../InstCombine/2007-09-17-AliasConstFold2.ll | 4 +- test/Transforms/InstCombine/2010-03-03-ExtElim.ll | 4 +- .../InstCombine/2012-04-23-Neon-Intrinsics.ll | 69 +- .../InstCombine/2012-07-30-addrsp-bitcast.ll | 2 +- test/Transforms/InstCombine/AddOverFlow.ll | 118 + .../InstCombine/OverlappingInsertvalues.ll | 36 + test/Transforms/InstCombine/abs_abs.ll | 961 + test/Transforms/InstCombine/add-shrink.ll | 10 +- test/Transforms/InstCombine/add-sitofp.ll | 2 +- test/Transforms/InstCombine/add2.ll | 272 + test/Transforms/InstCombine/add4.ll | 23 + test/Transforms/InstCombine/addrspacecast.ll | 80 +- test/Transforms/InstCombine/align-2d-gep.ll | 2 +- test/Transforms/InstCombine/alloca.ll | 21 + test/Transforms/InstCombine/ashr-nop.ll | 8 - test/Transforms/InstCombine/bitcast-store.ll | 18 +- test/Transforms/InstCombine/blend_x86.ll | 55 + .../InstCombine/call-cast-target-inalloca.ll | 22 + test/Transforms/InstCombine/call-cast-target.ll | 12 + test/Transforms/InstCombine/cast-call-combine.ll | 23 + test/Transforms/InstCombine/cast-set.ll | 7 + test/Transforms/InstCombine/cast.ll | 59 +- test/Transforms/InstCombine/ceil.ll | 56 + .../constant-fold-address-space-pointer.ll | 10 + test/Transforms/InstCombine/constant-fold-math.ll | 47 + test/Transforms/InstCombine/copysign.ll | 49 + test/Transforms/InstCombine/descale-zero.ll | 21 + test/Transforms/InstCombine/distribute.ll | 68 + test/Transforms/InstCombine/div.ll | 43 + .../InstCombine/double-float-shrink-1.ll | 5 +- test/Transforms/InstCombine/exp2-1.ll | 24 + test/Transforms/InstCombine/fast-math.ll | 53 + test/Transforms/InstCombine/fdiv.ll | 26 + test/Transforms/InstCombine/ffs-1.ll | 6 +- .../Transforms/InstCombine/float-shrink-compare.ll | 54 + test/Transforms/InstCombine/fmul.ll | 34 +- test/Transforms/InstCombine/fpcast.ll | 9 + test/Transforms/InstCombine/fpextend.ll | 14 +- test/Transforms/InstCombine/fpextend_x86.ll | 57 + test/Transforms/InstCombine/fprintf-1.ll | 8 +- test/Transforms/InstCombine/gep-addrspace.ll | 17 +- test/Transforms/InstCombine/gepphigep.ll | 56 + test/Transforms/InstCombine/getelementptr.ll | 37 +- test/Transforms/InstCombine/icmp.ll | 72 +- .../InstCombine/insert-extract-shuffle.ll | 37 + test/Transforms/InstCombine/intrinsics.ll | 13 + test/Transforms/InstCombine/load-addrspace-cast.ll | 12 + test/Transforms/InstCombine/load.ll | 48 +- test/Transforms/InstCombine/loadstore-alignment.ll | 114 +- test/Transforms/InstCombine/memcpy-from-global.ll | 68 +- test/Transforms/InstCombine/mul.ll | 16 + test/Transforms/InstCombine/onehot_merge.ll | 4 +- test/Transforms/InstCombine/overflow-mul.ll | 175 + test/Transforms/InstCombine/pow-1.ll | 29 +- test/Transforms/InstCombine/pr19420.ll | 67 + test/Transforms/InstCombine/pr20059.ll | 16 + test/Transforms/InstCombine/pr20079.ll | 9 + test/Transforms/InstCombine/printf-1.ll | 8 +- test/Transforms/InstCombine/r600-intrinsics.ll | 47 + test/Transforms/InstCombine/rem.ll | 11 +- test/Transforms/InstCombine/round.ll | 90 + test/Transforms/InstCombine/select-2.ll | 10 + test/Transforms/InstCombine/select-select.ll | 24 + test/Transforms/InstCombine/select.ll | 213 +- test/Transforms/InstCombine/sext.ll | 4 +- test/Transforms/InstCombine/shift.ll | 94 +- test/Transforms/InstCombine/sign-test-and-or.ll | 38 + test/Transforms/InstCombine/sincospi.ll | 9 +- test/Transforms/InstCombine/sprintf-1.ll | 8 +- test/Transforms/InstCombine/strchr-1.ll | 13 + test/Transforms/InstCombine/strlen-1.ll | 12 + test/Transforms/InstCombine/sub.ll | 74 +- test/Transforms/InstCombine/vec_demanded_elts.ll | 366 + test/Transforms/InstCombine/vec_phi_extract.ll | 4 +- test/Transforms/InstCombine/vec_sext.ll | 23 + test/Transforms/InstCombine/vec_shuffle.ll | 186 + test/Transforms/InstCombine/zext-bool-add-sub.ll | 2 +- test/Transforms/InstCombine/zext.ll | 34 + test/Transforms/InstMerge/ld_hoist_st_sink.ll | 84 + .../InstSimplify/2010-12-20-Distribute.ll | 62 - test/Transforms/InstSimplify/apint-or.ll | 37 + test/Transforms/InstSimplify/ashr-nop.ll | 10 + test/Transforms/InstSimplify/compare.ll | 230 + test/Transforms/InstSimplify/dead-code-removal.ll | 15 + test/Transforms/InstSimplify/undef.ll | 7 + test/Transforms/InstSimplify/vector_gep.ll | 49 +- .../Internalize/2009-01-05-InternalizeAliases.ll | 11 +- test/Transforms/Internalize/lists.ll | 11 +- test/Transforms/Internalize/local-visibility.ll | 25 + test/Transforms/JumpThreading/phi-eq.ll | 2 +- test/Transforms/JumpThreading/pr15851_hang.ll | 22 + test/Transforms/JumpThreading/select.ll | 2 +- test/Transforms/LICM/extra-copies.ll | 29 + test/Transforms/LICM/hoist-bitcast-load.ll | 239 + test/Transforms/LICM/hoist-deref-load.ll | 168 + test/Transforms/LICM/lcssa-ssa-promoter.ll | 76 + test/Transforms/LICM/scalar_promote.ll | 12 +- test/Transforms/LICM/sinking.ll | 104 +- test/Transforms/LICM/volatile-alias.ll | 2 +- test/Transforms/LoadCombine/load-combine.ll | 190 + test/Transforms/LoopIdiom/R600/lit.local.cfg | 3 + test/Transforms/LoopIdiom/R600/popcnt.ll | 104 + test/Transforms/LoopIdiom/X86/lit.local.cfg | 3 +- test/Transforms/LoopRotate/PhiSelfReference-1.ll | 39 + test/Transforms/LoopRotate/PhiSelfRefernce-1.ll | 39 - test/Transforms/LoopRotate/dbgvalue.ll | 6 +- .../LoopRotate/preserve-loop-simplify.ll | 65 + .../LoopSimplify/2007-10-28-InvokeCrash.ll | 2 +- test/Transforms/LoopSimplify/ashr-crash.ll | 80 + test/Transforms/LoopSimplify/notify-scev.ll | 110 + .../LoopStrengthReduce/AArch64/lit.local.cfg | 4 + .../LoopStrengthReduce/AArch64/lsr-memcpy.ll | 33 + .../LoopStrengthReduce/AArch64/lsr-memset.ll | 101 + .../LoopStrengthReduce/AArch64/req-regs.ll | 70 + .../ARM/2012-06-15-lsr-noaddrmode.ll | 2 +- .../LoopStrengthReduce/ARM/ivchain-ARM.ll | 3 +- .../LoopStrengthReduce/ARM/lit.local.cfg | 3 +- .../LoopStrengthReduce/X86/ivchain-X86.ll | 2 + .../LoopStrengthReduce/X86/lit.local.cfg | 3 +- .../X86/no_superflous_induction_vars.ll | 50 + test/Transforms/LoopStrengthReduce/X86/pr17473.ll | 2 +- .../dont_insert_redundant_ops.ll | 6 +- .../LoopStrengthReduce/lsr-expand-quadratic.ll | 2 +- test/Transforms/LoopStrengthReduce/pr18165.ll | 2 +- test/Transforms/LoopUnroll/PowerPC/lit.local.cfg | 3 +- test/Transforms/LoopUnroll/X86/lit.local.cfg | 3 + test/Transforms/LoopUnroll/X86/partial.ll | 127 + test/Transforms/LoopUnroll/loop-remarks.ll | 25 + test/Transforms/LoopUnroll/pr18861.ll | 43 + test/Transforms/LoopUnroll/runtime-loop.ll | 6 + .../LoopUnroll/unroll-pragmas-disabled.ll | 69 + test/Transforms/LoopUnroll/unroll-pragmas.ll | 289 + .../LoopVectorize/AArch64/aarch64-unroll.ll | 42 + .../LoopVectorize/AArch64/arm64-unroll.ll | 42 + .../LoopVectorize/AArch64/gather-cost.ll | 85 + .../Transforms/LoopVectorize/AArch64/lit.local.cfg | 5 + test/Transforms/LoopVectorize/ARM/arm-unroll.ll | 39 + test/Transforms/LoopVectorize/ARM/lit.local.cfg | 3 +- .../Transforms/LoopVectorize/PowerPC/lit.local.cfg | 3 + .../LoopVectorize/PowerPC/vsx-tsvc-s173.ll | 51 + .../LoopVectorize/X86/already-vectorized.ll | 6 +- test/Transforms/LoopVectorize/X86/avx512.ll | 35 + .../LoopVectorize/X86/fp32_to_uint32-cost-model.ll | 39 + .../LoopVectorize/X86/fp64_to_uint32-cost-model.ll | 40 + .../LoopVectorize/X86/fp_to_sint8-cost-model.ll | 25 + test/Transforms/LoopVectorize/X86/lit.local.cfg | 3 +- .../LoopVectorize/X86/metadata-enable.ll | 176 + test/Transforms/LoopVectorize/X86/small-size.ll | 27 +- .../LoopVectorize/X86/uint64_to_fp64-cost-model.ll | 26 + .../LoopVectorize/X86/unroll-small-loops.ll | 72 +- .../Transforms/LoopVectorize/X86/vect.omp.force.ll | 93 + .../LoopVectorize/X86/vect.omp.force.small-tc.ll | 73 + .../LoopVectorize/X86/vector_ptr_load_store.ll | 2 +- .../X86/vectorization-remarks-missed.ll | 161 + .../LoopVectorize/X86/vectorization-remarks.ll | 74 + test/Transforms/LoopVectorize/XCore/lit.local.cfg | 3 +- test/Transforms/LoopVectorize/calloc.ll | 2 +- test/Transforms/LoopVectorize/control-flow.ll | 78 + test/Transforms/LoopVectorize/flags.ll | 26 + test/Transforms/LoopVectorize/float-reduction.ll | 2 +- test/Transforms/LoopVectorize/gcc-examples.ll | 4 +- test/Transforms/LoopVectorize/global_alias.ll | 8 +- test/Transforms/LoopVectorize/if-conversion.ll | 2 +- test/Transforms/LoopVectorize/if-pred-stores.ll | 126 + test/Transforms/LoopVectorize/increment.ll | 2 +- test/Transforms/LoopVectorize/induction.ll | 65 +- test/Transforms/LoopVectorize/intrinsic.ll | 102 + test/Transforms/LoopVectorize/metadata-unroll.ll | 2 +- test/Transforms/LoopVectorize/metadata-width.ll | 2 +- test/Transforms/LoopVectorize/metadata.ll | 44 + .../LoopVectorize/multi-use-reduction-bug.ll | 2 +- .../LoopVectorize/multiple-address-spaces.ll | 2 +- test/Transforms/LoopVectorize/no_array_bounds.ll | 101 + test/Transforms/LoopVectorize/no_switch.ll | 86 + test/Transforms/LoopVectorize/ptr_loops.ll | 2 +- .../LoopVectorize/runtime-check-address-space.ll | 2 +- .../LoopVectorize/runtime-check-readonly.ll | 15 +- test/Transforms/LoopVectorize/store-shuffle-bug.ll | 19 +- test/Transforms/LoopVectorize/tbaa-nodep.ll | 102 + test/Transforms/LoopVectorize/unroll_novec.ll | 12 +- test/Transforms/LoopVectorize/value-ptr-bug.ll | 2 +- .../LoopVectorize/vect.omp.persistence.ll | 88 + test/Transforms/LoopVectorize/vect.stats.ll | 65 + test/Transforms/LoopVectorize/vectorize-once.ll | 6 +- .../Transforms/LoopVectorize/version-mem-access.ll | 87 + test/Transforms/LowerAtomic/atomic-swap.ll | 17 +- test/Transforms/LowerExpectIntrinsic/basic.ll | 29 + test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll | 15 - .../LowerInvoke/2005-08-03-InvokeWithPHI.ll | 17 - .../LowerInvoke/2005-08-03-InvokeWithPHIUse.ll | 15 - .../LowerInvoke/2008-02-14-CritEdgePhiCrash.ll | 14 - test/Transforms/LowerInvoke/basictest.ll | 30 - test/Transforms/LowerInvoke/lowerinvoke.ll | 25 + .../LowerSwitch/2014-06-10-SwitchContiguousOpt.ll | 27 + .../2014-06-11-SwitchDefaultUnreachableOpt.ll | 41 + .../LowerSwitch/2014-06-23-PHIlowering.ll | 40 + test/Transforms/LowerSwitch/feature.ll | 114 +- .../MemCpyOpt/2008-02-24-MultipleUseofSRet.ll | 4 +- .../MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll | 2 +- test/Transforms/MemCpyOpt/capturing-func.ll | 22 + test/Transforms/MemCpyOpt/form-memset.ll | 12 + test/Transforms/MemCpyOpt/loadstore-sret.ll | 2 +- test/Transforms/MemCpyOpt/memcpy-undef.ll | 46 + test/Transforms/MemCpyOpt/memcpy.ll | 21 +- test/Transforms/MemCpyOpt/sret.ll | 2 +- .../MergeFunc/call-and-invoke-with-ranges.ll | 91 + test/Transforms/MergeFunc/crash.ll | 14 +- test/Transforms/MergeFunc/functions.ll | 27 + .../Transforms/MergeFunc/inttoptr-address-space.ll | 6 +- test/Transforms/MergeFunc/inttoptr.ll | 14 +- .../MergeFunc/mergefunc-struct-return.ll | 40 + test/Transforms/MergeFunc/ranges.ll | 43 + test/Transforms/MetaRenamer/metarenamer.ll | 4 +- test/Transforms/ObjCARC/allocas.ll | 4 +- .../Transforms/ObjCARC/contract-end-of-use-list.ll | 30 + ...ensure-that-exception-unwind-path-is-visited.ll | 4 +- .../Reassociate/2002-05-15-AgressiveSubMove.ll | 15 +- .../Reassociate/2002-05-15-MissedTree.ll | 14 +- .../Reassociate/2002-05-15-SubReassociate.ll | 34 +- .../Reassociate/2002-05-15-SubReassociate2.ll | 13 - .../Reassociate/2005-09-01-ArrayOutOfBounds.ll | 43 +- .../Reassociate/2006-04-27-ReassociateVector.ll | 16 +- test/Transforms/Reassociate/basictest.ll | 201 +- test/Transforms/Reassociate/fp-commute.ll | 21 +- test/Transforms/Reassociate/inverses.ll | 12 + test/Transforms/Reassociate/looptest.ll | 1 + test/Transforms/Reassociate/mightymul.ll | 4 +- test/Transforms/Reassociate/multistep.ll | 1 - test/Transforms/Reassociate/negation.ll | 36 +- test/Transforms/Reassociate/otherops.ll | 42 +- test/Transforms/Reassociate/shift-factor.ll | 20 +- test/Transforms/Reassociate/subtest.ll | 31 +- test/Transforms/Reassociate/subtest2.ll | 13 - test/Transforms/SCCP/atomic.ll | 9 + .../Transforms/SLPVectorizer/AArch64/lit.local.cfg | 2 + .../SLPVectorizer/AArch64/mismatched-intrinsics.ll | 18 + test/Transforms/SLPVectorizer/ARM/lit.local.cfg | 3 +- test/Transforms/SLPVectorizer/R600/lit.local.cfg | 3 +- test/Transforms/SLPVectorizer/X86/addsub.ll | 181 + test/Transforms/SLPVectorizer/X86/align.ll | 27 + test/Transforms/SLPVectorizer/X86/call.ll | 128 + .../SLPVectorizer/X86/consecutive-access.ll | 175 + .../SLPVectorizer/X86/continue_vectorizing.ll | 31 + .../SLPVectorizer/X86/crash_vectorizeTree.ll | 65 + test/Transforms/SLPVectorizer/X86/cse.ll | 30 + test/Transforms/SLPVectorizer/X86/extractcost.ll | 30 + test/Transforms/SLPVectorizer/X86/gep.ll | 41 + .../X86/insert-element-build-vector.ll | 85 + test/Transforms/SLPVectorizer/X86/intrinsic.ll | 386 + test/Transforms/SLPVectorizer/X86/lit.local.cfg | 3 +- test/Transforms/SLPVectorizer/X86/metadata.ll | 61 + .../X86/non-vectorizable-intrinsic.ll | 36 + test/Transforms/SLPVectorizer/X86/phi.ll | 2 +- test/Transforms/SLPVectorizer/X86/pr19657.ll | 73 + test/Transforms/SLPVectorizer/X86/tiny-tree.ll | 15 + test/Transforms/SLPVectorizer/X86/value-bug.ll | 80 + test/Transforms/SLPVectorizer/XCore/lit.local.cfg | 3 +- test/Transforms/SROA/address-spaces.ll | 68 + test/Transforms/SROA/basictest.ll | 86 +- test/Transforms/SROA/slice-order-independence.ll | 37 + test/Transforms/SROA/slice-width.ll | 25 + test/Transforms/SROA/vector-promotion.ll | 47 + .../Inputs/bad_discriminator_value.prof | 2 + .../SampleProfile/Inputs/bad_fn_header.prof | 3 + .../SampleProfile/Inputs/bad_line_values.prof | 2 + .../SampleProfile/Inputs/bad_mangle.prof | 3 + .../SampleProfile/Inputs/bad_sample_line.prof | 3 + .../SampleProfile/Inputs/bad_samples.prof | 2 + test/Transforms/SampleProfile/Inputs/branch.prof | 5 +- test/Transforms/SampleProfile/Inputs/calls.prof | 10 + .../SampleProfile/Inputs/discriminator.prof | 8 + .../Transforms/SampleProfile/Inputs/propagate.prof | 17 + test/Transforms/SampleProfile/Inputs/syntax.prof | 3 + test/Transforms/SampleProfile/branch.ll | 18 +- test/Transforms/SampleProfile/calls.ll | 116 + test/Transforms/SampleProfile/discriminator.ll | 90 + test/Transforms/SampleProfile/propagate.ll | 243 + test/Transforms/SampleProfile/syntax.ll | 20 + .../ScalarRepl/memset-aggregate-byte-leader.ll | 6 +- test/Transforms/ScalarRepl/vector_memcpy.ll | 10 +- test/Transforms/Scalarizer/basic.ll | 451 + test/Transforms/Scalarizer/dbginfo.ll | 86 + test/Transforms/Scalarizer/no-data-layout.ll | 25 + .../SeparateConstOffsetFromGEP/NVPTX/lit.local.cfg | 3 + .../NVPTX/split-gep-and-gvn.ll | 196 + .../SeparateConstOffsetFromGEP/NVPTX/split-gep.ll | 236 + test/Transforms/SimplifyCFG/PR17073.ll | 73 + test/Transforms/SimplifyCFG/SPARC/lit.local.cfg | 3 +- test/Transforms/SimplifyCFG/X86/lit.local.cfg | 3 +- .../Transforms/SimplifyCFG/X86/switch-table-bug.ll | 41 + .../SimplifyCFG/X86/switch_to_lookup_table.ll | 167 + test/Transforms/SimplifyCFG/basictest.ll | 30 + test/Transforms/SimplifyCFG/extract-cost.ll | 22 + .../SimplifyCFG/no_speculative_loads_with_tsan.ll | 40 + .../SimplifyCFG/preserve-branchweights.ll | 84 +- test/Transforms/SimplifyCFG/speculate-math.ll | 58 + .../Transforms/SimplifyCFG/speculate-vector-ops.ll | 60 + .../SimplifyCFG/trapping-load-unreachable.ll | 2 +- test/Transforms/Sink/basic.ll | 79 + test/Transforms/StripSymbols/2010-08-25-crash.ll | 2 +- .../StripSymbols/strip-dead-debug-info.ll | 2 +- test/Transforms/TailCallElim/basic.ll | 45 + test/Transforms/TailDup/X86/lit.local.cfg | 3 +- test/Transforms/TailDup/lit.local.cfg | 3 +- test/Unit/lit.cfg | 13 +- test/Unit/lit.site.cfg.in | 1 - test/Verifier/2010-08-07-PointerIntrinsic.ll | 5 +- test/Verifier/alias.ll | 27 + test/Verifier/aliasing-chain.ll | 6 - .../bitcast-address-space-nested-global-cycle.ll | 4 +- .../bitcast-address-space-nested-global.ll | 4 +- ...ugh-constant-inttoptr-inside-gep-instruction.ll | 5 +- ...cast-address-space-through-constant-inttoptr.ll | 4 +- .../bitcast-address-space-through-gep-2.ll | 4 +- test/Verifier/bitcast-address-space-through-gep.ll | 4 +- .../bitcast-address-space-through-inttoptr.ll | 3 +- test/Verifier/bitcast-address-spaces.ll | 3 +- test/Verifier/bitcast-alias-address-space.ll | 4 +- test/Verifier/bitcast-vector-pointer-as.ll | 4 +- test/Verifier/comdat.ll | 5 + test/Verifier/comdat2.ll | 5 + test/Verifier/global-ctors.ll | 11 + test/Verifier/inalloca-vararg.ll | 9 + test/Verifier/inalloca1.ll | 22 + test/Verifier/inalloca2.ll | 39 + test/Verifier/inalloca3.ll | 13 + test/Verifier/jumptable.ll | 8 + test/Verifier/musttail-invalid.ll | 82 + test/Verifier/musttail-valid.ll | 16 + test/Verifier/range-1.ll | 2 +- test/Verifier/range-2.ll | 30 + test/Verifier/recursive-type-1.ll | 12 + test/Verifier/recursive-type-2.ll | 14 + test/Verifier/recursive-type-3.ll | 11 + test/Verifier/sret.ll | 7 + test/Verifier/varargs-intrinsic.ll | 6 +- test/lit.cfg | 87 +- test/lit.site.cfg.in | 2 + test/tools/llvm-cov/Inputs/copy_block_helper.gcda | Bin 0 -> 432 bytes test/tools/llvm-cov/Inputs/copy_block_helper.gcno | Bin 0 -> 1140 bytes test/tools/llvm-cov/Inputs/range_based_for.gcda | Bin 0 -> 164 bytes test/tools/llvm-cov/Inputs/range_based_for.gcno | Bin 0 -> 552 bytes test/tools/llvm-cov/Inputs/test.cpp | 5 +- test/tools/llvm-cov/Inputs/test.cpp.gcov | 82 - test/tools/llvm-cov/Inputs/test.gcda | Bin 824 -> 904 bytes test/tools/llvm-cov/Inputs/test.gcno | Bin 3112 -> 3552 bytes test/tools/llvm-cov/Inputs/test.h | 3 + test/tools/llvm-cov/Inputs/test_-a.cpp.gcov | 111 + test/tools/llvm-cov/Inputs/test_-a.h.gcov | 10 + test/tools/llvm-cov/Inputs/test_-a_-b.cpp.gcov | 134 + test/tools/llvm-cov/Inputs/test_-a_-b.h.gcov | 12 + .../llvm-cov/Inputs/test_-a_-b_-c_-u.cpp.gcov | 160 + test/tools/llvm-cov/Inputs/test_-a_-b_-c_-u.h.gcov | 14 + test/tools/llvm-cov/Inputs/test_-a_-b_-u.cpp.gcov | 160 + test/tools/llvm-cov/Inputs/test_-a_-b_-u.h.gcov | 14 + test/tools/llvm-cov/Inputs/test_-b.output | 13 + test/tools/llvm-cov/Inputs/test_-b_-f.output | 65 + test/tools/llvm-cov/Inputs/test_-f.output | 38 + .../llvm-cov/Inputs/test_file_checksum_fail.gcda | Bin 0 -> 825 bytes .../llvm-cov/Inputs/test_func_checksum_fail.gcda | Bin 0 -> 825 bytes .../llvm-cov/Inputs/test_long_file_names.output | 8 + test/tools/llvm-cov/Inputs/test_long_paths.output | 8 + test/tools/llvm-cov/Inputs/test_missing.cpp.gcov | 77 + test/tools/llvm-cov/Inputs/test_missing.h.gcov | 6 + test/tools/llvm-cov/Inputs/test_missing.output | 8 + test/tools/llvm-cov/Inputs/test_no_gcda.cpp.gcov | 79 + test/tools/llvm-cov/Inputs/test_no_gcda.h.gcov | 8 + test/tools/llvm-cov/Inputs/test_no_gcda.output | 8 + .../tools/llvm-cov/Inputs/test_no_options.cpp.gcov | 79 + test/tools/llvm-cov/Inputs/test_no_options.h.gcov | 8 + test/tools/llvm-cov/Inputs/test_no_options.output | 8 + test/tools/llvm-cov/Inputs/test_no_output.output | 6 + .../llvm-cov/Inputs/test_no_preserve_paths.output | 8 + test/tools/llvm-cov/Inputs/test_objdir.cpp.gcov | 79 + test/tools/llvm-cov/Inputs/test_objdir.h.gcov | 8 + test/tools/llvm-cov/Inputs/test_paths.cpp.gcov | 79 + test/tools/llvm-cov/Inputs/test_paths.gcda | Bin 0 -> 904 bytes test/tools/llvm-cov/Inputs/test_paths.gcno | Bin 0 -> 4476 bytes test/tools/llvm-cov/Inputs/test_paths.h.gcov | 8 + .../llvm-cov/Inputs/test_preserve_paths.output | 8 + test/tools/llvm-cov/Inputs/test_read_fail.gcno | Bin 111 -> 71 bytes test/tools/llvm-cov/copy_block_helper.m | 32 + test/tools/llvm-cov/lit.local.cfg | 2 +- test/tools/llvm-cov/llvm-cov.test | 115 +- test/tools/llvm-cov/range_based_for.cpp | 29 + .../tools/llvm-objdump/Inputs/export.dll.coff-i386 | Bin 0 -> 1052 bytes .../tools/llvm-objdump/Inputs/file-aux-record.yaml | 21 + test/tools/llvm-objdump/Inputs/file.obj.coff-arm | Bin 0 -> 374 bytes .../llvm-objdump/Inputs/large-bss.obj.coff-i386 | Bin 0 -> 270 bytes .../tools/llvm-objdump/Inputs/many-relocs.obj-i386 | Bin 0 -> 305 bytes test/tools/llvm-objdump/Inputs/nop.exe.coff-i386 | Bin 7680 -> 6144 bytes .../Inputs/out-of-section-sym.elf-i386 | Bin 0 -> 4450 bytes .../tools/llvm-objdump/Inputs/out-of-section-sym.s | 15 + .../Inputs/win64-unwind.exe.coff-x86_64 | Bin 698 -> 0 bytes .../Inputs/win64-unwind.exe.coff-x86_64.exe | Bin 0 -> 2560 bytes .../Inputs/win64-unwind.exe.coff-x86_64.obj | Bin 0 -> 698 bytes test/tools/llvm-objdump/coff-file.test | 6 + test/tools/llvm-objdump/coff-large-bss.test | 6 + test/tools/llvm-objdump/coff-many-relocs.test | 14 + .../coff-non-null-terminated-file.test | 5 + test/tools/llvm-objdump/coff-private-headers.test | 70 +- test/tools/llvm-objdump/hex-relocation-addr.test | 17 + test/tools/llvm-objdump/lit.local.cfg | 3 +- test/tools/llvm-objdump/out-of-section-sym.test | 13 + test/tools/llvm-objdump/win64-unwind-data.test | 155 +- test/tools/llvm-profdata/Inputs/bad-hash.profdata | 4 + test/tools/llvm-profdata/Inputs/bar3-1.profdata | 6 + test/tools/llvm-profdata/Inputs/c-general.profdata | Bin 0 -> 1384 bytes test/tools/llvm-profdata/Inputs/empty.profdata | 0 .../tools/llvm-profdata/Inputs/extra-word.profdata | 2 + test/tools/llvm-profdata/Inputs/foo3-1.profdata | 6 + test/tools/llvm-profdata/Inputs/foo3-2.profdata | 6 + .../tools/llvm-profdata/Inputs/foo3bar3-1.profdata | 13 + .../tools/llvm-profdata/Inputs/foo3bar3-2.profdata | 13 + test/tools/llvm-profdata/Inputs/foo4-1.profdata | 7 + test/tools/llvm-profdata/Inputs/foo4-2.profdata | 7 + .../Inputs/invalid-count-later.profdata | 4 + test/tools/llvm-profdata/Inputs/no-counts.profdata | 3 + test/tools/llvm-profdata/Inputs/overflow.profdata | 4 + test/tools/llvm-profdata/c-general.test | 24 + test/tools/llvm-profdata/errors.test | 16 + test/tools/llvm-profdata/raw-32-bits-be.test | 42 + test/tools/llvm-profdata/raw-32-bits-le.test | 42 + test/tools/llvm-profdata/raw-64-bits-be.test | 42 + test/tools/llvm-profdata/raw-64-bits-le.test | 42 + .../llvm-profdata/raw-magic-but-no-header.test | 6 + test/tools/llvm-profdata/raw-two-profiles.test | 64 + test/tools/llvm-profdata/simple.test | 77 + test/tools/llvm-readobj/ARM/attributes.s | 287 + test/tools/llvm-readobj/ARM/lit.local.cfg | 3 + test/tools/llvm-readobj/ARM/unwind.s | 326 + test/tools/llvm-readobj/Inputs/cxx-cli-aux.cpp | 2 + .../llvm-readobj/Inputs/cxx-cli-aux.obj.coff-i386 | Bin 0 -> 2682 bytes .../llvm-readobj/Inputs/dynamic-table-exe.mips | Bin 0 -> 6333 bytes .../llvm-readobj/Inputs/dynamic-table-exe.x86 | Bin 0 -> 6555 bytes .../llvm-readobj/Inputs/dynamic-table-so.mips | Bin 0 -> 5395 bytes test/tools/llvm-readobj/Inputs/dynamic-table.c | 6 +- test/tools/llvm-readobj/Inputs/dynamic-table.mips | Bin 5395 -> 0 bytes .../tools/llvm-readobj/Inputs/file-aux-record.yaml | 21 + .../Inputs/file-multiple-aux-records.yaml | 21 + .../tools/llvm-readobj/Inputs/got-empty.exe.mipsel | Bin 0 -> 9400 bytes .../llvm-readobj/Inputs/got-tls.so.elf-mips64el | Bin 0 -> 7398 bytes .../Inputs/multifile-linetables.obj.coff-2012-i368 | Bin 0 -> 1631 bytes .../multifile-linetables.obj.coff-2012-x86_64 | Bin 0 -> 1799 bytes .../multifunction-linetables.obj.coff-2012-i368 | Bin 0 -> 2155 bytes .../multifunction-linetables.obj.coff-2012-x86_64 | Bin 0 -> 2475 bytes test/tools/llvm-readobj/Inputs/nop.exe.coff-x86-64 | Bin 0 -> 1024 bytes .../tools/llvm-readobj/Inputs/trivial.obj.coff-arm | Bin 0 -> 367 bytes .../llvm-readobj/Inputs/trivial.obj.coff-i386 | Bin 314 -> 350 bytes .../llvm-readobj/Inputs/trivial.obj.elf-mipsel | Bin 0 -> 629 bytes .../Inputs/zero-string-table.obj.coff-i386 | Bin 0 -> 704 bytes test/tools/llvm-readobj/codeview-linetables.test | 282 + .../llvm-readobj/coff-file-sections-reading.test | 18 + .../coff-non-null-terminated-file.test | 20 + .../tools/llvm-readobj/coff-zero-string-table.test | 8 + test/tools/llvm-readobj/cxx-cli-aux.test | 42 + test/tools/llvm-readobj/dynamic.test | 84 +- test/tools/llvm-readobj/file-headers.test | 19 +- test/tools/llvm-readobj/mips-got.test | 331 + test/tools/llvm-readobj/peplus.test | 83 + test/tools/llvm-readobj/program-headers.test | 28 +- test/tools/llvm-readobj/relocations.test | 52 +- test/tools/llvm-readobj/sections-ext.test | 79 +- test/tools/llvm-readobj/sections.test | 33 + test/tools/llvm-readobj/symbols.test | 22 +- 4120 files changed, 247166 insertions(+), 221073 deletions(-) create mode 100644 test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll create mode 100644 test/Analysis/BasicAA/cs-cs.ll create mode 100644 test/Analysis/BasicAA/pr18573.ll create mode 100644 test/Analysis/BlockFrequencyInfo/bad_input.ll create mode 100644 test/Analysis/BlockFrequencyInfo/double_backedge.ll create mode 100644 test/Analysis/BlockFrequencyInfo/double_exit.ll create mode 100644 test/Analysis/BlockFrequencyInfo/irreducible.ll create mode 100644 test/Analysis/BlockFrequencyInfo/loop_with_branch.ll create mode 100644 test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll create mode 100644 test/Analysis/BranchProbabilityInfo/pr18705.ll create mode 100644 test/Analysis/CostModel/AArch64/lit.local.cfg create mode 100644 test/Analysis/CostModel/AArch64/select.ll create mode 100644 test/Analysis/CostModel/AArch64/store.ll create mode 100644 test/Analysis/CostModel/PowerPC/ext.ll create mode 100644 test/Analysis/CostModel/X86/alternate-shuffle-cost.ll create mode 100644 test/Analysis/CostModel/X86/scalarize.ll create mode 100644 test/Analysis/CostModel/X86/vdiv-cost.ll create mode 100644 test/Analysis/CostModel/X86/vselect-cost.ll create mode 100644 test/Analysis/CostModel/X86/vshift-cost.ll create mode 100644 test/Analysis/Delinearization/gcd_multiply_expr.ll create mode 100644 test/Analysis/Delinearization/iv_times_constant_in_subscript.ll create mode 100644 test/Analysis/Delinearization/multidim_two_accesses_different_delinearization.ll create mode 100644 test/Analysis/Delinearization/undef.ll create mode 100644 test/Analysis/LazyCallGraph/basic.ll create mode 100644 test/Analysis/Lint/address-spaces.ll create mode 100644 test/Analysis/ScalarEvolution/trip-count-pow2.ll create mode 100644 test/Analysis/ScalarEvolution/trip-count-switch.ll delete mode 100644 test/Analysis/ScalarEvolution/xor-and.ll delete mode 100644 test/Assembler/2009-04-25-AliasGEP.ll create mode 100644 test/Assembler/ConstantExprFoldSelect.ll create mode 100644 test/Assembler/addrspacecast-alias.ll create mode 100644 test/Assembler/alias-redefinition.ll create mode 100644 test/Assembler/getInt.ll create mode 100644 test/Assembler/inalloca.ll create mode 100644 test/Assembler/internal-hidden-alias.ll create mode 100644 test/Assembler/internal-hidden-function.ll create mode 100644 test/Assembler/internal-hidden-variable.ll create mode 100644 test/Assembler/internal-protected-alias.ll create mode 100644 test/Assembler/internal-protected-function.ll create mode 100644 test/Assembler/internal-protected-variable.ll create mode 100644 test/Assembler/invalid-comdat.ll create mode 100644 test/Assembler/invalid-comdat2.ll create mode 100644 test/Assembler/invalid-name.ll create mode 100644 test/Assembler/invalid_cast3.ll create mode 100644 test/Assembler/private-hidden-alias.ll create mode 100644 test/Assembler/private-hidden-function.ll create mode 100644 test/Assembler/private-hidden-variable.ll create mode 100644 test/Assembler/private-protected-alias.ll create mode 100644 test/Assembler/private-protected-function.ll create mode 100644 test/Assembler/private-protected-variable.ll create mode 100644 test/Assembler/upgrade-loop-metadata.ll create mode 100644 test/Bitcode/aggregateInstructions.3.2.ll create mode 100644 test/Bitcode/aggregateInstructions.3.2.ll.bc create mode 100644 test/Bitcode/atomic.ll create mode 100644 test/Bitcode/binaryFloatInstructions.3.2.ll create mode 100644 test/Bitcode/binaryFloatInstructions.3.2.ll.bc create mode 100644 test/Bitcode/binaryIntInstructions.3.2.ll create mode 100644 test/Bitcode/binaryIntInstructions.3.2.ll.bc create mode 100644 test/Bitcode/bitwiseInstructions.3.2.ll create mode 100644 test/Bitcode/bitwiseInstructions.3.2.ll.bc create mode 100644 test/Bitcode/calling-conventions.3.2.ll create mode 100644 test/Bitcode/calling-conventions.3.2.ll.bc create mode 100644 test/Bitcode/cmpxchg-upgrade.ll create mode 100644 test/Bitcode/cmpxchg-upgrade.ll.bc create mode 100644 test/Bitcode/conversionInstructions.3.2.ll create mode 100644 test/Bitcode/conversionInstructions.3.2.ll.bc create mode 100644 test/Bitcode/deprecated-linker_private-linker_private_weak.ll create mode 100644 test/Bitcode/global-variables.3.2.ll create mode 100644 test/Bitcode/global-variables.3.2.ll.bc create mode 100644 test/Bitcode/inalloca.ll create mode 100644 test/Bitcode/linkage-types-3.2.ll create mode 100644 test/Bitcode/linkage-types-3.2.ll.bc create mode 100644 test/Bitcode/local-linkage-default-visibility.3.4.ll create mode 100644 test/Bitcode/local-linkage-default-visibility.3.4.ll.bc create mode 100644 test/Bitcode/memInstructions.3.2.ll create mode 100644 test/Bitcode/memInstructions.3.2.ll.bc create mode 100644 test/Bitcode/miscInstructions.3.2.ll create mode 100644 test/Bitcode/miscInstructions.3.2.ll.bc create mode 100644 test/Bitcode/old-aliases.ll create mode 100644 test/Bitcode/old-aliases.ll.bc create mode 100644 test/Bitcode/pr18704.ll create mode 100644 test/Bitcode/pr18704.ll.bc create mode 100644 test/Bitcode/tailcall.ll create mode 100644 test/Bitcode/terminatorInstructions.3.2.ll create mode 100644 test/Bitcode/terminatorInstructions.3.2.ll.bc create mode 100644 test/Bitcode/upgrade-global-ctors.ll create mode 100644 test/Bitcode/upgrade-global-ctors.ll.bc create mode 100644 test/Bitcode/upgrade-loop-metadata.ll create mode 100644 test/Bitcode/upgrade-loop-metadata.ll.bc create mode 100644 test/Bitcode/variableArgumentIntrinsic.3.2.ll create mode 100644 test/Bitcode/variableArgumentIntrinsic.3.2.ll.bc create mode 100644 test/Bitcode/vectorInstructions.3.2.ll create mode 100644 test/Bitcode/vectorInstructions.3.2.ll.bc create mode 100644 test/Bitcode/visibility-styles.3.2.ll create mode 100644 test/Bitcode/visibility-styles.3.2.ll.bc create mode 100644 test/Bitcode/weak-cmpxchg-upgrade.ll create mode 100644 test/Bitcode/weak-cmpxchg-upgrade.ll.bc create mode 100755 test/BugPoint/compile-custom.ll create mode 100755 test/BugPoint/compile-custom.ll.py create mode 100644 test/CodeGen/AArch64/128bit_load_store.ll create mode 100644 test/CodeGen/AArch64/aarch64-address-type-promotion-assertion.ll create mode 100644 test/CodeGen/AArch64/aarch64-address-type-promotion.ll create mode 100644 test/CodeGen/AArch64/aarch64-neon-v1i1-setcc.ll create mode 100644 test/CodeGen/AArch64/arm64-2011-03-09-CPSRSpill.ll create mode 100644 test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll create mode 100644 test/CodeGen/AArch64/arm64-2011-03-21-Unaligned-Frame-Index.ll create mode 100644 test/CodeGen/AArch64/arm64-2011-04-21-CPSRBug.ll create mode 100644 test/CodeGen/AArch64/arm64-2011-10-18-LdStOptBug.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-01-11-ComparisonDAGCrash.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-05-07-DAGCombineVectorExtract.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-05-07-MemcpyAlignBug.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-05-09-LOADgot-bug.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-05-22-LdStOptBug.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll create mode 100644 test/CodeGen/AArch64/arm64-2012-07-11-InstrEmitterBug.ll create mode 100644 test/CodeGen/AArch64/arm64-2013-01-13-ffast-fcmp.ll create mode 100644 test/CodeGen/AArch64/arm64-2013-01-23-frem-crash.ll create mode 100644 test/CodeGen/AArch64/arm64-2013-01-23-sext-crash.ll create mode 100644 test/CodeGen/AArch64/arm64-2013-02-12-shufv8i8.ll create mode 100644 test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll create mode 100644 test/CodeGen/AArch64/arm64-AnInfiniteLoopInDAGCombine.ll create mode 100644 test/CodeGen/AArch64/arm64-EXT-undef-mask.ll create mode 100644 test/CodeGen/AArch64/arm64-aapcs.ll create mode 100644 test/CodeGen/AArch64/arm64-abi-varargs.ll create mode 100644 test/CodeGen/AArch64/arm64-abi.ll create mode 100644 test/CodeGen/AArch64/arm64-abi_align.ll create mode 100644 test/CodeGen/AArch64/arm64-addp.ll create mode 100644 test/CodeGen/AArch64/arm64-addr-mode-folding.ll create mode 100644 test/CodeGen/AArch64/arm64-addr-type-promotion.ll create mode 100644 test/CodeGen/AArch64/arm64-addrmode.ll create mode 100644 test/CodeGen/AArch64/arm64-alloc-no-stack-realign.ll create mode 100644 test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll create mode 100644 test/CodeGen/AArch64/arm64-andCmpBrToTBZ.ll create mode 100644 test/CodeGen/AArch64/arm64-ands-bad-peephole.ll create mode 100644 test/CodeGen/AArch64/arm64-anyregcc-crash.ll create mode 100644 test/CodeGen/AArch64/arm64-anyregcc.ll create mode 100644 test/CodeGen/AArch64/arm64-arith-saturating.ll create mode 100644 test/CodeGen/AArch64/arm64-arith.ll create mode 100644 test/CodeGen/AArch64/arm64-arm64-dead-def-elimination-flag.ll create mode 100644 test/CodeGen/AArch64/arm64-atomic-128.ll create mode 100644 test/CodeGen/AArch64/arm64-atomic.ll create mode 100644 test/CodeGen/AArch64/arm64-basic-pic.ll create mode 100644 test/CodeGen/AArch64/arm64-big-endian-bitconverts.ll create mode 100644 test/CodeGen/AArch64/arm64-big-endian-eh.ll create mode 100644 test/CodeGen/AArch64/arm64-big-endian-varargs.ll create mode 100644 test/CodeGen/AArch64/arm64-big-endian-vector-callee.ll create mode 100644 test/CodeGen/AArch64/arm64-big-endian-vector-caller.ll create mode 100644 test/CodeGen/AArch64/arm64-big-imm-offsets.ll create mode 100644 test/CodeGen/AArch64/arm64-big-stack.ll create mode 100644 test/CodeGen/AArch64/arm64-bitfield-extract.ll create mode 100644 test/CodeGen/AArch64/arm64-blockaddress.ll create mode 100644 test/CodeGen/AArch64/arm64-build-vector.ll create mode 100644 test/CodeGen/AArch64/arm64-call-tailcalls.ll create mode 100644 test/CodeGen/AArch64/arm64-cast-opt.ll create mode 100644 test/CodeGen/AArch64/arm64-ccmp-heuristics.ll create mode 100644 test/CodeGen/AArch64/arm64-ccmp.ll create mode 100644 test/CodeGen/AArch64/arm64-clrsb.ll create mode 100644 test/CodeGen/AArch64/arm64-coalesce-ext.ll create mode 100644 test/CodeGen/AArch64/arm64-code-model-large-abs.ll create mode 100644 test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll create mode 100644 test/CodeGen/AArch64/arm64-collect-loh-str.ll create mode 100644 test/CodeGen/AArch64/arm64-collect-loh.ll create mode 100644 test/CodeGen/AArch64/arm64-complex-copy-noneon.ll create mode 100644 test/CodeGen/AArch64/arm64-complex-ret.ll create mode 100644 test/CodeGen/AArch64/arm64-const-addr.ll create mode 100644 test/CodeGen/AArch64/arm64-convert-v4f64.ll create mode 100644 test/CodeGen/AArch64/arm64-copy-tuple.ll create mode 100644 test/CodeGen/AArch64/arm64-crc32.ll create mode 100644 test/CodeGen/AArch64/arm64-crypto.ll create mode 100644 test/CodeGen/AArch64/arm64-cse.ll create mode 100644 test/CodeGen/AArch64/arm64-csel.ll create mode 100644 test/CodeGen/AArch64/arm64-cvt.ll create mode 100644 test/CodeGen/AArch64/arm64-dagcombiner-convergence.ll create mode 100644 test/CodeGen/AArch64/arm64-dagcombiner-dead-indexed-load.ll create mode 100644 test/CodeGen/AArch64/arm64-dagcombiner-indexed-load.ll create mode 100644 test/CodeGen/AArch64/arm64-dagcombiner-load-slicing.ll create mode 100644 test/CodeGen/AArch64/arm64-dead-def-frame-index.ll create mode 100644 test/CodeGen/AArch64/arm64-dead-register-def-bug.ll create mode 100644 test/CodeGen/AArch64/arm64-dup.ll create mode 100644 test/CodeGen/AArch64/arm64-early-ifcvt.ll create mode 100644 test/CodeGen/AArch64/arm64-elf-calls.ll create mode 100644 test/CodeGen/AArch64/arm64-elf-constpool.ll create mode 100644 test/CodeGen/AArch64/arm64-elf-globals.ll create mode 100644 test/CodeGen/AArch64/arm64-ext.ll create mode 100644 test/CodeGen/AArch64/arm64-extend-int-to-fp.ll create mode 100644 test/CodeGen/AArch64/arm64-extend.ll create mode 100644 test/CodeGen/AArch64/arm64-extern-weak.ll create mode 100644 test/CodeGen/AArch64/arm64-extload-knownzero.ll create mode 100644 test/CodeGen/AArch64/arm64-extract.ll create mode 100644 test/CodeGen/AArch64/arm64-extract_subvector.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-addr-offset.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-alloca.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-br.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-call.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-conversion.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-fcmp.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-gv.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-icmp.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-indirectbr.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-intrinsic.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-materialize.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-noconvert.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-rem.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-ret.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel-select.ll create mode 100644 test/CodeGen/AArch64/arm64-fast-isel.ll create mode 100644 test/CodeGen/AArch64/arm64-fastcc-tailcall.ll create mode 100644 test/CodeGen/AArch64/arm64-fastisel-gep-promote-before-add.ll create mode 100644 test/CodeGen/AArch64/arm64-fcmp-opt.ll create mode 100644 test/CodeGen/AArch64/arm64-fcopysign.ll create mode 100644 test/CodeGen/AArch64/arm64-fixed-point-scalar-cvt-dagcombine.ll create mode 100644 test/CodeGen/AArch64/arm64-fmadd.ll create mode 100644 test/CodeGen/AArch64/arm64-fmax.ll create mode 100644 test/CodeGen/AArch64/arm64-fminv.ll create mode 100644 test/CodeGen/AArch64/arm64-fmuladd.ll create mode 100644 test/CodeGen/AArch64/arm64-fold-address.ll create mode 100644 test/CodeGen/AArch64/arm64-fold-lsl.ll create mode 100644 test/CodeGen/AArch64/arm64-fp-contract-zero.ll create mode 100644 test/CodeGen/AArch64/arm64-fp-imm.ll create mode 100644 test/CodeGen/AArch64/arm64-fp.ll create mode 100644 test/CodeGen/AArch64/arm64-fp128-folding.ll create mode 100644 test/CodeGen/AArch64/arm64-fp128.ll create mode 100644 test/CodeGen/AArch64/arm64-frame-index.ll create mode 100644 test/CodeGen/AArch64/arm64-frameaddr.ll create mode 100644 test/CodeGen/AArch64/arm64-global-address.ll create mode 100644 test/CodeGen/AArch64/arm64-hello.ll create mode 100644 test/CodeGen/AArch64/arm64-i16-subreg-extract.ll create mode 100644 test/CodeGen/AArch64/arm64-icmp-opt.ll create mode 100644 test/CodeGen/AArch64/arm64-illegal-float-ops.ll create mode 100644 test/CodeGen/AArch64/arm64-indexed-memory.ll create mode 100644 test/CodeGen/AArch64/arm64-indexed-vector-ldst-2.ll create mode 100644 test/CodeGen/AArch64/arm64-indexed-vector-ldst.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-I.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-J.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-K.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-L.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-M.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-error-N.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm-zero-reg-error.ll create mode 100644 test/CodeGen/AArch64/arm64-inline-asm.ll create mode 100644 test/CodeGen/AArch64/arm64-join-reserved.ll create mode 100644 test/CodeGen/AArch64/arm64-jumptable.ll create mode 100644 test/CodeGen/AArch64/arm64-large-frame.ll create mode 100644 test/CodeGen/AArch64/arm64-ld1.ll create mode 100644 test/CodeGen/AArch64/arm64-ldp.ll create mode 100644 test/CodeGen/AArch64/arm64-ldur.ll create mode 100644 test/CodeGen/AArch64/arm64-ldxr-stxr.ll create mode 100644 test/CodeGen/AArch64/arm64-leaf.ll create mode 100644 test/CodeGen/AArch64/arm64-long-shift.ll create mode 100644 test/CodeGen/AArch64/arm64-memcpy-inline.ll create mode 100644 test/CodeGen/AArch64/arm64-memset-inline.ll create mode 100644 test/CodeGen/AArch64/arm64-memset-to-bzero.ll create mode 100644 test/CodeGen/AArch64/arm64-misched-basic-A53.ll create mode 100644 test/CodeGen/AArch64/arm64-misched-basic-A57.ll create mode 100644 test/CodeGen/AArch64/arm64-misched-forwarding-A53.ll create mode 100644 test/CodeGen/AArch64/arm64-movi.ll create mode 100644 test/CodeGen/AArch64/arm64-mul.ll create mode 100644 test/CodeGen/AArch64/arm64-named-reg-alloc.ll create mode 100644 test/CodeGen/AArch64/arm64-named-reg-notareg.ll create mode 100644 test/CodeGen/AArch64/arm64-neg.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-2velem-high.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-2velem.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-3vdiff.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-aba-abd.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-across.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-add-pairwise.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-add-sub.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-compare-instructions.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-copy.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-copyPhysReg-tuple.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-mul-div.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-scalar-by-elem-mul.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-select_cc.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-simd-ldst-one.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-simd-shift.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-simd-vget.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-v1i1-setcc.ll create mode 100644 test/CodeGen/AArch64/arm64-neon-vector-list-spill.ll create mode 100644 test/CodeGen/AArch64/arm64-patchpoint.ll create mode 100644 test/CodeGen/AArch64/arm64-pic-local-symbol.ll create mode 100644 test/CodeGen/AArch64/arm64-platform-reg.ll create mode 100644 test/CodeGen/AArch64/arm64-popcnt.ll create mode 100644 test/CodeGen/AArch64/arm64-prefetch.ll create mode 100644 test/CodeGen/AArch64/arm64-promote-const.ll create mode 100644 test/CodeGen/AArch64/arm64-redzone.ll create mode 100644 test/CodeGen/AArch64/arm64-reg-copy-noneon.ll create mode 100644 test/CodeGen/AArch64/arm64-register-offset-addressing.ll create mode 100644 test/CodeGen/AArch64/arm64-register-pairing.ll create mode 100644 test/CodeGen/AArch64/arm64-regress-f128csel-flags.ll create mode 100644 test/CodeGen/AArch64/arm64-regress-interphase-shift.ll create mode 100644 test/CodeGen/AArch64/arm64-return-vector.ll create mode 100644 test/CodeGen/AArch64/arm64-returnaddr.ll create mode 100644 test/CodeGen/AArch64/arm64-rev.ll create mode 100644 test/CodeGen/AArch64/arm64-rounding.ll create mode 100644 test/CodeGen/AArch64/arm64-scaled_iv.ll create mode 100644 test/CodeGen/AArch64/arm64-scvt.ll create mode 100644 test/CodeGen/AArch64/arm64-setcc-int-to-fp-combine.ll create mode 100644 test/CodeGen/AArch64/arm64-shifted-sext.ll create mode 100644 test/CodeGen/AArch64/arm64-shrink-v1i64.ll create mode 100644 test/CodeGen/AArch64/arm64-simd-scalar-to-vector.ll create mode 100644 test/CodeGen/AArch64/arm64-simplest-elf.ll create mode 100644 test/CodeGen/AArch64/arm64-sincos.ll create mode 100644 test/CodeGen/AArch64/arm64-sitofp-combine-chains.ll create mode 100644 test/CodeGen/AArch64/arm64-sli-sri-opt.ll create mode 100644 test/CodeGen/AArch64/arm64-smaxv.ll create mode 100644 test/CodeGen/AArch64/arm64-sminv.ll create mode 100644 test/CodeGen/AArch64/arm64-spill-lr.ll create mode 100644 test/CodeGen/AArch64/arm64-spill.ll create mode 100644 test/CodeGen/AArch64/arm64-sqshl-uqshl-i64Contant.ll create mode 100644 test/CodeGen/AArch64/arm64-st1.ll create mode 100644 test/CodeGen/AArch64/arm64-stack-no-frame.ll create mode 100644 test/CodeGen/AArch64/arm64-stackmap.ll create mode 100644 test/CodeGen/AArch64/arm64-stackpointer.ll create mode 100644 test/CodeGen/AArch64/arm64-stacksave.ll create mode 100644 test/CodeGen/AArch64/arm64-stp.ll create mode 100644 test/CodeGen/AArch64/arm64-strict-align.ll create mode 100644 test/CodeGen/AArch64/arm64-stur.ll create mode 100644 test/CodeGen/AArch64/arm64-subsections.ll create mode 100644 test/CodeGen/AArch64/arm64-subvector-extend.ll create mode 100644 test/CodeGen/AArch64/arm64-swizzle-tbl-i16-layout.ll create mode 100644 test/CodeGen/AArch64/arm64-tbl.ll create mode 100644 test/CodeGen/AArch64/arm64-this-return.ll create mode 100644 test/CodeGen/AArch64/arm64-tls-darwin.ll create mode 100644 test/CodeGen/AArch64/arm64-tls-dynamic-together.ll create mode 100644 test/CodeGen/AArch64/arm64-tls-dynamics.ll create mode 100644 test/CodeGen/AArch64/arm64-tls-execs.ll create mode 100644 test/CodeGen/AArch64/arm64-trap.ll create mode 100644 test/CodeGen/AArch64/arm64-trn.ll create mode 100644 test/CodeGen/AArch64/arm64-trunc-store.ll create mode 100644 test/CodeGen/AArch64/arm64-umaxv.ll create mode 100644 test/CodeGen/AArch64/arm64-uminv.ll create mode 100644 test/CodeGen/AArch64/arm64-umov.ll create mode 100644 test/CodeGen/AArch64/arm64-unaligned_ldst.ll create mode 100644 test/CodeGen/AArch64/arm64-uzp.ll create mode 100644 test/CodeGen/AArch64/arm64-vaargs.ll create mode 100644 test/CodeGen/AArch64/arm64-vabs.ll create mode 100644 test/CodeGen/AArch64/arm64-vadd.ll create mode 100644 test/CodeGen/AArch64/arm64-vaddlv.ll create mode 100644 test/CodeGen/AArch64/arm64-vaddv.ll create mode 100644 test/CodeGen/AArch64/arm64-variadic-aapcs.ll create mode 100644 test/CodeGen/AArch64/arm64-vbitwise.ll create mode 100644 test/CodeGen/AArch64/arm64-vclz.ll create mode 100644 test/CodeGen/AArch64/arm64-vcmp.ll create mode 100644 test/CodeGen/AArch64/arm64-vcnt.ll create mode 100644 test/CodeGen/AArch64/arm64-vcombine.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvt.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvt_f.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvt_f32_su32.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvt_n.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvt_su32_f32.ll create mode 100644 test/CodeGen/AArch64/arm64-vcvtxd_f32_f64.ll create mode 100644 test/CodeGen/AArch64/arm64-vecCmpBr.ll create mode 100644 test/CodeGen/AArch64/arm64-vecFold.ll create mode 100644 test/CodeGen/AArch64/arm64-vector-ext.ll create mode 100644 test/CodeGen/AArch64/arm64-vector-imm.ll create mode 100644 test/CodeGen/AArch64/arm64-vector-insertion.ll create mode 100644 test/CodeGen/AArch64/arm64-vector-ldst.ll create mode 100644 test/CodeGen/AArch64/arm64-vext.ll create mode 100644 test/CodeGen/AArch64/arm64-vext_reverse.ll create mode 100644 test/CodeGen/AArch64/arm64-vfloatintrinsics.ll create mode 100644 test/CodeGen/AArch64/arm64-vhadd.ll create mode 100644 test/CodeGen/AArch64/arm64-vhsub.ll create mode 100644 test/CodeGen/AArch64/arm64-virtual_base.ll create mode 100644 test/CodeGen/AArch64/arm64-vmax.ll create mode 100644 test/CodeGen/AArch64/arm64-vminmaxnm.ll create mode 100644 test/CodeGen/AArch64/arm64-vmovn.ll create mode 100644 test/CodeGen/AArch64/arm64-vmul.ll create mode 100644 test/CodeGen/AArch64/arm64-volatile.ll create mode 100644 test/CodeGen/AArch64/arm64-vpopcnt.ll create mode 100644 test/CodeGen/AArch64/arm64-vqadd.ll create mode 100644 test/CodeGen/AArch64/arm64-vqsub.ll create mode 100644 test/CodeGen/AArch64/arm64-vselect.ll create mode 100644 test/CodeGen/AArch64/arm64-vsetcc_fp.ll create mode 100644 test/CodeGen/AArch64/arm64-vshift.ll create mode 100644 test/CodeGen/AArch64/arm64-vshr.ll create mode 100644 test/CodeGen/AArch64/arm64-vshuffle.ll create mode 100644 test/CodeGen/AArch64/arm64-vsqrt.ll create mode 100644 test/CodeGen/AArch64/arm64-vsra.ll create mode 100644 test/CodeGen/AArch64/arm64-vsub.ll create mode 100644 test/CodeGen/AArch64/arm64-weak-reference.ll create mode 100644 test/CodeGen/AArch64/arm64-xaluo.ll create mode 100644 test/CodeGen/AArch64/arm64-zero-cycle-regmov.ll create mode 100644 test/CodeGen/AArch64/arm64-zero-cycle-zeroing.ll create mode 100644 test/CodeGen/AArch64/arm64-zext.ll create mode 100644 test/CodeGen/AArch64/arm64-zextload-unscaled.ll create mode 100644 test/CodeGen/AArch64/arm64-zip.ll create mode 100644 test/CodeGen/AArch64/asm-large-immediate.ll create mode 100644 test/CodeGen/AArch64/assertion-rc-mismatch.ll create mode 100644 test/CodeGen/AArch64/branch-relax-asm.ll create mode 100644 test/CodeGen/AArch64/cmpxchg-idioms.ll create mode 100644 test/CodeGen/AArch64/compiler-ident.ll create mode 100644 test/CodeGen/AArch64/complex-fp-to-int.ll create mode 100644 test/CodeGen/AArch64/complex-int-to-fp.ll create mode 100644 test/CodeGen/AArch64/cpus.ll create mode 100644 test/CodeGen/AArch64/eliminate-trunc.ll create mode 100644 test/CodeGen/AArch64/f16-convert.ll create mode 100644 test/CodeGen/AArch64/fast-isel-mul.ll delete mode 100644 test/CodeGen/AArch64/fp128.ll create mode 100644 test/CodeGen/AArch64/free-zext.ll create mode 100644 test/CodeGen/AArch64/funcptr_cast.ll create mode 100644 test/CodeGen/AArch64/global-merge-1.ll create mode 100644 test/CodeGen/AArch64/global-merge-2.ll create mode 100644 test/CodeGen/AArch64/global-merge-3.ll create mode 100644 test/CodeGen/AArch64/global-merge-4.ll create mode 100644 test/CodeGen/AArch64/global-merge.ll create mode 100644 test/CodeGen/AArch64/half.ll create mode 100644 test/CodeGen/AArch64/hints.ll create mode 100644 test/CodeGen/AArch64/i1-contents.ll create mode 100644 test/CodeGen/AArch64/i128-fast-isel-fallback.ll delete mode 100644 test/CodeGen/AArch64/inline-asm-constraints.ll delete mode 100644 test/CodeGen/AArch64/inline-asm-modifiers.ll create mode 100644 test/CodeGen/AArch64/inlineasm-ldr-pseudo.ll create mode 100644 test/CodeGen/AArch64/intrinsics-memory-barrier.ll delete mode 100644 test/CodeGen/AArch64/large-frame.ll create mode 100644 test/CodeGen/AArch64/ldst-opt.ll delete mode 100644 test/CodeGen/AArch64/literal_pools.ll create mode 100644 test/CodeGen/AArch64/literal_pools_float.ll create mode 100644 test/CodeGen/AArch64/mature-mc-support.ll create mode 100644 test/CodeGen/AArch64/memcpy-f128.ll create mode 100644 test/CodeGen/AArch64/mul-lohi.ll create mode 100644 test/CodeGen/AArch64/mul_pow2.ll delete mode 100644 test/CodeGen/AArch64/neon-2velem-high.ll delete mode 100644 test/CodeGen/AArch64/neon-2velem.ll delete mode 100644 test/CodeGen/AArch64/neon-3vdiff.ll delete mode 100644 test/CodeGen/AArch64/neon-aba-abd.ll delete mode 100644 test/CodeGen/AArch64/neon-across.ll delete mode 100644 test/CodeGen/AArch64/neon-add-pairwise.ll delete mode 100644 test/CodeGen/AArch64/neon-add-sub.ll delete mode 100644 test/CodeGen/AArch64/neon-bsl.ll delete mode 100644 test/CodeGen/AArch64/neon-copy.ll delete mode 100644 test/CodeGen/AArch64/neon-crypto.ll delete mode 100644 test/CodeGen/AArch64/neon-facge-facgt.ll create mode 100644 test/CodeGen/AArch64/neon-fpround_f128.ll delete mode 100644 test/CodeGen/AArch64/neon-frsqrt-frecp.ll delete mode 100644 test/CodeGen/AArch64/neon-halving-add-sub.ll create mode 100644 test/CodeGen/AArch64/neon-idiv.ll delete mode 100644 test/CodeGen/AArch64/neon-max-min-pairwise.ll delete mode 100644 test/CodeGen/AArch64/neon-max-min.ll delete mode 100644 test/CodeGen/AArch64/neon-misc-scalar.ll delete mode 100644 test/CodeGen/AArch64/neon-misc.ll delete mode 100644 test/CodeGen/AArch64/neon-mul-div.ll create mode 100644 test/CodeGen/AArch64/neon-or-combine.ll delete mode 100644 test/CodeGen/AArch64/neon-rounding-halving-add.ll delete mode 100644 test/CodeGen/AArch64/neon-rounding-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-saturating-add-sub.ll delete mode 100644 test/CodeGen/AArch64/neon-saturating-rounding-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-saturating-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-abs.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-add-sub.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-by-elem-mul.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-compare.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-cvt.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-extract-narrow.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-fabd.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-fcvt.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-fp-compare.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-mul.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-neg.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-recip.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-reduce-pairwise.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-rounding-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-saturating-add-sub.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-saturating-rounding-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-saturating-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-shift-imm.ll delete mode 100644 test/CodeGen/AArch64/neon-scalar-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-ldst-multi-elem.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-ldst-one.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-ldst.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-post-ldst-multi-elem.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-post-ldst-one.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-shift.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-tbl.ll delete mode 100644 test/CodeGen/AArch64/neon-simd-vget.ll create mode 100644 test/CodeGen/AArch64/neon-truncStore-extLoad.ll create mode 100644 test/CodeGen/AArch64/nzcv-save.ll create mode 100644 test/CodeGen/AArch64/ragreedy-csr.ll create mode 100644 test/CodeGen/AArch64/rbit.ll delete mode 100644 test/CodeGen/AArch64/regress-wzr-allocatable.ll create mode 100644 test/CodeGen/AArch64/sincospow-vector-expansion.ll delete mode 100644 test/CodeGen/AArch64/tls-dynamic-together.ll delete mode 100644 test/CodeGen/AArch64/tls-dynamics.ll delete mode 100644 test/CodeGen/AArch64/tls-execs.ll create mode 100644 test/CodeGen/AArch64/trunc-v1i64.ll delete mode 100644 test/CodeGen/AArch64/variadic.ll delete mode 100644 test/CodeGen/ARM/2009-08-23-linkerprivate.ll delete mode 100644 test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll create mode 100644 test/CodeGen/ARM/2014-01-09-pseudo_expand_implicit_reg.ll create mode 100644 test/CodeGen/ARM/2014-02-05-vfp-regs-after-stack.ll create mode 100644 test/CodeGen/ARM/2014-02-21-byval-reg-split-alignment.ll create mode 100644 test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll create mode 100644 test/CodeGen/ARM/2014-07-18-earlyclobber-str-post.ll create mode 100644 test/CodeGen/ARM/Windows/aapcs.ll create mode 100644 test/CodeGen/ARM/Windows/alloca.ll create mode 100644 test/CodeGen/ARM/Windows/chkstk-movw-movt-isel.ll create mode 100644 test/CodeGen/ARM/Windows/chkstk.ll create mode 100644 test/CodeGen/ARM/Windows/dllimport.ll create mode 100644 test/CodeGen/ARM/Windows/frame-register.ll create mode 100644 test/CodeGen/ARM/Windows/global-minsize.ll create mode 100644 test/CodeGen/ARM/Windows/hard-float.ll create mode 100644 test/CodeGen/ARM/Windows/integer-floating-point-conversion.ll create mode 100644 test/CodeGen/ARM/Windows/long-calls.ll create mode 100644 test/CodeGen/ARM/Windows/mangling.ll create mode 100644 test/CodeGen/ARM/Windows/memset.ll create mode 100644 test/CodeGen/ARM/Windows/mov32t-bundling.ll create mode 100644 test/CodeGen/ARM/Windows/movw-movt-relocations.ll create mode 100644 test/CodeGen/ARM/Windows/no-aeabi.ll create mode 100644 test/CodeGen/ARM/Windows/no-arm-mode.ll create mode 100644 test/CodeGen/ARM/Windows/no-ehabi.ll create mode 100644 test/CodeGen/ARM/Windows/pic.ll create mode 100644 test/CodeGen/ARM/Windows/read-only-data.ll create mode 100644 test/CodeGen/ARM/Windows/structors.ll create mode 100644 test/CodeGen/ARM/Windows/vla.ll create mode 100644 test/CodeGen/ARM/aapcs-hfa-code.ll create mode 100644 test/CodeGen/ARM/aapcs-hfa.ll create mode 100644 test/CodeGen/ARM/arm-abi-attr.ll create mode 100644 test/CodeGen/ARM/atomic-cmpxchg.ll create mode 100644 test/CodeGen/ARM/big-endian-eh-unwind.ll create mode 100644 test/CodeGen/ARM/big-endian-neon-bitconv.ll create mode 100644 test/CodeGen/ARM/big-endian-neon-extend.ll create mode 100644 test/CodeGen/ARM/big-endian-neon-trunc-store.ll create mode 100644 test/CodeGen/ARM/big-endian-ret-f64.ll create mode 100644 test/CodeGen/ARM/big-endian-vector-callee.ll create mode 100644 test/CodeGen/ARM/big-endian-vector-caller.ll create mode 100644 test/CodeGen/ARM/bswap16.ll create mode 100644 test/CodeGen/ARM/build-attributes.ll create mode 100644 test/CodeGen/ARM/cache-intrinsic.ll create mode 100644 test/CodeGen/ARM/cmpxchg-idioms.ll create mode 100644 test/CodeGen/ARM/cmpxchg-weak.ll create mode 100644 test/CodeGen/ARM/cse-ldrlit.ll create mode 100644 test/CodeGen/ARM/debug-frame-large-stack.ll create mode 100644 test/CodeGen/ARM/debug-frame-no-debug.ll create mode 100644 test/CodeGen/ARM/debug-frame-vararg.ll create mode 100644 test/CodeGen/ARM/debug-frame.ll create mode 100644 test/CodeGen/ARM/debug-segmented-stacks.ll create mode 100644 test/CodeGen/ARM/default-float-abi.ll create mode 100644 test/CodeGen/ARM/dwarf-eh.ll create mode 100644 test/CodeGen/ARM/ehabi-handlerdata-nounwind.ll create mode 100644 test/CodeGen/ARM/ehabi-handlerdata.ll create mode 100644 test/CodeGen/ARM/fast-isel-inline-asm.ll create mode 100644 test/CodeGen/ARM/fastcc-vfp.ll create mode 100644 test/CodeGen/ARM/fastisel-thumb-litpool.ll create mode 100644 test/CodeGen/ARM/frame-register.ll create mode 100644 test/CodeGen/ARM/func-argpassing-endian.ll create mode 100644 test/CodeGen/ARM/global-merge-1.ll create mode 100644 test/CodeGen/ARM/half.ll create mode 100644 test/CodeGen/ARM/hfa-in-contiguous-registers.ll create mode 100644 test/CodeGen/ARM/hints.ll create mode 100644 test/CodeGen/ARM/ifcvt-branch-weight-bug.ll create mode 100644 test/CodeGen/ARM/ifcvt-branch-weight.ll create mode 100644 test/CodeGen/ARM/indirect-hidden.ll create mode 100644 test/CodeGen/ARM/inline-diagnostics.ll create mode 100644 test/CodeGen/ARM/inlineasm-ldr-pseudo.ll create mode 100644 test/CodeGen/ARM/inlineasm-switch-mode-oneway-from-arm.ll create mode 100644 test/CodeGen/ARM/inlineasm-switch-mode-oneway-from-thumb.ll create mode 100644 test/CodeGen/ARM/inlineasm-switch-mode.ll create mode 100644 test/CodeGen/ARM/intrinsics-memory-barrier.ll create mode 100644 test/CodeGen/ARM/intrinsics-overflow.ll create mode 100644 test/CodeGen/ARM/jump_tables.ll create mode 100644 test/CodeGen/ARM/ldaex-stlex.ll create mode 100644 test/CodeGen/ARM/ldstrex-m.ll create mode 100644 test/CodeGen/ARM/mature-mc-support.ll create mode 100644 test/CodeGen/ARM/metadata-default.ll create mode 100644 test/CodeGen/ARM/metadata-short-enums.ll create mode 100644 test/CodeGen/ARM/metadata-short-wchar.ll create mode 100644 test/CodeGen/ARM/minsize-imms.ll create mode 100644 test/CodeGen/ARM/minsize-litpools.ll create mode 100644 test/CodeGen/ARM/named-reg-alloc.ll create mode 100644 test/CodeGen/ARM/named-reg-notareg.ll create mode 100644 test/CodeGen/ARM/none-macho.ll create mode 100644 test/CodeGen/ARM/null-streamer.ll create mode 100644 test/CodeGen/ARM/optimize-dmbs-v7.ll create mode 100644 test/CodeGen/ARM/out-of-registers.ll delete mode 100644 test/CodeGen/ARM/prefetch-thumb.ll create mode 100644 test/CodeGen/ARM/rbit.ll create mode 100644 test/CodeGen/ARM/saxpy10-a9.ll create mode 100644 test/CodeGen/ARM/segmented-stacks-dynamic.ll create mode 100644 test/CodeGen/ARM/segmented-stacks.ll create mode 100644 test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll create mode 100644 test/CodeGen/ARM/ssp-data-layout.ll create mode 100644 test/CodeGen/ARM/stackpointer.ll create mode 100644 test/CodeGen/ARM/tail-call.ll create mode 100644 test/CodeGen/ARM/taildup-branch-weight.ll create mode 100644 test/CodeGen/ARM/thumb-litpool.ll create mode 100644 test/CodeGen/ARM/undefined.ll create mode 100644 test/CodeGen/ARM/varargs-spill-stack-align-nacl.ll create mode 100644 test/CodeGen/ARM/vector-spilling.ll create mode 100644 test/CodeGen/ARM/vfp-libcalls.ll create mode 100644 test/CodeGen/ARM/vfp-regs-dwarf.ll create mode 100644 test/CodeGen/ARM/zero-cycle-zero.ll create mode 100644 test/CodeGen/CPP/atomic.ll create mode 100644 test/CodeGen/CPP/attributes.ll create mode 100644 test/CodeGen/Generic/2014-02-05-OpaqueConstants.ll create mode 100644 test/CodeGen/Generic/no-target.ll create mode 100644 test/CodeGen/MSP430/misched-msp430.ll create mode 100644 test/CodeGen/Mips/Fast-ISel/loadstore2.ll create mode 100644 test/CodeGen/Mips/Fast-ISel/nullvoid.ll create mode 100644 test/CodeGen/Mips/Fast-ISel/simplestore.ll create mode 100644 test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll create mode 100644 test/CodeGen/Mips/Fast-ISel/simplestorei.ll create mode 100644 test/CodeGen/Mips/abicalls.ll create mode 100644 test/CodeGen/Mips/abiflags-xx.ll create mode 100644 test/CodeGen/Mips/abiflags32.ll create mode 100644 test/CodeGen/Mips/cache-intrinsic.ll create mode 100644 test/CodeGen/Mips/call-optimization.ll create mode 100644 test/CodeGen/Mips/cconv/arguments-float.ll create mode 100644 test/CodeGen/Mips/cconv/arguments-fp128.ll create mode 100644 test/CodeGen/Mips/cconv/arguments-hard-float-varargs.ll create mode 100644 test/CodeGen/Mips/cconv/arguments-hard-float.ll create mode 100644 test/CodeGen/Mips/cconv/arguments-hard-fp128.ll create mode 100644 test/CodeGen/Mips/cconv/arguments.ll create mode 100644 test/CodeGen/Mips/cconv/callee-saved-float.ll create mode 100644 test/CodeGen/Mips/cconv/callee-saved-fpxx.ll create mode 100644 test/CodeGen/Mips/cconv/callee-saved-fpxx1.ll create mode 100644 test/CodeGen/Mips/cconv/callee-saved.ll create mode 100644 test/CodeGen/Mips/cconv/memory-layout.ll create mode 100644 test/CodeGen/Mips/cconv/reserved-space.ll create mode 100644 test/CodeGen/Mips/cconv/return-float.ll create mode 100644 test/CodeGen/Mips/cconv/return-hard-float.ll create mode 100644 test/CodeGen/Mips/cconv/return-hard-fp128.ll create mode 100644 test/CodeGen/Mips/cconv/return.ll create mode 100644 test/CodeGen/Mips/cconv/stack-alignment.ll create mode 100644 test/CodeGen/Mips/cfi_offset.ll create mode 100644 test/CodeGen/Mips/ci2.ll create mode 100644 test/CodeGen/Mips/countleading.ll create mode 100644 test/CodeGen/Mips/ehframe-indirect.ll create mode 100644 test/CodeGen/Mips/elf_eflags.ll create mode 100644 test/CodeGen/Mips/fcmp.ll create mode 100644 test/CodeGen/Mips/fp64a.ll create mode 100644 test/CodeGen/Mips/fpxx.ll create mode 100644 test/CodeGen/Mips/l3mc.ll delete mode 100644 test/CodeGen/Mips/largefr1.ll create mode 100644 test/CodeGen/Mips/lcb2.ll create mode 100644 test/CodeGen/Mips/lcb3c.ll create mode 100644 test/CodeGen/Mips/lcb4a.ll create mode 100644 test/CodeGen/Mips/lcb5.ll create mode 100644 test/CodeGen/Mips/llvm-ir/call.ll create mode 100644 test/CodeGen/Mips/llvm-ir/indirectbr.ll create mode 100644 test/CodeGen/Mips/llvm-ir/ret.ll create mode 100644 test/CodeGen/Mips/mature-mc-support.ll create mode 100644 test/CodeGen/Mips/mbrsize4a.ll create mode 100644 test/CodeGen/Mips/micromips-atomic.ll create mode 100644 test/CodeGen/Mips/micromips-directives.ll create mode 100644 test/CodeGen/Mips/micromips-jal.ll create mode 100644 test/CodeGen/Mips/micromips-load-effective-address.ll create mode 100644 test/CodeGen/Mips/mips16-hf-attr.ll create mode 100644 test/CodeGen/Mips/mips32r6/compatibility.ll delete mode 100644 test/CodeGen/Mips/mips64-fp-indexed-ls.ll delete mode 100644 test/CodeGen/Mips/mips64countleading.ll delete mode 100644 test/CodeGen/Mips/mips64load-store-left-right.ll create mode 100644 test/CodeGen/Mips/mips64r6/compatibility.ll create mode 100644 test/CodeGen/Mips/nacl-align.ll create mode 100644 test/CodeGen/Mips/nacl-branch-delay.ll create mode 100644 test/CodeGen/Mips/nacl-reserved-regs.ll create mode 100644 test/CodeGen/Mips/no-odd-spreg.ll create mode 100644 test/CodeGen/Mips/null-streamer.ll create mode 100644 test/CodeGen/Mips/octeon.ll create mode 100644 test/CodeGen/Mips/octeon_popcnt.ll create mode 100644 test/CodeGen/Mips/optimize-pic-o0.ll create mode 100644 test/CodeGen/Mips/prevent-hoisting.ll create mode 100644 test/CodeGen/Mips/s2rem.ll create mode 100644 test/CodeGen/Mips/sr1.ll create mode 100644 test/CodeGen/Mips/start-asm-file.ll create mode 100644 test/CodeGen/Mips/tail16.ll create mode 100644 test/CodeGen/NVPTX/access-non-generic.ll create mode 100644 test/CodeGen/NVPTX/addrspacecast-gvar.ll create mode 100644 test/CodeGen/NVPTX/addrspacecast.ll create mode 100644 test/CodeGen/NVPTX/aggr-param.ll create mode 100644 test/CodeGen/NVPTX/arg-lowering.ll create mode 100644 test/CodeGen/NVPTX/atomics.ll create mode 100644 test/CodeGen/NVPTX/bfe.ll create mode 100644 test/CodeGen/NVPTX/call-with-alloca-buffer.ll create mode 100644 test/CodeGen/NVPTX/div-ri.ll create mode 100644 test/CodeGen/NVPTX/envreg.ll create mode 100644 test/CodeGen/NVPTX/fp-contract.ll create mode 100644 test/CodeGen/NVPTX/fp16.ll create mode 100644 test/CodeGen/NVPTX/gvar-init.ll create mode 100644 test/CodeGen/NVPTX/half.ll create mode 100644 test/CodeGen/NVPTX/imad.ll create mode 100644 test/CodeGen/NVPTX/isspacep.ll create mode 100644 test/CodeGen/NVPTX/ldparam-v4.ll create mode 100644 test/CodeGen/NVPTX/ldu-ldg.ll create mode 100644 test/CodeGen/NVPTX/managed.ll create mode 100644 test/CodeGen/NVPTX/misaligned-vector-ldst.ll create mode 100644 test/CodeGen/NVPTX/mulwide.ll create mode 100644 test/CodeGen/NVPTX/noduplicate-syncthreads.ll create mode 100644 test/CodeGen/NVPTX/rotate.ll create mode 100644 test/CodeGen/NVPTX/shift-parts.ll create mode 100644 test/CodeGen/NVPTX/surf-read-cuda.ll create mode 100644 test/CodeGen/NVPTX/surf-read.ll create mode 100644 test/CodeGen/NVPTX/surf-write-cuda.ll create mode 100644 test/CodeGen/NVPTX/surf-write.ll create mode 100644 test/CodeGen/NVPTX/symbol-naming.ll create mode 100644 test/CodeGen/NVPTX/tex-read-cuda.ll create mode 100644 test/CodeGen/NVPTX/tex-read.ll create mode 100644 test/CodeGen/NVPTX/texsurf-queries.ll create mode 100644 test/CodeGen/NVPTX/vector-call.ll create mode 100644 test/CodeGen/NVPTX/weak-global.ll create mode 100644 test/CodeGen/NVPTX/weak-linkage.ll delete mode 100644 test/CodeGen/PowerPC/2008-12-12-EH.ll delete mode 100644 test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll create mode 100644 test/CodeGen/PowerPC/aa-tbaa.ll create mode 100644 test/CodeGen/PowerPC/alias.ll create mode 100644 test/CodeGen/PowerPC/crash.ll create mode 100644 test/CodeGen/PowerPC/crbit-asm.ll create mode 100644 test/CodeGen/PowerPC/crbits.ll create mode 100644 test/CodeGen/PowerPC/ctrloop-sh.ll create mode 100644 test/CodeGen/PowerPC/func-addr.ll create mode 100644 test/CodeGen/PowerPC/i1-to-double.ll create mode 100644 test/CodeGen/PowerPC/indexed-load.ll create mode 100644 test/CodeGen/PowerPC/mature-mc-support.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r0.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r1-64.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r1.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r13-64.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r13.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r2-64.ll create mode 100644 test/CodeGen/PowerPC/named-reg-alloc-r2.ll create mode 100644 test/CodeGen/PowerPC/ppc32-i1-vaarg.ll create mode 100644 test/CodeGen/PowerPC/ppc32-lshrti3.ll create mode 100644 test/CodeGen/PowerPC/ppc32-pic.ll create mode 100644 test/CodeGen/PowerPC/ppc64-altivec-abi.ll create mode 100644 test/CodeGen/PowerPC/ppc64-byval-align.ll create mode 100644 test/CodeGen/PowerPC/ppc64-smallarg.ll create mode 100644 test/CodeGen/PowerPC/ppc64le-aggregates.ll create mode 100644 test/CodeGen/PowerPC/ppc64le-calls.ll create mode 100644 test/CodeGen/PowerPC/ppc64le-crsave.ll create mode 100644 test/CodeGen/PowerPC/ppc64le-localentry.ll create mode 100644 test/CodeGen/PowerPC/ppc64le-smallarg.ll create mode 100644 test/CodeGen/PowerPC/ppcf128-endian.ll create mode 100644 test/CodeGen/PowerPC/pr18663-2.ll create mode 100644 test/CodeGen/PowerPC/pr18663.ll create mode 100644 test/CodeGen/PowerPC/pr20442.ll create mode 100644 test/CodeGen/PowerPC/pwr7-gt-nop.ll create mode 100644 test/CodeGen/PowerPC/resolvefi-basereg.ll create mode 100644 test/CodeGen/PowerPC/resolvefi-disp.ll create mode 100644 test/CodeGen/PowerPC/rlwimi-dyn-and.ll create mode 100644 test/CodeGen/PowerPC/splat-bug.ll create mode 100644 test/CodeGen/PowerPC/srl-mask.ll delete mode 100644 test/CodeGen/PowerPC/tls-2.ll delete mode 100644 test/CodeGen/PowerPC/tls-gd.ll delete mode 100644 test/CodeGen/PowerPC/tls-ie.ll delete mode 100644 test/CodeGen/PowerPC/tls-ld-2.ll delete mode 100644 test/CodeGen/PowerPC/tls-ld.ll create mode 100644 test/CodeGen/PowerPC/tls-pic.ll create mode 100644 test/CodeGen/PowerPC/toc-load-sched-bug.ll create mode 100644 test/CodeGen/PowerPC/vec_shuffle_le.ll create mode 100644 test/CodeGen/PowerPC/vec_urem_const.ll create mode 100644 test/CodeGen/PowerPC/vperm-instcombine.ll create mode 100644 test/CodeGen/PowerPC/vperm-lowering.ll create mode 100644 test/CodeGen/PowerPC/vsx-args.ll create mode 100644 test/CodeGen/PowerPC/vsx-fma-m.ll create mode 100644 test/CodeGen/PowerPC/vsx-self-copy.ll create mode 100644 test/CodeGen/PowerPC/vsx-spill.ll create mode 100644 test/CodeGen/PowerPC/vsx.ll create mode 100644 test/CodeGen/PowerPC/vtable-reloc.ll create mode 100644 test/CodeGen/R600/anyext.ll create mode 100644 test/CodeGen/R600/array-ptr-calc-i32.ll create mode 100644 test/CodeGen/R600/atomic_cmp_swap_local.ll create mode 100644 test/CodeGen/R600/basic-branch.ll create mode 100644 test/CodeGen/R600/basic-loop.ll create mode 100644 test/CodeGen/R600/bswap.ll create mode 100644 test/CodeGen/R600/call.ll create mode 100644 test/CodeGen/R600/cayman-loop-bug.ll create mode 100644 test/CodeGen/R600/cf-stack-bug.ll create mode 100644 test/CodeGen/R600/codegen-prepare-addrmode-sext.ll create mode 100644 test/CodeGen/R600/concat_vectors.ll create mode 100644 test/CodeGen/R600/copy-illegal-type.ll create mode 100644 test/CodeGen/R600/ctlz_zero_undef.ll create mode 100644 test/CodeGen/R600/ctpop.ll create mode 100644 test/CodeGen/R600/ctpop64.ll create mode 100644 test/CodeGen/R600/cttz_zero_undef.ll create mode 100644 test/CodeGen/R600/cvt_f32_ubyte.ll create mode 100644 test/CodeGen/R600/default-fp-mode.ll create mode 100644 test/CodeGen/R600/extract_vector_elt_i16.ll create mode 100644 test/CodeGen/R600/fceil.ll create mode 100644 test/CodeGen/R600/fceil64.ll create mode 100644 test/CodeGen/R600/fcopysign.f32.ll create mode 100644 test/CodeGen/R600/fcopysign.f64.ll create mode 100644 test/CodeGen/R600/ffloor.ll create mode 100644 test/CodeGen/R600/fnearbyint.ll create mode 100644 test/CodeGen/R600/fp16_to_fp.ll create mode 100644 test/CodeGen/R600/fp32_to_fp16.ll create mode 100644 test/CodeGen/R600/fp_to_uint.f64.ll create mode 100644 test/CodeGen/R600/ftrunc.ll create mode 100644 test/CodeGen/R600/gv-const-addrspace-fail.ll create mode 100644 test/CodeGen/R600/gv-const-addrspace.ll create mode 100644 test/CodeGen/R600/half.ll create mode 100644 test/CodeGen/R600/icmp64.ll create mode 100644 test/CodeGen/R600/indirect-private-64.ll create mode 100644 test/CodeGen/R600/infinite-loop-evergreen.ll create mode 100644 test/CodeGen/R600/infinite-loop.ll create mode 100644 test/CodeGen/R600/input-mods.ll create mode 100644 test/CodeGen/R600/insert_vector_elt_f64.ll create mode 100644 test/CodeGen/R600/large-alloca.ll create mode 100644 test/CodeGen/R600/large-constant-initializer.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.abs.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.barrier.global.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.bfe.i32.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.bfe.u32.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.bfi.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.bfm.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.brev.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.clamp.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.cvt_f32_ubyte.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.div_fixup.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.div_fmas.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.div_scale.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.fract.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.imad24.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.imul24.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.legacy.rsq.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.rcp.f64.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.rcp.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.f64.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.rsq.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.trig_preop.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.umad24.ll create mode 100644 test/CodeGen/R600/llvm.AMDGPU.umul24.ll create mode 100644 test/CodeGen/R600/llvm.SI.gather4.ll create mode 100644 test/CodeGen/R600/llvm.SI.getlod.ll create mode 100644 test/CodeGen/R600/llvm.SI.image.ll create mode 100644 test/CodeGen/R600/llvm.SI.image.sample.ll create mode 100644 test/CodeGen/R600/llvm.SI.image.sample.o.ll create mode 100644 test/CodeGen/R600/llvm.amdgpu.dp4.ll create mode 100644 test/CodeGen/R600/llvm.amdgpu.kilp.ll create mode 100644 test/CodeGen/R600/llvm.amdgpu.lrp.ll create mode 100644 test/CodeGen/R600/llvm.exp2.ll create mode 100644 test/CodeGen/R600/llvm.log2.ll create mode 100644 test/CodeGen/R600/llvm.rint.f64.ll create mode 100644 test/CodeGen/R600/llvm.trunc.ll create mode 100644 test/CodeGen/R600/load-i1.ll create mode 100644 test/CodeGen/R600/local-64.ll create mode 100644 test/CodeGen/R600/local-atomics.ll create mode 100644 test/CodeGen/R600/local-atomics64.ll create mode 100644 test/CodeGen/R600/loop-idiom.ll create mode 100644 test/CodeGen/R600/mubuf.ll create mode 100644 test/CodeGen/R600/no-initializer-constant-addrspace.ll create mode 100644 test/CodeGen/R600/private-memory-atomics.ll create mode 100644 test/CodeGen/R600/private-memory-broken.ll create mode 100644 test/CodeGen/R600/r600-infinite-loop-bug-while-reorganizing-vector.ll create mode 100644 test/CodeGen/R600/register-count-comments.ll create mode 100644 test/CodeGen/R600/reorder-stores.ll create mode 100644 test/CodeGen/R600/rotl.i64.ll create mode 100644 test/CodeGen/R600/rotl.ll create mode 100644 test/CodeGen/R600/rotr.i64.ll create mode 100644 test/CodeGen/R600/rsq.ll create mode 100644 test/CodeGen/R600/saddo.ll create mode 100644 test/CodeGen/R600/salu-to-valu.ll create mode 100644 test/CodeGen/R600/scalar_to_vector.ll create mode 100644 test/CodeGen/R600/schedule-vs-if-nested-loop-failure.ll create mode 100644 test/CodeGen/R600/select-i1.ll create mode 100644 test/CodeGen/R600/select-vectors.ll create mode 100644 test/CodeGen/R600/select64.ll create mode 100644 test/CodeGen/R600/selectcc.ll create mode 100644 test/CodeGen/R600/setcc-equivalent.ll create mode 100644 test/CodeGen/R600/setcc-opt.ll create mode 100644 test/CodeGen/R600/sext-in-reg.ll create mode 100644 test/CodeGen/R600/sgpr-control-flow.ll create mode 100644 test/CodeGen/R600/simplify-demanded-bits-build-pair.ll create mode 100644 test/CodeGen/R600/smrd.ll create mode 100644 test/CodeGen/R600/srem.ll create mode 100644 test/CodeGen/R600/ssubo.ll create mode 100644 test/CodeGen/R600/store-v3i32.ll create mode 100644 test/CodeGen/R600/store-v3i64.ll create mode 100644 test/CodeGen/R600/trunc-store-i1.ll create mode 100644 test/CodeGen/R600/uaddo.ll create mode 100644 test/CodeGen/R600/udivrem.ll create mode 100644 test/CodeGen/R600/udivrem64.ll create mode 100644 test/CodeGen/R600/uint_to_fp.f64.ll create mode 100644 test/CodeGen/R600/unhandled-loop-condition-assertion.ll create mode 100644 test/CodeGen/R600/unroll.ll create mode 100644 test/CodeGen/R600/usubo.ll create mode 100644 test/CodeGen/R600/v1i64-kernel-arg.ll create mode 100644 test/CodeGen/R600/v_cndmask.ll create mode 100644 test/CodeGen/R600/valu-i1.ll create mode 100644 test/CodeGen/R600/vector-alloca.ll create mode 100644 test/CodeGen/R600/vop-shrink.ll create mode 100644 test/CodeGen/SPARC/64spill.ll create mode 100644 test/CodeGen/SPARC/atomics.ll create mode 100644 test/CodeGen/SPARC/inlineasm.ll create mode 100644 test/CodeGen/SPARC/mature-mc-support.ll create mode 100644 test/CodeGen/SPARC/missinglabel.ll create mode 100644 test/CodeGen/SPARC/obj-relocs.ll create mode 100644 test/CodeGen/SPARC/parts.ll create mode 100644 test/CodeGen/SPARC/spillsize.ll create mode 100644 test/CodeGen/SPARC/sret-secondary.ll create mode 100644 test/CodeGen/SPARC/trap.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-add-05.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-add-06.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-and-05.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-and-06.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-or-05.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-or-06.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-sub-05.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-sub-06.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-xor-05.ll create mode 100644 test/CodeGen/SystemZ/atomicrmw-xor-06.ll create mode 100644 test/CodeGen/SystemZ/fp-conv-13.ll create mode 100644 test/CodeGen/SystemZ/fp-conv-14.ll create mode 100644 test/CodeGen/SystemZ/mature-mc-support.ll create mode 100644 test/CodeGen/SystemZ/selectcc-01.ll create mode 100644 test/CodeGen/SystemZ/selectcc-02.ll create mode 100644 test/CodeGen/SystemZ/selectcc-03.ll create mode 100644 test/CodeGen/SystemZ/serialize-01.ll create mode 100644 test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll create mode 100644 test/CodeGen/Thumb/cortex-m0-unaligned-access.ll create mode 100644 test/CodeGen/Thumb/fastcc.ll create mode 100644 test/CodeGen/Thumb/mature-mc-support.ll create mode 100644 test/CodeGen/Thumb/segmented-stacks-dynamic.ll create mode 100644 test/CodeGen/Thumb/segmented-stacks.ll create mode 100644 test/CodeGen/Thumb/sjljehprepare-lower-vector.ll create mode 100644 test/CodeGen/Thumb/thumb-ldm.ll create mode 100644 test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll create mode 100644 test/CodeGen/Thumb/triple.ll create mode 100644 test/CodeGen/Thumb2/segmented-stacks.ll create mode 100644 test/CodeGen/Thumb2/tpsoft.ll create mode 100644 test/CodeGen/Thumb2/v8_IT_6.ll delete mode 100644 test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll delete mode 100644 test/CodeGen/X86/2007-09-18-ShuffleXformBug.ll delete mode 100644 test/CodeGen/X86/2007-10-17-IllegalAsm.ll delete mode 100644 test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll delete mode 100644 test/CodeGen/X86/2009-08-23-linkerprivate.ll delete mode 100644 test/CodeGen/X86/2010-12-02-MC-Set.ll create mode 100644 test/CodeGen/X86/2014-05-29-factorial.ll create mode 100644 test/CodeGen/X86/2014-05-30-CombineAddNSW.ll create mode 100644 test/CodeGen/X86/MachineBranchProb.ll create mode 100644 test/CodeGen/X86/address-type-promotion-constantexpr.ll delete mode 100644 test/CodeGen/X86/alias-error.ll create mode 100644 test/CodeGen/X86/atom-cmpb.ll create mode 100644 test/CodeGen/X86/atom-fixup-lea4.ll create mode 100644 test/CodeGen/X86/atomic-ops-ancient-64.ll create mode 100644 test/CodeGen/X86/atomic128.ll create mode 100644 test/CodeGen/X86/avoid_complex_am.ll create mode 100644 test/CodeGen/X86/avx-cvt-2.ll create mode 100644 test/CodeGen/X86/avx.ll create mode 100644 test/CodeGen/X86/avx1-logical-load-folding.ll create mode 100644 test/CodeGen/X86/avx2-blend.ll create mode 100644 test/CodeGen/X86/avx512-inc-dec.ll create mode 100644 test/CodeGen/X86/avx512-nontemporal.ll create mode 100644 test/CodeGen/X86/avx512-vselect-crash.ll create mode 100644 test/CodeGen/X86/avx512-zext-load-crash.ll create mode 100644 test/CodeGen/X86/cache-intrinsic.ll create mode 100644 test/CodeGen/X86/catch.ll create mode 100644 test/CodeGen/X86/cfi.ll create mode 100644 test/CodeGen/X86/cmpxchg-i1.ll create mode 100644 test/CodeGen/X86/cmpxchg-i128-i1.ll create mode 100644 test/CodeGen/X86/codegen-prepare-addrmode-sext.ll create mode 100644 test/CodeGen/X86/codegen-prepare-crash.ll create mode 100644 test/CodeGen/X86/coff-comdat.ll create mode 100644 test/CodeGen/X86/coff-comdat2.ll create mode 100644 test/CodeGen/X86/coff-comdat3.ll create mode 100644 test/CodeGen/X86/combine-64bit-vec-binop.ll create mode 100644 test/CodeGen/X86/combine-avx-intrinsics.ll create mode 100644 test/CodeGen/X86/combine-avx2-intrinsics.ll create mode 100644 test/CodeGen/X86/combine-or.ll create mode 100644 test/CodeGen/X86/combine-sse2-intrinsics.ll create mode 100644 test/CodeGen/X86/combine-sse41-intrinsics.ll create mode 100644 test/CodeGen/X86/combine-vec-shuffle-2.ll create mode 100644 test/CodeGen/X86/combine-vec-shuffle-3.ll create mode 100644 test/CodeGen/X86/combine-vec-shuffle-4.ll create mode 100644 test/CodeGen/X86/combine-vec-shuffle-5.ll create mode 100644 test/CodeGen/X86/combine-vec-shuffle.ll create mode 100644 test/CodeGen/X86/computeKnownBits_urem.ll create mode 100644 test/CodeGen/X86/const-base-addr.ll create mode 100644 test/CodeGen/X86/constant-hoisting-shift-immediate.ll create mode 100644 test/CodeGen/X86/cse-add-with-overflow.ll create mode 100644 test/CodeGen/X86/cvt16.ll create mode 100644 test/CodeGen/X86/dagcombine-and-setcc.ll create mode 100644 test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll create mode 100644 test/CodeGen/X86/dbg-changes-codegen.ll delete mode 100644 test/CodeGen/X86/dll-linkage.ll create mode 100644 test/CodeGen/X86/dllexport-x86_64.ll create mode 100644 test/CodeGen/X86/dllimport-x86_64.ll create mode 100644 test/CodeGen/X86/dllimport.ll create mode 100644 test/CodeGen/X86/dynamic-alloca-in-entry.ll create mode 100644 test/CodeGen/X86/elf-comdat.ll create mode 100644 test/CodeGen/X86/elf-comdat2.ll create mode 100644 test/CodeGen/X86/exedepsfix-broadcast.ll create mode 100644 test/CodeGen/X86/expand-opaque-const.ll create mode 100644 test/CodeGen/X86/extract-store.ll create mode 100644 test/CodeGen/X86/fast-isel-args-fail2.ll create mode 100644 test/CodeGen/X86/fast-isel-branch_weights.ll create mode 100644 test/CodeGen/X86/fast-isel-cmp-branch2.ll create mode 100644 test/CodeGen/X86/fast-isel-cmp-branch3.ll create mode 100644 test/CodeGen/X86/fast-isel-cmp.ll create mode 100644 test/CodeGen/X86/fast-isel-fold-mem.ll create mode 100644 test/CodeGen/X86/fast-isel-select-cmov.ll create mode 100644 test/CodeGen/X86/fast-isel-select-cmov2.ll create mode 100644 test/CodeGen/X86/fast-isel-select-cmp.ll create mode 100644 test/CodeGen/X86/fast-isel-select-pseudo-cmov.ll create mode 100644 test/CodeGen/X86/fast-isel-select-sse.ll create mode 100644 test/CodeGen/X86/fast-isel-select.ll create mode 100644 test/CodeGen/X86/fast-isel-sse12-fptoint.ll create mode 100644 test/CodeGen/X86/fma-do-not-commute.ll create mode 100644 test/CodeGen/X86/fold-call-oper.ll create mode 100644 test/CodeGen/X86/fold-vector-sext-crash.ll create mode 100644 test/CodeGen/X86/fold-vector-sext-zext.ll create mode 100644 test/CodeGen/X86/frameaddr.ll create mode 100644 test/CodeGen/X86/haddsub-2.ll create mode 100644 test/CodeGen/X86/haddsub-undef.ll create mode 100644 test/CodeGen/X86/half.ll create mode 100644 test/CodeGen/X86/i8-umulo.ll create mode 100644 test/CodeGen/X86/inalloca-ctor.ll create mode 100644 test/CodeGen/X86/inalloca-invoke.ll create mode 100644 test/CodeGen/X86/inalloca-stdcall.ll create mode 100644 test/CodeGen/X86/inalloca.ll create mode 100644 test/CodeGen/X86/indirect-hidden.ll create mode 100644 test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll create mode 100644 test/CodeGen/X86/inline-asm-stack-realign.ll create mode 100644 test/CodeGen/X86/inline-asm-stack-realign2.ll create mode 100644 test/CodeGen/X86/inline-asm-stack-realign3.ll create mode 100644 test/CodeGen/X86/ins_split_regalloc.ll create mode 100644 test/CodeGen/X86/jump_table_alias.ll create mode 100644 test/CodeGen/X86/jump_table_bitcast.ll create mode 100644 test/CodeGen/X86/jump_tables.ll create mode 100644 test/CodeGen/X86/large-constants.ll create mode 100644 test/CodeGen/X86/libcall-sret.ll create mode 100644 test/CodeGen/X86/lower-bitcast.ll create mode 100644 test/CodeGen/X86/lower-vec-shift.ll create mode 100644 test/CodeGen/X86/lzcnt-tzcnt.ll create mode 100644 test/CodeGen/X86/macho-comdat.ll create mode 100644 test/CodeGen/X86/mature-mc-support.ll create mode 100644 test/CodeGen/X86/misched-aa-colored.ll create mode 100644 test/CodeGen/X86/misched-aa-mmos.ll create mode 100644 test/CodeGen/X86/mod128.ll create mode 100644 test/CodeGen/X86/mul128_sext_loop.ll create mode 100644 test/CodeGen/X86/musttail-indirect.ll create mode 100644 test/CodeGen/X86/musttail-thiscall.ll create mode 100644 test/CodeGen/X86/musttail.ll create mode 100644 test/CodeGen/X86/named-reg-alloc.ll create mode 100644 test/CodeGen/X86/named-reg-notareg.ll delete mode 100644 test/CodeGen/X86/no-cfi.ll delete mode 100644 test/CodeGen/X86/no-elf-compact-unwind.ll create mode 100644 test/CodeGen/X86/opaque-constant-asm.ll create mode 100644 test/CodeGen/X86/osx-private-labels.ll create mode 100644 test/CodeGen/X86/peephole-multiple-folds.ll delete mode 100644 test/CodeGen/X86/pr10420.ll delete mode 100644 test/CodeGen/X86/pr14090.ll create mode 100644 test/CodeGen/X86/pr19049.ll create mode 100644 test/CodeGen/X86/pr20020.ll create mode 100644 test/CodeGen/X86/pr20088.ll create mode 100644 test/CodeGen/X86/preserve_allcc64.ll create mode 100644 test/CodeGen/X86/preserve_mostcc64.ll create mode 100644 test/CodeGen/X86/pshufd-combine-crash.ll create mode 100644 test/CodeGen/X86/ragreedy-bug.ll create mode 100644 test/CodeGen/X86/ragreedy-hoist-spill.ll create mode 100644 test/CodeGen/X86/ragreedy-last-chance-recoloring.ll create mode 100644 test/CodeGen/X86/rdpmc.ll create mode 100644 test/CodeGen/X86/remat-invalid-liveness.ll create mode 100644 test/CodeGen/X86/rotate4.ll create mode 100644 test/CodeGen/X86/saddo-redundant-add.ll create mode 100644 test/CodeGen/X86/setjmp-spills.ll create mode 100644 test/CodeGen/X86/shift-combine-crash.ll create mode 100644 test/CodeGen/X86/shift-pcmp.ll create mode 100644 test/CodeGen/X86/shuffle-combine-crash.ll create mode 100644 test/CodeGen/X86/sqrt.ll create mode 100644 test/CodeGen/X86/sse-scalar-fp-arith-2.ll create mode 100644 test/CodeGen/X86/sse-scalar-fp-arith.ll create mode 100644 test/CodeGen/X86/sse3-avx-addsub-2.ll create mode 100644 test/CodeGen/X86/sse3-avx-addsub.ll create mode 100644 test/CodeGen/X86/ssp-data-layout.ll create mode 100644 test/CodeGen/X86/stackmap-fast-isel.ll create mode 100644 test/CodeGen/X86/stackmap-liveness.ll create mode 100644 test/CodeGen/X86/stackmap-nops.ll create mode 100644 test/CodeGen/X86/stackpointer.ll create mode 100644 test/CodeGen/X86/sunkaddr-ext.ll create mode 100644 test/CodeGen/X86/swizzle-2.ll create mode 100644 test/CodeGen/X86/swizzle-avx2.ll create mode 100644 test/CodeGen/X86/testb-je-fusion.ll create mode 100644 test/CodeGen/X86/vbinop-simplify-bug.ll create mode 100644 test/CodeGen/X86/vec_setcc-2.ll create mode 100644 test/CodeGen/X86/vec_shift5.ll create mode 100644 test/CodeGen/X86/vec_shift6.ll create mode 100644 test/CodeGen/X86/vec_shuf-insert.ll create mode 100644 test/CodeGen/X86/vec_shuffle-40.ll create mode 100644 test/CodeGen/X86/vec_shuffle-41.ll create mode 100644 test/CodeGen/X86/vector-idiv.ll create mode 100644 test/CodeGen/X86/vector-shuffle-128-v16.ll create mode 100644 test/CodeGen/X86/vector-shuffle-128-v2.ll create mode 100644 test/CodeGen/X86/vector-shuffle-128-v4.ll create mode 100644 test/CodeGen/X86/vector-shuffle-128-v8.ll create mode 100644 test/CodeGen/X86/vector-shuffle-combining.ll create mode 100644 test/CodeGen/X86/vselect-2.ll create mode 100644 test/CodeGen/X86/vselect.ll create mode 100644 test/CodeGen/X86/vshift-6.ll create mode 100644 test/CodeGen/X86/widen_conversions.ll create mode 100644 test/CodeGen/X86/win64_eh.ll create mode 100644 test/CodeGen/X86/win_cst_pool.ll create mode 100644 test/CodeGen/X86/x86-64-double-precision-shift-left.ll create mode 100644 test/CodeGen/X86/x86-64-double-precision-shift-right.ll create mode 100644 test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll create mode 100644 test/CodeGen/X86/x86-64-double-shifts-var.ll delete mode 100644 test/CodeGen/X86/x86-64-frameaddr.ll create mode 100644 test/CodeGen/X86/x86-64-sret-return-2.ll create mode 100644 test/CodeGen/X86/x86-64-static-relo-movl.ll delete mode 100644 test/CodeGen/X86/x86-frameaddr.ll delete mode 100644 test/CodeGen/X86/x86-frameaddr2.ll create mode 100644 test/CodeGen/X86/x86-setcc-int-to-fp-combine.ll create mode 100644 test/CodeGen/X86/x86-upgrade-avx-vbroadcast.ll create mode 100644 test/CodeGen/X86/xaluo.ll create mode 100644 test/CodeGen/X86/zlib-longest-match.ll create mode 100644 test/CodeGen/XCore/align.ll create mode 100644 test/CodeGen/XCore/call.ll create mode 100644 test/CodeGen/XCore/codemodel.ll create mode 100644 test/CodeGen/XCore/dwarf_debug.ll create mode 100644 test/CodeGen/XCore/llvm-intrinsics.ll create mode 100644 test/CodeGen/XCore/memcpy.ll create mode 100644 test/CodeGen/XCore/resources_combine.ll delete mode 100644 test/DebugInfo/2010-01-19-DbgScope.ll delete mode 100644 test/DebugInfo/AArch64/cfi-frame.ll create mode 100644 test/DebugInfo/AArch64/struct_by_value.ll delete mode 100644 test/DebugInfo/AArch64/variable-loc.ll create mode 100644 test/DebugInfo/ARM/sectionorder.ll create mode 100644 test/DebugInfo/ARM/tls.ll create mode 100644 test/DebugInfo/COFF/asan-module-ctor.ll create mode 100644 test/DebugInfo/COFF/asan-module-without-functions.ll create mode 100644 test/DebugInfo/COFF/asm.ll create mode 100644 test/DebugInfo/COFF/lit.local.cfg create mode 100644 test/DebugInfo/COFF/multifile.ll create mode 100644 test/DebugInfo/COFF/multifunction.ll create mode 100644 test/DebugInfo/COFF/simple.ll create mode 100644 test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll create mode 100644 test/DebugInfo/Inputs/arange-overlap.cc create mode 100755 test/DebugInfo/Inputs/arange-overlap.elf-x86_64 create mode 100644 test/DebugInfo/Inputs/arm-relocs.elf-arm create mode 100644 test/DebugInfo/Inputs/dwarfdump-line-dwo.cc create mode 100644 test/DebugInfo/Inputs/dwarfdump-line-dwo.elf-x86-64 create mode 100644 test/DebugInfo/Inputs/fission-ranges.cc create mode 100755 test/DebugInfo/Inputs/fission-ranges.elf-x86_64 create mode 100755 test/DebugInfo/Inputs/llvm-symbolizer-dwo-test create mode 100644 test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc create mode 100644 test/DebugInfo/Inputs/llvm-symbolizer-test.c create mode 100755 test/DebugInfo/Inputs/llvm-symbolizer-test.elf-x86-64 create mode 100644 test/DebugInfo/Inputs/shared-object-stripped.elf-i386 create mode 100644 test/DebugInfo/Mips/delay-slot.ll create mode 100644 test/DebugInfo/Mips/lit.local.cfg create mode 100644 test/DebugInfo/PR20038.ll create mode 100644 test/DebugInfo/Sparc/gnu-window-save.ll create mode 100644 test/DebugInfo/Sparc/lit.local.cfg create mode 100644 test/DebugInfo/X86/DW_AT_linkage_name.ll create mode 100644 test/DebugInfo/X86/arange.ll create mode 100644 test/DebugInfo/X86/array.ll create mode 100644 test/DebugInfo/X86/array2.ll create mode 100644 test/DebugInfo/X86/c-type-units.ll create mode 100644 test/DebugInfo/X86/coff_debug_info_type.ll create mode 100644 test/DebugInfo/X86/cu-ranges-odr.ll create mode 100644 test/DebugInfo/X86/cu-ranges.ll create mode 100644 test/DebugInfo/X86/dbg-asm.s delete mode 100644 test/DebugInfo/X86/dbg-large-unsigned-const.ll create mode 100644 test/DebugInfo/X86/dbg-value-const-byref.ll create mode 100644 test/DebugInfo/X86/debug-dead-local-var.ll create mode 100644 test/DebugInfo/X86/debug-loc-asan.ll create mode 100644 test/DebugInfo/X86/debug-loc-offset.ll create mode 100644 test/DebugInfo/X86/debug-ranges-offset.ll create mode 100644 test/DebugInfo/X86/decl-derived-member.ll create mode 100644 test/DebugInfo/X86/discriminator.ll delete mode 100644 test/DebugInfo/X86/eh_symbol.ll create mode 100644 test/DebugInfo/X86/formal_parameter.ll create mode 100644 test/DebugInfo/X86/inline-member-function.ll create mode 100644 test/DebugInfo/X86/inline-seldag-test.ll create mode 100644 test/DebugInfo/X86/lexical_block.ll create mode 100644 test/DebugInfo/X86/objc-property-void.ll create mode 100644 test/DebugInfo/X86/pr19307.ll delete mode 100644 test/DebugInfo/X86/pr9951.ll create mode 100644 test/DebugInfo/X86/sret.ll create mode 100644 test/DebugInfo/X86/subregisters.ll delete mode 100644 test/DebugInfo/X86/tls-fission.ll create mode 100644 test/DebugInfo/X86/type_units_with_addresses.ll create mode 100644 test/DebugInfo/arm-relocs.test create mode 100644 test/DebugInfo/constant-pointers.ll create mode 100644 test/DebugInfo/cross-cu-inlining.ll create mode 100644 test/DebugInfo/cross-cu-linkonce.ll create mode 100644 test/DebugInfo/cu-line-tables.ll create mode 100644 test/DebugInfo/cu-range-hole.ll create mode 100644 test/DebugInfo/cu-ranges.ll create mode 100644 test/DebugInfo/dead-argument-order.ll create mode 100644 test/DebugInfo/debug-info-qualifiers.ll delete mode 100644 test/DebugInfo/dwarfdump-inlining.test create mode 100644 test/DebugInfo/dwarfdump-line-dwo.test create mode 100644 test/DebugInfo/dwarfdump-ranges.test delete mode 100644 test/DebugInfo/dwarfdump-test.test create mode 100644 test/DebugInfo/empty.ll create mode 100644 test/DebugInfo/incorrect-variable-debugloc.ll create mode 100644 test/DebugInfo/inline-no-debug-info.ll create mode 100644 test/DebugInfo/inline-scopes.ll create mode 100644 test/DebugInfo/llvm-symbolizer-zlib.test create mode 100644 test/DebugInfo/lto-comp-dir.ll create mode 100644 test/DebugInfo/missing-abstract-variable.ll create mode 100644 test/DebugInfo/namespace_function_definition.ll create mode 100644 test/DebugInfo/namespace_inline_function_definition.ll create mode 100644 test/DebugInfo/restrict.ll create mode 100644 test/DebugInfo/sugared-constants.ll create mode 100644 test/DebugInfo/typedef.ll create mode 100644 test/DebugInfo/unconditional-branch.ll create mode 100644 test/DebugInfo/varargs.ll create mode 100644 test/ExecutionEngine/MCJIT/load-object-a.ll create mode 100644 test/ExecutionEngine/MCJIT/non-extern-addend-smallcodemodel.ll create mode 100644 test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s create mode 100644 test/ExecutionEngine/RuntimeDyld/ARM/lit.local.cfg delete mode 100644 test/ExecutionEngine/RuntimeDyld/Inputs/arm_secdiff_reloc.o create mode 100644 test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s create mode 100644 test/ExecutionEngine/RuntimeDyld/X86/lit.local.cfg delete mode 100644 test/ExecutionEngine/RuntimeDyld/arm_secdiff_reloc.test create mode 100644 test/Feature/alias2.ll create mode 100644 test/Feature/comdat.ll create mode 100644 test/Feature/intrinsic-noduplicate.ll delete mode 100644 test/Feature/linker_private_linkages.ll create mode 100644 test/Feature/optnone-llc.ll create mode 100644 test/Feature/optnone-opt.ll create mode 100644 test/FileCheck/check-multiple-prefixes-nomatch-2.txt create mode 100644 test/FileCheck/implicit-check-not.txt create mode 100644 test/Instrumentation/AddressSanitizer/X86/asm_attr.ll create mode 100644 test/Instrumentation/AddressSanitizer/X86/asm_mov.ll create mode 100644 test/Instrumentation/AddressSanitizer/X86/asm_mov.s create mode 100644 test/Instrumentation/AddressSanitizer/X86/asm_mov_no_instrumentation.s create mode 100644 test/Instrumentation/AddressSanitizer/X86/asm_swap_intel.s create mode 100644 test/Instrumentation/AddressSanitizer/coverage-dbg.ll delete mode 100644 test/Instrumentation/AddressSanitizer/different_scale_and_offset.ll create mode 100644 test/Instrumentation/AddressSanitizer/do-not-instrument-llvm-metadata.ll create mode 100644 test/Instrumentation/AddressSanitizer/do-not-touch-comdat-global.ll create mode 100644 test/Instrumentation/AddressSanitizer/freebsd.ll create mode 100644 test/Instrumentation/AddressSanitizer/global_metadata.ll create mode 100644 test/Instrumentation/AddressSanitizer/instrumentation-with-call-threshold.ll create mode 100644 test/Instrumentation/AddressSanitizer/stack-poisoning.ll create mode 100644 test/Instrumentation/AddressSanitizer/stack_layout.ll create mode 100644 test/Instrumentation/AddressSanitizer/ubsan.ll create mode 100644 test/Instrumentation/DataFlowSanitizer/union.ll create mode 100644 test/Instrumentation/MemorySanitizer/check_access_address.ll create mode 100644 test/Instrumentation/MemorySanitizer/do-not-emit-module-limits.ll create mode 100644 test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll create mode 100644 test/Instrumentation/MemorySanitizer/missing_origin.ll create mode 100644 test/Instrumentation/MemorySanitizer/mul_by_constant.ll create mode 100644 test/Instrumentation/MemorySanitizer/store-origin.ll create mode 100644 test/Instrumentation/MemorySanitizer/vector_arith.ll create mode 100644 test/Instrumentation/MemorySanitizer/vector_pack.ll create mode 100644 test/Instrumentation/MemorySanitizer/vector_shift.ll create mode 100644 test/LTO/attrs.ll create mode 100644 test/LTO/current-section.ll create mode 100644 test/LTO/jump-table-type.ll create mode 100644 test/LTO/keep-used-puts-during-instcombine.ll create mode 100644 test/LTO/no-undefined-puts-when-implemented.ll create mode 100644 test/LTO/private-symbol.ll create mode 100644 test/LTO/symver-asm.ll create mode 100644 test/LTO/triple-init.ll create mode 100644 test/Linker/Inputs/alias.ll create mode 100644 test/Linker/Inputs/comdat.ll create mode 100644 test/Linker/Inputs/comdat2.ll create mode 100644 test/Linker/Inputs/comdat3.ll create mode 100644 test/Linker/Inputs/comdat4.ll create mode 100644 test/Linker/Inputs/comdat5.ll create mode 100644 test/Linker/Inputs/datalayout-a.ll create mode 100644 test/Linker/Inputs/datalayout-b.ll create mode 100644 test/Linker/Inputs/old_global_ctors.3.4.bc create mode 100644 test/Linker/Inputs/targettriple-a.ll create mode 100644 test/Linker/Inputs/targettriple-b.ll create mode 100644 test/Linker/alias.ll create mode 100644 test/Linker/comdat.ll create mode 100644 test/Linker/comdat2.ll create mode 100644 test/Linker/comdat3.ll create mode 100644 test/Linker/comdat4.ll create mode 100644 test/Linker/comdat5.ll create mode 100644 test/Linker/comdat6.ll create mode 100644 test/Linker/comdat7.ll create mode 100644 test/Linker/comdat8.ll create mode 100644 test/Linker/datalayout.ll create mode 100644 test/Linker/debug-info-version-a.ll create mode 100644 test/Linker/debug-info-version-b.ll create mode 100644 test/Linker/dllstorage-a.ll create mode 100644 test/Linker/dllstorage-b.ll create mode 100644 test/Linker/func-attrs-a.ll create mode 100644 test/Linker/func-attrs-b.ll create mode 100644 test/Linker/global_ctors.ll create mode 100644 test/Linker/targettriple.ll create mode 100644 test/Linker/type-unique-odr-a.ll create mode 100644 test/Linker/type-unique-odr-b.ll create mode 100644 test/Linker/type-unique-simple2-a.ll create mode 100644 test/Linker/type-unique-simple2-b.ll create mode 100644 test/MC/AArch64/alias-logicalimm.s create mode 100644 test/MC/AArch64/arm64-adr.s create mode 100644 test/MC/AArch64/arm64-advsimd.s create mode 100644 test/MC/AArch64/arm64-aliases.s create mode 100644 test/MC/AArch64/arm64-arithmetic-encoding.s create mode 100644 test/MC/AArch64/arm64-arm64-fixup.s create mode 100644 test/MC/AArch64/arm64-basic-a64-instructions.s create mode 100644 test/MC/AArch64/arm64-be-datalayout.s create mode 100644 test/MC/AArch64/arm64-bitfield-encoding.s create mode 100644 test/MC/AArch64/arm64-branch-encoding.s create mode 100644 test/MC/AArch64/arm64-condbr-without-dots.s create mode 100644 test/MC/AArch64/arm64-crypto.s create mode 100644 test/MC/AArch64/arm64-diagno-predicate.s create mode 100644 test/MC/AArch64/arm64-diags.s create mode 100644 test/MC/AArch64/arm64-directive_loh.s create mode 100644 test/MC/AArch64/arm64-elf-reloc-condbr.s create mode 100644 test/MC/AArch64/arm64-elf-relocs.s create mode 100644 test/MC/AArch64/arm64-fp-encoding.s create mode 100644 test/MC/AArch64/arm64-large-relocs.s create mode 100644 test/MC/AArch64/arm64-leaf-compact-unwind.s create mode 100644 test/MC/AArch64/arm64-logical-encoding.s create mode 100644 test/MC/AArch64/arm64-mapping-across-sections.s create mode 100644 test/MC/AArch64/arm64-mapping-within-section.s create mode 100644 test/MC/AArch64/arm64-memory.s create mode 100644 test/MC/AArch64/arm64-nv-cond.s create mode 100644 test/MC/AArch64/arm64-optional-hash.s create mode 100644 test/MC/AArch64/arm64-separator.s create mode 100644 test/MC/AArch64/arm64-simd-ldst.s create mode 100644 test/MC/AArch64/arm64-small-data-fixups.s create mode 100644 test/MC/AArch64/arm64-spsel-sysreg.s create mode 100644 test/MC/AArch64/arm64-system-encoding.s create mode 100644 test/MC/AArch64/arm64-target-specific-sysreg.s create mode 100644 test/MC/AArch64/arm64-tls-modifiers-darwin.s create mode 100644 test/MC/AArch64/arm64-tls-relocs.s create mode 100644 test/MC/AArch64/arm64-v128_lo-diagnostics.s create mode 100644 test/MC/AArch64/arm64-variable-exprs.s create mode 100644 test/MC/AArch64/arm64-vector-lists.s create mode 100644 test/MC/AArch64/arm64-verbose-vector-case.s create mode 100644 test/MC/AArch64/dot-req-case-insensitive.s create mode 100644 test/MC/AArch64/dot-req-diagnostics.s create mode 100644 test/MC/AArch64/dot-req.s delete mode 100644 test/MC/AArch64/elf-reloc-addend.s delete mode 100644 test/MC/AArch64/elf-reloc-condbr.s create mode 100644 test/MC/AArch64/ldr-pseudo-diagnostics.s create mode 100644 test/MC/AArch64/ldr-pseudo-obj-errors.s create mode 100644 test/MC/AArch64/ldr-pseudo.s create mode 100644 test/MC/AArch64/neon-sxtl.s create mode 100644 test/MC/AArch64/neon-uxtl.s create mode 100644 test/MC/AArch64/optional-hash.s create mode 100644 test/MC/ARM/Windows/mov32t-range.s create mode 100644 test/MC/ARM/Windows/multiple-text-sections.s create mode 100644 test/MC/ARM/Windows/text-attributes.s create mode 100644 test/MC/ARM/arm-elf-symver.s create mode 100644 test/MC/ARM/arm-qualifier-diagnostics.s delete mode 100644 test/MC/ARM/arm_word_directive.s create mode 100644 test/MC/ARM/big-endian-arm-fixup.s create mode 100644 test/MC/ARM/big-endian-thumb-fixup.s create mode 100644 test/MC/ARM/big-endian-thumb2-fixup.s create mode 100644 test/MC/ARM/bkpt.s create mode 100644 test/MC/ARM/cmp-immediate-fixup-error.s create mode 100644 test/MC/ARM/cmp-immediate-fixup-error2.s create mode 100644 test/MC/ARM/cmp-immediate-fixup.s create mode 100644 test/MC/ARM/cmp-immediate-fixup2.s create mode 100644 test/MC/ARM/coff-debugging-secrel.ll create mode 100644 test/MC/ARM/coff-file.s create mode 100644 test/MC/ARM/coff-function-type-info.ll create mode 100644 test/MC/ARM/coff-relocations.s create mode 100644 test/MC/ARM/comment.s create mode 100644 test/MC/ARM/complex-operands.s create mode 100644 test/MC/ARM/directive-align.s create mode 100644 test/MC/ARM/directive-arch-armv2.s create mode 100644 test/MC/ARM/directive-arch-armv2a.s create mode 100644 test/MC/ARM/directive-arch-armv3.s create mode 100644 test/MC/ARM/directive-arch-armv3m.s create mode 100644 test/MC/ARM/directive-arch-armv4.s create mode 100644 test/MC/ARM/directive-arch-armv4t.s create mode 100644 test/MC/ARM/directive-arch-armv5.s create mode 100644 test/MC/ARM/directive-arch-armv5t.s create mode 100644 test/MC/ARM/directive-arch-armv5te.s create mode 100644 test/MC/ARM/directive-arch-armv6-m.s create mode 100644 test/MC/ARM/directive-arch-armv6.s create mode 100644 test/MC/ARM/directive-arch-armv6j.s create mode 100644 test/MC/ARM/directive-arch-armv6t2.s create mode 100644 test/MC/ARM/directive-arch-armv6z.s create mode 100644 test/MC/ARM/directive-arch-armv6zk.s create mode 100644 test/MC/ARM/directive-arch-armv7-a.s create mode 100644 test/MC/ARM/directive-arch-armv7-m.s create mode 100644 test/MC/ARM/directive-arch-armv7-r.s create mode 100644 test/MC/ARM/directive-arch-armv7.s create mode 100644 test/MC/ARM/directive-arch-armv7a.s create mode 100644 test/MC/ARM/directive-arch-armv7m.s create mode 100644 test/MC/ARM/directive-arch-armv7r.s create mode 100644 test/MC/ARM/directive-arch-armv8-a.s create mode 100644 test/MC/ARM/directive-arch-armv8a.s create mode 100644 test/MC/ARM/directive-arch-iwmmxt.s create mode 100644 test/MC/ARM/directive-arch-iwmmxt2.s create mode 100644 test/MC/ARM/directive-arch_extension-crc.s create mode 100644 test/MC/ARM/directive-arch_extension-crypto.s create mode 100644 test/MC/ARM/directive-arch_extension-fp.s create mode 100644 test/MC/ARM/directive-arch_extension-idiv.s create mode 100644 test/MC/ARM/directive-arch_extension-mp.s create mode 100644 test/MC/ARM/directive-arch_extension-sec.s create mode 100644 test/MC/ARM/directive-arch_extension-simd.s create mode 100644 test/MC/ARM/directive-eabi_attribute-2.s create mode 100644 test/MC/ARM/directive-eabi_attribute-diagnostics.s create mode 100644 test/MC/ARM/directive-eabi_attribute-overwrite.s create mode 100644 test/MC/ARM/directive-even.s create mode 100644 test/MC/ARM/directive-fpu-softvfp.s create mode 100644 test/MC/ARM/directive-literals.s create mode 100644 test/MC/ARM/directive-object_arch-2.s create mode 100644 test/MC/ARM/directive-object_arch-3.s create mode 100644 test/MC/ARM/directive-object_arch-diagnostics.s create mode 100644 test/MC/ARM/directive-object_arch.s create mode 100644 test/MC/ARM/directive-tlsdescseq-diagnostics.s create mode 100644 test/MC/ARM/directive-tlsdescseq.s create mode 100644 test/MC/ARM/directive-word-diagnostics.s create mode 100644 test/MC/ARM/dot-req-case-insensitive.s create mode 100644 test/MC/ARM/dwarf-asm-multiple-sections.s create mode 100644 test/MC/ARM/dwarf-asm-no-code.s create mode 100644 test/MC/ARM/dwarf-asm-nonstandard-section.s create mode 100644 test/MC/ARM/dwarf-asm-single-section.s create mode 100644 test/MC/ARM/dwarf-cfi-initial-state.s create mode 100644 test/MC/ARM/eh-directive-movsp-diagnostics.s create mode 100644 test/MC/ARM/eh-directive-movsp.s create mode 100644 test/MC/ARM/eh-directive-personalityindex-diagnostics.s create mode 100644 test/MC/ARM/eh-directive-personalityindex.s delete mode 100644 test/MC/ARM/eh-directive-save-diagnoatics.s create mode 100644 test/MC/ARM/eh-directive-save-diagnostics.s create mode 100644 test/MC/ARM/eh-directive-unwind_raw-diagnostics.s create mode 100644 test/MC/ARM/eh-directive-unwind_raw.s create mode 100644 test/MC/ARM/fconst.s create mode 100644 test/MC/ARM/fixup-cpu-mode.s create mode 100644 test/MC/ARM/fp-const-errors.s create mode 100644 test/MC/ARM/gas-compl-copr-reg.s create mode 100644 test/MC/ARM/inst-arm-suffixes.s create mode 100644 test/MC/ARM/inst-constant-required.s create mode 100644 test/MC/ARM/inst-directive-emit.s create mode 100644 test/MC/ARM/inst-directive.s create mode 100644 test/MC/ARM/inst-overflow.s create mode 100644 test/MC/ARM/inst-thumb-overflow-2.s create mode 100644 test/MC/ARM/inst-thumb-overflow.s create mode 100644 test/MC/ARM/inst-thumb-suffixes.s create mode 100644 test/MC/ARM/invalid-vector-index.s create mode 100644 test/MC/ARM/ldr-pseudo-darwin.s create mode 100644 test/MC/ARM/ldr-pseudo-obj-errors.s create mode 100644 test/MC/ARM/ldr-pseudo-parse-errors.s create mode 100644 test/MC/ARM/ldr-pseudo.s create mode 100644 test/MC/ARM/ldrd-strd-gnu-arm-bad-imm.s create mode 100644 test/MC/ARM/ldrd-strd-gnu-arm.s create mode 100644 test/MC/ARM/ldrd-strd-gnu-sp.s create mode 100644 test/MC/ARM/ldrd-strd-gnu-thumb-bad-regs.s create mode 100644 test/MC/ARM/ldrd-strd-gnu-thumb.s create mode 100644 test/MC/ARM/ltorg-darwin.s create mode 100644 test/MC/ARM/ltorg.s create mode 100644 test/MC/ARM/macho-relocs-with-addend.s create mode 100644 test/MC/ARM/mul-v4.s create mode 100644 test/MC/ARM/neon-vld-vst-align.s create mode 100644 test/MC/ARM/not-armv4.s create mode 100644 test/MC/ARM/pool.s create mode 100644 test/MC/ARM/symbol-variants-errors.s create mode 100644 test/MC/ARM/symbol-variants.s create mode 100644 test/MC/ARM/target-expressions.s create mode 100644 test/MC/ARM/thumb-far-jump.s create mode 100644 test/MC/ARM/thumb-st_other.s create mode 100644 test/MC/ARM/thumb-types.s create mode 100644 test/MC/ARM/thumb2-cbn-to-next-inst.s create mode 100644 test/MC/ARM/thumb2-strd.s create mode 100644 test/MC/ARM/thumb2be-b.w-encoding.s create mode 100644 test/MC/ARM/thumb2be-beq.w-encoding.s create mode 100644 test/MC/ARM/thumb2be-movt-encoding.s create mode 100644 test/MC/ARM/thumb2be-movw-encoding.s create mode 100644 test/MC/ARM/thumb_set-diagnostics.s create mode 100644 test/MC/ARM/thumb_set.s create mode 100644 test/MC/ARM/thumbv7m.s create mode 100644 test/MC/ARM/udf-arm-diagnostics.s create mode 100644 test/MC/ARM/udf-arm.s create mode 100644 test/MC/ARM/udf-thumb-2-diagnostics.s create mode 100644 test/MC/ARM/udf-thumb-2.s create mode 100644 test/MC/ARM/udf-thumb-diagnostics.s create mode 100644 test/MC/ARM/udf-thumb.s create mode 100644 test/MC/ARM/unwind-stack-diagnostics.s create mode 100644 test/MC/ARM/variant-diagnostics.s create mode 100644 test/MC/ARM/vfp-aliases-diagnostics.s create mode 100644 test/MC/ARM/vfp-aliases.s create mode 100644 test/MC/ARM/vmov-vmvn-byte-replicate.s create mode 100644 test/MC/ARM/vmov-vmvn-illegal-cases.s create mode 100644 test/MC/ARM/vorr-vbic-illegal-cases.s delete mode 100644 test/MC/ARM/xscale-attributes.ll create mode 100644 test/MC/AsmParser/directive-err-diagnostics.s create mode 100644 test/MC/AsmParser/directive-err.s create mode 100644 test/MC/AsmParser/directive_end-2.s create mode 100644 test/MC/AsmParser/directive_end.s create mode 100644 test/MC/AsmParser/directive_rept-diagnostics.s create mode 100644 test/MC/AsmParser/directive_rept.s create mode 100644 test/MC/AsmParser/dot-symbol-assignment-backwards.s create mode 100644 test/MC/AsmParser/dot-symbol-assignment.s create mode 100644 test/MC/AsmParser/dot-symbol-non-absolute.s create mode 100644 test/MC/AsmParser/if-diagnostics.s create mode 100644 test/MC/AsmParser/ifeqs-diagnostics.s create mode 100644 test/MC/AsmParser/ifeqs.s create mode 100644 test/MC/AsmParser/invalid-input-assertion.s create mode 100644 test/MC/AsmParser/macro-qualifier-diagnostics.s create mode 100644 test/MC/AsmParser/macro-qualifier.s create mode 100644 test/MC/AsmParser/macros-argument-parsing-diagnostics.s create mode 100644 test/MC/AsmParser/macros-argument-parsing.s create mode 100644 test/MC/AsmParser/macros-darwin-vararg.s create mode 100644 test/MC/AsmParser/macros-gas.s delete mode 100644 test/MC/AsmParser/macros.s create mode 100644 test/MC/AsmParser/vararg-default-value.s create mode 100644 test/MC/AsmParser/vararg.s create mode 100644 test/MC/COFF/bad-expr.s create mode 100644 test/MC/COFF/comm.s create mode 100644 test/MC/COFF/directive-section-characteristics.ll create mode 100644 test/MC/COFF/early-dce.s create mode 100644 test/MC/COFF/file.s create mode 100644 test/MC/COFF/initialised-data.ll create mode 100644 test/MC/COFF/invalid-def.s create mode 100644 test/MC/COFF/invalid-endef.s create mode 100644 test/MC/COFF/invalid-scl-range.s create mode 100644 test/MC/COFF/invalid-scl.s create mode 100644 test/MC/COFF/invalid-type-range.s create mode 100644 test/MC/COFF/invalid-type.s create mode 100644 test/MC/COFF/ir-to-imgrel.ll create mode 100644 test/MC/COFF/offset.s create mode 100644 test/MC/COFF/secidx-diagnostic.s create mode 100644 test/MC/COFF/secidx.s create mode 100644 test/MC/COFF/section-comdat-conflict.s create mode 100644 test/MC/COFF/section-comdat-conflict2.s create mode 100644 test/MC/COFF/seh-stackalloc-zero.s create mode 100644 test/MC/COFF/timestamp.s create mode 100644 test/MC/Disassembler/AArch64/arm64-advsimd.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-arithmetic.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-basic-a64-undefined.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-bitfield.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-branch.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-canonical-form.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-crc32.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-crypto.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-invalid-logical.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-logical.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-memory.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-non-apple-fmov.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-scalar-fp.txt create mode 100644 test/MC/Disassembler/AArch64/arm64-system.txt create mode 100644 test/MC/Disassembler/ARM/addrmode2-reencoding.txt create mode 100644 test/MC/Disassembler/Mips/mips32r6.txt create mode 100644 test/MC/Disassembler/Mips/mips64r6.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_2r.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_2r_msa64.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_2rf.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_3r.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_3rf.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_bit.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_ctrlregs.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_dlsa.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_elm.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_elm_insert.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_elm_insert_msa64.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_elm_insve.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_elm_msa64.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_i10.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_i5.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_i8.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_lsa.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_mi10.txt create mode 100644 test/MC/Disassembler/Mips/msa/test_vec.txt create mode 100644 test/MC/Disassembler/PowerPC/lit.local.cfg create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding-bookIII.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding-ext.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding-fp.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding-vmx.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-encoding.txt create mode 100644 test/MC/Disassembler/PowerPC/ppc64-operands.txt create mode 100644 test/MC/Disassembler/PowerPC/vsx.txt create mode 100644 test/MC/Disassembler/Sparc/lit.local.cfg create mode 100644 test/MC/Disassembler/Sparc/sparc-fp.txt create mode 100644 test/MC/Disassembler/Sparc/sparc-mem.txt create mode 100644 test/MC/Disassembler/Sparc/sparc.txt create mode 100644 test/MC/Disassembler/X86/avx-512.txt create mode 100644 test/MC/Disassembler/X86/fp-stack.txt create mode 100644 test/MC/Disassembler/X86/missing-sib.txt create mode 100644 test/MC/Disassembler/X86/moffs.txt create mode 100644 test/MC/Disassembler/X86/padlock.txt create mode 100644 test/MC/Disassembler/X86/x86-16.txt create mode 100644 test/MC/ELF/ARM/bss-non-zero-value.s create mode 100644 test/MC/ELF/ARM/gnu-type-hash-diagnostics.s create mode 100644 test/MC/ELF/ARM/gnu-type-hash.s create mode 100644 test/MC/ELF/ARM/lit.local.cfg create mode 100644 test/MC/ELF/bad-expr.s create mode 100644 test/MC/ELF/bad-expr2.s create mode 100644 test/MC/ELF/bad-expr3.s create mode 100644 test/MC/ELF/cfi-version.ll create mode 100644 test/MC/ELF/compression.s create mode 100644 test/MC/ELF/discriminator.s create mode 100644 test/MC/ELF/dot-symbol-assignment.s create mode 100644 test/MC/ELF/gnu-type-diagnostics.s create mode 100644 test/MC/ELF/gnu-type.s create mode 100644 test/MC/ELF/ifunc-reloc.s delete mode 100644 test/MC/ELF/many-section.s create mode 100644 test/MC/ELF/many-sections.s create mode 100644 test/MC/ELF/no-reloc.s create mode 100644 test/MC/ELF/nocompression.s create mode 100644 test/MC/ELF/offset.s create mode 100644 test/MC/ELF/pr19430.s create mode 100644 test/MC/ELF/strtab-suffix-opt.s create mode 100644 test/MC/ELF/subtraction-error.s delete mode 100644 test/MC/ELF/symref.s create mode 100644 test/MC/ELF/symver.s create mode 100644 test/MC/ELF/type-propagate.s create mode 100644 test/MC/MachO/AArch64/darwin-ARM64-local-label-diff.s create mode 100644 test/MC/MachO/AArch64/darwin-ARM64-reloc.s create mode 100644 test/MC/MachO/AArch64/lit.local.cfg create mode 100644 test/MC/MachO/ARM/aliased-symbols.s create mode 100644 test/MC/MachO/ARM/bad-darwin-ARM-reloc.s create mode 100644 test/MC/MachO/ARM/bad-darwin-directives.s create mode 100644 test/MC/MachO/ARM/ios-version-min-load-command.s create mode 100644 test/MC/MachO/ARM/version-min-diagnostics.s create mode 100644 test/MC/MachO/ARM/version-min.s create mode 100644 test/MC/MachO/bad-darwin-x86_64-reloc-expr.s create mode 100644 test/MC/MachO/eh-frame-reloc.s create mode 100644 test/MC/MachO/eh_symbol.s create mode 100644 test/MC/MachO/osx-version-min-load-command.s create mode 100644 test/MC/MachO/pr19185.s create mode 100644 test/MC/MachO/x86_32-scattered-reloc-fallback.s delete mode 100644 test/MC/Mips/abicalls.ll create mode 100644 test/MC/Mips/cfi.s create mode 100644 test/MC/Mips/cpload-bad.s create mode 100644 test/MC/Mips/cpload.s create mode 100644 test/MC/Mips/cpsetup-bad.s create mode 100644 test/MC/Mips/cpsetup.s delete mode 100644 test/MC/Mips/do_switch.ll create mode 100644 test/MC/Mips/do_switch1.s create mode 100644 test/MC/Mips/do_switch2.s create mode 100644 test/MC/Mips/do_switch3.s delete mode 100644 test/MC/Mips/elf-N64.ll create mode 100644 test/MC/Mips/elf-N64.s delete mode 100644 test/MC/Mips/elf-gprel-32-64.ll create mode 100644 test/MC/Mips/elf-gprel-32-64.s delete mode 100644 test/MC/Mips/elf-reginfo.ll delete mode 100644 test/MC/Mips/elf-relsym.ll create mode 100644 test/MC/Mips/elf-relsym.s delete mode 100644 test/MC/Mips/elf-tls.ll create mode 100644 test/MC/Mips/elf-tls.s delete mode 100644 test/MC/Mips/elf_eflags.ll create mode 100644 test/MC/Mips/elf_eflags_abicalls.s create mode 100644 test/MC/Mips/elf_eflags_micromips.s create mode 100644 test/MC/Mips/elf_eflags_mips16.s create mode 100644 test/MC/Mips/elf_eflags_nan2008.s create mode 100644 test/MC/Mips/elf_eflags_nanlegacy.s create mode 100644 test/MC/Mips/elf_eflags_noreorder.s create mode 100644 test/MC/Mips/elf_eflags_pic0.s create mode 100644 test/MC/Mips/elf_eflags_pic2.s create mode 100644 test/MC/Mips/elf_reginfo.s delete mode 100644 test/MC/Mips/elf_st_other.ll create mode 100644 test/MC/Mips/higher-highest-addressing.s delete mode 100644 test/MC/Mips/higher_highest.ll delete mode 100644 test/MC/Mips/lea_64.ll create mode 100644 test/MC/Mips/llvm-mc-fixup-endianness.s create mode 100644 test/MC/Mips/micromips-16-bit-instructions.s create mode 100644 test/MC/Mips/micromips-alias.s create mode 100644 test/MC/Mips/micromips-bad-branches.s create mode 100644 test/MC/Mips/micromips-control-instructions.s create mode 100644 test/MC/Mips/micromips-diagnostic-fixup.s create mode 100644 test/MC/Mips/micromips-el-fixup-data.s create mode 100644 test/MC/Mips/micromips-fpu-instructions.s delete mode 100644 test/MC/Mips/micromips-long-branch.ll create mode 100644 test/MC/Mips/micromips-pc16-fixup.s create mode 100644 test/MC/Mips/mips-abi-bad.s create mode 100644 test/MC/Mips/mips-bad-branches.s create mode 100644 test/MC/Mips/mips-data-directives.s create mode 100644 test/MC/Mips/mips-diagnostic-fixup.s create mode 100644 test/MC/Mips/mips-expansions-bad.s create mode 100644 test/MC/Mips/mips-noat.s create mode 100644 test/MC/Mips/mips-pc16-fixup.s create mode 100644 test/MC/Mips/mips-reginfo-fp32.s create mode 100644 test/MC/Mips/mips-reginfo-fp64.s create mode 100644 test/MC/Mips/mips-register-names-invalid.s create mode 100644 test/MC/Mips/mips-register-names-o32.s delete mode 100644 test/MC/Mips/mips-register-names.s create mode 100644 test/MC/Mips/mips1/invalid-mips2-wrong-error.s create mode 100644 test/MC/Mips/mips1/invalid-mips2.s create mode 100644 test/MC/Mips/mips1/invalid-mips3-wrong-error.s create mode 100644 test/MC/Mips/mips1/invalid-mips3.s create mode 100644 test/MC/Mips/mips1/invalid-mips32.s create mode 100644 test/MC/Mips/mips1/invalid-mips4-wrong-error.s create mode 100644 test/MC/Mips/mips1/invalid-mips4.s create mode 100644 test/MC/Mips/mips1/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips1/invalid-mips5.s create mode 100644 test/MC/Mips/mips1/valid-xfail.s create mode 100644 test/MC/Mips/mips1/valid.s create mode 100644 test/MC/Mips/mips2/invalid-mips3-wrong-error.s create mode 100644 test/MC/Mips/mips2/invalid-mips3.s create mode 100644 test/MC/Mips/mips2/invalid-mips32.s create mode 100644 test/MC/Mips/mips2/invalid-mips32r2-xfail.s create mode 100644 test/MC/Mips/mips2/invalid-mips32r2.s create mode 100644 test/MC/Mips/mips2/invalid-mips4-wrong-error.s create mode 100644 test/MC/Mips/mips2/invalid-mips4.s create mode 100644 test/MC/Mips/mips2/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips2/invalid-mips5.s create mode 100644 test/MC/Mips/mips2/valid.s create mode 100644 test/MC/Mips/mips3/invalid-mips32.s create mode 100644 test/MC/Mips/mips3/invalid-mips4.s create mode 100644 test/MC/Mips/mips3/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips3/invalid-mips5.s create mode 100644 test/MC/Mips/mips3/valid.s create mode 100644 test/MC/Mips/mips32/abiflags.s create mode 100644 test/MC/Mips/mips32/invalid-mips32r2-xfail.s create mode 100644 test/MC/Mips/mips32/invalid-mips32r2.s create mode 100644 test/MC/Mips/mips32/invalid-mips64.s create mode 100644 test/MC/Mips/mips32/valid-xfail.s create mode 100644 test/MC/Mips/mips32/valid.s create mode 100644 test/MC/Mips/mips32r2/abiflags.s create mode 100644 test/MC/Mips/mips32r2/invalid-mips64r2.s create mode 100644 test/MC/Mips/mips32r2/invalid.s create mode 100644 test/MC/Mips/mips32r2/valid-xfail.s create mode 100644 test/MC/Mips/mips32r2/valid.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips1-wrong-error.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips1.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips2-wrong-error.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips2.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips32-wrong-error.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips32.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips32r2.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips4-wrong-error.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips4.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips32r6/invalid-mips5.s create mode 100644 test/MC/Mips/mips32r6/invalid.s create mode 100644 test/MC/Mips/mips32r6/relocations.s create mode 100644 test/MC/Mips/mips32r6/valid-xfail.s create mode 100644 test/MC/Mips/mips32r6/valid.s create mode 100644 test/MC/Mips/mips4/invalid-mips32.s create mode 100644 test/MC/Mips/mips4/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips4/invalid-mips5.s create mode 100644 test/MC/Mips/mips4/invalid-mips64.s create mode 100644 test/MC/Mips/mips4/invalid-mips64r2-xfail.s create mode 100644 test/MC/Mips/mips4/invalid-mips64r2.s create mode 100644 test/MC/Mips/mips4/valid-xfail.s create mode 100644 test/MC/Mips/mips4/valid.s create mode 100644 test/MC/Mips/mips5/invalid-mips32.s create mode 100644 test/MC/Mips/mips5/invalid-mips64.s create mode 100644 test/MC/Mips/mips5/invalid-mips64r2-xfail.s create mode 100644 test/MC/Mips/mips5/invalid-mips64r2.s create mode 100644 test/MC/Mips/mips5/valid-xfail.s create mode 100644 test/MC/Mips/mips5/valid.s create mode 100644 test/MC/Mips/mips64-expansions.s create mode 100644 test/MC/Mips/mips64-register-names-n32-n64.s create mode 100644 test/MC/Mips/mips64-register-names-o32.s delete mode 100644 test/MC/Mips/mips64-register-names.s create mode 100644 test/MC/Mips/mips64/abiflags.s create mode 100644 test/MC/Mips/mips64/invalid-mips64r2-xfail.s create mode 100644 test/MC/Mips/mips64/invalid-mips64r2.s create mode 100644 test/MC/Mips/mips64/valid-xfail.s create mode 100644 test/MC/Mips/mips64/valid.s create mode 100644 test/MC/Mips/mips64eb-fixups.s create mode 100644 test/MC/Mips/mips64r2/abi-bad.s create mode 100644 test/MC/Mips/mips64r2/abiflags.s create mode 100644 test/MC/Mips/mips64r2/invalid.s create mode 100644 test/MC/Mips/mips64r2/valid-xfail.s create mode 100644 test/MC/Mips/mips64r2/valid.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips1-wrong-error.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips1.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips2.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips3-wrong-error.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips3.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips32-wrong-error.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips4-wrong-error.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips4.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips5-wrong-error.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips5.s create mode 100644 test/MC/Mips/mips64r6/invalid-mips64.s create mode 100644 test/MC/Mips/mips64r6/invalid.s create mode 100644 test/MC/Mips/mips64r6/relocations.s create mode 100644 test/MC/Mips/mips64r6/valid-xfail.s create mode 100644 test/MC/Mips/mips64r6/valid.s create mode 100644 test/MC/Mips/mips_abi_flags_xx.s create mode 100644 test/MC/Mips/mips_abi_flags_xx_set.s create mode 100644 test/MC/Mips/mips_directives_bad.s delete mode 100644 test/MC/Mips/mips_gprel16.ll create mode 100644 test/MC/Mips/mips_gprel16.s create mode 100644 test/MC/Mips/msa/abiflags.s create mode 100644 test/MC/Mips/msa/test_2r_msa64.s create mode 100644 test/MC/Mips/msa/test_dlsa.s create mode 100644 test/MC/Mips/msa/test_elm_insert_msa64.s create mode 100644 test/MC/Mips/msa/test_elm_msa64.s create mode 100644 test/MC/Mips/nacl-mask.s create mode 100644 test/MC/Mips/nooddspreg-cmdarg.s create mode 100644 test/MC/Mips/nooddspreg-error.s create mode 100644 test/MC/Mips/nooddspreg.s create mode 100644 test/MC/Mips/octeon-instructions.s create mode 100644 test/MC/Mips/oddspreg.s delete mode 100644 test/MC/Mips/r-mips-got-disp.ll create mode 100644 test/MC/Mips/r-mips-got-disp.s create mode 100644 test/MC/Mips/set-at-directive-explicit-at.s create mode 100644 test/MC/Mips/sym-expr.s delete mode 100644 test/MC/Mips/xgot.ll create mode 100644 test/MC/Mips/xgot.s create mode 100644 test/MC/PowerPC/ppc-reloc.s create mode 100644 test/MC/PowerPC/ppc64-abiversion.s create mode 100644 test/MC/PowerPC/ppc64-localentry-error1.s create mode 100644 test/MC/PowerPC/ppc64-localentry-error2.s create mode 100644 test/MC/PowerPC/ppc64-localentry.s create mode 100644 test/MC/PowerPC/vsx.s create mode 100644 test/MC/Sparc/lit.local.cfg create mode 100644 test/MC/Sparc/sparc-alu-instructions.s create mode 100644 test/MC/Sparc/sparc-atomic-instructions.s create mode 100644 test/MC/Sparc/sparc-ctrl-instructions.s create mode 100644 test/MC/Sparc/sparc-directive-xword.s create mode 100644 test/MC/Sparc/sparc-directives.s create mode 100644 test/MC/Sparc/sparc-fp-instructions.s create mode 100644 test/MC/Sparc/sparc-mem-instructions.s create mode 100644 test/MC/Sparc/sparc-nop-data.s create mode 100644 test/MC/Sparc/sparc-pic.s create mode 100644 test/MC/Sparc/sparc-relocations.s create mode 100644 test/MC/Sparc/sparc-vis.s create mode 100644 test/MC/Sparc/sparc64-alu-instructions.s create mode 100644 test/MC/Sparc/sparc64-ctrl-instructions.s create mode 100644 test/MC/Sparc/sparcv8-instructions.s create mode 100644 test/MC/Sparc/sparcv9-instructions.s create mode 100644 test/MC/X86/fixup-cpu-mode.s create mode 100644 test/MC/X86/index-operations.s create mode 100644 test/MC/X86/intel-syntax-avx512.s create mode 100644 test/MC/X86/intel-syntax-bitwise-ops.s create mode 100644 test/MC/X86/intel-syntax-directional-label.s create mode 100644 test/MC/X86/intel-syntax-invalid-basereg.s create mode 100644 test/MC/X86/intel-syntax-invalid-scale.s create mode 100644 test/MC/X86/no-elf-compact-unwind.s create mode 100644 test/MC/X86/relax-insn.s create mode 100644 test/MC/X86/reloc-undef-global.s create mode 100644 test/MC/X86/ret.s create mode 100644 test/MC/X86/stackmap-nops.ll create mode 100644 test/MC/X86/variant-diagnostics.s create mode 100644 test/MC/X86/x86-16.s create mode 100644 test/MC/X86/x86-itanium.ll create mode 100644 test/MC/X86/x86-target-directives.s create mode 100644 test/MC/X86/x86-windows-itanium-libcalls.ll create mode 100644 test/MC/X86/x86_64-signed-reloc.s create mode 100644 test/Object/Inputs/COFF/long-file-symbol.yaml create mode 100644 test/Object/Inputs/COFF/weak-external.yaml create mode 100644 test/Object/Inputs/absolute.elf-x86-64 create mode 100644 test/Object/Inputs/common.coff-i386 create mode 100644 test/Object/Inputs/corrupt-archive.a create mode 100644 test/Object/Inputs/darwin-m-test1.mach0-armv7 create mode 100644 test/Object/Inputs/darwin-m-test2.macho-i386 create mode 100755 test/Object/Inputs/darwin-m-test3.macho-x86-64 create mode 100755 test/Object/Inputs/hello-world.macho-x86_64 create mode 100644 test/Object/Inputs/macho-archive-x86_64.a create mode 100755 test/Object/Inputs/macho-hello-g.macho-x86_64 create mode 100644 test/Object/Inputs/macho-text-data-bss.macho-x86_64 create mode 100644 test/Object/Inputs/macho-universal-archive.x86_64.i386 create mode 100755 test/Object/Inputs/no-sections.elf-x86-64 create mode 100644 test/Object/Inputs/program-headers.mips64 create mode 100644 test/Object/Inputs/relocatable-with-section-address.elf-x86-64 create mode 100755 test/Object/Inputs/relocation-dynamic.elf-i386 create mode 100644 test/Object/Inputs/relocation-relocatable.elf-i386 create mode 100644 test/Object/Inputs/thumb-symbols.elf.arm create mode 100644 test/Object/Inputs/trivial-object-test.elf-mipsel create mode 100644 test/Object/Inputs/unwind-section.elf-x86-64 create mode 100644 test/Object/Inputs/weak.elf-x86-64 create mode 100644 test/Object/X86/archive-ir-asm.ll create mode 100644 test/Object/X86/nm-ir.ll create mode 100644 test/Object/X86/yaml2obj-elf-x86-rel.yaml create mode 100644 test/Object/ar-error.test create mode 100644 test/Object/mangle-ir.ll create mode 100644 test/Object/nm-darwin-m.test create mode 100644 test/Object/obj2yaml-coff-long-file-symbol.test create mode 100644 test/Object/obj2yaml-coff-weak-external.test create mode 100644 test/Object/objdump-no-sectionheaders.test create mode 100644 test/Object/size-trivial-macho.test create mode 100644 test/Object/yaml2obj-coff-multi-doc.test create mode 100644 test/Object/yaml2obj-elf-file-headers-with-e_flags.yaml create mode 100644 test/Object/yaml2obj-elf-multi-doc.test create mode 100644 test/Object/yaml2obj-elf-rel.yaml create mode 100644 test/Object/yaml2obj-elf-section-invalid-size.yaml create mode 100644 test/Object/yaml2obj-elf-symbol-visibility.yaml delete mode 100644 test/Other/Inputs/llvm_cov.gcda delete mode 100644 test/Other/Inputs/llvm_cov.gcno delete mode 100644 test/Other/llvm-cov.test create mode 100644 test/Other/new-pass-manager.ll create mode 100644 test/Other/optimization-remarks-inline.ll create mode 100644 test/Other/pass-pipeline-parsing.ll create mode 100644 test/TableGen/ValidIdentifiers.td create mode 100644 test/TableGen/if-empty-list-arg.td create mode 100644 test/TableGen/intrinsic-long-name.td create mode 100644 test/TableGen/listconcat.td create mode 100644 test/Transforms/AddDiscriminators/basic.ll create mode 100644 test/Transforms/AddDiscriminators/first-only.ll create mode 100644 test/Transforms/AddDiscriminators/multiple.ll create mode 100644 test/Transforms/AddDiscriminators/no-discriminators.ll create mode 100644 test/Transforms/ArgumentPromotion/dbg.ll create mode 100644 test/Transforms/ArgumentPromotion/inalloca.ll create mode 100644 test/Transforms/ArgumentPromotion/tail.ll create mode 100644 test/Transforms/AtomicExpandLoadLinked/ARM/atomic-expansion-v7.ll create mode 100644 test/Transforms/AtomicExpandLoadLinked/ARM/atomic-expansion-v8.ll create mode 100644 test/Transforms/AtomicExpandLoadLinked/ARM/cmpxchg-weak.ll create mode 100644 test/Transforms/AtomicExpandLoadLinked/ARM/lit.local.cfg create mode 100644 test/Transforms/CodeGenPrepare/X86/extend-sink-hoist.ll create mode 100644 test/Transforms/CodeGenPrepare/X86/lit.local.cfg create mode 100644 test/Transforms/CodeGenPrepare/X86/sink-addrspacecast.ll create mode 100644 test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink.ll create mode 100644 test/Transforms/ConstantHoisting/AArch64/const-addr.ll create mode 100644 test/Transforms/ConstantHoisting/AArch64/large-immediate.ll create mode 100644 test/Transforms/ConstantHoisting/AArch64/lit.local.cfg create mode 100644 test/Transforms/ConstantHoisting/PowerPC/const-base-addr.ll create mode 100644 test/Transforms/ConstantHoisting/PowerPC/lit.local.cfg create mode 100644 test/Transforms/ConstantHoisting/PowerPC/masks.ll create mode 100644 test/Transforms/ConstantHoisting/X86/cast-inst.ll create mode 100644 test/Transforms/ConstantHoisting/X86/const-base-addr.ll create mode 100644 test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll create mode 100644 test/Transforms/ConstantHoisting/X86/large-immediate.ll create mode 100644 test/Transforms/ConstantHoisting/X86/lit.local.cfg create mode 100644 test/Transforms/ConstantHoisting/X86/phi.ll create mode 100644 test/Transforms/ConstantHoisting/X86/stackmap.ll delete mode 100644 test/Transforms/ConstantMerge/linker-private.ll create mode 100644 test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll create mode 100644 test/Transforms/GCOVProfiling/global-ctor.ll create mode 100644 test/Transforms/GCOVProfiling/linezero.ll create mode 100644 test/Transforms/GVN/calloc-load-removal.ll create mode 100644 test/Transforms/GVN/invariant-load.ll create mode 100644 test/Transforms/GVN/load-pre-nonlocal.ll create mode 100644 test/Transforms/GlobalDCE/global_ctors.ll create mode 100644 test/Transforms/GlobalDCE/global_ctors_integration.ll create mode 100644 test/Transforms/GlobalOpt/alias-used-address-space.ll create mode 100644 test/Transforms/GlobalOpt/alias-used-section.ll create mode 100644 test/Transforms/GlobalOpt/fastcc.ll create mode 100644 test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll create mode 100644 test/Transforms/IndVarSimplify/iv-widen.ll create mode 100644 test/Transforms/IndVarSimplify/lcssa-preservation.ll create mode 100644 test/Transforms/IndVarSimplify/overflowcheck.ll create mode 100644 test/Transforms/IndVarSimplify/pr18223.ll delete mode 100644 test/Transforms/Inline/2010-05-31-ByvalTailcall.ll create mode 100644 test/Transforms/Inline/byval-tail-call.ll create mode 100644 test/Transforms/Inline/byval_lifetime.ll create mode 100644 test/Transforms/Inline/debug-invoke.ll create mode 100644 test/Transforms/Inline/ignore-debug-info.ll create mode 100644 test/Transforms/Inline/inline-cold.ll create mode 100644 test/Transforms/Inline/inline-vla.ll create mode 100644 test/Transforms/Inline/invoke-cleanup.ll create mode 100644 test/Transforms/Inline/invoke-combine-clauses.ll create mode 100644 test/Transforms/Inline/null-function.ll create mode 100644 test/Transforms/Inline/optimization-remarks.ll create mode 100644 test/Transforms/Inline/switch.ll create mode 100644 test/Transforms/InstCombine/AddOverFlow.ll create mode 100644 test/Transforms/InstCombine/OverlappingInsertvalues.ll create mode 100644 test/Transforms/InstCombine/abs_abs.ll delete mode 100644 test/Transforms/InstCombine/ashr-nop.ll create mode 100644 test/Transforms/InstCombine/blend_x86.ll create mode 100644 test/Transforms/InstCombine/call-cast-target-inalloca.ll create mode 100644 test/Transforms/InstCombine/cast-call-combine.ll create mode 100644 test/Transforms/InstCombine/ceil.ll create mode 100644 test/Transforms/InstCombine/constant-fold-math.ll create mode 100644 test/Transforms/InstCombine/copysign.ll create mode 100644 test/Transforms/InstCombine/descale-zero.ll create mode 100644 test/Transforms/InstCombine/distribute.ll create mode 100644 test/Transforms/InstCombine/fpextend_x86.ll create mode 100644 test/Transforms/InstCombine/gepphigep.ll create mode 100644 test/Transforms/InstCombine/insert-extract-shuffle.ll create mode 100644 test/Transforms/InstCombine/load-addrspace-cast.ll create mode 100644 test/Transforms/InstCombine/overflow-mul.ll create mode 100644 test/Transforms/InstCombine/pr19420.ll create mode 100644 test/Transforms/InstCombine/pr20059.ll create mode 100644 test/Transforms/InstCombine/pr20079.ll create mode 100644 test/Transforms/InstCombine/r600-intrinsics.ll create mode 100644 test/Transforms/InstCombine/round.ll create mode 100644 test/Transforms/InstCombine/select-select.ll create mode 100644 test/Transforms/InstMerge/ld_hoist_st_sink.ll delete mode 100644 test/Transforms/InstSimplify/2010-12-20-Distribute.ll create mode 100644 test/Transforms/InstSimplify/apint-or.ll create mode 100644 test/Transforms/InstSimplify/ashr-nop.ll create mode 100644 test/Transforms/InstSimplify/dead-code-removal.ll create mode 100644 test/Transforms/Internalize/local-visibility.ll create mode 100644 test/Transforms/JumpThreading/pr15851_hang.ll create mode 100644 test/Transforms/LICM/extra-copies.ll create mode 100644 test/Transforms/LICM/hoist-bitcast-load.ll create mode 100644 test/Transforms/LICM/hoist-deref-load.ll create mode 100644 test/Transforms/LICM/lcssa-ssa-promoter.ll create mode 100644 test/Transforms/LoadCombine/load-combine.ll create mode 100644 test/Transforms/LoopIdiom/R600/lit.local.cfg create mode 100644 test/Transforms/LoopIdiom/R600/popcnt.ll create mode 100644 test/Transforms/LoopRotate/PhiSelfReference-1.ll delete mode 100644 test/Transforms/LoopRotate/PhiSelfRefernce-1.ll create mode 100644 test/Transforms/LoopRotate/preserve-loop-simplify.ll create mode 100644 test/Transforms/LoopSimplify/ashr-crash.ll create mode 100644 test/Transforms/LoopSimplify/notify-scev.ll create mode 100644 test/Transforms/LoopStrengthReduce/AArch64/lit.local.cfg create mode 100644 test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll create mode 100644 test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll create mode 100644 test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll create mode 100644 test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll create mode 100644 test/Transforms/LoopUnroll/X86/lit.local.cfg create mode 100644 test/Transforms/LoopUnroll/X86/partial.ll create mode 100644 test/Transforms/LoopUnroll/loop-remarks.ll create mode 100644 test/Transforms/LoopUnroll/pr18861.ll create mode 100644 test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll create mode 100644 test/Transforms/LoopUnroll/unroll-pragmas.ll create mode 100644 test/Transforms/LoopVectorize/AArch64/aarch64-unroll.ll create mode 100644 test/Transforms/LoopVectorize/AArch64/arm64-unroll.ll create mode 100644 test/Transforms/LoopVectorize/AArch64/gather-cost.ll create mode 100644 test/Transforms/LoopVectorize/AArch64/lit.local.cfg create mode 100644 test/Transforms/LoopVectorize/PowerPC/lit.local.cfg create mode 100644 test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll create mode 100644 test/Transforms/LoopVectorize/X86/avx512.ll create mode 100644 test/Transforms/LoopVectorize/X86/fp32_to_uint32-cost-model.ll create mode 100644 test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll create mode 100644 test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll create mode 100644 test/Transforms/LoopVectorize/X86/metadata-enable.ll create mode 100644 test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll create mode 100644 test/Transforms/LoopVectorize/X86/vect.omp.force.ll create mode 100644 test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll create mode 100644 test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll create mode 100644 test/Transforms/LoopVectorize/X86/vectorization-remarks.ll create mode 100644 test/Transforms/LoopVectorize/control-flow.ll create mode 100644 test/Transforms/LoopVectorize/if-pred-stores.ll create mode 100644 test/Transforms/LoopVectorize/metadata.ll create mode 100644 test/Transforms/LoopVectorize/no_array_bounds.ll create mode 100644 test/Transforms/LoopVectorize/no_switch.ll create mode 100644 test/Transforms/LoopVectorize/tbaa-nodep.ll create mode 100644 test/Transforms/LoopVectorize/vect.omp.persistence.ll create mode 100644 test/Transforms/LoopVectorize/vect.stats.ll create mode 100644 test/Transforms/LoopVectorize/version-mem-access.ll delete mode 100644 test/Transforms/LowerInvoke/2004-02-29-PHICrash.ll delete mode 100644 test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHI.ll delete mode 100644 test/Transforms/LowerInvoke/2005-08-03-InvokeWithPHIUse.ll delete mode 100644 test/Transforms/LowerInvoke/2008-02-14-CritEdgePhiCrash.ll delete mode 100644 test/Transforms/LowerInvoke/basictest.ll create mode 100644 test/Transforms/LowerInvoke/lowerinvoke.ll create mode 100644 test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll create mode 100644 test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll create mode 100644 test/Transforms/LowerSwitch/2014-06-23-PHIlowering.ll create mode 100644 test/Transforms/MemCpyOpt/capturing-func.ll create mode 100644 test/Transforms/MemCpyOpt/memcpy-undef.ll create mode 100644 test/Transforms/MergeFunc/call-and-invoke-with-ranges.ll create mode 100644 test/Transforms/MergeFunc/functions.ll create mode 100644 test/Transforms/MergeFunc/mergefunc-struct-return.ll create mode 100644 test/Transforms/MergeFunc/ranges.ll create mode 100644 test/Transforms/ObjCARC/contract-end-of-use-list.ll delete mode 100644 test/Transforms/Reassociate/2002-05-15-SubReassociate2.ll delete mode 100644 test/Transforms/Reassociate/subtest2.ll create mode 100644 test/Transforms/SCCP/atomic.ll create mode 100644 test/Transforms/SLPVectorizer/AArch64/lit.local.cfg create mode 100644 test/Transforms/SLPVectorizer/AArch64/mismatched-intrinsics.ll create mode 100644 test/Transforms/SLPVectorizer/X86/addsub.ll create mode 100644 test/Transforms/SLPVectorizer/X86/align.ll create mode 100644 test/Transforms/SLPVectorizer/X86/call.ll create mode 100644 test/Transforms/SLPVectorizer/X86/consecutive-access.ll create mode 100644 test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll create mode 100644 test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll create mode 100644 test/Transforms/SLPVectorizer/X86/extractcost.ll create mode 100644 test/Transforms/SLPVectorizer/X86/gep.ll create mode 100644 test/Transforms/SLPVectorizer/X86/intrinsic.ll create mode 100644 test/Transforms/SLPVectorizer/X86/metadata.ll create mode 100644 test/Transforms/SLPVectorizer/X86/non-vectorizable-intrinsic.ll create mode 100644 test/Transforms/SLPVectorizer/X86/pr19657.ll create mode 100644 test/Transforms/SLPVectorizer/X86/value-bug.ll create mode 100644 test/Transforms/SROA/address-spaces.ll create mode 100644 test/Transforms/SROA/slice-order-independence.ll create mode 100644 test/Transforms/SROA/slice-width.ll create mode 100644 test/Transforms/SampleProfile/Inputs/bad_discriminator_value.prof create mode 100644 test/Transforms/SampleProfile/Inputs/bad_fn_header.prof create mode 100644 test/Transforms/SampleProfile/Inputs/bad_line_values.prof create mode 100644 test/Transforms/SampleProfile/Inputs/bad_mangle.prof create mode 100644 test/Transforms/SampleProfile/Inputs/bad_sample_line.prof create mode 100644 test/Transforms/SampleProfile/Inputs/bad_samples.prof create mode 100644 test/Transforms/SampleProfile/Inputs/calls.prof create mode 100644 test/Transforms/SampleProfile/Inputs/discriminator.prof create mode 100644 test/Transforms/SampleProfile/Inputs/propagate.prof create mode 100644 test/Transforms/SampleProfile/Inputs/syntax.prof create mode 100644 test/Transforms/SampleProfile/calls.ll create mode 100644 test/Transforms/SampleProfile/discriminator.ll create mode 100644 test/Transforms/SampleProfile/propagate.ll create mode 100644 test/Transforms/SampleProfile/syntax.ll create mode 100644 test/Transforms/Scalarizer/basic.ll create mode 100644 test/Transforms/Scalarizer/dbginfo.ll create mode 100644 test/Transforms/Scalarizer/no-data-layout.ll create mode 100644 test/Transforms/SeparateConstOffsetFromGEP/NVPTX/lit.local.cfg create mode 100644 test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll create mode 100644 test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll create mode 100644 test/Transforms/SimplifyCFG/PR17073.ll create mode 100644 test/Transforms/SimplifyCFG/X86/switch-table-bug.ll create mode 100644 test/Transforms/SimplifyCFG/extract-cost.ll create mode 100644 test/Transforms/SimplifyCFG/no_speculative_loads_with_tsan.ll create mode 100644 test/Transforms/SimplifyCFG/speculate-math.ll create mode 100644 test/Transforms/SimplifyCFG/speculate-vector-ops.ll create mode 100644 test/Verifier/alias.ll delete mode 100644 test/Verifier/aliasing-chain.ll create mode 100644 test/Verifier/comdat.ll create mode 100644 test/Verifier/comdat2.ll create mode 100644 test/Verifier/global-ctors.ll create mode 100755 test/Verifier/inalloca-vararg.ll create mode 100644 test/Verifier/inalloca1.ll create mode 100644 test/Verifier/inalloca2.ll create mode 100644 test/Verifier/inalloca3.ll create mode 100644 test/Verifier/jumptable.ll create mode 100644 test/Verifier/musttail-invalid.ll create mode 100644 test/Verifier/musttail-valid.ll create mode 100644 test/Verifier/recursive-type-1.ll create mode 100644 test/Verifier/recursive-type-2.ll create mode 100644 test/Verifier/recursive-type-3.ll create mode 100644 test/Verifier/sret.ll create mode 100644 test/tools/llvm-cov/Inputs/copy_block_helper.gcda create mode 100644 test/tools/llvm-cov/Inputs/copy_block_helper.gcno create mode 100644 test/tools/llvm-cov/Inputs/range_based_for.gcda create mode 100644 test/tools/llvm-cov/Inputs/range_based_for.gcno delete mode 100644 test/tools/llvm-cov/Inputs/test.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test.h create mode 100644 test/tools/llvm-cov/Inputs/test_-a.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b_-c_-u.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b_-c_-u.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b_-u.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-a_-b_-u.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_-b.output create mode 100644 test/tools/llvm-cov/Inputs/test_-b_-f.output create mode 100644 test/tools/llvm-cov/Inputs/test_-f.output create mode 100644 test/tools/llvm-cov/Inputs/test_file_checksum_fail.gcda create mode 100644 test/tools/llvm-cov/Inputs/test_func_checksum_fail.gcda create mode 100644 test/tools/llvm-cov/Inputs/test_long_file_names.output create mode 100644 test/tools/llvm-cov/Inputs/test_long_paths.output create mode 100644 test/tools/llvm-cov/Inputs/test_missing.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_missing.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_missing.output create mode 100644 test/tools/llvm-cov/Inputs/test_no_gcda.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_no_gcda.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_no_gcda.output create mode 100644 test/tools/llvm-cov/Inputs/test_no_options.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_no_options.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_no_options.output create mode 100644 test/tools/llvm-cov/Inputs/test_no_output.output create mode 100644 test/tools/llvm-cov/Inputs/test_no_preserve_paths.output create mode 100644 test/tools/llvm-cov/Inputs/test_objdir.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_objdir.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_paths.cpp.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_paths.gcda create mode 100644 test/tools/llvm-cov/Inputs/test_paths.gcno create mode 100644 test/tools/llvm-cov/Inputs/test_paths.h.gcov create mode 100644 test/tools/llvm-cov/Inputs/test_preserve_paths.output create mode 100644 test/tools/llvm-cov/copy_block_helper.m create mode 100644 test/tools/llvm-cov/range_based_for.cpp create mode 100644 test/tools/llvm-objdump/Inputs/export.dll.coff-i386 create mode 100644 test/tools/llvm-objdump/Inputs/file-aux-record.yaml create mode 100755 test/tools/llvm-objdump/Inputs/file.obj.coff-arm create mode 100644 test/tools/llvm-objdump/Inputs/large-bss.obj.coff-i386 create mode 100644 test/tools/llvm-objdump/Inputs/many-relocs.obj-i386 create mode 100644 test/tools/llvm-objdump/Inputs/out-of-section-sym.elf-i386 create mode 100644 test/tools/llvm-objdump/Inputs/out-of-section-sym.s delete mode 100644 test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64 create mode 100644 test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64.exe create mode 100644 test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64.obj create mode 100644 test/tools/llvm-objdump/coff-file.test create mode 100644 test/tools/llvm-objdump/coff-large-bss.test create mode 100644 test/tools/llvm-objdump/coff-many-relocs.test create mode 100644 test/tools/llvm-objdump/coff-non-null-terminated-file.test create mode 100644 test/tools/llvm-objdump/hex-relocation-addr.test create mode 100644 test/tools/llvm-objdump/out-of-section-sym.test create mode 100644 test/tools/llvm-profdata/Inputs/bad-hash.profdata create mode 100644 test/tools/llvm-profdata/Inputs/bar3-1.profdata create mode 100644 test/tools/llvm-profdata/Inputs/c-general.profdata create mode 100644 test/tools/llvm-profdata/Inputs/empty.profdata create mode 100644 test/tools/llvm-profdata/Inputs/extra-word.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo3-1.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo3-2.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo3bar3-1.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo3bar3-2.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo4-1.profdata create mode 100644 test/tools/llvm-profdata/Inputs/foo4-2.profdata create mode 100644 test/tools/llvm-profdata/Inputs/invalid-count-later.profdata create mode 100644 test/tools/llvm-profdata/Inputs/no-counts.profdata create mode 100644 test/tools/llvm-profdata/Inputs/overflow.profdata create mode 100644 test/tools/llvm-profdata/c-general.test create mode 100644 test/tools/llvm-profdata/errors.test create mode 100644 test/tools/llvm-profdata/raw-32-bits-be.test create mode 100644 test/tools/llvm-profdata/raw-32-bits-le.test create mode 100644 test/tools/llvm-profdata/raw-64-bits-be.test create mode 100644 test/tools/llvm-profdata/raw-64-bits-le.test create mode 100644 test/tools/llvm-profdata/raw-magic-but-no-header.test create mode 100644 test/tools/llvm-profdata/raw-two-profiles.test create mode 100644 test/tools/llvm-profdata/simple.test create mode 100644 test/tools/llvm-readobj/ARM/attributes.s create mode 100644 test/tools/llvm-readobj/ARM/lit.local.cfg create mode 100644 test/tools/llvm-readobj/ARM/unwind.s create mode 100644 test/tools/llvm-readobj/Inputs/cxx-cli-aux.cpp create mode 100644 test/tools/llvm-readobj/Inputs/cxx-cli-aux.obj.coff-i386 create mode 100755 test/tools/llvm-readobj/Inputs/dynamic-table-exe.mips create mode 100755 test/tools/llvm-readobj/Inputs/dynamic-table-exe.x86 create mode 100644 test/tools/llvm-readobj/Inputs/dynamic-table-so.mips delete mode 100644 test/tools/llvm-readobj/Inputs/dynamic-table.mips create mode 100644 test/tools/llvm-readobj/Inputs/file-aux-record.yaml create mode 100644 test/tools/llvm-readobj/Inputs/file-multiple-aux-records.yaml create mode 100755 test/tools/llvm-readobj/Inputs/got-empty.exe.mipsel create mode 100755 test/tools/llvm-readobj/Inputs/got-tls.so.elf-mips64el create mode 100644 test/tools/llvm-readobj/Inputs/multifile-linetables.obj.coff-2012-i368 create mode 100644 test/tools/llvm-readobj/Inputs/multifile-linetables.obj.coff-2012-x86_64 create mode 100644 test/tools/llvm-readobj/Inputs/multifunction-linetables.obj.coff-2012-i368 create mode 100644 test/tools/llvm-readobj/Inputs/multifunction-linetables.obj.coff-2012-x86_64 create mode 100644 test/tools/llvm-readobj/Inputs/nop.exe.coff-x86-64 create mode 100755 test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm create mode 100644 test/tools/llvm-readobj/Inputs/trivial.obj.elf-mipsel create mode 100644 test/tools/llvm-readobj/Inputs/zero-string-table.obj.coff-i386 create mode 100644 test/tools/llvm-readobj/codeview-linetables.test create mode 100644 test/tools/llvm-readobj/coff-file-sections-reading.test create mode 100644 test/tools/llvm-readobj/coff-non-null-terminated-file.test create mode 100644 test/tools/llvm-readobj/coff-zero-string-table.test create mode 100644 test/tools/llvm-readobj/cxx-cli-aux.test create mode 100644 test/tools/llvm-readobj/mips-got.test create mode 100644 test/tools/llvm-readobj/peplus.test (limited to 'test') diff --git a/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll b/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll index 563d3326367b..32d9930f4270 100644 --- a/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll +++ b/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu" %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 } %struct.usb_bus = type { %struct.device* } %struct.usb_hcd = type { %struct.usb_bus, i64, [0 x i64] } -@uhci_pci_ids = external constant [1 x %struct.pci_device_id] ; <[1 x %struct.pci_device_id]*> [#uses=1] +@uhci_pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer @__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @uhci_pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0] diff --git a/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll b/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll index 52d0af1b81ce..cd997ea52513 100644 --- a/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll +++ b/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu" %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 } %struct.usb_bus = type { %struct.device* } %struct.usb_hcd = type { %struct.usb_bus, [0 x i64] } -@pci_ids = external constant [1 x %struct.pci_device_id] ; <[1 x %struct.pci_device_id]*> [#uses=1] +@pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer @__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0] diff --git a/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll b/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll new file mode 100644 index 000000000000..bc2512eca0c9 --- /dev/null +++ b/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll @@ -0,0 +1,36 @@ +; RUN: opt < %s -basicaa -gvn -S | FileCheck %s + +; PR15967 +; BasicAA claims no alias when there is (due to a problem when the MaxLookup +; limit was reached). + +target datalayout = "e" + +%struct.foo = type { i32, i32 } + +define i32 @main() { + %t = alloca %struct.foo, align 4 + %1 = getelementptr inbounds %struct.foo* %t, i32 0, i32 0 + store i32 1, i32* %1, align 4 + %2 = getelementptr inbounds %struct.foo* %t, i64 1 + %3 = bitcast %struct.foo* %2 to i8* + %4 = getelementptr inbounds i8* %3, i32 -1 + store i8 0, i8* %4 + %5 = getelementptr inbounds i8* %4, i32 -1 + store i8 0, i8* %5 + %6 = getelementptr inbounds i8* %5, i32 -1 + store i8 0, i8* %6 + %7 = getelementptr inbounds i8* %6, i32 -1 + store i8 0, i8* %7 + %8 = getelementptr inbounds i8* %7, i32 -1 + store i8 0, i8* %8 + %9 = getelementptr inbounds i8* %8, i32 -1 + store i8 0, i8* %9 + %10 = getelementptr inbounds i8* %9, i32 -1 + store i8 0, i8* %10 + %11 = getelementptr inbounds i8* %10, i32 -1 + store i8 0, i8* %11 + %12 = load i32* %1, align 4 + ret i32 %12 +; CHECK: ret i32 %12 +} diff --git a/test/Analysis/BasicAA/cs-cs.ll b/test/Analysis/BasicAA/cs-cs.ll new file mode 100644 index 000000000000..693634c0414d --- /dev/null +++ b/test/Analysis/BasicAA/cs-cs.ll @@ -0,0 +1,236 @@ +; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32" +target triple = "arm-apple-ios" + +declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*, i32) nounwind readonly +declare void @llvm.arm.neon.vst1.v8i16(i8*, <8 x i16>, i32) nounwind + +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind + +declare void @a_readonly_func(i8 *) noinline nounwind readonly + +define <8 x i16> @test1(i8* %p, <8 x i16> %y) { +entry: + %q = getelementptr i8* %p, i64 16 + %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind + call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) + %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind + %c = add <8 x i16> %a, %b + ret <8 x i16> %c + +; CHECK-LABEL: Function: test1: + +; CHECK: NoAlias: i8* %p, i8* %q +; CHECK: Just Ref: Ptr: i8* %p <-> %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: Ptr: i8* %q <-> %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: Ptr: i8* %p <-> call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) +; CHECK: Both ModRef: Ptr: i8* %q <-> call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) +; CHECK: Just Ref: Ptr: i8* %p <-> %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: Ptr: i8* %q <-> %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 <-> call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) +; CHECK: NoModRef: %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 <-> %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) <-> %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) <-> %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 <-> %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 +; CHECK: NoModRef: %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) #1 <-> call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) +} + +define void @test2(i8* %P, i8* %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2: + +; CHECK: MayAlias: i8* %P, i8* %Q +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test2a(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2a: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + %R = getelementptr i8* %P, i64 12 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2b: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: NoAlias: i8* %P, i8* %R +; CHECK: NoAlias: i8* %Q, i8* %R +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + %R = getelementptr i8* %P, i64 11 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2c: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: NoAlias: i8* %P, i8* %R +; CHECK: NoAlias: i8* %Q, i8* %R +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + %R = getelementptr i8* %P, i64 -12 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2d: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: NoAlias: i8* %P, i8* %R +; CHECK: NoAlias: i8* %Q, i8* %R +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test2e(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + %R = getelementptr i8* %P, i64 -11 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test2e: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: NoAlias: i8* %P, i8* %R +; CHECK: NoAlias: i8* %Q, i8* %R +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test3(i8* %P, i8* %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test3: + +; CHECK: MayAlias: i8* %P, i8* %Q +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +} + +define void @test3a(i8* noalias %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test3a: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) +} + +define void @test4(i8* %P, i8* noalias %Q) nounwind ssp { + tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test4: + +; CHECK: NoAlias: i8* %P, i8* %Q +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) +; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) +; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) +} + +define void @test5(i8* %P, i8* %Q, i8* %R) nounwind ssp { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) + ret void + +; CHECK-LABEL: Function: test5: + +; CHECK: MayAlias: i8* %P, i8* %Q +; CHECK: MayAlias: i8* %P, i8* %R +; CHECK: MayAlias: i8* %Q, i8* %R +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) +; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) +} + +define void @test6(i8* %P) nounwind ssp { + call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false) + call void @a_readonly_func(i8* %P) + ret void + +; CHECK-LABEL: Function: test6: + +; CHECK: Just Mod: Ptr: i8* %P <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false) +; CHECK: Just Ref: Ptr: i8* %P <-> call void @a_readonly_func(i8* %P) +; CHECK: Just Mod: call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false) <-> call void @a_readonly_func(i8* %P) +; CHECK: Just Ref: call void @a_readonly_func(i8* %P) <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false) +} + +attributes #0 = { nounwind } diff --git a/test/Analysis/BasicAA/noalias-bugs.ll b/test/Analysis/BasicAA/noalias-bugs.ll index c02a302c1950..2bcc14fd9397 100644 --- a/test/Analysis/BasicAA/noalias-bugs.ll +++ b/test/Analysis/BasicAA/noalias-bugs.ll @@ -1,6 +1,6 @@ ; RUN: opt -S -basicaa -dse < %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" +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; We incorrectly returned noalias in the example below for "ptr.64" and diff --git a/test/Analysis/BasicAA/pr18573.ll b/test/Analysis/BasicAA/pr18573.ll new file mode 100644 index 000000000000..1d2a316b6ffe --- /dev/null +++ b/test/Analysis/BasicAA/pr18573.ll @@ -0,0 +1,53 @@ +; RUN: opt %s -O2 -S | FileCheck %s + +; Check that llvm.x86.avx2.gather.d.ps.256 intrinsic is not eliminated as gather and store memory accesses are based on arr.ptr +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind readonly +declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*, <8 x i32>, <8 x float>, i8) #0 + +; Function Attrs: nounwind +define <8 x float> @foo1(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 { +allocas: + %vix = load <8 x i32>* %vix.ptr, align 4 + %t1.ptr = getelementptr i8* %arr.ptr, i8 4 + + %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 + store i8 1, i8* %t1.ptr, align 4 + + %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 + %res = fadd <8 x float> %v1, %v2 + + ret <8 x float> %res +} +; CHECK: foo1 +; CHECK: llvm.x86.avx2.gather.d.ps.256 +; CHECK: store +; CHECK: llvm.x86.avx2.gather.d.ps.256 + +; Check that second gather is eliminated as gather and store memory accesses are based on different no-aliasing pointers + +; Function Attrs: nounwind +define <8 x float> @foo2(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 { +allocas: + %vix = load <8 x i32>* %vix.ptr, align 4 + %t1.ptr = getelementptr i8* %arr.ptr, i8 4 + + %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 + store i8 1, i8* %t2.ptr, align 4 + + %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 + %res = fadd <8 x float> %v1, %v2 + + ret <8 x float> %res +} +; CHECK: foo2 +; CHECK: llvm.x86.avx2.gather.d.ps.256 +; CHECK: store +; CHECK-NOT: llvm.x86.avx2.gather.d.ps.256 + +attributes #0 = { nounwind readonly } +attributes #1 = { nounwind "target-cpu"="corei7-avx" "target-features"="+avx2,+popcnt,+cmov,+f16c,+rdrnd,+fma" } +attributes #2 = { nounwind } + diff --git a/test/Analysis/BlockFrequencyInfo/bad_input.ll b/test/Analysis/BlockFrequencyInfo/bad_input.ll new file mode 100644 index 000000000000..bcdc1e6f0bc0 --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/bad_input.ll @@ -0,0 +1,50 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +declare void @g(i32 %x) + +; CHECK-LABEL: Printing analysis {{.*}} for function 'branch_weight_0': +; CHECK-NEXT: block-frequency-info: branch_weight_0 +define void @branch_weight_0(i32 %a) { +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + br label %for.body + +; Check that we get 1,4 instead of 0,3. +; CHECK-NEXT: for.body: float = 4.0, +for.body: + %i = phi i32 [ 0, %entry ], [ %inc, %for.body ] + call void @g(i32 %i) + %inc = add i32 %i, 1 + %cmp = icmp ugt i32 %inc, %a + br i1 %cmp, label %for.end, label %for.body, !prof !0 + +; CHECK-NEXT: for.end: float = 1.0, int = [[ENTRY]] +for.end: + ret void +} + +!0 = metadata !{metadata !"branch_weights", i32 0, i32 3} + +; CHECK-LABEL: Printing analysis {{.*}} for function 'infinite_loop' +; CHECK-NEXT: block-frequency-info: infinite_loop +define void @infinite_loop(i1 %x) { +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + br i1 %x, label %for.body, label %for.end, !prof !1 + +; Check that the loop scale maxes out at 4096, giving 2048 here. +; CHECK-NEXT: for.body: float = 2048.0, +for.body: + %i = phi i32 [ 0, %entry ], [ %inc, %for.body ] + call void @g(i32 %i) + %inc = add i32 %i, 1 + br label %for.body + +; Check that the exit weight is half of entry, since half is lost in the +; infinite loop above. +; CHECK-NEXT: for.end: float = 0.5, +for.end: + ret void +} + +!1 = metadata !{metadata !"branch_weights", i32 1, i32 1} diff --git a/test/Analysis/BlockFrequencyInfo/basic.ll b/test/Analysis/BlockFrequencyInfo/basic.ll index ce29fb5ce1ba..006e6ab4d74e 100644 --- a/test/Analysis/BlockFrequencyInfo/basic.ll +++ b/test/Analysis/BlockFrequencyInfo/basic.ll @@ -1,13 +1,14 @@ ; RUN: opt < %s -analyze -block-freq | FileCheck %s define i32 @test1(i32 %i, i32* %a) { -; CHECK: Printing analysis {{.*}} for function 'test1' -; CHECK: entry = 1.0 +; CHECK-LABEL: Printing analysis {{.*}} for function 'test1': +; CHECK-NEXT: block-frequency-info: test1 +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] entry: br label %body ; Loop backedges are weighted and thus their bodies have a greater frequency. -; CHECK: body = 32.0 +; CHECK-NEXT: body: float = 32.0, body: %iv = phi i32 [ 0, %entry ], [ %next, %body ] %base = phi i32 [ 0, %entry ], [ %sum, %body ] @@ -18,29 +19,29 @@ body: %exitcond = icmp eq i32 %next, %i br i1 %exitcond, label %exit, label %body -; CHECK: exit = 1.0 +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] exit: ret i32 %sum } define i32 @test2(i32 %i, i32 %a, i32 %b) { -; CHECK: Printing analysis {{.*}} for function 'test2' -; CHECK: entry = 1.0 +; CHECK-LABEL: Printing analysis {{.*}} for function 'test2': +; CHECK-NEXT: block-frequency-info: test2 +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] entry: %cond = icmp ult i32 %i, 42 br i1 %cond, label %then, label %else, !prof !0 ; The 'then' branch is predicted more likely via branch weight metadata. -; CHECK: then = 0.94116 +; CHECK-NEXT: then: float = 0.9411{{[0-9]*}}, then: br label %exit -; CHECK: else = 0.05877 +; CHECK-NEXT: else: float = 0.05882{{[0-9]*}}, else: br label %exit -; FIXME: It may be a bug that we don't sum back to 1.0. -; CHECK: exit = 0.99993 +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] exit: %result = phi i32 [ %a, %then ], [ %b, %else ] ret i32 %result @@ -49,37 +50,37 @@ exit: !0 = metadata !{metadata !"branch_weights", i32 64, i32 4} define i32 @test3(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { -; CHECK: Printing analysis {{.*}} for function 'test3' -; CHECK: entry = 1.0 +; CHECK-LABEL: Printing analysis {{.*}} for function 'test3': +; CHECK-NEXT: block-frequency-info: test3 +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] entry: switch i32 %i, label %case_a [ i32 1, label %case_b i32 2, label %case_c i32 3, label %case_d i32 4, label %case_e ], !prof !1 -; CHECK: case_a = 0.04998 +; CHECK-NEXT: case_a: float = 0.05, case_a: br label %exit -; CHECK: case_b = 0.04998 +; CHECK-NEXT: case_b: float = 0.05, case_b: br label %exit ; The 'case_c' branch is predicted more likely via branch weight metadata. -; CHECK: case_c = 0.79998 +; CHECK-NEXT: case_c: float = 0.8, case_c: br label %exit -; CHECK: case_d = 0.04998 +; CHECK-NEXT: case_d: float = 0.05, case_d: br label %exit -; CHECK: case_e = 0.04998 +; CHECK-NEXT: case_e: float = 0.05, case_e: br label %exit -; FIXME: It may be a bug that we don't sum back to 1.0. -; CHECK: exit = 0.99993 +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] exit: %result = phi i32 [ %a, %case_a ], [ %b, %case_b ], @@ -91,44 +92,50 @@ exit: !1 = metadata !{metadata !"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} -; CHECK: Printing analysis {{.*}} for function 'nested_loops' -; CHECK: entry = 1.0 -; This test doesn't seem to be assigning sensible frequencies to nested loops. define void @nested_loops(i32 %a) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'nested_loops': +; CHECK-NEXT: block-frequency-info: nested_loops +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] entry: br label %for.cond1.preheader +; CHECK-NEXT: for.cond1.preheader: float = 4001.0, for.cond1.preheader: %x.024 = phi i32 [ 0, %entry ], [ %inc12, %for.inc11 ] br label %for.cond4.preheader +; CHECK-NEXT: for.cond4.preheader: float = 16008001.0, for.cond4.preheader: %y.023 = phi i32 [ 0, %for.cond1.preheader ], [ %inc9, %for.inc8 ] %add = add i32 %y.023, %x.024 br label %for.body6 +; CHECK-NEXT: for.body6: float = 64048012001.0, for.body6: %z.022 = phi i32 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ] %add7 = add i32 %add, %z.022 - tail call void @g(i32 %add7) #2 + tail call void @g(i32 %add7) %inc = add i32 %z.022, 1 %cmp5 = icmp ugt i32 %inc, %a br i1 %cmp5, label %for.inc8, label %for.body6, !prof !2 +; CHECK-NEXT: for.inc8: float = 16008001.0, for.inc8: %inc9 = add i32 %y.023, 1 %cmp2 = icmp ugt i32 %inc9, %a br i1 %cmp2, label %for.inc11, label %for.cond4.preheader, !prof !2 +; CHECK-NEXT: for.inc11: float = 4001.0, for.inc11: %inc12 = add i32 %x.024, 1 %cmp = icmp ugt i32 %inc12, %a br i1 %cmp, label %for.end13, label %for.cond1.preheader, !prof !2 +; CHECK-NEXT: for.end13: float = 1.0, int = [[ENTRY]] for.end13: ret void } -declare void @g(i32) #1 +declare void @g(i32) !2 = metadata !{metadata !"branch_weights", i32 1, i32 4000} diff --git a/test/Analysis/BlockFrequencyInfo/double_backedge.ll b/test/Analysis/BlockFrequencyInfo/double_backedge.ll new file mode 100644 index 000000000000..df8217cfa1b1 --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/double_backedge.ll @@ -0,0 +1,27 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +define void @double_backedge(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'double_backedge': +; CHECK-NEXT: block-frequency-info: double_backedge +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br label %loop + +loop: +; CHECK-NEXT: loop: float = 10.0, + br i1 %x, label %exit, label %loop.1, !prof !0 + +loop.1: +; CHECK-NEXT: loop.1: float = 9.0, + br i1 %x, label %loop, label %loop.2, !prof !1 + +loop.2: +; CHECK-NEXT: loop.2: float = 5.0, + br label %loop + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!0 = metadata !{metadata !"branch_weights", i32 1, i32 9} +!1 = metadata !{metadata !"branch_weights", i32 4, i32 5} diff --git a/test/Analysis/BlockFrequencyInfo/double_exit.ll b/test/Analysis/BlockFrequencyInfo/double_exit.ll new file mode 100644 index 000000000000..75f664d07ac4 --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/double_exit.ll @@ -0,0 +1,165 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +; CHECK-LABEL: Printing analysis {{.*}} for function 'double_exit': +; CHECK-NEXT: block-frequency-info: double_exit +define i32 @double_exit(i32 %N) { +; Mass = 1 +; Frequency = 1 +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + br label %outer + +; Mass = 1 +; Backedge mass = 1/3, exit mass = 2/3 +; Loop scale = 3/2 +; Pseudo-edges = exit +; Pseudo-mass = 1 +; Frequency = 1*3/2*1 = 3/2 +; CHECK-NEXT: outer: float = 1.5, +outer: + %I.0 = phi i32 [ 0, %entry ], [ %inc6, %outer.inc ] + %Return.0 = phi i32 [ 0, %entry ], [ %Return.1, %outer.inc ] + %cmp = icmp slt i32 %I.0, %N + br i1 %cmp, label %inner, label %exit, !prof !2 ; 2:1 + +; Mass = 1 +; Backedge mass = 3/5, exit mass = 2/5 +; Loop scale = 5/2 +; Pseudo-edges = outer.inc @ 1/5, exit @ 1/5 +; Pseudo-mass = 2/3 +; Frequency = 3/2*1*5/2*2/3 = 5/2 +; CHECK-NEXT: inner: float = 2.5, +inner: + %Return.1 = phi i32 [ %Return.0, %outer ], [ %call4, %inner.inc ] + %J.0 = phi i32 [ %I.0, %outer ], [ %inc, %inner.inc ] + %cmp2 = icmp slt i32 %J.0, %N + br i1 %cmp2, label %inner.body, label %outer.inc, !prof !1 ; 4:1 + +; Mass = 4/5 +; Frequency = 5/2*4/5 = 2 +; CHECK-NEXT: inner.body: float = 2.0, +inner.body: + %call = call i32 @c2(i32 %I.0, i32 %J.0) + %tobool = icmp ne i32 %call, 0 + br i1 %tobool, label %exit, label %inner.inc, !prof !0 ; 3:1 + +; Mass = 3/5 +; Frequency = 5/2*3/5 = 3/2 +; CHECK-NEXT: inner.inc: float = 1.5, +inner.inc: + %call4 = call i32 @logic2(i32 %Return.1, i32 %I.0, i32 %J.0) + %inc = add nsw i32 %J.0, 1 + br label %inner + +; Mass = 1/3 +; Frequency = 3/2*1/3 = 1/2 +; CHECK-NEXT: outer.inc: float = 0.5, +outer.inc: + %inc6 = add nsw i32 %I.0, 1 + br label %outer + +; Mass = 1 +; Frequency = 1 +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] +exit: + %Return.2 = phi i32 [ %Return.1, %inner.body ], [ %Return.0, %outer ] + ret i32 %Return.2 +} + +!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} +!1 = metadata !{metadata !"branch_weights", i32 4, i32 1} +!2 = metadata !{metadata !"branch_weights", i32 2, i32 1} + +declare i32 @c2(i32, i32) +declare i32 @logic2(i32, i32, i32) + +; CHECK-LABEL: Printing analysis {{.*}} for function 'double_exit_in_loop': +; CHECK-NEXT: block-frequency-info: double_exit_in_loop +define i32 @double_exit_in_loop(i32 %N) { +; Mass = 1 +; Frequency = 1 +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + br label %outer + +; Mass = 1 +; Backedge mass = 1/2, exit mass = 1/2 +; Loop scale = 2 +; Pseudo-edges = exit +; Pseudo-mass = 1 +; Frequency = 1*2*1 = 2 +; CHECK-NEXT: outer: float = 2.0, +outer: + %I.0 = phi i32 [ 0, %entry ], [ %inc12, %outer.inc ] + %Return.0 = phi i32 [ 0, %entry ], [ %Return.3, %outer.inc ] + %cmp = icmp slt i32 %I.0, %N + br i1 %cmp, label %middle, label %exit, !prof !3 ; 1:1 + +; Mass = 1 +; Backedge mass = 1/3, exit mass = 2/3 +; Loop scale = 3/2 +; Pseudo-edges = outer.inc +; Pseudo-mass = 1/2 +; Frequency = 2*1*3/2*1/2 = 3/2 +; CHECK-NEXT: middle: float = 1.5, +middle: + %J.0 = phi i32 [ %I.0, %outer ], [ %inc9, %middle.inc ] + %Return.1 = phi i32 [ %Return.0, %outer ], [ %Return.2, %middle.inc ] + %cmp2 = icmp slt i32 %J.0, %N + br i1 %cmp2, label %inner, label %outer.inc, !prof !2 ; 2:1 + +; Mass = 1 +; Backedge mass = 3/5, exit mass = 2/5 +; Loop scale = 5/2 +; Pseudo-edges = middle.inc @ 1/5, outer.inc @ 1/5 +; Pseudo-mass = 2/3 +; Frequency = 3/2*1*5/2*2/3 = 5/2 +; CHECK-NEXT: inner: float = 2.5, +inner: + %Return.2 = phi i32 [ %Return.1, %middle ], [ %call7, %inner.inc ] + %K.0 = phi i32 [ %J.0, %middle ], [ %inc, %inner.inc ] + %cmp5 = icmp slt i32 %K.0, %N + br i1 %cmp5, label %inner.body, label %middle.inc, !prof !1 ; 4:1 + +; Mass = 4/5 +; Frequency = 5/2*4/5 = 2 +; CHECK-NEXT: inner.body: float = 2.0, +inner.body: + %call = call i32 @c3(i32 %I.0, i32 %J.0, i32 %K.0) + %tobool = icmp ne i32 %call, 0 + br i1 %tobool, label %outer.inc, label %inner.inc, !prof !0 ; 3:1 + +; Mass = 3/5 +; Frequency = 5/2*3/5 = 3/2 +; CHECK-NEXT: inner.inc: float = 1.5, +inner.inc: + %call7 = call i32 @logic3(i32 %Return.2, i32 %I.0, i32 %J.0, i32 %K.0) + %inc = add nsw i32 %K.0, 1 + br label %inner + +; Mass = 1/3 +; Frequency = 3/2*1/3 = 1/2 +; CHECK-NEXT: middle.inc: float = 0.5, +middle.inc: + %inc9 = add nsw i32 %J.0, 1 + br label %middle + +; Mass = 1/2 +; Frequency = 2*1/2 = 1 +; CHECK-NEXT: outer.inc: float = 1.0, +outer.inc: + %Return.3 = phi i32 [ %Return.2, %inner.body ], [ %Return.1, %middle ] + %inc12 = add nsw i32 %I.0, 1 + br label %outer + +; Mass = 1 +; Frequency = 1 +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] +exit: + ret i32 %Return.0 +} + +!3 = metadata !{metadata !"branch_weights", i32 1, i32 1} + +declare i32 @c3(i32, i32, i32) +declare i32 @logic3(i32, i32, i32, i32) diff --git a/test/Analysis/BlockFrequencyInfo/irreducible.ll b/test/Analysis/BlockFrequencyInfo/irreducible.ll new file mode 100644 index 000000000000..af4ad15d9c1d --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/irreducible.ll @@ -0,0 +1,421 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +; A loop with multiple exits isn't irreducible. It should be handled +; correctly. +; +; CHECK-LABEL: Printing analysis {{.*}} for function 'multiexit': +; CHECK-NEXT: block-frequency-info: multiexit +define void @multiexit(i1 %x) { +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + br label %loop.1 + +; CHECK-NEXT: loop.1: float = 2.0, +loop.1: + br i1 %x, label %exit.1, label %loop.2, !prof !0 + +; CHECK-NEXT: loop.2: float = 1.75, +loop.2: + br i1 %x, label %exit.2, label %loop.1, !prof !1 + +; CHECK-NEXT: exit.1: float = 0.25, +exit.1: + br label %return + +; CHECK-NEXT: exit.2: float = 0.75, +exit.2: + br label %return + +; CHECK-NEXT: return: float = 1.0, int = [[ENTRY]] +return: + ret void +} + +!0 = metadata !{metadata !"branch_weights", i32 1, i32 7} +!1 = metadata !{metadata !"branch_weights", i32 3, i32 4} + +; Irreducible control flow +; ======================== +; +; LoopInfo defines a loop as a non-trivial SCC dominated by a single block, +; called the header. A given loop, L, can have sub-loops, which are loops +; within the subgraph of L that excludes the header. +; +; In addition to loops, -block-freq has limited support for irreducible SCCs, +; which are SCCs with multiple entry blocks. Irreducible SCCs are discovered +; on they fly, and modelled as loops with multiple headers. +; +; The headers of irreducible sub-SCCs consist of its entry blocks and all nodes +; that are targets of a backedge within it (excluding backedges within true +; sub-loops). +; +; -block-freq is currently designed to act like a block is inserted that +; intercepts all the edges to the headers. All backedges and entries point to +; this block. Its successors are the headers, which split the frequency +; evenly. +; +; There are a number of testcases below. Only the first two have detailed +; explanations. +; +; Testcase #1 +; =========== +; +; In this case c1 and c2 should have frequencies of 15/7 and 13/7, +; respectively. To calculate this, consider assigning 1.0 to entry, and +; distributing frequency iteratively (to infinity). At the first iteration, +; entry gives 3/4 to c1 and 1/4 to c2. At every step after, c1 and c2 give 3/4 +; of what they have to each other. Somehow, all of it comes out to exit. +; +; c1 = 3/4 + 1/4*3/4 + 3/4*3^2/4^2 + 1/4*3^3/4^3 + 3/4*3^3/4^3 + ... +; c2 = 1/4 + 3/4*3/4 + 1/4*3^2/4^2 + 3/4*3^3/4^3 + 1/4*3^3/4^3 + ... +; +; Simplify by splitting up the odd and even terms of the series and taking out +; factors so that the infite series matches: +; +; c1 = 3/4 *(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; + 3/16*(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; c2 = 1/4 *(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; + 9/16*(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; +; c1 = 15/16*(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; c2 = 13/16*(9^0/16^0 + 9^1/16^1 + 9^2/16^2 + ...) +; +; Since this geometric series sums to 16/7: +; +; c1 = 15/7 +; c2 = 13/7 +; +; If we treat c1 and c2 as members of the same loop, the exit frequency of the +; loop as a whole is 1/4, so the loop scale should be 4. Summing c1 and c2 +; gives 28/7, or 4.0, which is nice confirmation of the math above. +; +; -block-freq currently treats the two nodes as equals. +define void @multientry(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'multientry': +; CHECK-NEXT: block-frequency-info: multientry +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br i1 %x, label %c1, label %c2, !prof !2 + +c1: +; CHECK-NEXT: c1: float = 2.0, +; The "correct" answer is: float = 2.142857{{[0-9]*}}, + br i1 %x, label %c2, label %exit, !prof !2 + +c2: +; CHECK-NEXT: c2: float = 2.0, +; The "correct" answer is: float = 1.857142{{[0-9]*}}, + br i1 %x, label %c1, label %exit, !prof !2 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} + +!2 = metadata !{metadata !"branch_weights", i32 3, i32 1} + +; Testcase #2 +; =========== +; +; In this case c1 and c2 should be treated as equals in a single loop. The +; exit frequency is 1/3, so the scaling factor for the loop should be 3.0. The +; loop is entered 2/3 of the time, and c1 and c2 split the total loop frequency +; evenly (1/2), so they should each have frequencies of 1.0 (3.0*2/3*1/2). +; Another way of computing this result is by assigning 1.0 to entry and showing +; that c1 and c2 should accumulate frequencies of: +; +; 1/3 + 2/9 + 4/27 + 8/81 + ... +; 2^0/3^1 + 2^1/3^2 + 2^2/3^3 + 2^3/3^4 + ... +; +; At the first step, c1 and c2 each get 1/3 of the entry. At each subsequent +; step, c1 and c2 each get 1/3 of what's left in c1 and c2 combined. This +; infinite series sums to 1. +; +; Since the currently algorithm *always* assumes entry blocks are equal, +; -block-freq gets the right answers here. +define void @crossloops(i2 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'crossloops': +; CHECK-NEXT: block-frequency-info: crossloops +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + switch i2 %x, label %exit [ i2 1, label %c1 + i2 2, label %c2 ], !prof !3 + +c1: +; CHECK-NEXT: c1: float = 1.0, + switch i2 %x, label %exit [ i2 1, label %c1 + i2 2, label %c2 ], !prof !3 + +c2: +; CHECK-NEXT: c2: float = 1.0, + switch i2 %x, label %exit [ i2 1, label %c1 + i2 2, label %c2 ], !prof !3 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} + +!3 = metadata !{metadata !"branch_weights", i32 2, i32 2, i32 2} + +; A true loop with irreducible control flow inside. +define void @loop_around_irreducible(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_around_irreducible': +; CHECK-NEXT: block-frequency-info: loop_around_irreducible +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br label %loop + +loop: +; CHECK-NEXT: loop: float = 4.0, int = [[HEAD:[0-9]+]] + br i1 %x, label %left, label %right, !prof !4 + +left: +; CHECK-NEXT: left: float = 8.0, + br i1 %x, label %right, label %loop.end, !prof !5 + +right: +; CHECK-NEXT: right: float = 8.0, + br i1 %x, label %left, label %loop.end, !prof !5 + +loop.end: +; CHECK-NEXT: loop.end: float = 4.0, int = [[HEAD]] + br i1 %x, label %loop, label %exit, !prof !5 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!4 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!5 = metadata !{metadata !"branch_weights", i32 3, i32 1} + +; Two unrelated irreducible SCCs. +define void @two_sccs(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'two_sccs': +; CHECK-NEXT: block-frequency-info: two_sccs +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br i1 %x, label %a, label %b, !prof !6 + +a: +; CHECK-NEXT: a: float = 0.75, + br i1 %x, label %a.left, label %a.right, !prof !7 + +a.left: +; CHECK-NEXT: a.left: float = 1.5, + br i1 %x, label %a.right, label %exit, !prof !6 + +a.right: +; CHECK-NEXT: a.right: float = 1.5, + br i1 %x, label %a.left, label %exit, !prof !6 + +b: +; CHECK-NEXT: b: float = 0.25, + br i1 %x, label %b.left, label %b.right, !prof !7 + +b.left: +; CHECK-NEXT: b.left: float = 0.625, + br i1 %x, label %b.right, label %exit, !prof !8 + +b.right: +; CHECK-NEXT: b.right: float = 0.625, + br i1 %x, label %b.left, label %exit, !prof !8 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!6 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!7 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!8 = metadata !{metadata !"branch_weights", i32 4, i32 1} + +; A true loop inside irreducible control flow. +define void @loop_inside_irreducible(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_inside_irreducible': +; CHECK-NEXT: block-frequency-info: loop_inside_irreducible +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br i1 %x, label %left, label %right, !prof !9 + +left: +; CHECK-NEXT: left: float = 2.0, + br i1 %x, label %right, label %exit, !prof !10 + +right: +; CHECK-NEXT: right: float = 2.0, int = [[RIGHT:[0-9]+]] + br label %loop + +loop: +; CHECK-NEXT: loop: float = 6.0, + br i1 %x, label %loop, label %right.end, !prof !11 + +right.end: +; CHECK-NEXT: right.end: float = 2.0, int = [[RIGHT]] + br i1 %x, label %left, label %exit, !prof !10 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!9 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!10 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!11 = metadata !{metadata !"branch_weights", i32 2, i32 1} + +; Irreducible control flow in a branch that's in a true loop. +define void @loop_around_branch_with_irreducible(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_around_branch_with_irreducible': +; CHECK-NEXT: block-frequency-info: loop_around_branch_with_irreducible +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br label %loop + +loop: +; CHECK-NEXT: loop: float = 2.0, int = [[LOOP:[0-9]+]] + br i1 %x, label %normal, label %irreducible.entry, !prof !12 + +normal: +; CHECK-NEXT: normal: float = 1.5, + br label %loop.end + +irreducible.entry: +; CHECK-NEXT: irreducible.entry: float = 0.5, int = [[IRREDUCIBLE:[0-9]+]] + br i1 %x, label %left, label %right, !prof !13 + +left: +; CHECK-NEXT: left: float = 1.0, + br i1 %x, label %right, label %irreducible.exit, !prof !12 + +right: +; CHECK-NEXT: right: float = 1.0, + br i1 %x, label %left, label %irreducible.exit, !prof !12 + +irreducible.exit: +; CHECK-NEXT: irreducible.exit: float = 0.5, int = [[IRREDUCIBLE]] + br label %loop.end + +loop.end: +; CHECK-NEXT: loop.end: float = 2.0, int = [[LOOP]] + br i1 %x, label %loop, label %exit, !prof !13 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!12 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!13 = metadata !{metadata !"branch_weights", i32 1, i32 1} + +; Irreducible control flow between two true loops. +define void @loop_around_branch_with_irreducible_around_loop(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_around_branch_with_irreducible_around_loop': +; CHECK-NEXT: block-frequency-info: loop_around_branch_with_irreducible_around_loop +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br label %loop + +loop: +; CHECK-NEXT: loop: float = 3.0, int = [[LOOP:[0-9]+]] + br i1 %x, label %normal, label %irreducible, !prof !14 + +normal: +; CHECK-NEXT: normal: float = 2.0, + br label %loop.end + +irreducible: +; CHECK-NEXT: irreducible: float = 1.0, + br i1 %x, label %left, label %right, !prof !15 + +left: +; CHECK-NEXT: left: float = 2.0, + br i1 %x, label %right, label %loop.end, !prof !16 + +right: +; CHECK-NEXT: right: float = 2.0, int = [[RIGHT:[0-9]+]] + br label %right.loop + +right.loop: +; CHECK-NEXT: right.loop: float = 10.0, + br i1 %x, label %right.loop, label %right.end, !prof !17 + +right.end: +; CHECK-NEXT: right.end: float = 2.0, int = [[RIGHT]] + br i1 %x, label %left, label %loop.end, !prof !16 + +loop.end: +; CHECK-NEXT: loop.end: float = 3.0, int = [[LOOP]] + br i1 %x, label %loop, label %exit, !prof !14 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!14 = metadata !{metadata !"branch_weights", i32 2, i32 1} +!15 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!16 = metadata !{metadata !"branch_weights", i32 3, i32 1} +!17 = metadata !{metadata !"branch_weights", i32 4, i32 1} + +; An irreducible SCC with a non-header. +define void @nonheader(i1 %x) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'nonheader': +; CHECK-NEXT: block-frequency-info: nonheader +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br i1 %x, label %left, label %right, !prof !18 + +left: +; CHECK-NEXT: left: float = 1.0, + br i1 %x, label %bottom, label %exit, !prof !19 + +right: +; CHECK-NEXT: right: float = 1.0, + br i1 %x, label %bottom, label %exit, !prof !20 + +bottom: +; CHECK-NEXT: bottom: float = 1.0, + br i1 %x, label %left, label %right, !prof !18 + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!18 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!19 = metadata !{metadata !"branch_weights", i32 1, i32 3} +!20 = metadata !{metadata !"branch_weights", i32 3, i32 1} + +; An irreducible SCC with an irreducible sub-SCC. In the current version of +; -block-freq, this means an extra header. +; +; This testcases uses non-trivial branch weights. The CHECK statements here +; will start to fail if we change -block-freq to be more accurate. Currently, +; we expect left, right and top to be treated as equal headers. +define void @nonentry_header(i1 %x, i2 %y) { +; CHECK-LABEL: Printing analysis {{.*}} for function 'nonentry_header': +; CHECK-NEXT: block-frequency-info: nonentry_header +entry: +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] + br i1 %x, label %left, label %right, !prof !21 + +left: +; CHECK-NEXT: left: float = 3.0, + br i1 %x, label %top, label %bottom, !prof !22 + +right: +; CHECK-NEXT: right: float = 3.0, + br i1 %x, label %top, label %bottom, !prof !22 + +top: +; CHECK-NEXT: top: float = 3.0, + switch i2 %y, label %exit [ i2 0, label %left + i2 1, label %right + i2 2, label %bottom ], !prof !23 + +bottom: +; CHECK-NEXT: bottom: float = 4.5, + br label %top + +exit: +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] + ret void +} +!21 = metadata !{metadata !"branch_weights", i32 2, i32 1} +!22 = metadata !{metadata !"branch_weights", i32 1, i32 1} +!23 = metadata !{metadata !"branch_weights", i32 8, i32 1, i32 3, i32 12} diff --git a/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll b/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll new file mode 100644 index 000000000000..9d27b6bf0f20 --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/loop_with_branch.ll @@ -0,0 +1,44 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +; CHECK-LABEL: Printing analysis {{.*}} for function 'loop_with_branch': +; CHECK-NEXT: block-frequency-info: loop_with_branch +define void @loop_with_branch(i32 %a) { +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + %skip_loop = call i1 @foo0(i32 %a) + br i1 %skip_loop, label %skip, label %header, !prof !0 + +; CHECK-NEXT: skip: float = 0.25, +skip: + br label %exit + +; CHECK-NEXT: header: float = 4.5, +header: + %i = phi i32 [ 0, %entry ], [ %i.next, %back ] + %i.next = add i32 %i, 1 + %choose = call i2 @foo1(i32 %i) + switch i2 %choose, label %exit [ i2 0, label %left + i2 1, label %right ], !prof !1 + +; CHECK-NEXT: left: float = 1.5, +left: + br label %back + +; CHECK-NEXT: right: float = 2.25, +right: + br label %back + +; CHECK-NEXT: back: float = 3.75, +back: + br label %header + +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] +exit: + ret void +} + +declare i1 @foo0(i32) +declare i2 @foo1(i32) + +!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} +!1 = metadata !{metadata !"branch_weights", i32 1, i32 2, i32 3} diff --git a/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll b/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll new file mode 100644 index 000000000000..d93ffceb5fab --- /dev/null +++ b/test/Analysis/BlockFrequencyInfo/nested_loop_with_branches.ll @@ -0,0 +1,59 @@ +; RUN: opt < %s -analyze -block-freq | FileCheck %s + +; CHECK-LABEL: Printing analysis {{.*}} for function 'nested_loop_with_branches' +; CHECK-NEXT: block-frequency-info: nested_loop_with_branches +define void @nested_loop_with_branches(i32 %a) { +; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]] +entry: + %v0 = call i1 @foo0(i32 %a) + br i1 %v0, label %exit, label %outer, !prof !0 + +; CHECK-NEXT: outer: float = 12.0, +outer: + %i = phi i32 [ 0, %entry ], [ %i.next, %inner.end ], [ %i.next, %no_inner ] + %i.next = add i32 %i, 1 + %do_inner = call i1 @foo1(i32 %i) + br i1 %do_inner, label %no_inner, label %inner, !prof !0 + +; CHECK-NEXT: inner: float = 36.0, +inner: + %j = phi i32 [ 0, %outer ], [ %j.next, %inner.end ] + %side = call i1 @foo3(i32 %j) + br i1 %side, label %left, label %right, !prof !0 + +; CHECK-NEXT: left: float = 9.0, +left: + %v4 = call i1 @foo4(i32 %j) + br label %inner.end + +; CHECK-NEXT: right: float = 27.0, +right: + %v5 = call i1 @foo5(i32 %j) + br label %inner.end + +; CHECK-NEXT: inner.end: float = 36.0, +inner.end: + %stay_inner = phi i1 [ %v4, %left ], [ %v5, %right ] + %j.next = add i32 %j, 1 + br i1 %stay_inner, label %inner, label %outer, !prof !1 + +; CHECK-NEXT: no_inner: float = 3.0, +no_inner: + %continue = call i1 @foo6(i32 %i) + br i1 %continue, label %outer, label %exit, !prof !1 + +; CHECK-NEXT: exit: float = 1.0, int = [[ENTRY]] +exit: + ret void +} + +declare i1 @foo0(i32) +declare i1 @foo1(i32) +declare i1 @foo2(i32) +declare i1 @foo3(i32) +declare i1 @foo4(i32) +declare i1 @foo5(i32) +declare i1 @foo6(i32) + +!0 = metadata !{metadata !"branch_weights", i32 1, i32 3} +!1 = metadata !{metadata !"branch_weights", i32 3, i32 1} diff --git a/test/Analysis/BranchProbabilityInfo/loop.ll b/test/Analysis/BranchProbabilityInfo/loop.ll index b648cbb16a60..40f1111c6b03 100644 --- a/test/Analysis/BranchProbabilityInfo/loop.ll +++ b/test/Analysis/BranchProbabilityInfo/loop.ll @@ -15,7 +15,7 @@ do.body: %i.0 = phi i32 [ 0, %entry ], [ %inc3, %do.end ] call void @g1() br label %do.body1 -; CHECK: edge do.body -> do.body1 probability is 124 / 124 = 100% +; CHECK: edge do.body -> do.body1 probability is 16 / 16 = 100% do.body1: %j.0 = phi i32 [ 0, %do.body ], [ %inc, %do.body1 ] @@ -55,8 +55,8 @@ for.body: %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc5, %for.end ] call void @g1() br i1 %cmp27, label %for.body3, label %for.end -; CHECK: edge for.body -> for.body3 probability is 62 / 124 = 50% -; CHECK: edge for.body -> for.end probability is 62 / 124 = 50% +; CHECK: edge for.body -> for.body3 probability is 20 / 32 = 62.5% +; CHECK: edge for.body -> for.end probability is 12 / 32 = 37.5% for.body3: %j.08 = phi i32 [ %inc, %for.body3 ], [ 0, %for.body ] @@ -91,8 +91,8 @@ do.body: %0 = load i32* %c, align 4 %cmp = icmp slt i32 %0, 42 br i1 %cmp, label %do.body1, label %if.end -; CHECK: edge do.body -> do.body1 probability is 62 / 124 = 50% -; CHECK: edge do.body -> if.end probability is 62 / 124 = 50% +; CHECK: edge do.body -> do.body1 probability is 16 / 32 = 50% +; CHECK: edge do.body -> if.end probability is 16 / 32 = 50% do.body1: %j.0 = phi i32 [ %inc, %do.body1 ], [ 0, %do.body ] @@ -165,7 +165,7 @@ do.body: %i.0 = phi i32 [ 0, %entry ], [ %inc4, %do.end ] call void @g1() br label %do.body1 -; CHECK: edge do.body -> do.body1 probability is 124 / 124 = 100% +; CHECK: edge do.body -> do.body1 probability is 16 / 16 = 100% do.body1: %j.0 = phi i32 [ 0, %do.body ], [ %inc, %if.end ] @@ -209,7 +209,7 @@ do.body: %i.0 = phi i32 [ 0, %entry ], [ %inc4, %do.end ] call void @g1() br label %do.body1 -; CHECK: edge do.body -> do.body1 probability is 124 / 124 = 100% +; CHECK: edge do.body -> do.body1 probability is 16 / 16 = 100% do.body1: %j.0 = phi i32 [ 0, %do.body ], [ %inc, %do.cond ] @@ -261,14 +261,14 @@ for.body: %0 = load i32* %c, align 4 %cmp1 = icmp eq i32 %0, %i.011 br i1 %cmp1, label %for.inc5, label %if.end -; CHECK: edge for.body -> for.inc5 probability is 62 / 124 = 50% -; CHECK: edge for.body -> if.end probability is 62 / 124 = 50% +; CHECK: edge for.body -> for.inc5 probability is 16 / 32 = 50% +; CHECK: edge for.body -> if.end probability is 16 / 32 = 50% if.end: call void @g1() br i1 %cmp38, label %for.body4, label %for.end -; CHECK: edge if.end -> for.body4 probability is 62 / 124 = 50% -; CHECK: edge if.end -> for.end probability is 62 / 124 = 50% +; CHECK: edge if.end -> for.body4 probability is 20 / 32 = 62.5% +; CHECK: edge if.end -> for.end probability is 12 / 32 = 37.5% for.body4: %j.09 = phi i32 [ %inc, %for.body4 ], [ 0, %if.end ] @@ -282,7 +282,7 @@ for.body4: for.end: call void @g3() br label %for.inc5 -; CHECK: edge for.end -> for.inc5 probability is 124 / 124 = 100% +; CHECK: edge for.end -> for.inc5 probability is 16 / 16 = 100% for.inc5: %inc6 = add nsw i32 %i.011, 1 @@ -314,35 +314,35 @@ for.body: %i.019 = phi i32 [ 0, %for.body.lr.ph ], [ %inc14, %for.end ] call void @g1() br i1 %cmp216, label %for.body3, label %for.end -; CHECK: edge for.body -> for.body3 probability is 62 / 124 = 50% -; CHECK: edge for.body -> for.end probability is 62 / 124 = 50% +; CHECK: edge for.body -> for.body3 probability is 20 / 32 = 62.5% +; CHECK: edge for.body -> for.end probability is 12 / 32 = 37.5% for.body3: %j.017 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ] %0 = load i32* %c, align 4 %cmp4 = icmp eq i32 %0, %j.017 br i1 %cmp4, label %for.inc, label %if.end -; CHECK: edge for.body3 -> for.inc probability is 62 / 124 = 50% -; CHECK: edge for.body3 -> if.end probability is 62 / 124 = 50% +; CHECK: edge for.body3 -> for.inc probability is 16 / 32 = 50% +; CHECK: edge for.body3 -> if.end probability is 16 / 32 = 50% if.end: %1 = load i32* %arrayidx5, align 4 %cmp6 = icmp eq i32 %1, %j.017 br i1 %cmp6, label %for.inc, label %if.end8 -; CHECK: edge if.end -> for.inc probability is 62 / 124 = 50% -; CHECK: edge if.end -> if.end8 probability is 62 / 124 = 50% +; CHECK: edge if.end -> for.inc probability is 16 / 32 = 50% +; CHECK: edge if.end -> if.end8 probability is 16 / 32 = 50% if.end8: %2 = load i32* %arrayidx9, align 4 %cmp10 = icmp eq i32 %2, %j.017 br i1 %cmp10, label %for.inc, label %if.end12 -; CHECK: edge if.end8 -> for.inc probability is 62 / 124 = 50% -; CHECK: edge if.end8 -> if.end12 probability is 62 / 124 = 50% +; CHECK: edge if.end8 -> for.inc probability is 16 / 32 = 50% +; CHECK: edge if.end8 -> if.end12 probability is 16 / 32 = 50% if.end12: call void @g2() br label %for.inc -; CHECK: edge if.end12 -> for.inc probability is 124 / 124 = 100% +; CHECK: edge if.end12 -> for.inc probability is 16 / 16 = 100% for.inc: %inc = add nsw i32 %j.017, 1 diff --git a/test/Analysis/BranchProbabilityInfo/pr18705.ll b/test/Analysis/BranchProbabilityInfo/pr18705.ll new file mode 100644 index 000000000000..9f239b46058d --- /dev/null +++ b/test/Analysis/BranchProbabilityInfo/pr18705.ll @@ -0,0 +1,58 @@ +; RUN: opt < %s -analyze -branch-prob | FileCheck %s + +; Since neither of while.body's out-edges is an exit or a back edge, +; calcLoopBranchHeuristics should return early without setting the weights. +; calcFloatingPointHeuristics, which is run later, sets the weights. +; +; CHECK: edge while.body -> if.then probability is 20 / 32 = 62.5% +; CHECK: edge while.body -> if.else probability is 12 / 32 = 37.5% + +define void @foo1(i32 %n, i32* nocapture %b, i32* nocapture %c, i32* nocapture %d, float* nocapture readonly %f0, float* nocapture readonly %f1) { +entry: + %tobool8 = icmp eq i32 %n, 0 + br i1 %tobool8, label %while.end, label %while.body.lr.ph + +while.body.lr.ph: + %0 = sext i32 %n to i64 + br label %while.body + +while.body: + %indvars.iv = phi i64 [ %0, %while.body.lr.ph ], [ %indvars.iv.next, %if.end ] + %b.addr.011 = phi i32* [ %b, %while.body.lr.ph ], [ %b.addr.1, %if.end ] + %d.addr.010 = phi i32* [ %d, %while.body.lr.ph ], [ %incdec.ptr4, %if.end ] + %c.addr.09 = phi i32* [ %c, %while.body.lr.ph ], [ %c.addr.1, %if.end ] + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %arrayidx = getelementptr inbounds float* %f0, i64 %indvars.iv.next + %1 = load float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float* %f1, i64 %indvars.iv.next + %2 = load float* %arrayidx2, align 4 + %cmp = fcmp une float %1, %2 + br i1 %cmp, label %if.then, label %if.else + +if.then: + %incdec.ptr = getelementptr inbounds i32* %b.addr.011, i64 1 + %3 = load i32* %b.addr.011, align 4 + %add = add nsw i32 %3, 12 + store i32 %add, i32* %b.addr.011, align 4 + br label %if.end + +if.else: + %incdec.ptr3 = getelementptr inbounds i32* %c.addr.09, i64 1 + %4 = load i32* %c.addr.09, align 4 + %sub = add nsw i32 %4, -13 + store i32 %sub, i32* %c.addr.09, align 4 + br label %if.end + +if.end: + %c.addr.1 = phi i32* [ %c.addr.09, %if.then ], [ %incdec.ptr3, %if.else ] + %b.addr.1 = phi i32* [ %incdec.ptr, %if.then ], [ %b.addr.011, %if.else ] + %incdec.ptr4 = getelementptr inbounds i32* %d.addr.010, i64 1 + store i32 14, i32* %d.addr.010, align 4 + %5 = trunc i64 %indvars.iv.next to i32 + %tobool = icmp eq i32 %5, 0 + br i1 %tobool, label %while.end, label %while.body + +while.end: + ret void +} + diff --git a/test/Analysis/CostModel/AArch64/lit.local.cfg b/test/Analysis/CostModel/AArch64/lit.local.cfg new file mode 100644 index 000000000000..7184443994b6 --- /dev/null +++ b/test/Analysis/CostModel/AArch64/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'AArch64' in config.root.targets: + config.unsupported = True diff --git a/test/Analysis/CostModel/AArch64/select.ll b/test/Analysis/CostModel/AArch64/select.ll new file mode 100644 index 000000000000..216dc5ddc488 --- /dev/null +++ b/test/Analysis/CostModel/AArch64/select.ll @@ -0,0 +1,38 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32" + +; CHECK-LABEL: select +define void @select() { + ; Scalar values + ; CHECK: cost of 1 {{.*}} select + %v1 = select i1 undef, i8 undef, i8 undef + ; CHECK: cost of 1 {{.*}} select + %v2 = select i1 undef, i16 undef, i16 undef + ; CHECK: cost of 1 {{.*}} select + %v3 = select i1 undef, i32 undef, i32 undef + ; CHECK: cost of 1 {{.*}} select + %v4 = select i1 undef, i64 undef, i64 undef + ; CHECK: cost of 1 {{.*}} select + %v5 = select i1 undef, float undef, float undef + ; CHECK: cost of 1 {{.*}} select + %v6 = select i1 undef, double undef, double undef + + ; Vector values - check for vectors that have a high cost because they end up + ; scalarized. + ; CHECK: cost of 320 {{.*}} select + %v13b = select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef + + ; CHECK: cost of 160 {{.*}} select + %v15b = select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef + ; CHECK: cost of 320 {{.*}} select + %v15c = select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef + + ; CHECK: cost of 80 {{.*}} select + %v16a = select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef + ; CHECK: cost of 160 {{.*}} select + %v16b = select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef + ; CHECK: cost of 320 {{.*}} select + %v16c = select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef + + ret void +} diff --git a/test/Analysis/CostModel/AArch64/store.ll b/test/Analysis/CostModel/AArch64/store.ll new file mode 100644 index 000000000000..0c9883cf2a2f --- /dev/null +++ b/test/Analysis/CostModel/AArch64/store.ll @@ -0,0 +1,22 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32" +; CHECK-LABEL: store +define void @store() { + ; Stores of <2 x i64> should be expensive because we don't split them and + ; and unaligned 16b stores have bad performance. + ; CHECK: cost of 12 {{.*}} store + store <2 x i64> undef, <2 x i64> * undef + + ; We scalarize the loads/stores because there is no vector register name for + ; these types (they get extended to v.4h/v.2s). + ; CHECK: cost of 16 {{.*}} store + store <2 x i8> undef, <2 x i8> * undef + ; CHECK: cost of 64 {{.*}} store + store <4 x i8> undef, <4 x i8> * undef + ; CHECK: cost of 16 {{.*}} load + load <2 x i8> * undef + ; CHECK: cost of 64 {{.*}} load + load <4 x i8> * undef + + ret void +} diff --git a/test/Analysis/CostModel/ARM/cast.ll b/test/Analysis/CostModel/ARM/cast.ll index 0cdd61cac4f7..662110f2720d 100644 --- a/test/Analysis/CostModel/ARM/cast.ll +++ b/test/Analysis/CostModel/ARM/cast.ll @@ -221,9 +221,9 @@ define i32 @casts() { %r96 = fptoui <2 x float> undef to <2 x i32> ; CHECK: cost of 1 {{.*}} fptosi %r97 = fptosi <2 x float> undef to <2 x i32> - ; CHECK: cost of 24 {{.*}} fptoui + ; CHECK: cost of 28 {{.*}} fptoui %r98 = fptoui <2 x float> undef to <2 x i64> - ; CHECK: cost of 24 {{.*}} fptosi + ; CHECK: cost of 28 {{.*}} fptosi %r99 = fptosi <2 x float> undef to <2 x i64> ; CHECK: cost of 8 {{.*}} fptoui @@ -242,9 +242,9 @@ define i32 @casts() { %r106 = fptoui <2 x double> undef to <2 x i32> ; CHECK: cost of 2 {{.*}} fptosi %r107 = fptosi <2 x double> undef to <2 x i32> - ; CHECK: cost of 24 {{.*}} fptoui + ; CHECK: cost of 28 {{.*}} fptoui %r108 = fptoui <2 x double> undef to <2 x i64> - ; CHECK: cost of 24 {{.*}} fptosi + ; CHECK: cost of 28 {{.*}} fptosi %r109 = fptosi <2 x double> undef to <2 x i64> ; CHECK: cost of 16 {{.*}} fptoui @@ -263,9 +263,9 @@ define i32 @casts() { %r116 = fptoui <4 x float> undef to <4 x i32> ; CHECK: cost of 1 {{.*}} fptosi %r117 = fptosi <4 x float> undef to <4 x i32> - ; CHECK: cost of 48 {{.*}} fptoui + ; CHECK: cost of 56 {{.*}} fptoui %r118 = fptoui <4 x float> undef to <4 x i64> - ; CHECK: cost of 48 {{.*}} fptosi + ; CHECK: cost of 56 {{.*}} fptosi %r119 = fptosi <4 x float> undef to <4 x i64> ; CHECK: cost of 16 {{.*}} fptoui @@ -284,9 +284,9 @@ define i32 @casts() { %r126 = fptoui <4 x double> undef to <4 x i32> ; CHECK: cost of 16 {{.*}} fptosi %r127 = fptosi <4 x double> undef to <4 x i32> - ; CHECK: cost of 48 {{.*}} fptoui + ; CHECK: cost of 56 {{.*}} fptoui %r128 = fptoui <4 x double> undef to <4 x i64> - ; CHECK: cost of 48 {{.*}} fptosi + ; CHECK: cost of 56 {{.*}} fptosi %r129 = fptosi <4 x double> undef to <4 x i64> ; CHECK: cost of 32 {{.*}} fptoui @@ -305,9 +305,9 @@ define i32 @casts() { %r136 = fptoui <8 x float> undef to <8 x i32> ; CHECK: cost of 2 {{.*}} fptosi %r137 = fptosi <8 x float> undef to <8 x i32> - ; CHECK: cost of 96 {{.*}} fptoui + ; CHECK: cost of 112 {{.*}} fptoui %r138 = fptoui <8 x float> undef to <8 x i64> - ; CHECK: cost of 96 {{.*}} fptosi + ; CHECK: cost of 112 {{.*}} fptosi %r139 = fptosi <8 x float> undef to <8 x i64> ; CHECK: cost of 32 {{.*}} fptoui @@ -326,9 +326,9 @@ define i32 @casts() { %r146 = fptoui <8 x double> undef to <8 x i32> ; CHECK: cost of 32 {{.*}} fptosi %r147 = fptosi <8 x double> undef to <8 x i32> - ; CHECK: cost of 96 {{.*}} fptoui + ; CHECK: cost of 112 {{.*}} fptoui %r148 = fptoui <8 x double> undef to <8 x i64> - ; CHECK: cost of 96 {{.*}} fptosi + ; CHECK: cost of 112 {{.*}} fptosi %r149 = fptosi <8 x double> undef to <8 x i64> ; CHECK: cost of 64 {{.*}} fptoui @@ -347,9 +347,9 @@ define i32 @casts() { %r156 = fptoui <16 x float> undef to <16 x i32> ; CHECK: cost of 4 {{.*}} fptosi %r157 = fptosi <16 x float> undef to <16 x i32> - ; CHECK: cost of 192 {{.*}} fptoui + ; CHECK: cost of 224 {{.*}} fptoui %r158 = fptoui <16 x float> undef to <16 x i64> - ; CHECK: cost of 192 {{.*}} fptosi + ; CHECK: cost of 224 {{.*}} fptosi %r159 = fptosi <16 x float> undef to <16 x i64> ; CHECK: cost of 64 {{.*}} fptoui @@ -368,9 +368,9 @@ define i32 @casts() { %r166 = fptoui <16 x double> undef to <16 x i32> ; CHECK: cost of 64 {{.*}} fptosi %r167 = fptosi <16 x double> undef to <16 x i32> - ; CHECK: cost of 192 {{.*}} fptoui + ; CHECK: cost of 224 {{.*}} fptoui %r168 = fptoui <16 x double> undef to <16 x i64> - ; CHECK: cost of 192 {{.*}} fptosi + ; CHECK: cost of 224 {{.*}} fptosi %r169 = fptosi <16 x double> undef to <16 x i64> ; CHECK: cost of 8 {{.*}} uitofp @@ -528,7 +528,7 @@ define i32 @casts() { %r242 = uitofp <16 x i8> undef to <16 x double> ; CHECK: cost of 64 {{.*}} sitofp %r243 = sitofp <16 x i8> undef to <16 x double> - ; C4ECK: cost of 64 {{.*}} uitofp + ; CHECK: cost of 64 {{.*}} uitofp %r244 = uitofp <16 x i16> undef to <16 x double> ; CHECK: cost of 64 {{.*}} sitofp %r245 = sitofp <16 x i16> undef to <16 x double> diff --git a/test/Analysis/CostModel/ARM/lit.local.cfg b/test/Analysis/CostModel/ARM/lit.local.cfg index 8a3ba96497e7..98c6700c209d 100644 --- a/test/Analysis/CostModel/ARM/lit.local.cfg +++ b/test/Analysis/CostModel/ARM/lit.local.cfg @@ -1,4 +1,3 @@ -targets = set(config.root.targets_to_build.split()) -if not 'ARM' in targets: +if not 'ARM' in config.root.targets: config.unsupported = True diff --git a/test/Analysis/CostModel/PowerPC/ext.ll b/test/Analysis/CostModel/PowerPC/ext.ll new file mode 100644 index 000000000000..7d6a14e93cdf --- /dev/null +++ b/test/Analysis/CostModel/PowerPC/ext.ll @@ -0,0 +1,21 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx | FileCheck %s +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +define void @exts() { + + ; CHECK: cost of 1 {{.*}} sext + %v1 = sext i16 undef to i32 + + ; CHECK: cost of 1 {{.*}} sext + %v2 = sext <2 x i16> undef to <2 x i32> + + ; CHECK: cost of 1 {{.*}} sext + %v3 = sext <4 x i16> undef to <4 x i32> + + ; CHECK: cost of 112 {{.*}} sext + %v4 = sext <8 x i16> undef to <8 x i32> + + ret void +} + diff --git a/test/Analysis/CostModel/PowerPC/insert_extract.ll b/test/Analysis/CostModel/PowerPC/insert_extract.ll index f51963d56fde..8dc003153a24 100644 --- a/test/Analysis/CostModel/PowerPC/insert_extract.ll +++ b/test/Analysis/CostModel/PowerPC/insert_extract.ll @@ -3,13 +3,13 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "powerpc64-unknown-linux-gnu" define i32 @insert(i32 %arg) { - ; CHECK: cost of 13 {{.*}} insertelement + ; CHECK: cost of 10 {{.*}} insertelement %x = insertelement <4 x i32> undef, i32 %arg, i32 0 ret i32 undef } define i32 @extract(<4 x i32> %arg) { - ; CHECK: cost of 13 {{.*}} extractelement + ; CHECK: cost of 3 {{.*}} extractelement %x = extractelement <4 x i32> %arg, i32 0 ret i32 %x } diff --git a/test/Analysis/CostModel/PowerPC/lit.local.cfg b/test/Analysis/CostModel/PowerPC/lit.local.cfg index 2e463005586f..5d33887ff0a4 100644 --- a/test/Analysis/CostModel/PowerPC/lit.local.cfg +++ b/test/Analysis/CostModel/PowerPC/lit.local.cfg @@ -1,4 +1,3 @@ -targets = set(config.root.targets_to_build.split()) -if not 'PowerPC' in targets: +if not 'PowerPC' in config.root.targets: config.unsupported = True diff --git a/test/Analysis/CostModel/PowerPC/load_store.ll b/test/Analysis/CostModel/PowerPC/load_store.ll index c77cce955abf..368f0a73489b 100644 --- a/test/Analysis/CostModel/PowerPC/load_store.ll +++ b/test/Analysis/CostModel/PowerPC/load_store.ll @@ -29,6 +29,17 @@ define i32 @loads(i32 %arg) { ; CHECK: cost of 4 {{.*}} load load i128* undef, align 4 + ; FIXME: There actually are sub-vector Altivec loads, and so we could handle + ; this with a small expense, but we don't currently. + ; CHECK: cost of 48 {{.*}} load + load <4 x i16>* undef, align 2 + + ; CHECK: cost of 1 {{.*}} load + load <4 x i32>* undef, align 4 + + ; CHECK: cost of 46 {{.*}} load + load <3 x float>* undef, align 1 + ret i32 undef } diff --git a/test/Analysis/CostModel/X86/alternate-shuffle-cost.ll b/test/Analysis/CostModel/X86/alternate-shuffle-cost.ll new file mode 100644 index 000000000000..2e162f0f0005 --- /dev/null +++ b/test/Analysis/CostModel/X86/alternate-shuffle-cost.ll @@ -0,0 +1,347 @@ +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2,-ssse3 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2,+sse3,+ssse3 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSSE3 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2 + + +; Verify the cost model for alternate shuffles. + +; shufflevector instructions with illegal 64-bit vector types. +; 64-bit packed integer vectors (v2i32) are promoted to type v2i64. +; 64-bit packed float vectors (v2f32) are widened to type v4f32. + +define <2 x i32> @test_v2i32(<2 x i32> %a, <2 x i32> %b) { + %1 = shufflevector <2 x i32> %a, <2 x i32> %b, <2 x i32> + ret <2 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2i32': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <2 x float> @test_v2f32(<2 x float> %a, <2 x float> %b) { + %1 = shufflevector <2 x float> %a, <2 x float> %b, <2 x i32> + ret <2 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2f32': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <2 x i32> @test_v2i32_2(<2 x i32> %a, <2 x i32> %b) { + %1 = shufflevector <2 x i32> %a, <2 x i32> %b, <2 x i32> + ret <2 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2i32_2': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <2 x float> @test_v2f32_2(<2 x float> %a, <2 x float> %b) { + %1 = shufflevector <2 x float> %a, <2 x float> %b, <2 x i32> + ret <2 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2f32_2': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +; Test shuffles on packed vectors of two elements. + +define <2 x i64> @test_v2i64(<2 x i64> %a, <2 x i64> %b) { + %1 = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> + ret <2 x i64> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2i64': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <2 x double> @test_v2f64(<2 x double> %a, <2 x double> %b) { + %1 = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> + ret <2 x double> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2f64': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <2 x i64> @test_v2i64_2(<2 x i64> %a, <2 x i64> %b) { + %1 = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> + ret <2 x i64> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2i64_2': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <2 x double> @test_v2f64_2(<2 x double> %a, <2 x double> %b) { + %1 = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> + ret <2 x double> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v2f64_2': +; SSE2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +; Test shuffles on packed vectors of four elements. + +define <4 x i32> @test_v4i32(<4 x i32> %a, <4 x i32> %b) { + %1 = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> + ret <4 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4i32': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x i32> @test_v4i32_2(<4 x i32> %a, <4 x i32> %b) { + %1 = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> + ret <4 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4i32_2': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x float> @test_v4f32(<4 x float> %a, <4 x float> %b) { + %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4f32': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x float> @test_v4f32_2(<4 x float> %a, <4 x float> %b) { + %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4f32_2': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <4 x i64> @test_v4i64(<4 x i64> %a, <4 x i64> %b) { + %1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> + ret <4 x i64> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4i64': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x i64> @test_v4i64_2(<4 x i64> %a, <4 x i64> %b) { + %1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> + ret <4 x i64> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4i64_2': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x double> @test_v4f64(<4 x double> %a, <4 x double> %b) { + %1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> + ret <4 x double> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4f64': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <4 x double> @test_v4f64_2(<4 x double> %a, <4 x double> %b) { + %1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> + ret <4 x double> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v4f64_2': +; SSE2: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +; Test shuffles on packed vectors of eight elements. +define <8 x i16> @test_v8i16(<8 x i16> %a, <8 x i16> %b) { + %1 = shufflevector <8 x i16> %a, <8 x i16> %b, <8 x i32> + ret <8 x i16> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8i16': +; SSE2: Cost Model: {{.*}} 8 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <8 x i16> @test_v8i16_2(<8 x i16> %a, <8 x i16> %b) { + %1 = shufflevector <8 x i16> %a, <8 x i16> %b, <8 x i32> + ret <8 x i16> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8i16_2': +; SSE2: Cost Model: {{.*}} 8 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <8 x i32> @test_v8i32(<8 x i32> %a, <8 x i32> %b) { + %1 = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> + ret <8 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8i32': +; SSE2: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <8 x i32> @test_v8i32_2(<8 x i32> %a, <8 x i32> %b) { + %1 = shufflevector <8 x i32> %a, <8 x i32> %b, <8 x i32> + ret <8 x i32> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8i32_2': +; SSE2: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <8 x float> @test_v8f32(<8 x float> %a, <8 x float> %b) { + %1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8f32': +; SSE2: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <8 x float> @test_v8f32_2(<8 x float> %a, <8 x float> %b) { + %1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v8f32_2': +; SSE2: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 4 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +; Test shuffles on packed vectors of sixteen elements. +define <16 x i8> @test_v16i8(<16 x i8> %a, <16 x i8> %b) { + %1 = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> + ret <16 x i8> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v16i8': +; SSE2: Cost Model: {{.*}} 48 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector + + +define <16 x i8> @test_v16i8_2(<16 x i8> %a, <16 x i8> %b) { + %1 = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> + ret <16 x i8> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v16i8_2': +; SSE2: Cost Model: {{.*}} 48 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 3 for instruction: %1 = shufflevector + + +define <16 x i16> @test_v16i16(<16 x i16> %a, <16 x i16> %b) { + %1 = shufflevector <16 x i16> %a, <16 x i16> %b, <16 x i32> + ret <16 x i16> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v16i16': +; SSE2: Cost Model: {{.*}} 16 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 5 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + + +define <16 x i16> @test_v16i16_2(<16 x i16> %a, <16 x i16> %b) { + %1 = shufflevector <16 x i16> %a, <16 x i16> %b, <16 x i32> + ret <16 x i16> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v16i16_2': +; SSE2: Cost Model: {{.*}} 16 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 2 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 5 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 1 for instruction: %1 = shufflevector + +define <32 x i8> @test_v32i8(<32 x i8> %a, <32 x i8> %b) { + %1 = shufflevector <32 x i8> %a, <32 x i8> %b, <32 x i32> + ret <32 x i8> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v32i8': +; SSE2: Cost Model: {{.*}} 96 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 9 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 9 for instruction: %1 = shufflevector + + +define <32 x i8> @test_v32i8_2(<32 x i8> %a, <32 x i8> %b) { + %1 = shufflevector <32 x i8> %a, <32 x i8> %b, <32 x i32> + ret <32 x i8> %1 +} +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_v32i8_2': +; SSE2: Cost Model: {{.*}} 96 for instruction: %1 = shufflevector +; SSSE3: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; SSE41: Cost Model: {{.*}} 6 for instruction: %1 = shufflevector +; AVX: Cost Model: {{.*}} 9 for instruction: %1 = shufflevector +; AVX2: Cost Model: {{.*}} 9 for instruction: %1 = shufflevector + diff --git a/test/Analysis/CostModel/X86/cast.ll b/test/Analysis/CostModel/X86/cast.ll index f3c1283c7e32..7f97b176f7c1 100644 --- a/test/Analysis/CostModel/X86/cast.ll +++ b/test/Analysis/CostModel/X86/cast.ll @@ -1,10 +1,11 @@ -; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX2 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-AVX 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-apple-macosx10.8.0" define i32 @add(i32 %arg) { - +; CHECK-LABEL: for function 'add' ; -- Same size registeres -- ;CHECK: cost of 1 {{.*}} zext %A = zext <4 x i1> undef to <4 x i32> @@ -33,57 +34,106 @@ define i32 @add(i32 %arg) { } define i32 @zext_sext(<8 x i1> %in) { - ;CHECK: cost of 6 {{.*}} zext +; CHECK-AVX2-LABEL: for function 'zext_sext' +; CHECK-AVX-LABEL: for function 'zext_sext' + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext %Z = zext <8 x i1> %in to <8 x i32> - ;CHECK: cost of 9 {{.*}} sext + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 7 {{.*}} sext %S = sext <8 x i1> %in to <8 x i32> - ;CHECK: cost of 1 {{.*}} zext + ;CHECK-AVX2: cost of 1 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext %A1 = zext <16 x i8> undef to <16 x i16> - ;CHECK: cost of 1 {{.*}} sext + ;CHECK-AVX2: cost of 1 {{.*}} sext + ;CHECK-AVX: cost of 4 {{.*}} sext %A2 = sext <16 x i8> undef to <16 x i16> - ;CHECK: cost of 1 {{.*}} sext + ;CHECK-AVX2: cost of 1 {{.*}} sext + ;CHECK-AVX: cost of 4 {{.*}} sext %A = sext <8 x i16> undef to <8 x i32> - ;CHECK: cost of 1 {{.*}} zext + ;CHECK-AVX2: cost of 1 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext %B = zext <8 x i16> undef to <8 x i32> - ;CHECK: cost of 1 {{.*}} sext + ;CHECK-AVX2: cost of 1 {{.*}} sext + ;CHECK-AVX: cost of 4 {{.*}} sext %C = sext <4 x i32> undef to <4 x i64> - ;CHECK: cost of 6 {{.*}} sext - %C1 = sext <4 x i8> undef to <4 x i64> - ;CHECK: cost of 6 {{.*}} sext - %C2 = sext <4 x i16> undef to <4 x i64> - ;CHECK: cost of 1 {{.*}} zext + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext + %C.v8i8.z = zext <8 x i8> undef to <8 x i32> + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 7 {{.*}} sext + %C.v8i8.s = sext <8 x i8> undef to <8 x i32> + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 3 {{.*}} zext + %C.v4i16.z = zext <4 x i16> undef to <4 x i64> + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 6 {{.*}} sext + %C.v4i16.s = sext <4 x i16> undef to <4 x i64> + + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext + %C.v4i8.z = zext <4 x i8> undef to <4 x i64> + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 6 {{.*}} sext + %C.v4i8.s = sext <4 x i8> undef to <4 x i64> + + ;CHECK-AVX2: cost of 1 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext %D = zext <4 x i32> undef to <4 x i64> - ;CHECK: cost of 1 {{.*}} trunc + ;CHECK-AVX2: cost of 2 {{.*}} trunc + ;CHECK-AVX: cost of 4 {{.*}} trunc %E = trunc <4 x i64> undef to <4 x i32> - ;CHECK: cost of 1 {{.*}} trunc + ;CHECK-AVX2: cost of 2 {{.*}} trunc + ;CHECK-AVX: cost of 5 {{.*}} trunc %F = trunc <8 x i32> undef to <8 x i16> - ;CHECK: cost of 2 {{.*}} trunc + ;CHECK-AVX2: cost of 4 {{.*}} trunc + ;CHECK-AVX: cost of 4 {{.*}} trunc %F1 = trunc <16 x i16> undef to <16 x i8> - - ;CHECK: cost of 3 {{.*}} trunc + ;CHECK-AVX2: cost of 2 {{.*}} trunc + ;CHECK-AVX: cost of 4 {{.*}} trunc + %F2 = trunc <8 x i32> undef to <8 x i8> + ;CHECK-AVX2: cost of 2 {{.*}} trunc + ;CHECK-AVX: cost of 4 {{.*}} trunc + %F3 = trunc <4 x i64> undef to <4 x i8> + + ;CHECK-AVX2: cost of 4 {{.*}} trunc + ;CHECK-AVX: cost of 9 {{.*}} trunc %G = trunc <8 x i64> undef to <8 x i32> ret i32 undef } define i32 @masks8(<8 x i1> %in) { - ;CHECK: cost of 6 {{.*}} zext +; CHECK-AVX2-LABEL: for function 'masks8' +; CHECK-AVX-LABEL: for function 'masks8' + + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext %Z = zext <8 x i1> %in to <8 x i32> - ;CHECK: cost of 9 {{.*}} sext + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 7 {{.*}} sext %S = sext <8 x i1> %in to <8 x i32> ret i32 undef } define i32 @masks4(<4 x i1> %in) { - ;CHECK: cost of 8 {{.*}} sext +; CHECK-AVX2-LABEL: for function 'masks4' +; CHECK-AVX-LABEL: for function 'masks4' + + ;CHECK-AVX2: cost of 3 {{.*}} zext + ;CHECK-AVX: cost of 4 {{.*}} zext + %Z = zext <4 x i1> %in to <4 x i64> + ;CHECK-AVX2: cost of 3 {{.*}} sext + ;CHECK-AVX: cost of 6 {{.*}} sext %S = sext <4 x i1> %in to <4 x i64> ret i32 undef } define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) { +; CHECK-LABEL: for function 'sitofp4' ; CHECK: cost of 3 {{.*}} sitofp %A1 = sitofp <4 x i1> %a to <4 x float> ; CHECK: cost of 3 {{.*}} sitofp @@ -107,6 +157,7 @@ define void @sitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) { } define void @sitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) { +; CHECK-LABEL: for function 'sitofp8' ; CHECK: cost of 8 {{.*}} sitofp %A1 = sitofp <8 x i1> %a to <8 x float> @@ -122,6 +173,7 @@ define void @sitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) { } define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) { +; CHECK-LABEL: for function 'uitofp4' ; CHECK: cost of 7 {{.*}} uitofp %A1 = uitofp <4 x i1> %a to <4 x float> ; CHECK: cost of 7 {{.*}} uitofp @@ -145,6 +197,7 @@ define void @uitofp4(<4 x i1> %a, <4 x i8> %b, <4 x i16> %c, <4 x i32> %d) { } define void @uitofp8(<8 x i1> %a, <8 x i8> %b, <8 x i16> %c, <8 x i32> %d) { +; CHECK-LABEL: for function 'uitofp8' ; CHECK: cost of 6 {{.*}} uitofp %A1 = uitofp <8 x i1> %a to <8 x float> diff --git a/test/Analysis/CostModel/X86/cmp.ll b/test/Analysis/CostModel/X86/cmp.ll index 713b3742e920..9f2bdb3c21b7 100644 --- a/test/Analysis/CostModel/X86/cmp.ll +++ b/test/Analysis/CostModel/X86/cmp.ll @@ -1,5 +1,5 @@ -; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck --check-prefix=AVX1 %s -; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck --check-prefix=AVX2 %s +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck -check-prefix=CHECK -check-prefix=AVX1 %s +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck -check-prefix=CHECK -check-prefix=AVX2 %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-apple-macosx10.8.0" diff --git a/test/Analysis/CostModel/X86/intrinsic-cost.ll b/test/Analysis/CostModel/X86/intrinsic-cost.ll index 8eeee8124d9a..3b27b52f7654 100644 --- a/test/Analysis/CostModel/X86/intrinsic-cost.ll +++ b/test/Analysis/CostModel/X86/intrinsic-cost.ll @@ -58,3 +58,31 @@ for.end: ; preds = %vector.body } declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>) nounwind readnone + +define void @test3(float* nocapture %f, <4 x float> %b, <4 x float> %c) nounwind { +vector.ph: + br label %vector.body + +vector.body: ; preds = %vector.body, %vector.ph + %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] + %0 = getelementptr inbounds float* %f, i64 %index + %1 = bitcast float* %0 to <4 x float>* + %wide.load = load <4 x float>* %1, align 4 + %2 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %wide.load, <4 x float> %b, <4 x float> %c) + store <4 x float> %2, <4 x float>* %1, align 4 + %index.next = add i64 %index, 4 + %3 = icmp eq i64 %index.next, 1024 + br i1 %3, label %for.end, label %vector.body + +for.end: ; preds = %vector.body + ret void + +; CORE2: Printing analysis 'Cost Model Analysis' for function 'test3': +; CORE2: Cost Model: Found an estimated cost of 4 for instruction: %2 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %wide.load, <4 x float> %b, <4 x float> %c) + +; COREI7: Printing analysis 'Cost Model Analysis' for function 'test3': +; COREI7: Cost Model: Found an estimated cost of 4 for instruction: %2 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %wide.load, <4 x float> %b, <4 x float> %c) + +} + +declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) nounwind readnone diff --git a/test/Analysis/CostModel/X86/lit.local.cfg b/test/Analysis/CostModel/X86/lit.local.cfg index ba763cf03ffc..e71f3cc4c41e 100644 --- a/test/Analysis/CostModel/X86/lit.local.cfg +++ b/test/Analysis/CostModel/X86/lit.local.cfg @@ -1,4 +1,3 @@ -targets = set(config.root.targets_to_build.split()) -if not 'X86' in targets: +if not 'X86' in config.root.targets: config.unsupported = True diff --git a/test/Analysis/CostModel/X86/scalarize.ll b/test/Analysis/CostModel/X86/scalarize.ll new file mode 100644 index 000000000000..fc25fcbc563f --- /dev/null +++ b/test/Analysis/CostModel/X86/scalarize.ll @@ -0,0 +1,41 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=i386 -mcpu=corei7-avx | FileCheck %s -check-prefix=CHECK32 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s -check-prefix=CHECK64 + +; Test vector scalarization costs. +; RUN: llc < %s -march=x86 -mcpu=i386 +; RUN: llc < %s -march=x86 -mcpu=yonah + +%i4 = type <4 x i32> +%i8 = type <2 x i64> + +;;; TEST HANDLING OF VARIOUS VECTOR SIZES + +declare %i4 @llvm.bswap.v4i32(%i4) +declare %i8 @llvm.bswap.v2i64(%i8) + +declare %i4 @llvm.ctpop.v4i32(%i4) +declare %i8 @llvm.ctpop.v2i64(%i8) + +; CHECK32-LABEL: test_scalarized_intrinsics +; CHECK64-LABEL: test_scalarized_intrinsics +define void @test_scalarized_intrinsics() { + %r1 = add %i8 undef, undef + +; CHECK32: cost of 12 {{.*}}bswap.v4i32 +; CHECK64: cost of 12 {{.*}}bswap.v4i32 + %r2 = call %i4 @llvm.bswap.v4i32(%i4 undef) +; CHECK32: cost of 10 {{.*}}bswap.v2i64 +; CHECK64: cost of 6 {{.*}}bswap.v2i64 + %r3 = call %i8 @llvm.bswap.v2i64(%i8 undef) + +; CHECK32: cost of 12 {{.*}}ctpop.v4i32 +; CHECK64: cost of 12 {{.*}}ctpop.v4i32 + %r4 = call %i4 @llvm.ctpop.v4i32(%i4 undef) +; CHECK32: cost of 10 {{.*}}ctpop.v2i64 +; CHECK64: cost of 6 {{.*}}ctpop.v2i64 + %r5 = call %i8 @llvm.ctpop.v2i64(%i8 undef) + +; CHECK32: ret +; CHECK64: ret + ret void +} diff --git a/test/Analysis/CostModel/X86/vdiv-cost.ll b/test/Analysis/CostModel/X86/vdiv-cost.ll new file mode 100644 index 000000000000..c8e4557cbefd --- /dev/null +++ b/test/Analysis/CostModel/X86/vdiv-cost.ll @@ -0,0 +1,92 @@ +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2 + +define <4 x i32> @test1(<4 x i32> %a) { + %div = udiv <4 x i32> %a, + ret <4 x i32> %div + +; CHECK: 'Cost Model Analysis' for function 'test1': +; SSE2: Found an estimated cost of 15 for instruction: %div +; AVX2: Found an estimated cost of 15 for instruction: %div +} + +define <8 x i32> @test2(<8 x i32> %a) { + %div = udiv <8 x i32> %a, + ret <8 x i32> %div + +; CHECK: 'Cost Model Analysis' for function 'test2': +; SSE2: Found an estimated cost of 30 for instruction: %div +; AVX2: Found an estimated cost of 15 for instruction: %div +} + +define <8 x i16> @test3(<8 x i16> %a) { + %div = udiv <8 x i16> %a, + ret <8 x i16> %div + +; CHECK: 'Cost Model Analysis' for function 'test3': +; SSE2: Found an estimated cost of 6 for instruction: %div +; AVX2: Found an estimated cost of 6 for instruction: %div +} + +define <16 x i16> @test4(<16 x i16> %a) { + %div = udiv <16 x i16> %a, + ret <16 x i16> %div + +; CHECK: 'Cost Model Analysis' for function 'test4': +; SSE2: Found an estimated cost of 12 for instruction: %div +; AVX2: Found an estimated cost of 6 for instruction: %div +} + +define <8 x i16> @test5(<8 x i16> %a) { + %div = sdiv <8 x i16> %a, + ret <8 x i16> %div + +; CHECK: 'Cost Model Analysis' for function 'test5': +; SSE2: Found an estimated cost of 6 for instruction: %div +; AVX2: Found an estimated cost of 6 for instruction: %div +} + +define <16 x i16> @test6(<16 x i16> %a) { + %div = sdiv <16 x i16> %a, + ret <16 x i16> %div + +; CHECK: 'Cost Model Analysis' for function 'test6': +; SSE2: Found an estimated cost of 12 for instruction: %div +; AVX2: Found an estimated cost of 6 for instruction: %div +} + +define <16 x i8> @test7(<16 x i8> %a) { + %div = sdiv <16 x i8> %a, + ret <16 x i8> %div + +; CHECK: 'Cost Model Analysis' for function 'test7': +; SSE2: Found an estimated cost of 320 for instruction: %div +; AVX2: Found an estimated cost of 320 for instruction: %div +} + +define <4 x i32> @test8(<4 x i32> %a) { + %div = sdiv <4 x i32> %a, + ret <4 x i32> %div + +; CHECK: 'Cost Model Analysis' for function 'test8': +; SSE2: Found an estimated cost of 19 for instruction: %div +; AVX2: Found an estimated cost of 15 for instruction: %div +} + +define <8 x i32> @test9(<8 x i32> %a) { + %div = sdiv <8 x i32> %a, + ret <8 x i32> %div + +; CHECK: 'Cost Model Analysis' for function 'test9': +; SSE2: Found an estimated cost of 38 for instruction: %div +; AVX2: Found an estimated cost of 15 for instruction: %div +} + +define <8 x i32> @test10(<8 x i32> %a) { + %div = sdiv <8 x i32> %a, + ret <8 x i32> %div + +; CHECK: 'Cost Model Analysis' for function 'test10': +; SSE2: Found an estimated cost of 160 for instruction: %div +; AVX2: Found an estimated cost of 160 for instruction: %div +} diff --git a/test/Analysis/CostModel/X86/vselect-cost.ll b/test/Analysis/CostModel/X86/vselect-cost.ll new file mode 100644 index 000000000000..2416777506df --- /dev/null +++ b/test/Analysis/CostModel/X86/vselect-cost.ll @@ -0,0 +1,126 @@ +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2 + + +; Verify the cost of vector select instructions. + +; SSE41 added blend instructions with an immediate for <2 x double> and +; <4 x float>. Integers of the same size should also use those instructions. + +define <2 x i64> @test_2i64(<2 x i64> %a, <2 x i64> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_2i64': +; SSE2: Cost Model: {{.*}} 4 for instruction: %sel = select <2 x i1> +; SSE41: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> + %sel = select <2 x i1> , <2 x i64> %a, <2 x i64> %b + ret <2 x i64> %sel +} + +define <2 x double> @test_2double(<2 x double> %a, <2 x double> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_2double': +; SSE2: Cost Model: {{.*}} 3 for instruction: %sel = select <2 x i1> +; SSE41: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <2 x i1> + %sel = select <2 x i1> , <2 x double> %a, <2 x double> %b + ret <2 x double> %sel +} + +define <4 x i32> @test_4i32(<4 x i32> %a, <4 x i32> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_4i32': +; SSE2: Cost Model: {{.*}} 8 for instruction: %sel = select <4 x i1> +; SSE41: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> + %sel = select <4 x i1> , <4 x i32> %a, <4 x i32> %b + ret <4 x i32> %sel +} + +define <4 x float> @test_4float(<4 x float> %a, <4 x float> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_4float': +; SSE2: Cost Model: {{.*}} 7 for instruction: %sel = select <4 x i1> +; SSE41: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> + %sel = select <4 x i1> , <4 x float> %a, <4 x float> %b + ret <4 x float> %sel +} + +define <16 x i8> @test_16i8(<16 x i8> %a, <16 x i8> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_16i8': +; SSE2: Cost Model: {{.*}} 32 for instruction: %sel = select <16 x i1> +; SSE41: Cost Model: {{.*}} 1 for instruction: %sel = select <16 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <16 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <16 x i1> + %sel = select <16 x i1> , <16 x i8> %a, <16 x i8> %b + ret <16 x i8> %sel +} + +; AVX added blend instructions with an immediate for <4 x double> and +; <8 x float>. Integers of the same size should also use those instructions. +define <4 x i64> @test_4i64(<4 x i64> %a, <4 x i64> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_4i64': +; SSE2: Cost Model: {{.*}} 8 for instruction: %sel = select <4 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <4 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> + %sel = select <4 x i1> , <4 x i64> %a, <4 x i64> %b + ret <4 x i64> %sel +} + +define <4 x double> @test_4double(<4 x double> %a, <4 x double> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_4double': +; SSE2: Cost Model: {{.*}} 6 for instruction: %sel = select <4 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <4 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <4 x i1> + %sel = select <4 x i1> , <4 x double> %a, <4 x double> %b + ret <4 x double> %sel +} + +define <8 x i32> @test_8i32(<8 x i32> %a, <8 x i32> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_8i32': +; SSE2: Cost Model: {{.*}} 16 for instruction: %sel = select <8 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <8 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <8 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <8 x i1> + %sel = select <8 x i1> , <8 x i32> %a, <8 x i32> %b + ret <8 x i32> %sel +} + +define <8 x float> @test_8float(<8 x float> %a, <8 x float> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_8float': +; SSE2: Cost Model: {{.*}} 14 for instruction: %sel = select <8 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <8 x i1> +; AVX: Cost Model: {{.*}} 1 for instruction: %sel = select <8 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <8 x i1> + %sel = select <8 x i1> , <8 x float> %a, <8 x float> %b + ret <8 x float> %sel +} + +; AVX2 +define <16 x i16> @test_16i16(<16 x i16> %a, <16 x i16> %b) { +; CHECK:Printing analysis 'Cost Model Analysis' for function 'test_16i16': +; SSE2: Cost Model: {{.*}} 32 for instruction: %sel = select <16 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <16 x i1> +;;; FIXME: This AVX cost is obviously wrong. We shouldn't be scalarizing. +; AVX: Cost Model: {{.*}} 32 for instruction: %sel = select <16 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <16 x i1> + %sel = select <16 x i1> , <16 x i16> %a, <16 x i16> %b + ret <16 x i16> %sel +} + +define <32 x i8> @test_32i8(<32 x i8> %a, <32 x i8> %b) { +; CHECK: Printing analysis 'Cost Model Analysis' for function 'test_32i8': +; SSE2: Cost Model: {{.*}} 64 for instruction: %sel = select <32 x i1> +; SSE41: Cost Model: {{.*}} 2 for instruction: %sel = select <32 x i1> +;;; FIXME: This AVX cost is obviously wrong. We shouldn't be scalarizing. +; AVX: Cost Model: {{.*}} 64 for instruction: %sel = select <32 x i1> +; AVX2: Cost Model: {{.*}} 1 for instruction: %sel = select <32 x i1> + %sel = select <32 x i1> , <32 x i8> %a, <32 x i8> %b + ret <32 x i8> %sel +} + diff --git a/test/Analysis/CostModel/X86/vshift-cost.ll b/test/Analysis/CostModel/X86/vshift-cost.ll new file mode 100644 index 000000000000..84d72463ac0d --- /dev/null +++ b/test/Analysis/CostModel/X86/vshift-cost.ll @@ -0,0 +1,167 @@ +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2,-sse4.1 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE41 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7-avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=core-avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX2 + + +; Verify the cost of vector shift left instructions. + +; We always emit a single pmullw in the case of v8i16 vector shifts by +; non-uniform constant. + +define <8 x i16> @test1(<8 x i16> %a) { + %shl = shl <8 x i16> %a, + ret <8 x i16> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test1': +; CHECK: Found an estimated cost of 1 for instruction: %shl + + +define <8 x i16> @test2(<8 x i16> %a) { + %shl = shl <8 x i16> %a, + ret <8 x i16> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test2': +; CHECK: Found an estimated cost of 1 for instruction: %shl + + +; With SSE4.1, v4i32 shifts can be lowered into a single pmulld instruction. +; Make sure that the estimated cost is always 1 except for the case where +; we only have SSE2 support. With SSE2, we are forced to special lower the +; v4i32 mul as a 2x shuffle, 2x pmuludq, 2x shuffle. + +define <4 x i32> @test3(<4 x i32> %a) { + %shl = shl <4 x i32> %a, + ret <4 x i32> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test3': +; SSE2: Found an estimated cost of 6 for instruction: %shl +; SSE41: Found an estimated cost of 1 for instruction: %shl +; AVX: Found an estimated cost of 1 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +define <4 x i32> @test4(<4 x i32> %a) { + %shl = shl <4 x i32> %a, + ret <4 x i32> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test4': +; SSE2: Found an estimated cost of 6 for instruction: %shl +; SSE41: Found an estimated cost of 1 for instruction: %shl +; AVX: Found an estimated cost of 1 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +; On AVX2 we are able to lower the following shift into a single +; vpsllvq. Therefore, the expected cost is only 1. +; In all other cases, this shift is scalarized as the target does not support +; vpsllv instructions. + +define <2 x i64> @test5(<2 x i64> %a) { + %shl = shl <2 x i64> %a, + ret <2 x i64> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test5': +; SSE2: Found an estimated cost of 20 for instruction: %shl +; SSE41: Found an estimated cost of 20 for instruction: %shl +; AVX: Found an estimated cost of 20 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +; v16i16 and v8i32 shift left by non-uniform constant are lowered into +; vector multiply instructions. With AVX (but not AVX2), the vector multiply +; is lowered into a sequence of: 1 extract + 2 vpmullw + 1 insert. +; +; With AVX2, instruction vpmullw works with 256bit quantities and +; therefore there is no need to split the resulting vector multiply into +; a sequence of two multiply. +; +; With SSE2 and SSE4.1, the vector shift cost for 'test6' is twice +; the cost computed in the case of 'test1'. That is because the backend +; simply emits 2 pmullw with no extract/insert. + + +define <16 x i16> @test6(<16 x i16> %a) { + %shl = shl <16 x i16> %a, + ret <16 x i16> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test6': +; SSE2: Found an estimated cost of 2 for instruction: %shl +; SSE41: Found an estimated cost of 2 for instruction: %shl +; AVX: Found an estimated cost of 4 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +; With SSE2 and SSE4.1, the vector shift cost for 'test7' is twice +; the cost computed in the case of 'test3'. That is because the multiply +; is type-legalized into two 4i32 vector multiply. + +define <8 x i32> @test7(<8 x i32> %a) { + %shl = shl <8 x i32> %a, + ret <8 x i32> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test7': +; SSE2: Found an estimated cost of 12 for instruction: %shl +; SSE41: Found an estimated cost of 2 for instruction: %shl +; AVX: Found an estimated cost of 4 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +; On AVX2 we are able to lower the following shift into a single +; vpsllvq. Therefore, the expected cost is only 1. +; In all other cases, this shift is scalarized as the target does not support +; vpsllv instructions. + +define <4 x i64> @test8(<4 x i64> %a) { + %shl = shl <4 x i64> %a, + ret <4 x i64> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test8': +; SSE2: Found an estimated cost of 40 for instruction: %shl +; SSE41: Found an estimated cost of 40 for instruction: %shl +; AVX: Found an estimated cost of 40 for instruction: %shl +; AVX2: Found an estimated cost of 1 for instruction: %shl + + +; Same as 'test6', with the difference that the cost is double. + +define <32 x i16> @test9(<32 x i16> %a) { + %shl = shl <32 x i16> %a, + ret <32 x i16> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test9': +; SSE2: Found an estimated cost of 4 for instruction: %shl +; SSE41: Found an estimated cost of 4 for instruction: %shl +; AVX: Found an estimated cost of 8 for instruction: %shl +; AVX2: Found an estimated cost of 2 for instruction: %shl + + +; Same as 'test7', except that now the cost is double. + +define <16 x i32> @test10(<16 x i32> %a) { + %shl = shl <16 x i32> %a, + ret <16 x i32> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test10': +; SSE2: Found an estimated cost of 24 for instruction: %shl +; SSE41: Found an estimated cost of 4 for instruction: %shl +; AVX: Found an estimated cost of 8 for instruction: %shl +; AVX2: Found an estimated cost of 2 for instruction: %shl + + +; On AVX2 we are able to lower the following shift into a sequence of +; two vpsllvq instructions. Therefore, the expected cost is only 2. +; In all other cases, this shift is scalarized as we don't have vpsllv +; instructions. + +define <8 x i64> @test11(<8 x i64> %a) { + %shl = shl <8 x i64> %a, + ret <8 x i64> %shl +} +; CHECK: 'Cost Model Analysis' for function 'test11': +; SSE2: Found an estimated cost of 80 for instruction: %shl +; SSE41: Found an estimated cost of 80 for instruction: %shl +; AVX: Found an estimated cost of 80 for instruction: %shl +; AVX2: Found an estimated cost of 2 for instruction: %shl + + diff --git a/test/Analysis/Delinearization/a.ll b/test/Analysis/Delinearization/a.ll index 9308749b2792..efebcc42ea27 100644 --- a/test/Analysis/Delinearization/a.ll +++ b/test/Analysis/Delinearization/a.ll @@ -12,17 +12,6 @@ ; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of sizeof(i32) bytes. ; CHECK: ArrayRef[{3,+,2}<%for.i>][{-4,+,3}<%for.j>][{7,+,5}<%for.k>] -; AddRec: {{(8 + ((4 + (12 * %m)) * %o) + %A),+,(8 * %m * %o)}<%for.i>,+,(12 * %o)}<%for.j> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][%o] with elements of sizeof(i32) bytes. -; CHECK: ArrayRef[{(1 + (3 * %m)),+,(2 * %m)}<%for.i>][{2,+,(3 * %o)}<%for.j>] - -; AddRec: {(8 + ((-8 + (24 * %m)) * %o) + %A),+,(8 * %m * %o)}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of 2 bytes. -; CHECK: ArrayRef[{((1 + ((-1 + (3 * %m)) * %o)) * sizeof(i32)),+,(%m * %o * sizeof(i32))}<%for.i>] - -; Function Attrs: nounwind uwtable define void @foo(i64 %n, i64 %m, i64 %o, i32* nocapture %A) #0 { entry: %cmp32 = icmp sgt i64 %n, 0 diff --git a/test/Analysis/Delinearization/gcd_multiply_expr.ll b/test/Analysis/Delinearization/gcd_multiply_expr.ll new file mode 100644 index 000000000000..f962f6db7f2b --- /dev/null +++ b/test/Analysis/Delinearization/gcd_multiply_expr.ll @@ -0,0 +1,153 @@ +; RUN: opt < %s -basicaa -da -analyze -delinearize +; +; a, b, c, d, g, h; +; char *f; +; static fn1(p1) { +; char *e = p1; +; for (; d;) { +; a = 0; +; for (;; ++a) +; for (; b; ++b) +; c = e[b + a]; +; } +; } +; +; fn2() { +; for (;;) +; fn1(&f[g * h]); +; } + +@g = common global i32 0, align 4 +@h = common global i32 0, align 4 +@f = common global i8* null, align 4 +@a = common global i32 0, align 4 +@b = common global i32 0, align 4 +@c = common global i32 0, align 4 +@d = common global i32 0, align 4 + +define i32 @fn2() { +entry: + %.pr = load i32* @d, align 4 + %phitmp = icmp eq i32 %.pr, 0 + br label %for.cond + +for.cond: + %0 = phi i1 [ true, %for.cond ], [ %phitmp, %entry ] + br i1 %0, label %for.cond, label %for.cond2thread-pre-split.preheader.i + +for.cond2thread-pre-split.preheader.i: + %1 = load i32* @g, align 4 + %2 = load i32* @h, align 4 + %mul = mul nsw i32 %2, %1 + %3 = load i8** @f, align 4 + %.pr.pre.i = load i32* @b, align 4 + br label %for.cond2thread-pre-split.i + +for.cond2thread-pre-split.i: + %.pr.i = phi i32 [ 0, %for.inc5.i ], [ %.pr.pre.i, %for.cond2thread-pre-split.preheader.i ] + %storemerge.i = phi i32 [ %inc6.i, %for.inc5.i ], [ 0, %for.cond2thread-pre-split.preheader.i ] + store i32 %storemerge.i, i32* @a, align 4 + %tobool31.i = icmp eq i32 %.pr.i, 0 + br i1 %tobool31.i, label %for.inc5.i, label %for.body4.preheader.i + +for.body4.preheader.i: + %4 = icmp slt i32 %.pr.i, -7 + %add.i = add i32 %storemerge.i, %mul + br i1 %4, label %for.body4.i.preheader, label %for.body4.ur.i.preheader + +for.body4.i.preheader: + %5 = sub i32 -8, %.pr.i + %6 = lshr i32 %5, 3 + %7 = mul i32 %6, 8 + br label %for.body4.i + +for.body4.i: + %8 = phi i32 [ %inc.7.i, %for.body4.i ], [ %.pr.i, %for.body4.i.preheader ] + %arrayidx.sum1 = add i32 %add.i, %8 + %arrayidx.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum1 + %9 = load i8* %arrayidx.i, align 1 + %conv.i = sext i8 %9 to i32 + store i32 %conv.i, i32* @c, align 4 + %inc.i = add nsw i32 %8, 1 + store i32 %inc.i, i32* @b, align 4 + %arrayidx.sum2 = add i32 %add.i, %inc.i + %arrayidx.1.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum2 + %10 = load i8* %arrayidx.1.i, align 1 + %conv.1.i = sext i8 %10 to i32 + store i32 %conv.1.i, i32* @c, align 4 + %inc.1.i = add nsw i32 %8, 2 + store i32 %inc.1.i, i32* @b, align 4 + %arrayidx.sum3 = add i32 %add.i, %inc.1.i + %arrayidx.2.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum3 + %11 = load i8* %arrayidx.2.i, align 1 + %conv.2.i = sext i8 %11 to i32 + store i32 %conv.2.i, i32* @c, align 4 + %inc.2.i = add nsw i32 %8, 3 + store i32 %inc.2.i, i32* @b, align 4 + %arrayidx.sum4 = add i32 %add.i, %inc.2.i + %arrayidx.3.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum4 + %12 = load i8* %arrayidx.3.i, align 1 + %conv.3.i = sext i8 %12 to i32 + store i32 %conv.3.i, i32* @c, align 4 + %inc.3.i = add nsw i32 %8, 4 + store i32 %inc.3.i, i32* @b, align 4 + %arrayidx.sum5 = add i32 %add.i, %inc.3.i + %arrayidx.4.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum5 + %13 = load i8* %arrayidx.4.i, align 1 + %conv.4.i = sext i8 %13 to i32 + store i32 %conv.4.i, i32* @c, align 4 + %inc.4.i = add nsw i32 %8, 5 + store i32 %inc.4.i, i32* @b, align 4 + %arrayidx.sum6 = add i32 %add.i, %inc.4.i + %arrayidx.5.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum6 + %14 = load i8* %arrayidx.5.i, align 1 + %conv.5.i = sext i8 %14 to i32 + store i32 %conv.5.i, i32* @c, align 4 + %inc.5.i = add nsw i32 %8, 6 + store i32 %inc.5.i, i32* @b, align 4 + %arrayidx.sum7 = add i32 %add.i, %inc.5.i + %arrayidx.6.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum7 + %15 = load i8* %arrayidx.6.i, align 1 + %conv.6.i = sext i8 %15 to i32 + store i32 %conv.6.i, i32* @c, align 4 + %inc.6.i = add nsw i32 %8, 7 + store i32 %inc.6.i, i32* @b, align 4 + %arrayidx.sum8 = add i32 %add.i, %inc.6.i + %arrayidx.7.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum8 + %16 = load i8* %arrayidx.7.i, align 1 + %conv.7.i = sext i8 %16 to i32 + store i32 %conv.7.i, i32* @c, align 4 + %inc.7.i = add nsw i32 %8, 8 + store i32 %inc.7.i, i32* @b, align 4 + %tobool3.7.i = icmp sgt i32 %inc.7.i, -8 + br i1 %tobool3.7.i, label %for.inc5.loopexit.ur-lcssa.i, label %for.body4.i + +for.inc5.loopexit.ur-lcssa.i: + %17 = add i32 %.pr.i, 8 + %18 = add i32 %17, %7 + %19 = icmp eq i32 %18, 0 + br i1 %19, label %for.inc5.i, label %for.body4.ur.i.preheader + +for.body4.ur.i.preheader: + %.ph = phi i32 [ %18, %for.inc5.loopexit.ur-lcssa.i ], [ %.pr.i, %for.body4.preheader.i ] + br label %for.body4.ur.i + +for.body4.ur.i: + %20 = phi i32 [ %inc.ur.i, %for.body4.ur.i ], [ %.ph, %for.body4.ur.i.preheader ] + %arrayidx.sum = add i32 %add.i, %20 + %arrayidx.ur.i = getelementptr inbounds i8* %3, i32 %arrayidx.sum + %21 = load i8* %arrayidx.ur.i, align 1 + %conv.ur.i = sext i8 %21 to i32 + store i32 %conv.ur.i, i32* @c, align 4 + %inc.ur.i = add nsw i32 %20, 1 + store i32 %inc.ur.i, i32* @b, align 4 + %tobool3.ur.i = icmp eq i32 %inc.ur.i, 0 + br i1 %tobool3.ur.i, label %for.inc5.i.loopexit, label %for.body4.ur.i + +for.inc5.i.loopexit: + br label %for.inc5.i + +for.inc5.i: + %inc6.i = add nsw i32 %storemerge.i, 1 + br label %for.cond2thread-pre-split.i +} diff --git a/test/Analysis/Delinearization/himeno_1.ll b/test/Analysis/Delinearization/himeno_1.ll index 9458bd2e5261..c94ca7aff759 100644 --- a/test/Analysis/Delinearization/himeno_1.ll +++ b/test/Analysis/Delinearization/himeno_1.ll @@ -31,16 +31,6 @@ ; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.cols to i64)][(sext i32 %a.deps to i64)] with elements of sizeof(float) bytes. ; CHECK: ArrayRef[{1,+,1}<%for.i>][{1,+,1}<%for.j>][{1,+,1}<%for.k>] -; AddRec: {{(-4 + (4 * (sext i32 (-1 + %p.deps) to i64)) + (4 * (sext i32 %a.deps to i64) * (1 + (sext i32 %a.cols to i64))) + %a.base),+,(4 * (sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i>,+,(4 * (sext i32 %a.deps to i64))}<%for.j> -; CHECK: Base offset: %a.base -; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.deps to i64)] with elements of sizeof(float) bytes. -; CHECK: ArrayRef[{(1 + (sext i32 %a.cols to i64)),+,(sext i32 %a.cols to i64)}<%for.i>][{(-1 + (sext i32 (-1 + %p.deps) to i64)),+,(sext i32 %a.deps to i64)}<%for.j>] - -; AddRec: {(-4 + (4 * (sext i32 (-1 + %p.deps) to i64)) + ((sext i32 %a.deps to i64) * (-4 + (4 * (sext i32 (-1 + %p.cols) to i64)) + (4 * (sext i32 %a.cols to i64)))) + %a.base),+,(4 * (sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i> -; CHECK: Base offset: %a.base -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(float) bytes. -; CHECK: ArrayRef[{(-1 + (sext i32 (-1 + %p.deps) to i64) + ((sext i32 %a.deps to i64) * (-1 + (sext i32 (-1 + %p.cols) to i64) + (sext i32 %a.cols to i64)))),+,((sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i>] - %struct.Mat = type { float*, i32, i32, i32, i32 } define void @jacobi(i32 %nn, %struct.Mat* nocapture %a, %struct.Mat* nocapture %p) nounwind uwtable { diff --git a/test/Analysis/Delinearization/himeno_2.ll b/test/Analysis/Delinearization/himeno_2.ll index a29006606fab..c256384f201e 100644 --- a/test/Analysis/Delinearization/himeno_2.ll +++ b/test/Analysis/Delinearization/himeno_2.ll @@ -31,16 +31,6 @@ ; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.cols to i64)][(sext i32 %a.deps to i64)] with elements of sizeof(float) bytes. ; CHECK: ArrayRef[{1,+,1}<%for.i>][{1,+,1}<%for.j>][{1,+,1}<%for.k>] -; AddRec: {{(-4 + (4 * (sext i32 (-1 + %p.deps) to i64)) + (4 * (sext i32 %a.deps to i64) * (1 + (sext i32 %a.cols to i64))) + %a.base),+,(4 * (sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i>,+,(4 * (sext i32 %a.deps to i64))}<%for.j> -; CHECK: Base offset: %a.base -; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.deps to i64)] with elements of sizeof(float) bytes. -; CHECK: ArrayRef[{(1 + (sext i32 %a.cols to i64)),+,(sext i32 %a.cols to i64)}<%for.i>][{(-1 + (sext i32 (-1 + %p.deps) to i64)),+,(sext i32 %a.deps to i64)}<%for.j>] - -; AddRec: {(-4 + (4 * (sext i32 (-1 + %p.deps) to i64)) + ((sext i32 %a.deps to i64) * (-4 + (4 * (sext i32 (-1 + %p.cols) to i64)) + (4 * (sext i32 %a.cols to i64)))) + %a.base),+,(4 * (sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i> -; CHECK: Base offset: %a.base -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(float) bytes. -; CHECK: ArrayRef[{(-1 + (sext i32 (-1 + %p.deps) to i64) + ((sext i32 %a.deps to i64) * (-1 + (sext i32 (-1 + %p.cols) to i64) + (sext i32 %a.cols to i64)))),+,((sext i32 %a.deps to i64) * (sext i32 %a.cols to i64))}<%for.i>] - %struct.Mat = type { float*, i32, i32, i32, i32 } define void @jacobi(i32 %nn, %struct.Mat* nocapture %a, %struct.Mat* nocapture %p) nounwind uwtable { diff --git a/test/Analysis/Delinearization/iv_times_constant_in_subscript.ll b/test/Analysis/Delinearization/iv_times_constant_in_subscript.ll new file mode 100644 index 000000000000..01a4b96b11a0 --- /dev/null +++ b/test/Analysis/Delinearization/iv_times_constant_in_subscript.ll @@ -0,0 +1,45 @@ +; RUN: opt < %s -analyze -delinearize | FileCheck %s + +; Derived from the following code: +; +; void foo(long n, long m, long b, double A[n][m]) { +; for (long i = 0; i < n; i++) +; for (long j = 0; j < m; j++) +; A[2i+b][2j] = 1.0; +; } + +; AddRec: {{((%m * %b * sizeof(double)) + %A),+,(2 * %m * sizeof(double))}<%for.i>,+,(2 * sizeof(double))}<%for.j> +; CHECK: Base offset: %A +; CHECK: ArrayDecl[UnknownSize][%m] with elements of sizeof(double) bytes. +; CHECK: ArrayRef[{%b,+,2}<%for.i>][{0,+,2}<%for.j>] + + +define void @foo(i64 %n, i64 %m, i64 %b, double* %A) { +entry: + br label %for.i + +for.i: + %i = phi i64 [ 0, %entry ], [ %i.inc, %for.i.inc ] + %outerdim = mul nsw i64 %i, 2 + %outerdim2 = add nsw i64 %outerdim, %b + %tmp = mul nsw i64 %outerdim2, %m + br label %for.j + +for.j: + %j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ] + %prodj = mul i64 %j, 2 + %vlaarrayidx.sum = add i64 %prodj, %tmp + %arrayidx = getelementptr inbounds double* %A, i64 %vlaarrayidx.sum + store double 1.0, double* %arrayidx + %j.inc = add nsw i64 %j, 1 + %j.exitcond = icmp eq i64 %j.inc, %m + br i1 %j.exitcond, label %for.i.inc, label %for.j + +for.i.inc: + %i.inc = add nsw i64 %i, 1 + %i.exitcond = icmp eq i64 %i.inc, %n + br i1 %i.exitcond, label %end, label %for.i + +end: + ret void +} diff --git a/test/Analysis/Delinearization/lit.local.cfg b/test/Analysis/Delinearization/lit.local.cfg index 19eebc0ac7ac..c6106e4746f2 100644 --- a/test/Analysis/Delinearization/lit.local.cfg +++ b/test/Analysis/Delinearization/lit.local.cfg @@ -1 +1 @@ -config.suffixes = ['.ll', '.c', '.cpp'] +config.suffixes = ['.ll'] diff --git a/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll b/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll index 82cab167c74f..ae80ebc52271 100644 --- a/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll +++ b/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll @@ -13,16 +13,6 @@ ; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of sizeof(double) bytes. ; CHECK: ArrayRef[{3,+,1}<%for.i>][{-4,+,1}<%for.j>][{7,+,1}<%for.k>] -; AddRec: {{(48 + ((-24 + (24 * %m)) * %o) + %A),+,(8 * %m * %o)}<%for.i>,+,(8 * %o)}<%for.j> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][%o] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(-3 + (3 * %m)),+,%m}<%for.i>][{6,+,%o}<%for.j>] - -; AddRec: {(48 + ((-32 + (32 * %m)) * %o) + %A),+,(8 * %m * %o)}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(6 + ((-4 + (4 * %m)) * %o)),+,(%m * %o)}<%for.i>] - define void @foo(i64 %n, i64 %m, i64 %o, double* %A) { entry: br label %for.i diff --git a/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_nts_3d.ll b/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_nts_3d.ll index a1e779fff6c9..75080dad3af7 100644 --- a/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_nts_3d.ll +++ b/test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_nts_3d.ll @@ -13,16 +13,6 @@ ; CHECK: ArrayDecl[UnknownSize][%m][(%o + %p)] with elements of sizeof(double) bytes. ; CHECK: ArrayRef[{3,+,1}<%for.cond4.preheader.lr.ph.us>][{-4,+,1}<%for.body6.lr.ph.us.us>][{7,+,1}<%for.body6.us.us>] -; AddRec: {{(48 + (8 * %o) + (8 * (-4 + (3 * %m)) * (%o + %p)) + %A),+,(8 * (%o + %p) * %m)}<%for.cond4.preheader.lr.ph.us>,+,(8 * (%o + %p))}<%for.body6.lr.ph.us.us> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][(%o + %p)] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(-4 + (3 * %m)),+,%m}<%for.cond4.preheader.lr.ph.us>][{(6 + %o),+,(%o + %p)}<%for.body6.lr.ph.us.us>] - -; AddRec: {(48 + (8 * %o) + ((-40 + (32 * %m)) * (%o + %p)) + %A),+,(8 * (%o + %p) * %m)}<%for.cond4.preheader.lr.ph.us> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(6 + ((-5 + (4 * %m)) * (%o + %p)) + %o),+,((%o + %p) * %m)}<%for.cond4.preheader.lr.ph.us>] - define void @foo(i64 %n, i64 %m, i64 %o, i64 %p, double* nocapture %A) nounwind uwtable { entry: %add = add nsw i64 %p, %o diff --git a/test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll b/test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll index a52a4c93ce23..e921444668d0 100644 --- a/test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll +++ b/test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll @@ -13,16 +13,6 @@ ; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of sizeof(double) bytes. ; CHECK: ArrayRef[{%p,+,1}<%for.i>][{%q,+,1}<%for.j>][{%r,+,1}<%for.k>] -; AddRec: {{(-8 + (8 * ((((%m * %p) + %q) * %o) + %r)) + (8 * %o) + %A),+,(8 * %m * %o)}<%for.i>,+,(8 * %o)}<%for.j> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][%o] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(1 + (%m * %p) + %q),+,%m}<%for.i>][{(-1 + %r),+,%o}<%for.j>] - -; AddRec: {(-8 + (8 * ((((%m * %p) + %q) * %o) + %r)) + (8 * %m * %o) + %A),+,(8 * %m * %o)}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(-1 + ((((1 + %p) * %m) + %q) * %o) + %r),+,(%m * %o)}<%for.i>] - define void @foo(i64 %n, i64 %m, i64 %o, double* %A, i64 %p, i64 %q, i64 %r) { entry: br label %for.i diff --git a/test/Analysis/Delinearization/multidim_only_ivs_2d.ll b/test/Analysis/Delinearization/multidim_only_ivs_2d.ll index d68a15883942..5a88c4ce4eb1 100644 --- a/test/Analysis/Delinearization/multidim_only_ivs_2d.ll +++ b/test/Analysis/Delinearization/multidim_only_ivs_2d.ll @@ -8,16 +8,20 @@ ; A[i][j] = 1.0; ; } +; Inst: %val = load double* %arrayidx +; In Loop with Header: for.j +; AddRec: {{0,+,(%m * sizeof(double))}<%for.i>,+,sizeof(double)}<%for.j> +; Base offset: %A +; ArrayDecl[UnknownSize][%m] with elements of sizeof(double) bytes. +; ArrayRef[{0,+,1}<%for.i>][{0,+,1}<%for.j>] + +; Inst: store double %val, double* %arrayidx +; In Loop with Header: for.j ; AddRec: {{%A,+,(8 * %m)}<%for.i>,+,8}<%for.j> ; CHECK: Base offset: %A ; CHECK: ArrayDecl[UnknownSize][%m] with elements of sizeof(double) bytes. ; CHECK: ArrayRef[{0,+,1}<%for.i>][{0,+,1}<%for.j>] -; AddRec: {(-8 + (8 * %m) + %A),+,(8 * %m)}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(-1 + %m),+,%m}<%for.i>] - define void @foo(i64 %n, i64 %m, double* %A) { entry: br label %for.i @@ -31,7 +35,8 @@ for.j: %j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ] %vlaarrayidx.sum = add i64 %j, %tmp %arrayidx = getelementptr inbounds double* %A, i64 %vlaarrayidx.sum - store double 1.0, double* %arrayidx + %val = load double* %arrayidx + store double %val, double* %arrayidx %j.inc = add nsw i64 %j, 1 %j.exitcond = icmp eq i64 %j.inc, %m br i1 %j.exitcond, label %for.i.inc, label %for.j diff --git a/test/Analysis/Delinearization/multidim_only_ivs_2d_nested.ll b/test/Analysis/Delinearization/multidim_only_ivs_2d_nested.ll index 7207420205aa..810188f7d552 100644 --- a/test/Analysis/Delinearization/multidim_only_ivs_2d_nested.ll +++ b/test/Analysis/Delinearization/multidim_only_ivs_2d_nested.ll @@ -1,4 +1,6 @@ ; RUN: opt < %s -analyze -delinearize | FileCheck %s +; XFAIL: * +; We do not recognize anymore variable size arrays. ; extern void bar(long n, long m, double A[n][m]); ; diff --git a/test/Analysis/Delinearization/multidim_only_ivs_3d.ll b/test/Analysis/Delinearization/multidim_only_ivs_3d.ll index 24f95837c860..aad0f0940840 100644 --- a/test/Analysis/Delinearization/multidim_only_ivs_3d.ll +++ b/test/Analysis/Delinearization/multidim_only_ivs_3d.ll @@ -13,16 +13,6 @@ ; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of sizeof(double) bytes. ; CHECK: ArrayRef[{0,+,1}<%for.i>][{0,+,1}<%for.j>][{0,+,1}<%for.k>] -; AddRec: {{(-8 + (8 * %o) + %A),+,(8 * %m * %o)}<%for.i>,+,(8 * %o)}<%for.j> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][(%m * %o)] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{0,+,1}<%for.i>][{(-1 + %o),+,%o}<%for.j>] - -; AddRec: {(-8 + (8 * %m * %o) + %A),+,(8 * %m * %o)}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of sizeof(double) bytes. -; CHECK: ArrayRef[{(-1 + (%m * %o)),+,(%m * %o)}<%for.i>] - define void @foo(i64 %n, i64 %m, i64 %o, double* %A) { entry: br label %for.i diff --git a/test/Analysis/Delinearization/multidim_only_ivs_3d_cast.ll b/test/Analysis/Delinearization/multidim_only_ivs_3d_cast.ll index e1516104ddfc..9e406d125f44 100644 --- a/test/Analysis/Delinearization/multidim_only_ivs_3d_cast.ll +++ b/test/Analysis/Delinearization/multidim_only_ivs_3d_cast.ll @@ -12,16 +12,6 @@ ; CHECK: ArrayDecl[UnknownSize][(zext i32 %m to i64)][(zext i32 %o to i64)] with elements of 8 bytes. ; CHECK: ArrayRef[{0,+,1}<%for.i>][{0,+,1}<%for.j>][{0,+,1}<%for.k>] -; AddRec: {{((8 * (zext i32 (-1 + %o) to i64)) + %A),+,(8 * (zext i32 %m to i64) * (zext i32 %o to i64))}<%for.i>,+,(8 * (zext i32 %o to i64))}<%for.j> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize][((zext i32 %m to i64) * (zext i32 %o to i64))] with elements of 8 bytes. -; CHECK: ArrayRef[{0,+,1}<%for.i>][{(zext i32 (-1 + %o) to i64),+,(zext i32 %o to i64)}<%for.j>] - -; AddRec: {((8 * (zext i32 (-1 + %o) to i64)) + (8 * (zext i32 (-1 + %m) to i64) * (zext i32 %o to i64)) + %A),+,(8 * (zext i32 %m to i64) * (zext i32 %o to i64))}<%for.i> -; CHECK: Base offset: %A -; CHECK: ArrayDecl[UnknownSize] with elements of 8 bytes. -; CHECK: ArrayRef[{((zext i32 (-1 + %o) to i64) + ((zext i32 (-1 + %m) to i64) * (zext i32 %o to i64))),+,((zext i32 %m to i64) * (zext i32 %o to i64))}<%for.i>] - 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" diff --git a/test/Analysis/Delinearization/multidim_two_accesses_different_delinearization.ll b/test/Analysis/Delinearization/multidim_two_accesses_different_delinearization.ll new file mode 100644 index 000000000000..6a98507340ac --- /dev/null +++ b/test/Analysis/Delinearization/multidim_two_accesses_different_delinearization.ll @@ -0,0 +1,43 @@ +; RUN: opt -basicaa -da -analyze -da-delinearize < %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" + +; Derived from the following code: +; +; void foo(long n, long m, double *A) { +; for (long i = 0; i < n; i++) +; for (long j = 0; j < m; j++) +; *(A + i * n + j) = 1.0; +; *(A + j * m + i) = 2.0; +; } + +define void @foo(i64 %n, i64 %m, double* %A) { +entry: + br label %for.i + +for.i: + %i = phi i64 [ 0, %entry ], [ %i.inc, %for.i.inc ] + br label %for.j + +for.j: + %j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ] + %tmp = mul nsw i64 %i, %m + %vlaarrayidx.sum = add i64 %j, %tmp + %arrayidx = getelementptr inbounds double* %A, i64 %vlaarrayidx.sum + store double 1.0, double* %arrayidx + %tmp1 = mul nsw i64 %j, %n + %vlaarrayidx.sum1 = add i64 %i, %tmp1 + %arrayidx1 = getelementptr inbounds double* %A, i64 %vlaarrayidx.sum1 + store double 1.0, double* %arrayidx1 + %j.inc = add nsw i64 %j, 1 + %j.exitcond = icmp eq i64 %j.inc, %m + br i1 %j.exitcond, label %for.i.inc, label %for.j + +for.i.inc: + %i.inc = add nsw i64 %i, 1 + %i.exitcond = icmp eq i64 %i.inc, %n + br i1 %i.exitcond, label %end, label %for.i + +end: + ret void +} diff --git a/test/Analysis/Delinearization/undef.ll b/test/Analysis/Delinearization/undef.ll new file mode 100644 index 000000000000..8ee64e3a2f40 --- /dev/null +++ b/test/Analysis/Delinearization/undef.ll @@ -0,0 +1,38 @@ +; RUN: opt < %s -analyze -delinearize +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @foo(double* %Ey) { +entry: + br i1 undef, label %for.cond55.preheader, label %for.end324 + +for.cond55.preheader: + %iz.069 = phi i64 [ %inc323, %for.inc322 ], [ 0, %entry ] + br i1 undef, label %for.cond58.preheader, label %for.inc322 + +for.cond58.preheader: + %iy.067 = phi i64 [ %inc320, %for.end ], [ 0, %for.cond55.preheader ] + br i1 undef, label %for.body60, label %for.end + +for.body60: + %ix.062 = phi i64 [ %inc, %for.body60 ], [ 0, %for.cond58.preheader ] + %0 = mul i64 %iz.069, undef + %tmp5 = add i64 %iy.067, %0 + %tmp6 = mul i64 %tmp5, undef + %arrayidx69.sum = add i64 undef, %tmp6 + %arrayidx70 = getelementptr inbounds double* %Ey, i64 %arrayidx69.sum + %1 = load double* %arrayidx70, align 8 + %inc = add nsw i64 %ix.062, 1 + br i1 false, label %for.body60, label %for.end + +for.end: + %inc320 = add nsw i64 %iy.067, 1 + br i1 undef, label %for.cond58.preheader, label %for.inc322 + +for.inc322: + %inc323 = add nsw i64 %iz.069, 1 + br i1 undef, label %for.cond55.preheader, label %for.end324 + +for.end324: + ret void +} diff --git a/test/Analysis/DependenceAnalysis/Banerjee.ll b/test/Analysis/DependenceAnalysis/Banerjee.ll index 09e8fd29dcc4..883a06d0bed5 100644 --- a/test/Analysis/DependenceAnalysis/Banerjee.ll +++ b/test/Analysis/DependenceAnalysis/Banerjee.ll @@ -1,4 +1,5 @@ -; RUN: opt < %s -analyze -basicaa -da | FileCheck %s +; RUN: opt < %s -analyze -basicaa -da -da-delinearize=false | FileCheck %s +; RUN: opt < %s -analyze -basicaa -da -da-delinearize | FileCheck %s -check-prefix=DELIN ; ModuleID = 'Banerjee.bc' 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" @@ -21,6 +22,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee0': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [<= <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 1, %entry ], [ %inc8, %for.inc7 ] @@ -73,6 +82,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - output [* *]! +; DELIN: 'Dependence Analysis' for function 'banerjee1': +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [* <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - output [* *]! + for.cond1.preheader.preheader: ; preds = %entry %0 = add i64 %n, 1 br label %for.cond1.preheader @@ -140,6 +157,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee2': +; DELIN: da analyze - none! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -191,6 +216,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee3': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [> >]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -242,6 +275,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee4': +; DELIN: da analyze - none! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] @@ -293,6 +334,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee5': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [< <]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] @@ -344,6 +393,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee6': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [=> <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -395,6 +452,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee7': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [> <=]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -446,6 +511,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee8': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [> <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -497,6 +570,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee9': +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [<= =|<]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -549,6 +630,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee10': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [<> =]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] @@ -600,6 +689,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee11': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [<= <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] @@ -651,6 +748,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'banerjee12': +; DELIN: da analyze - none! +; DELIN: da analyze - flow [= <>]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i64* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] diff --git a/test/Analysis/DependenceAnalysis/GCD.ll b/test/Analysis/DependenceAnalysis/GCD.ll index bb31d118857d..7eca18ed262c 100644 --- a/test/Analysis/DependenceAnalysis/GCD.ll +++ b/test/Analysis/DependenceAnalysis/GCD.ll @@ -1,4 +1,5 @@ -; RUN: opt < %s -analyze -basicaa -da | FileCheck %s +; RUN: opt < %s -analyze -basicaa -da -da-delinearize=false | FileCheck %s +; RUN: opt < %s -analyze -basicaa -da -da-delinearize | FileCheck %s -check-prefix=DELIN ; ModuleID = 'GCD.bc' 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" @@ -22,6 +23,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd0' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [=> *|<]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc8 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc8 ] %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] @@ -75,6 +84,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd1' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc9 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc9 ] %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ] @@ -129,6 +146,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd2' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc9 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc9 ] %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ] @@ -183,6 +208,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd3' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [<> *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc7 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc7 ] %i.03 = phi i64 [ 0, %entry ], [ %inc8, %for.inc7 ] @@ -235,6 +268,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd4' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc17 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc17 ] %i.03 = phi i64 [ 0, %entry ], [ %inc18, %for.inc17 ] @@ -297,6 +338,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - none! +; DELIN: 'Dependence Analysis' for function 'gcd5' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [<> *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - none! + for.cond1.preheader: ; preds = %entry, %for.inc17 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc17 ] %i.03 = phi i64 [ 0, %entry ], [ %inc18, %for.inc17 ] @@ -360,6 +409,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - output [* *]! +; DELIN: 'Dependence Analysis' for function 'gcd6' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - output [* *]! + for.cond1.preheader.preheader: ; preds = %entry br label %for.cond1.preheader @@ -432,6 +489,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - output [* *]! +; DELIN: 'Dependence Analysis' for function 'gcd7' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [* *|<]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - output [* *]! + for.cond1.preheader.preheader: ; preds = %entry br label %for.cond1.preheader @@ -516,6 +581,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - output [* *]! +; DELIN: 'Dependence Analysis' for function 'gcd8' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - none! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - output [* *]! + for.cond1.preheader.preheader: ; preds = %entry br label %for.cond1.preheader @@ -595,6 +668,14 @@ entry: ; CHECK: da analyze - confused! ; CHECK: da analyze - output [* *]! +; DELIN: 'Dependence Analysis' for function 'gcd9' +; DELIN: da analyze - output [* *]! +; DELIN: da analyze - flow [* *|<]! +; DELIN: da analyze - confused! +; DELIN: da analyze - input [* *]! +; DELIN: da analyze - confused! +; DELIN: da analyze - output [* *]! + for.cond1.preheader.preheader: ; preds = %entry br label %for.cond1.preheader diff --git a/test/Analysis/LazyCallGraph/basic.ll b/test/Analysis/LazyCallGraph/basic.ll new file mode 100644 index 000000000000..b8108d99ed6f --- /dev/null +++ b/test/Analysis/LazyCallGraph/basic.ll @@ -0,0 +1,176 @@ +; RUN: opt -disable-output -passes=print-cg %s 2>&1 | FileCheck %s +; +; Basic validation of the call graph analysis used in the new pass manager. + +define void @f() { +; CHECK-LABEL: Call edges in function: f +; CHECK-NOT: -> + +entry: + ret void +} + +; A bunch more functions just to make it easier to test several call edges at once. +define void @f1() { + ret void +} +define void @f2() { + ret void +} +define void @f3() { + ret void +} +define void @f4() { + ret void +} +define void @f5() { + ret void +} +define void @f6() { + ret void +} +define void @f7() { + ret void +} +define void @f8() { + ret void +} +define void @f9() { + ret void +} +define void @f10() { + ret void +} +define void @f11() { + ret void +} +define void @f12() { + ret void +} + +declare i32 @__gxx_personality_v0(...) + +define void @test0() { +; CHECK-LABEL: Call edges in function: test0 +; CHECK-NEXT: -> f +; CHECK-NOT: -> + +entry: + call void @f() + call void @f() + call void @f() + call void @f() + ret void +} + +define void ()* @test1(void ()** %x) { +; CHECK-LABEL: Call edges in function: test1 +; CHECK-NEXT: -> f12 +; CHECK-NEXT: -> f11 +; CHECK-NEXT: -> f10 +; CHECK-NEXT: -> f7 +; CHECK-NEXT: -> f9 +; CHECK-NEXT: -> f8 +; CHECK-NEXT: -> f6 +; CHECK-NEXT: -> f5 +; CHECK-NEXT: -> f4 +; CHECK-NEXT: -> f3 +; CHECK-NEXT: -> f2 +; CHECK-NEXT: -> f1 +; CHECK-NOT: -> + +entry: + br label %next + +dead: + br label %next + +next: + phi void ()* [ @f1, %entry ], [ @f2, %dead ] + select i1 true, void ()* @f3, void ()* @f4 + store void ()* @f5, void ()** %x + call void @f6() + call void (void ()*, void ()*)* bitcast (void ()* @f7 to void (void ()*, void ()*)*)(void ()* @f8, void ()* @f9) + invoke void @f10() to label %exit unwind label %unwind + +exit: + ret void ()* @f11 + +unwind: + %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } { i8* bitcast (void ()* @f12 to i8*), i32 42 } +} + +@g = global void ()* @f1 +@g1 = global [4 x void ()*] [void ()* @f2, void ()* @f3, void ()* @f4, void ()* @f5] +@g2 = global {i8, void ()*, i8} {i8 1, void ()* @f6, i8 2} +@h = constant void ()* @f7 + +define void @test2() { +; CHECK-LABEL: Call edges in function: test2 +; CHECK-NEXT: -> f7 +; CHECK-NEXT: -> f6 +; CHECK-NEXT: -> f5 +; CHECK-NEXT: -> f4 +; CHECK-NEXT: -> f3 +; CHECK-NEXT: -> f2 +; CHECK-NEXT: -> f1 +; CHECK-NOT: -> + + load i8** bitcast (void ()** @g to i8**) + load i8** bitcast (void ()** getelementptr ([4 x void ()*]* @g1, i32 0, i32 2) to i8**) + load i8** bitcast (void ()** getelementptr ({i8, void ()*, i8}* @g2, i32 0, i32 1) to i8**) + load i8** bitcast (void ()** @h to i8**) + ret void +} + +; Verify the SCCs formed. +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f7 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f6 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f5 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f4 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f3 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f2 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f1 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: test2 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f12 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f11 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f10 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f9 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f8 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: test1 +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: f +; +; CHECK-LABEL: SCC with 1 functions: +; CHECK-NEXT: test0 diff --git a/test/Analysis/Lint/address-spaces.ll b/test/Analysis/Lint/address-spaces.ll new file mode 100644 index 000000000000..46ee1d734baf --- /dev/null +++ b/test/Analysis/Lint/address-spaces.ll @@ -0,0 +1,25 @@ +; RUN: opt -lint < %s + +target datalayout = "p32:32:32-p1:16:16:16-n16:32" + +declare void @foo(i64) nounwind + +define i64 @test1(i32 addrspace(1)* %x) nounwind { + %y = ptrtoint i32 addrspace(1)* %x to i64 + ret i64 %y +} + +define <4 x i64> @test1_vector(<4 x i32 addrspace(1)*> %x) nounwind { + %y = ptrtoint <4 x i32 addrspace(1)*> %x to <4 x i64> + ret <4 x i64> %y +} + +define i32 addrspace(1)* @test2(i64 %x) nounwind { + %y = inttoptr i64 %x to i32 addrspace(1)* + ret i32 addrspace(1)* %y +} + +define <4 x i32 addrspace(1)*> @test2_vector(<4 x i64> %x) nounwind { + %y = inttoptr <4 x i64> %x to <4 x i32 addrspace(1)*> + ret <4 x i32 addrspace(1)*> %y +} \ No newline at end of file diff --git a/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll b/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll index 3dacfbb0a8d4..a845465a26b5 100644 --- a/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll +++ b/test/Analysis/ScalarEvolution/2009-04-22-TruncCast.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -analyze -scalar-evolution | grep "(trunc i" | not grep ext +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test1' ; CHECK-NOT: (trunc i{{.*}}ext diff --git a/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll b/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll index b88e33f2bb8a..5746d1c5900c 100644 --- a/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll +++ b/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -basicaa -globalopt -instcombine -loop-rotate -licm -instcombine -indvars -loop-deletion -constmerge -S +; RUN: opt < %s -basicaa -globalopt -instcombine -loop-rotate -licm -instcombine -indvars -loop-deletion -constmerge -S | FileCheck %s ; PR11882: ComputeLoadConstantCompareExitLimit crash. ; ; for.body is deleted leaving a loop-invariant load. diff --git a/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll b/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll index 52e6683c9f01..66df9d19234f 100644 --- a/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll +++ b/test/Analysis/ScalarEvolution/2012-05-18-LoopPredRecurse.ll @@ -4,7 +4,7 @@ ; getUDivExpr()->getZeroExtendExpr()->isLoopBackedgeGuardedBy() ; ; We actually want SCEV simplification to fail gracefully in this -; case, so there's no output to check, just the absense of stack overflow. +; case, so there's no output to check, just the absence of stack overflow. @c = common global i8 0, align 1 diff --git a/test/Analysis/ScalarEvolution/and-xor.ll b/test/Analysis/ScalarEvolution/and-xor.ll index 404ab91e269d..ad636da4d4d7 100644 --- a/test/Analysis/ScalarEvolution/and-xor.ll +++ b/test/Analysis/ScalarEvolution/and-xor.ll @@ -1,11 +1,27 @@ ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s +; CHECK-LABEL: @test1 ; CHECK: --> (zext ; CHECK: --> (zext ; CHECK-NOT: --> (zext -define i32 @foo(i32 %x) { +define i32 @test1(i32 %x) { %n = and i32 %x, 255 %y = xor i32 %n, 255 ret i32 %y } + +; ScalarEvolution shouldn't try to analyze %z into something like +; --> (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64) +; or +; --> (8 * (zext i1 (trunc i64 ((8 * %x) /u 8) to i1) to i64)) + +; CHECK-LABEL: @test2 +; CHECK: --> (8 * (zext i1 (trunc i64 %x to i1) to i64)) + +define i64 @test2(i64 %x) { + %a = shl i64 %x, 3 + %t = and i64 %a, 8 + %z = xor i64 %t, 8 + ret i64 %z +} diff --git a/test/Analysis/ScalarEvolution/fold.ll b/test/Analysis/ScalarEvolution/fold.ll index 57006dd9bb42..ab5742557b33 100644 --- a/test/Analysis/ScalarEvolution/fold.ll +++ b/test/Analysis/ScalarEvolution/fold.ll @@ -60,3 +60,29 @@ loop: exit: ret void } + +define void @test5(i32 %i) { +; CHECK-LABEL: @test5 + %A = and i32 %i, 1 +; CHECK: --> (zext i1 (trunc i32 %i to i1) to i32) + %B = and i32 %i, 2 +; CHECK: --> (2 * (zext i1 (trunc i32 (%i /u 2) to i1) to i32)) + %C = and i32 %i, 63 +; CHECK: --> (zext i6 (trunc i32 %i to i6) to i32) + %D = and i32 %i, 126 +; CHECK: --> (2 * (zext i6 (trunc i32 (%i /u 2) to i6) to i32)) + %E = and i32 %i, 64 +; CHECK: --> (64 * (zext i1 (trunc i32 (%i /u 64) to i1) to i32)) + %F = and i32 %i, -2147483648 +; CHECK: --> (-2147483648 * (%i /u -2147483648)) + ret void +} + +define void @test6(i8 %x) { +; CHECK-LABEL: @test6 + %A = zext i8 %x to i16 + %B = shl nuw i16 %A, 8 + %C = and i16 %B, -2048 +; CHECK: --> (2048 * ((zext i8 %x to i16) /u 8)) + ret void +} diff --git a/test/Analysis/ScalarEvolution/max-trip-count.ll b/test/Analysis/ScalarEvolution/max-trip-count.ll index 0cdbdf57a64c..31f06a46ad00 100644 --- a/test/Analysis/ScalarEvolution/max-trip-count.ll +++ b/test/Analysis/ScalarEvolution/max-trip-count.ll @@ -98,3 +98,112 @@ for.end: ; preds = %for.cond.for.end_cr ; CHECK: Determining loop execution counts for: @test ; CHECK-NEXT: backedge-taken count is ; CHECK-NEXT: max backedge-taken count is -1 + +; PR19799: Indvars miscompile due to an incorrect max backedge taken count from SCEV. +; CHECK-LABEL: @pr19799 +; CHECK: Loop %for.body.i: Unpredictable backedge-taken count. +; CHECK: Loop %for.body.i: max backedge-taken count is 1 +@a = common global i32 0, align 4 + +define i32 @pr19799() { +entry: + store i32 -1, i32* @a, align 4 + br label %for.body.i + +for.body.i: ; preds = %for.cond.i, %entry + %storemerge1.i = phi i32 [ -1, %entry ], [ %add.i.i, %for.cond.i ] + %tobool.i = icmp eq i32 %storemerge1.i, 0 + %add.i.i = add nsw i32 %storemerge1.i, 2 + br i1 %tobool.i, label %bar.exit, label %for.cond.i + +for.cond.i: ; preds = %for.body.i + store i32 %add.i.i, i32* @a, align 4 + %cmp.i = icmp slt i32 %storemerge1.i, 0 + br i1 %cmp.i, label %for.body.i, label %bar.exit + +bar.exit: ; preds = %for.cond.i, %for.body.i + ret i32 0 +} + +; PR18886: Indvars miscompile due to an incorrect max backedge taken count from SCEV. +; CHECK-LABEL: @pr18886 +; CHECK: Loop %for.body: Unpredictable backedge-taken count. +; CHECK: Loop %for.body: max backedge-taken count is 3 +@aa = global i64 0, align 8 + +define i32 @pr18886() { +entry: + store i64 -21, i64* @aa, align 8 + br label %for.body + +for.body: + %storemerge1 = phi i64 [ -21, %entry ], [ %add, %for.cond ] + %tobool = icmp eq i64 %storemerge1, 0 + %add = add nsw i64 %storemerge1, 8 + br i1 %tobool, label %return, label %for.cond + +for.cond: + store i64 %add, i64* @aa, align 8 + %cmp = icmp slt i64 %add, 9 + br i1 %cmp, label %for.body, label %return + +return: + %retval.0 = phi i32 [ 1, %for.body ], [ 0, %for.cond ] + ret i32 %retval.0 +} + +; Here we have a must-exit loop latch that is not computable and a +; may-exit early exit that can only have one non-exiting iteration +; before the check is forever skipped. +; +; CHECK-LABEL: @cannot_compute_mustexit +; CHECK: Loop %for.body.i: Unpredictable backedge-taken count. +; CHECK: Loop %for.body.i: Unpredictable max backedge-taken count. +@b = common global i32 0, align 4 + +define i32 @cannot_compute_mustexit() { +entry: + store i32 -1, i32* @a, align 4 + br label %for.body.i + +for.body.i: ; preds = %for.cond.i, %entry + %storemerge1.i = phi i32 [ -1, %entry ], [ %add.i.i, %for.cond.i ] + %tobool.i = icmp eq i32 %storemerge1.i, 0 + %add.i.i = add nsw i32 %storemerge1.i, 2 + br i1 %tobool.i, label %bar.exit, label %for.cond.i + +for.cond.i: ; preds = %for.body.i + store i32 %add.i.i, i32* @a, align 4 + %ld = load volatile i32* @b + %cmp.i = icmp ne i32 %ld, 0 + br i1 %cmp.i, label %for.body.i, label %bar.exit + +bar.exit: ; preds = %for.cond.i, %for.body.i + ret i32 0 +} + +; This loop has two must-exits, both of which dominate the latch. The +; MaxBECount should be the minimum of them. +; +; CHECK-LABEL: @two_mustexit +; CHECK: Loop %for.body.i: Unpredictable backedge-taken count. +; CHECK: Loop %for.body.i: max backedge-taken count is 1 +define i32 @two_mustexit() { +entry: + store i32 -1, i32* @a, align 4 + br label %for.body.i + +for.body.i: ; preds = %for.cond.i, %entry + %storemerge1.i = phi i32 [ -1, %entry ], [ %add.i.i, %for.cond.i ] + %tobool.i = icmp sgt i32 %storemerge1.i, 0 + %add.i.i = add nsw i32 %storemerge1.i, 2 + br i1 %tobool.i, label %bar.exit, label %for.cond.i + +for.cond.i: ; preds = %for.body.i + store i32 %add.i.i, i32* @a, align 4 + %cmp.i = icmp slt i32 %storemerge1.i, 3 + br i1 %cmp.i, label %for.body.i, label %bar.exit + +bar.exit: ; preds = %for.cond.i, %for.body.i + ret i32 0 +} diff --git a/test/Analysis/ScalarEvolution/nsw-offset.ll b/test/Analysis/ScalarEvolution/nsw-offset.ll index 8969a5ad4ceb..88cdcf23d9ed 100644 --- a/test/Analysis/ScalarEvolution/nsw-offset.ll +++ b/test/Analysis/ScalarEvolution/nsw-offset.ll @@ -73,5 +73,5 @@ return: ; preds = %bb1.return_crit_edg ret void } -; CHECK: Loop %bb: backedge-taken count is ((-1 + %n) /u 2) +; CHECK: Loop %bb: backedge-taken count is ((-1 + (2 * (%no /u 2))) /u 2) ; CHECK: Loop %bb: max backedge-taken count is 1073741822 diff --git a/test/Analysis/ScalarEvolution/trip-count-pow2.ll b/test/Analysis/ScalarEvolution/trip-count-pow2.ll new file mode 100644 index 000000000000..2c5b72e49daf --- /dev/null +++ b/test/Analysis/ScalarEvolution/trip-count-pow2.ll @@ -0,0 +1,53 @@ +; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s + +define void @test1(i32 %n) { +entry: + %s = mul i32 %n, 96 + br label %loop +loop: + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i32 %i, 32 + %t = icmp ne i32 %i.next, %s + br i1 %t, label %loop, label %exit +exit: + ret void + +; CHECK-LABEL: @test1 +; CHECK: Loop %loop: backedge-taken count is ((-32 + (96 * %n)) /u 32) +; CHECK: Loop %loop: max backedge-taken count is ((-32 + (96 * %n)) /u 32) +} + +; PR19183 +define i32 @test2(i32 %n) { +entry: + %s = and i32 %n, -32 + br label %loop +loop: + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i32 %i, 32 + %t = icmp ne i32 %i.next, %s + br i1 %t, label %loop, label %exit +exit: + ret i32 %i + +; CHECK-LABEL: @test2 +; CHECK: Loop %loop: backedge-taken count is ((-32 + (32 * (%n /u 32))) /u 32) +; CHECK: Loop %loop: max backedge-taken count is ((-32 + (32 * (%n /u 32))) /u 32) +} + +define void @test3(i32 %n) { +entry: + %s = mul i32 %n, 96 + br label %loop +loop: + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] + %i.next = add i32 %i, 96 + %t = icmp ne i32 %i.next, %s + br i1 %t, label %loop, label %exit +exit: + ret void + +; CHECK-LABEL: @test3 +; CHECK: Loop %loop: Unpredictable backedge-taken count. +; CHECK: Loop %loop: Unpredictable max backedge-taken count. +} diff --git a/test/Analysis/ScalarEvolution/trip-count-switch.ll b/test/Analysis/ScalarEvolution/trip-count-switch.ll new file mode 100644 index 000000000000..2d2b6b499408 --- /dev/null +++ b/test/Analysis/ScalarEvolution/trip-count-switch.ll @@ -0,0 +1,30 @@ +; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s + +declare void @foo() + +define void @test1() nounwind { +entry: + br label %for.cond + +for.cond: ; preds = %if.end, %entry + %i.0 = phi i32 [ 2, %entry ], [ %dec, %if.end ] + switch i32 %i.0, label %if.end [ + i32 0, label %for.end + i32 1, label %if.then + ] + +if.then: ; preds = %for.cond + tail call void @foo() + br label %if.end + +if.end: ; preds = %for.cond, %if.then + %dec = add nsw i32 %i.0, -1 + br label %for.cond + +for.end: ; preds = %for.cond + ret void + +; CHECK-LABEL: @test1 +; CHECK: Loop %for.cond: backedge-taken count is 2 +; CHECK: Loop %for.cond: max backedge-taken count is 2 +} diff --git a/test/Analysis/ScalarEvolution/xor-and.ll b/test/Analysis/ScalarEvolution/xor-and.ll deleted file mode 100644 index 2616ea928a49..000000000000 --- a/test/Analysis/ScalarEvolution/xor-and.ll +++ /dev/null @@ -1,13 +0,0 @@ -; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s - -; ScalarEvolution shouldn't try to analyze %z into something like -; --> (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64) - -; CHECK: --> (zext i4 (-8 + (trunc i64 (8 * %x) to i4)) to i64) - -define i64 @foo(i64 %x) { - %a = shl i64 %x, 3 - %t = and i64 %a, 8 - %z = xor i64 %t, 8 - ret i64 %z -} diff --git a/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll b/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll index 6fd6eaca012e..cdf72811ce5f 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll @@ -18,8 +18,8 @@ define void @foo(i8* nocapture %p, i8* nocapture %q, i8* nocapture %s) nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind -; CHECK [[TAGA]] = metadata !{metadata [[TYPEA:!.*]], metadata [[TYPEA]], i64 0} -; CHECK [[TYPEA]] = metadata !{metadata !"A", metadata !{{.*}}} +; CHECK: [[TAGA]] = metadata !{metadata [[TYPEA:!.*]], metadata [[TYPEA]], i64 0} +; CHECK: [[TYPEA]] = metadata !{metadata !"A", metadata !{{.*}}} !0 = metadata !{metadata !"tbaa root", null} !1 = metadata !{metadata !3, metadata !3, i64 0} !2 = metadata !{metadata !4, metadata !4, i64 0} diff --git a/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll b/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll index 0cd5c301842a..e1c5d4526470 100644 --- a/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll +++ b/test/Analysis/TypeBasedAliasAnalysis/tbaa-path.ll @@ -43,7 +43,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i16 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %s.addr = alloca i32*, align 8 %A.addr = alloca %struct.StructA*, align 8 @@ -98,7 +98,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i16 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %A.addr = alloca %struct.StructA*, align 8 %B.addr = alloca %struct.StructB*, align 8 @@ -127,7 +127,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i32 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %A.addr = alloca %struct.StructA*, align 8 %B.addr = alloca %struct.StructB*, align 8 @@ -155,7 +155,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i32 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %A.addr = alloca %struct.StructA*, align 8 %B.addr = alloca %struct.StructB*, align 8 @@ -184,7 +184,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i32 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %A.addr = alloca %struct.StructA*, align 8 %S.addr = alloca %struct.StructS*, align 8 @@ -212,7 +212,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i16 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %A.addr = alloca %struct.StructA*, align 8 %S.addr = alloca %struct.StructS*, align 8 @@ -240,7 +240,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i32 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %S.addr = alloca %struct.StructS*, align 8 %S2.addr = alloca %struct.StructS2*, align 8 @@ -268,7 +268,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i16 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %S.addr = alloca %struct.StructS*, align 8 %S2.addr = alloca %struct.StructS2*, align 8 @@ -296,7 +296,7 @@ entry: ; OPT: define ; OPT: store i32 1 ; OPT: store i32 4 -; Remove a load and propogate the value from store. +; Remove a load and propagate the value from store. ; OPT: ret i32 1 %C.addr = alloca %struct.StructC*, align 8 %D.addr = alloca %struct.StructD*, align 8 diff --git a/test/Assembler/2007-09-10-AliasFwdRef.ll b/test/Assembler/2007-09-10-AliasFwdRef.ll index b21491ba5a90..2ebfc2719e95 100644 --- a/test/Assembler/2007-09-10-AliasFwdRef.ll +++ b/test/Assembler/2007-09-10-AliasFwdRef.ll @@ -6,4 +6,6 @@ -declare extern_weak i32 @pthread_cancel(i32) +define weak i32 @pthread_cancel(i32) { + ret i32 0 +} diff --git a/test/Assembler/2009-04-25-AliasGEP.ll b/test/Assembler/2009-04-25-AliasGEP.ll deleted file mode 100644 index 6d07208defe3..000000000000 --- a/test/Assembler/2009-04-25-AliasGEP.ll +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis -; PR4066 -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin9" - %struct.i2c_device_id = type { } -@w83l785ts_id = internal constant [0 x %struct.i2c_device_id] zeroinitializer, align 1 ; <[0 x %struct.i2c_device_id]*> [#uses=1] - -@__mod_i2c_device_table = alias getelementptr ([0 x %struct.i2c_device_id]* @w83l785ts_id, i32 0, i32 0) ; <%struct.i2c_device_id*> [#uses=0] diff --git a/test/Assembler/ConstantExprFoldSelect.ll b/test/Assembler/ConstantExprFoldSelect.ll new file mode 100644 index 000000000000..b000e02653c6 --- /dev/null +++ b/test/Assembler/ConstantExprFoldSelect.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; PR18319 + +define void @function() { + %c = trunc <4 x i16> select (<4 x i1> , <4 x i16> , <4 x i16> ) to <4 x i8> +; CHECK: + ret void +} diff --git a/test/Assembler/addrspacecast-alias.ll b/test/Assembler/addrspacecast-alias.ll new file mode 100644 index 000000000000..d7516599dfe2 --- /dev/null +++ b/test/Assembler/addrspacecast-alias.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Test that global aliases are allowed to be constant addrspacecast + +@i = internal addrspace(1) global i8 42 +@ia = alias internal addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*) +; CHECK: @ia = alias internal addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*) diff --git a/test/Assembler/alias-redefinition.ll b/test/Assembler/alias-redefinition.ll new file mode 100644 index 000000000000..19ad85bf5f5b --- /dev/null +++ b/test/Assembler/alias-redefinition.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as %s 2>&1 | FileCheck %s + +; CHECK: error: redefinition of global named '@bar' + +@foo = global i32 0 +@bar = alias i32* @foo +@bar = alias i32* @foo diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll index b245cdea75b1..d7ccd9900bd8 100644 --- a/test/Assembler/atomic.ll +++ b/test/Assembler/atomic.ll @@ -10,10 +10,14 @@ define void @f(i32* %x) { store atomic i32 3, i32* %x release, align 4 ; CHECK: store atomic volatile i32 3, i32* %x singlethread monotonic, align 4 store atomic volatile i32 3, i32* %x singlethread monotonic, align 4 - ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic - cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic - ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel - cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel + ; CHECK: cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic monotonic + cmpxchg i32* %x, i32 1, i32 0 singlethread monotonic monotonic + ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire + cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire + ; CHECK: cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic + cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic + ; CHECK: cmpxchg weak i32* %x, i32 13, i32 0 seq_cst monotonic + cmpxchg weak i32* %x, i32 13, i32 0 seq_cst monotonic ; CHECK: atomicrmw add i32* %x, i32 10 seq_cst atomicrmw add i32* %x, i32 10 seq_cst ; CHECK: atomicrmw volatile xchg i32* %x, i32 10 monotonic diff --git a/test/Assembler/functionlocal-metadata.ll b/test/Assembler/functionlocal-metadata.ll index 0d93bfdb275d..f9b1d7403796 100644 --- a/test/Assembler/functionlocal-metadata.ll +++ b/test/Assembler/functionlocal-metadata.ll @@ -53,4 +53,4 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone ; CHECK: ![[ID0]] = metadata !{i32 662302, i32 26, metadata ![[ID1]], null} ; CHECK: ![[ID1]] = metadata !{i32 4, metadata !"foo"} ; CHECK: ![[ID2]] = metadata !{metadata !"bar"} -; CHECK; ![[ID3]] = metadata !{metadata !"foo"} +; CHECK: ![[ID3]] = metadata !{metadata !"foo"} diff --git a/test/Assembler/getInt.ll b/test/Assembler/getInt.ll new file mode 100644 index 000000000000..8e2537ae6cf1 --- /dev/null +++ b/test/Assembler/getInt.ll @@ -0,0 +1,3 @@ +; RUN: not opt < %s 2>&1 | grep 'not a number, or does not fit in an unsigned int' + +target datalayout = "p:4294967296:64:64" diff --git a/test/Assembler/half-constprop.ll b/test/Assembler/half-constprop.ll index 03ccdda97e0a..9e24f7242ba9 100644 --- a/test/Assembler/half-constprop.ll +++ b/test/Assembler/half-constprop.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -O3 | llvm-dis | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; Testing half constant propagation. define half @abc() nounwind { diff --git a/test/Assembler/half-conv.ll b/test/Assembler/half-conv.ll index bf9ae5713979..70a6b86c393f 100644 --- a/test/Assembler/half-conv.ll +++ b/test/Assembler/half-conv.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -O3 | llvm-dis | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; Testing half to float conversion. define float @abc() nounwind { diff --git a/test/Assembler/inalloca.ll b/test/Assembler/inalloca.ll new file mode 100644 index 000000000000..ff7a87e0a392 --- /dev/null +++ b/test/Assembler/inalloca.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as %s -o /dev/null + +define void @a() { +entry: + %0 = alloca inalloca i32 + %1 = alloca inalloca [2 x i32] + %2 = alloca inalloca i32, i32 2 + %3 = alloca inalloca i32, i32 2, align 16 + %4 = alloca inalloca i32, i32 2, align 16, !foo !0 + %5 = alloca i32, i32 2, align 16, !foo !0 + %6 = alloca i32, i32 2, align 16 + ret void +} + +!0 = metadata !{i32 662302, null} +!foo = !{ !0 } diff --git a/test/Assembler/internal-hidden-alias.ll b/test/Assembler/internal-hidden-alias.ll new file mode 100644 index 000000000000..660514bb1850 --- /dev/null +++ b/test/Assembler/internal-hidden-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = hidden alias internal i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-hidden-function.ll b/test/Assembler/internal-hidden-function.ll new file mode 100644 index 000000000000..193ed7c28919 --- /dev/null +++ b/test/Assembler/internal-hidden-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define internal hidden void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/internal-hidden-variable.ll b/test/Assembler/internal-hidden-variable.ll new file mode 100644 index 000000000000..eddd06758a04 --- /dev/null +++ b/test/Assembler/internal-hidden-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = internal hidden global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-protected-alias.ll b/test/Assembler/internal-protected-alias.ll new file mode 100644 index 000000000000..d78582684c50 --- /dev/null +++ b/test/Assembler/internal-protected-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = protected alias internal i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-protected-function.ll b/test/Assembler/internal-protected-function.ll new file mode 100644 index 000000000000..944cb75eec4c --- /dev/null +++ b/test/Assembler/internal-protected-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define internal protected void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/internal-protected-variable.ll b/test/Assembler/internal-protected-variable.ll new file mode 100644 index 000000000000..df02275bac79 --- /dev/null +++ b/test/Assembler/internal-protected-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = internal protected global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/invalid-comdat.ll b/test/Assembler/invalid-comdat.ll new file mode 100644 index 000000000000..987e1e1e7d92 --- /dev/null +++ b/test/Assembler/invalid-comdat.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +@v = global i32 0, comdat $v +; CHECK: use of undefined comdat '$v' diff --git a/test/Assembler/invalid-comdat2.ll b/test/Assembler/invalid-comdat2.ll new file mode 100644 index 000000000000..ed656ef2b112 --- /dev/null +++ b/test/Assembler/invalid-comdat2.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +$v = comdat any +$v = comdat any +; CHECK: redefinition of comdat '$v' diff --git a/test/Assembler/invalid-name.ll b/test/Assembler/invalid-name.ll new file mode 100644 index 000000000000..d9d7a1108808 --- /dev/null +++ b/test/Assembler/invalid-name.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as %s 2>&1 | FileCheck %s + +; CHECK: expected function name +define void @"zed\00bar"() { + ret void +} diff --git a/test/Assembler/invalid_cast3.ll b/test/Assembler/invalid_cast3.ll new file mode 100644 index 000000000000..cc956cee59a1 --- /dev/null +++ b/test/Assembler/invalid_cast3.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +; CHECK: invalid cast opcode for cast from '<4 x i32*>' to '<2 x i32*>' +define <2 x i32*> @illegal_vector_pointer_bitcast_num_elements(<4 x i32*> %c) { + %bc = bitcast <4 x i32*> %c to <2 x i32*> + ret <2 x i32*> %bc +} diff --git a/test/Assembler/private-hidden-alias.ll b/test/Assembler/private-hidden-alias.ll new file mode 100644 index 000000000000..58be92a34f25 --- /dev/null +++ b/test/Assembler/private-hidden-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = hidden alias private i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-hidden-function.ll b/test/Assembler/private-hidden-function.ll new file mode 100644 index 000000000000..dd73f0413b9f --- /dev/null +++ b/test/Assembler/private-hidden-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define private hidden void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/private-hidden-variable.ll b/test/Assembler/private-hidden-variable.ll new file mode 100644 index 000000000000..ce6bfa9bae68 --- /dev/null +++ b/test/Assembler/private-hidden-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = private hidden global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-protected-alias.ll b/test/Assembler/private-protected-alias.ll new file mode 100644 index 000000000000..a72c248f0b03 --- /dev/null +++ b/test/Assembler/private-protected-alias.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@global = global i32 0 + +@alias = protected alias private i32* @global +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-protected-function.ll b/test/Assembler/private-protected-function.ll new file mode 100644 index 000000000000..5dbb420a8253 --- /dev/null +++ b/test/Assembler/private-protected-function.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +define private protected void @function() { +; CHECK: symbol with local linkage must have default visibility +entry: + ret void +} diff --git a/test/Assembler/private-protected-variable.ll b/test/Assembler/private-protected-variable.ll new file mode 100644 index 000000000000..c4458f5b3f63 --- /dev/null +++ b/test/Assembler/private-protected-variable.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +@var = private protected global i32 0 +; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/upgrade-loop-metadata.ll b/test/Assembler/upgrade-loop-metadata.ll new file mode 100644 index 000000000000..1c0311dd09e9 --- /dev/null +++ b/test/Assembler/upgrade-loop-metadata.ll @@ -0,0 +1,41 @@ +; Test to make sure loop vectorizer metadata is automatically upgraded. +; +; Run using opt as well to ensure that the metadata is upgraded when parsing +; assembly. +; +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: opt -S < %s | FileCheck %s + +define void @_Z28loop_with_vectorize_metadatav() { +entry: + %i = alloca i32, align 4 + store i32 0, i32* %i, align 4 + br label %for.cond + +for.cond: ; preds = %for.inc, %entry + %0 = load i32* %i, align 4 + %cmp = icmp slt i32 %0, 16 + br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 + +for.body: ; preds = %for.cond + br label %for.inc + +for.inc: ; preds = %for.body + %1 = load i32* %i, align 4 + %inc = add nsw i32 %1, 1 + store i32 %inc, i32* %i, align 4 + br label %for.cond + +for.end: ; preds = %for.cond + ret void +} + +; CHECK: !{metadata !"llvm.loop.interleave.count", i32 4} +; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8} +; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true} + +!0 = metadata !{metadata !"clang version 3.5.0 (trunk 211528)"} +!1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4, metadata !4} +!2 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4} +!3 = metadata !{metadata !"llvm.vectorizer.width", i32 8} +!4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true} diff --git a/test/Bindings/Ocaml/target.ml b/test/Bindings/Ocaml/target.ml index d69fb0e664fd..0a2283aa3ed5 100644 --- a/test/Bindings/Ocaml/target.ml +++ b/test/Bindings/Ocaml/target.ml @@ -43,12 +43,10 @@ let machine = TargetMachine.create (Target.default_triple ()) target let test_target_data () = let module DL = DataLayout in - let layout = "e-p:32:32:32-S32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-" ^ - "f16:16:16-f32:32:32-f64:32:64-f128:128:128-v64:32:64-v128:32:128-" ^ - "a0:0:64-n32" in + let layout = "e-p:32:32-f64:32:64-v64:32:64-v128:32:128-n32-S32" in let dl = DL.of_string layout in let sty = struct_type context [| i32_type; i64_type |] in - + assert_equal (DL.as_string dl) layout; assert_equal (DL.byte_order dl) Endian.Little; assert_equal (DL.pointer_size dl) 4; @@ -88,7 +86,8 @@ let test_target_machine () = assert_equal (TM.triple machine) (Target.default_triple ()); assert_equal (TM.cpu machine) ""; assert_equal (TM.features machine) ""; - ignore (TM.data_layout machine) + ignore (TM.data_layout machine); + TM.set_verbose_asm true machine (*===-- Code Emission -----------------------------------------------------===*) diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml index 167efce0b2b1..f014116ffe8e 100644 --- a/test/Bindings/Ocaml/vmcore.ml +++ b/test/Bindings/Ocaml/vmcore.ml @@ -85,11 +85,11 @@ let test_target () = end; begin group "layout"; - let layout = "bogus" in + let layout = "e" in set_data_layout layout m; insist (layout = data_layout m) end - (* CHECK: target datalayout = "bogus" + (* CHECK: target datalayout = "e" * CHECK: target triple = "i686-apple-darwin8" *) @@ -413,7 +413,7 @@ let test_global_values () = let test_global_variables () = let (++) x f = f x; x in - let fourty_two32 = const_int i32_type 42 in + let forty_two32 = const_int i32_type 42 in group "declarations"; begin (* CHECK: @GVar01 = external global i32 @@ -444,16 +444,16 @@ let test_global_variables () = * CHECK: @QGVar02 = addrspace(3) global i32 42 * CHECK: @QGVar03 = addrspace(3) global i32 42 *) - let g = define_global "GVar02" fourty_two32 m in + let g = define_global "GVar02" forty_two32 m in let g2 = declare_global i32_type "GVar03" m ++ - set_initializer fourty_two32 in + set_initializer forty_two32 in insist (not (is_declaration g)); insist (not (is_declaration g2)); insist ((global_initializer g) == (global_initializer g2)); - let g = define_qualified_global "QGVar02" fourty_two32 3 m in + let g = define_qualified_global "QGVar02" forty_two32 3 m in let g2 = declare_qualified_global i32_type "QGVar03" 3 m ++ - set_initializer fourty_two32 in + set_initializer forty_two32 in insist (not (is_declaration g)); insist (not (is_declaration g2)); insist ((global_initializer g) == (global_initializer g2)); @@ -462,34 +462,34 @@ let test_global_variables () = (* CHECK: GVar04{{.*}}thread_local *) group "threadlocal"; - let g = define_global "GVar04" fourty_two32 m ++ + let g = define_global "GVar04" forty_two32 m ++ set_thread_local true in insist (is_thread_local g); (* CHECK: GVar05{{.*}}thread_local(initialexec) *) group "threadlocal_mode"; - let g = define_global "GVar05" fourty_two32 m ++ + let g = define_global "GVar05" forty_two32 m ++ set_thread_local_mode ThreadLocalMode.InitialExec in insist ((thread_local_mode g) = ThreadLocalMode.InitialExec); (* CHECK: GVar06{{.*}}externally_initialized *) group "externally_initialized"; - let g = define_global "GVar06" fourty_two32 m ++ + let g = define_global "GVar06" forty_two32 m ++ set_externally_initialized true in insist (is_externally_initialized g); (* CHECK-NOWHERE-NOT: GVar07 *) group "delete"; - let g = define_global "GVar07" fourty_two32 m in + let g = define_global "GVar07" forty_two32 m in delete_global g; (* CHECK: ConstGlobalVar{{.*}}constant *) group "constant"; - let g = define_global "ConstGlobalVar" fourty_two32 m in + let g = define_global "ConstGlobalVar" forty_two32 m in insist (not (is_global_constant g)); set_global_constant true g; insist (is_global_constant g); @@ -581,7 +581,8 @@ let test_users () = let test_aliases () = (* CHECK: @alias = alias i32* @aliasee *) - let v = declare_global i32_type "aliasee" m in + let forty_two32 = const_int i32_type 42 in + let v = define_global "aliasee" forty_two32 m in ignore (add_alias m (pointer_type i32_type) v "alias") diff --git a/test/Bindings/llvm-c/lit.local.cfg b/test/Bindings/llvm-c/lit.local.cfg index d83ebeed8e1c..75b22c06fb2f 100644 --- a/test/Bindings/llvm-c/lit.local.cfg +++ b/test/Bindings/llvm-c/lit.local.cfg @@ -1,5 +1,4 @@ -targets = set(config.root.targets_to_build.split()) -if not "X86" in targets: +if not "X86" in config.root.targets: config.unsupported = True -if not "ARM" in targets: +if not "ARM" in config.root.targets: config.unsupported = True diff --git a/test/Bitcode/aggregateInstructions.3.2.ll b/test/Bitcode/aggregateInstructions.3.2.ll new file mode 100644 index 000000000000..9352390b131b --- /dev/null +++ b/test/Bitcode/aggregateInstructions.3.2.ll @@ -0,0 +1,33 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; aggregateOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread instructions with aggregate operands +; in older bitcode files. + +define void @extractvalue([4 x i8] %x1, [4 x [4 x i8]] %x2, {{i32, float}} %x3){ +entry: +; CHECK: %res1 = extractvalue [4 x i8] %x1, 0 + %res1 = extractvalue [4 x i8] %x1, 0 + +; CHECK-NEXT: %res2 = extractvalue [4 x [4 x i8]] %x2, 1 + %res2 = extractvalue [4 x [4 x i8 ]] %x2, 1 + +; CHECK-NEXT: %res3 = extractvalue [4 x [4 x i8]] %x2, 0, 1 + %res3 = extractvalue [4 x [4 x i8 ]] %x2, 0, 1 + +; CHECK-NEXT: %res4 = extractvalue { { i32, float } } %x3, 0, 1 + %res4 = extractvalue {{i32, float}} %x3, 0, 1 + + ret void +} + +define void @insertvalue([4 x [4 x i8 ]] %x1){ +entry: +; CHECK: %res1 = insertvalue [4 x [4 x i8]] %x1, i8 0, 0, 0 + %res1 = insertvalue [4 x [4 x i8 ]] %x1, i8 0, 0, 0 + +; CHECK-NEXT: %res2 = insertvalue [4 x [4 x i8]] undef, i8 0, 0, 0 + %res2 = insertvalue [4 x [4 x i8 ]] undef, i8 0, 0, 0 + + ret void +} \ No newline at end of file diff --git a/test/Bitcode/aggregateInstructions.3.2.ll.bc b/test/Bitcode/aggregateInstructions.3.2.ll.bc new file mode 100644 index 000000000000..053f85fda645 Binary files /dev/null and b/test/Bitcode/aggregateInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/atomic.ll b/test/Bitcode/atomic.ll new file mode 100644 index 000000000000..37815a749b55 --- /dev/null +++ b/test/Bitcode/atomic.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as %s -o - | llvm-dis | FileCheck %s + +define void @test_cmpxchg(i32* %addr, i32 %desired, i32 %new) { + cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst + ; CHECK: cmpxchg i32* %addr, i32 %desired, i32 %new seq_cst seq_cst + + cmpxchg volatile i32* %addr, i32 %desired, i32 %new seq_cst monotonic + ; CHECK: cmpxchg volatile i32* %addr, i32 %desired, i32 %new seq_cst monotonic + + cmpxchg weak i32* %addr, i32 %desired, i32 %new acq_rel acquire + ; CHECK: cmpxchg weak i32* %addr, i32 %desired, i32 %new acq_rel acquire + + cmpxchg weak volatile i32* %addr, i32 %desired, i32 %new singlethread release monotonic + ; CHECK: cmpxchg weak volatile i32* %addr, i32 %desired, i32 %new singlethread release monotonic + + ret void +} \ No newline at end of file diff --git a/test/Bitcode/attributes.ll b/test/Bitcode/attributes.ll index 1789878e9f50..2490e5920726 100644 --- a/test/Bitcode/attributes.ll +++ b/test/Bitcode/attributes.ll @@ -203,7 +203,7 @@ define void @f34() ; CHECK: define void @f34() { call void @nobuiltin() nobuiltin -; CHECK: call void @nobuiltin() #24 +; CHECK: call void @nobuiltin() #25 ret void; } @@ -213,6 +213,32 @@ define void @f35() optnone noinline ret void; } +define void @f36(i8* inalloca) { +; CHECK: define void @f36(i8* inalloca) { + ret void +} + +define nonnull i8* @f37(i8* nonnull %a) { +; CHECK: define nonnull i8* @f37(i8* nonnull %a) { + ret i8* %a +} + +define void @f38() unnamed_addr jumptable { +; CHECK: define void @f38() unnamed_addr #24 + call void bitcast (void (i8*)* @f36 to void ()*)() + unreachable +} + +define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) { +; CHECK: define dereferenceable(2) i8* @f39(i8* dereferenceable(1) %a) { + ret i8* %a +} + +define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) { +; CHECK: define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(18446744073709551615) %a) { + ret i8* %a +} + ; CHECK: attributes #0 = { noreturn } ; CHECK: attributes #1 = { nounwind } ; CHECK: attributes #2 = { readnone } @@ -237,5 +263,5 @@ define void @f35() optnone noinline ; CHECK: attributes #21 = { sspstrong } ; CHECK: attributes #22 = { minsize } ; CHECK: attributes #23 = { noinline optnone } -; CHECK: attributes #24 = { nobuiltin } - +; CHECK: attributes #24 = { jumptable } +; CHECK: attributes #25 = { nobuiltin } diff --git a/test/Bitcode/binaryFloatInstructions.3.2.ll b/test/Bitcode/binaryFloatInstructions.3.2.ll new file mode 100644 index 000000000000..f94d82d23c9f --- /dev/null +++ b/test/Bitcode/binaryFloatInstructions.3.2.ll @@ -0,0 +1,120 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; BinaryFloatOperation.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread binary float instructions from +; older bitcode files. + +define void @fadd(float %x1, double %x2 ,half %x3, fp128 %x4, x86_fp80 %x5, ppc_fp128 %x6){ +entry: +; CHECK: %res1 = fadd float %x1, %x1 + %res1 = fadd float %x1, %x1 + +; CHECK-NEXT: %res2 = fadd double %x2, %x2 + %res2 = fadd double %x2, %x2 + +; CHECK-NEXT: %res3 = fadd half %x3, %x3 + %res3 = fadd half %x3, %x3 + +; CHECK-NEXT: %res4 = fadd fp128 %x4, %x4 + %res4 = fadd fp128 %x4, %x4 + +; CHECK-NEXT: %res5 = fadd x86_fp80 %x5, %x5 + %res5 = fadd x86_fp80 %x5, %x5 + +; CHECK-NEXT: %res6 = fadd ppc_fp128 %x6, %x6 + %res6 = fadd ppc_fp128 %x6, %x6 + + ret void +} + +define void @faddFloatVec(<2 x float> %x1, <3 x float> %x2 ,<4 x float> %x3, <8 x float> %x4, <16 x float> %x5){ +entry: +; CHECK: %res1 = fadd <2 x float> %x1, %x1 + %res1 = fadd <2 x float> %x1, %x1 + +; CHECK-NEXT: %res2 = fadd <3 x float> %x2, %x2 + %res2 = fadd <3 x float> %x2, %x2 + +; CHECK-NEXT: %res3 = fadd <4 x float> %x3, %x3 + %res3 = fadd <4 x float> %x3, %x3 + +; CHECK-NEXT: %res4 = fadd <8 x float> %x4, %x4 + %res4 = fadd <8 x float> %x4, %x4 + +; CHECK-NEXT: %res5 = fadd <16 x float> %x5, %x5 + %res5 = fadd <16 x float> %x5, %x5 + + ret void +} + +define void @faddDoubleVec(<2 x double> %x1, <3 x double> %x2 ,<4 x double> %x3, <8 x double> %x4, <16 x double> %x5){ +entry: +; CHECK: %res1 = fadd <2 x double> %x1, %x1 + %res1 = fadd <2 x double> %x1, %x1 + +; CHECK-NEXT: %res2 = fadd <3 x double> %x2, %x2 + %res2 = fadd <3 x double> %x2, %x2 + +; CHECK-NEXT: %res3 = fadd <4 x double> %x3, %x3 + %res3 = fadd <4 x double> %x3, %x3 + +; CHECK-NEXT: %res4 = fadd <8 x double> %x4, %x4 + %res4 = fadd <8 x double> %x4, %x4 + +; CHECK-NEXT: %res5 = fadd <16 x double> %x5, %x5 + %res5 = fadd <16 x double> %x5, %x5 + + ret void +} + +define void @faddHalfVec(<2 x half> %x1, <3 x half> %x2 ,<4 x half> %x3, <8 x half> %x4, <16 x half> %x5){ +entry: +; CHECK: %res1 = fadd <2 x half> %x1, %x1 + %res1 = fadd <2 x half> %x1, %x1 + +; CHECK-NEXT: %res2 = fadd <3 x half> %x2, %x2 + %res2 = fadd <3 x half> %x2, %x2 + +; CHECK-NEXT: %res3 = fadd <4 x half> %x3, %x3 + %res3 = fadd <4 x half> %x3, %x3 + +; CHECK-NEXT: %res4 = fadd <8 x half> %x4, %x4 + %res4 = fadd <8 x half> %x4, %x4 + +; CHECK-NEXT: %res5 = fadd <16 x half> %x5, %x5 + %res5 = fadd <16 x half> %x5, %x5 + + ret void +} + +define void @fsub(float %x1){ +entry: +; CHECK: %res1 = fsub float %x1, %x1 + %res1 = fsub float %x1, %x1 + + ret void +} + +define void @fmul(float %x1){ +entry: +; CHECK: %res1 = fmul float %x1, %x1 + %res1 = fmul float %x1, %x1 + + ret void +} + +define void @fdiv(float %x1){ +entry: +; CHECK: %res1 = fdiv float %x1, %x1 + %res1 = fdiv float %x1, %x1 + + ret void +} + +define void @frem(float %x1){ +entry: +; CHECK: %res1 = frem float %x1, %x1 + %res1 = frem float %x1, %x1 + + ret void +} diff --git a/test/Bitcode/binaryFloatInstructions.3.2.ll.bc b/test/Bitcode/binaryFloatInstructions.3.2.ll.bc new file mode 100644 index 000000000000..8dbb4e456a04 Binary files /dev/null and b/test/Bitcode/binaryFloatInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/binaryIntInstructions.3.2.ll b/test/Bitcode/binaryIntInstructions.3.2.ll new file mode 100644 index 000000000000..b08501ca932a --- /dev/null +++ b/test/Bitcode/binaryIntInstructions.3.2.ll @@ -0,0 +1,177 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; BinaryIntOperation.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread binary integer instructions from +; older bitcode files. + +define void @add(i1 %x1, i8 %x2 ,i16 %x3, i32 %x4, i64 %x5){ +entry: +; CHECK: %res1 = add i1 %x1, %x1 + %res1 = add i1 %x1, %x1 + +; CHECK-NEXT: %res2 = add i8 %x2, %x2 + %res2 = add i8 %x2, %x2 + +; CHECK-NEXT: %res3 = add i16 %x3, %x3 + %res3 = add i16 %x3, %x3 + +; CHECK-NEXT: %res4 = add i32 %x4, %x4 + %res4 = add i32 %x4, %x4 + +; CHECK-NEXT: %res5 = add i64 %x5, %x5 + %res5 = add i64 %x5, %x5 + +; CHECK: %res6 = add nuw i1 %x1, %x1 + %res6 = add nuw i1 %x1, %x1 + +; CHECK: %res7 = add nsw i1 %x1, %x1 + %res7 = add nsw i1 %x1, %x1 + +; CHECK: %res8 = add nuw nsw i1 %x1, %x1 + %res8 = add nuw nsw i1 %x1, %x1 + + ret void +} + +define void @addvec8NuwNsw(<2 x i8> %x1, <3 x i8> %x2 ,<4 x i8> %x3, <8 x i8> %x4, <16 x i8> %x5){ +entry: +; CHECK: %res1 = add nuw nsw <2 x i8> %x1, %x1 + %res1 = add nuw nsw <2 x i8> %x1, %x1 + +; CHECK-NEXT: %res2 = add nuw nsw <3 x i8> %x2, %x2 + %res2 = add nuw nsw <3 x i8> %x2, %x2 + +; CHECK-NEXT: %res3 = add nuw nsw <4 x i8> %x3, %x3 + %res3 = add nuw nsw <4 x i8> %x3, %x3 + +; CHECK-NEXT: %res4 = add nuw nsw <8 x i8> %x4, %x4 + %res4 = add nuw nsw <8 x i8> %x4, %x4 + +; CHECK-NEXT: %res5 = add nuw nsw <16 x i8> %x5, %x5 + %res5 = add nuw nsw <16 x i8> %x5, %x5 + + ret void +} + +define void @addvec16NuwNsw(<2 x i16> %x1, <3 x i16> %x2 ,<4 x i16> %x3, <8 x i16> %x4, <16 x i16> %x5){ +entry: +; CHECK: %res1 = add nuw nsw <2 x i16> %x1, %x1 + %res1 = add nuw nsw <2 x i16> %x1, %x1 + +; CHECK-NEXT: %res2 = add nuw nsw <3 x i16> %x2, %x2 + %res2 = add nuw nsw <3 x i16> %x2, %x2 + +; CHECK-NEXT: %res3 = add nuw nsw <4 x i16> %x3, %x3 + %res3 = add nuw nsw <4 x i16> %x3, %x3 + +; CHECK-NEXT: %res4 = add nuw nsw <8 x i16> %x4, %x4 + %res4 = add nuw nsw <8 x i16> %x4, %x4 + +; CHECK-NEXT: %res5 = add nuw nsw <16 x i16> %x5, %x5 + %res5 = add nuw nsw <16 x i16> %x5, %x5 + + ret void +} + +define void @addvec32NuwNsw(<2 x i32> %x1, <3 x i32> %x2 ,<4 x i32> %x3, <8 x i32> %x4, <16 x i32> %x5){ +entry: +; CHECK: %res1 = add nuw nsw <2 x i32> %x1, %x1 + %res1 = add nuw nsw <2 x i32> %x1, %x1 + +; CHECK-NEXT: %res2 = add nuw nsw <3 x i32> %x2, %x2 + %res2 = add nuw nsw <3 x i32> %x2, %x2 + +; CHECK-NEXT: %res3 = add nuw nsw <4 x i32> %x3, %x3 + %res3 = add nuw nsw <4 x i32> %x3, %x3 + +; CHECK-NEXT: %res4 = add nuw nsw <8 x i32> %x4, %x4 + %res4 = add nuw nsw <8 x i32> %x4, %x4 + +; CHECK-NEXT: %res5 = add nuw nsw <16 x i32> %x5, %x5 + %res5 = add nuw nsw <16 x i32> %x5, %x5 + + ret void +} + +define void @addvec64NuwNsw(<2 x i64> %x1, <3 x i64> %x2 ,<4 x i64> %x3, <8 x i64> %x4, <16 x i64> %x5){ +entry: +; CHECK: %res1 = add nuw nsw <2 x i64> %x1, %x1 + %res1 = add nuw nsw <2 x i64> %x1, %x1 + +; CHECK-NEXT: %res2 = add nuw nsw <3 x i64> %x2, %x2 + %res2 = add nuw nsw <3 x i64> %x2, %x2 + +; CHECK-NEXT: %res3 = add nuw nsw <4 x i64> %x3, %x3 + %res3 = add nuw nsw <4 x i64> %x3, %x3 + +; CHECK-NEXT: %res4 = add nuw nsw <8 x i64> %x4, %x4 + %res4 = add nuw nsw <8 x i64> %x4, %x4 + +; CHECK-NEXT: %res5 = add nuw nsw <16 x i64> %x5, %x5 + %res5 = add nuw nsw <16 x i64> %x5, %x5 + + ret void +} + +define void @sub(i8 %x1){ +entry: +; CHECK: %res1 = sub i8 %x1, %x1 + %res1 = sub i8 %x1, %x1 + +; CHECK: %res2 = sub nuw i8 %x1, %x1 + %res2 = sub nuw i8 %x1, %x1 + +; CHECK: %res3 = sub nsw i8 %x1, %x1 + %res3 = sub nsw i8 %x1, %x1 + +; CHECK: %res4 = sub nuw nsw i8 %x1, %x1 + %res4 = sub nuw nsw i8 %x1, %x1 + + ret void +} + +define void @mul(i8 %x1){ +entry: +; CHECK: %res1 = mul i8 %x1, %x1 + %res1 = mul i8 %x1, %x1 + + ret void +} + +define void @udiv(i8 %x1){ +entry: +; CHECK: %res1 = udiv i8 %x1, %x1 + %res1 = udiv i8 %x1, %x1 + +; CHECK-NEXT: %res2 = udiv exact i8 %x1, %x1 + %res2 = udiv exact i8 %x1, %x1 + + ret void +} + +define void @sdiv(i8 %x1){ +entry: +; CHECK: %res1 = sdiv i8 %x1, %x1 + %res1 = sdiv i8 %x1, %x1 + +; CHECK-NEXT: %res2 = sdiv exact i8 %x1, %x1 + %res2 = sdiv exact i8 %x1, %x1 + + ret void +} + +define void @urem(i32 %x1){ +entry: +; CHECK: %res1 = urem i32 %x1, %x1 + %res1 = urem i32 %x1, %x1 + + ret void +} + +define void @srem(i32 %x1){ +entry: +; CHECK: %res1 = srem i32 %x1, %x1 + %res1 = srem i32 %x1, %x1 + + ret void +} diff --git a/test/Bitcode/binaryIntInstructions.3.2.ll.bc b/test/Bitcode/binaryIntInstructions.3.2.ll.bc new file mode 100644 index 000000000000..749e0c34dc84 Binary files /dev/null and b/test/Bitcode/binaryIntInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/bitwiseInstructions.3.2.ll b/test/Bitcode/bitwiseInstructions.3.2.ll new file mode 100644 index 000000000000..6225a08f2064 --- /dev/null +++ b/test/Bitcode/bitwiseInstructions.3.2.ll @@ -0,0 +1,68 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; bitwiseOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread bitwise instructions from +; older bitcode files. + +define void @shl(i8 %x1){ +entry: +; CHECK: %res1 = shl i8 %x1, %x1 + %res1 = shl i8 %x1, %x1 + +; CHECK: %res2 = shl nuw i8 %x1, %x1 + %res2 = shl nuw i8 %x1, %x1 + +; CHECK: %res3 = shl nsw i8 %x1, %x1 + %res3 = shl nsw i8 %x1, %x1 + +; CHECK: %res4 = shl nuw nsw i8 %x1, %x1 + %res4 = shl nuw nsw i8 %x1, %x1 + + ret void +} + +define void @lshr(i8 %x1){ +entry: +; CHECK: %res1 = lshr i8 %x1, %x1 + %res1 = lshr i8 %x1, %x1 + +; CHECK: %res2 = lshr exact i8 %x1, %x1 + %res2 = lshr exact i8 %x1, %x1 + + ret void +} + +define void @ashr(i8 %x1){ +entry: +; CHECK: %res1 = ashr i8 %x1, %x1 + %res1 = ashr i8 %x1, %x1 + +; CHECK-NEXT: %res2 = ashr exact i8 %x1, %x1 + %res2 = ashr exact i8 %x1, %x1 + + ret void +} + +define void @and(i8 %x1){ +entry: +; CHECK: %res1 = and i8 %x1, %x1 + %res1 = and i8 %x1, %x1 + + ret void +} + +define void @or(i8 %x1){ +entry: +; CHECK: %res1 = or i8 %x1, %x1 + %res1 = or i8 %x1, %x1 + + ret void +} + +define void @xor(i8 %x1){ +entry: +; CHECK: %res1 = xor i8 %x1, %x1 + %res1 = xor i8 %x1, %x1 + + ret void +} \ No newline at end of file diff --git a/test/Bitcode/bitwiseInstructions.3.2.ll.bc b/test/Bitcode/bitwiseInstructions.3.2.ll.bc new file mode 100644 index 000000000000..136a7c9a0a2d Binary files /dev/null and b/test/Bitcode/bitwiseInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/calling-conventions.3.2.ll b/test/Bitcode/calling-conventions.3.2.ll new file mode 100644 index 000000000000..aca9efd0892b --- /dev/null +++ b/test/Bitcode/calling-conventions.3.2.ll @@ -0,0 +1,150 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; calling-conventions.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not silently misread calling conventions of +; older bitcode files. + +declare ccc void @ccc() +; CHECK: declare void @ccc + +declare fastcc void @fastcc() +; CHECK: declare fastcc void @fastcc + +declare coldcc void @coldcc() +; CHECK: declare coldcc void @coldcc + +declare cc10 void @cc10() +; CHECK: declare cc10 void @cc10 + +declare spir_kernel void @spir_kernel() +; CHECK: declare spir_kernel void @spir_kernel + +declare spir_func void @spir_func() +; CHECK: declare spir_func void @spir_func + +declare intel_ocl_bicc void @intel_ocl_bicc() +; CHECK: declare intel_ocl_bicc void @intel_ocl_bicc + +declare x86_stdcallcc void @x86_stdcallcc() +; CHECK: declare x86_stdcallcc void @x86_stdcallcc + +declare x86_fastcallcc void @x86_fastcallcc() +; CHECK: declare x86_fastcallcc void @x86_fastcallcc + +declare x86_thiscallcc void @x86_thiscallcc() +; CHECK: declare x86_thiscallcc void @x86_thiscallcc + +declare arm_apcscc void @arm_apcscc() +; CHECK: declare arm_apcscc void @arm_apcscc + +declare arm_aapcscc void @arm_aapcscc() +; CHECK: declare arm_aapcscc void @arm_aapcscc + +declare arm_aapcs_vfpcc void @arm_aapcs_vfpcc() +; CHECK: declare arm_aapcs_vfpcc void @arm_aapcs_vfpcc + +declare msp430_intrcc void @msp430_intrcc() +; CHECK: declare msp430_intrcc void @msp430_intrcc + +declare ptx_kernel void @ptx_kernel() +; CHECK: declare ptx_kernel void @ptx_kernel + +declare ptx_device void @ptx_device() +; CHECK: declare ptx_device void @ptx_device + +define void @call_ccc() { +; CHECK: call void @ccc + call ccc void @ccc() + ret void +} + +define void @call_fastcc() { +; CHECK: call fastcc void @fastcc + call fastcc void @fastcc() + ret void +} + +define void @call_coldcc() { +; CHECK: call coldcc void @coldcc + call coldcc void @coldcc() + ret void +} + +define void @call_cc10 () { +; CHECK: call cc10 void @cc10 + call cc10 void @cc10 () + ret void +} + +define void @call_spir_kernel() { +; CHECK: call spir_kernel void @spir_kernel + call spir_kernel void @spir_kernel() + ret void +} + +define void @call_spir_func() { +; CHECK: call spir_func void @spir_func + call spir_func void @spir_func() + ret void +} + +define void @call_intel_ocl_bicc() { +; CHECK: call intel_ocl_bicc void @intel_ocl_bicc + call intel_ocl_bicc void @intel_ocl_bicc() + ret void +} + +define void @call_x86_stdcallcc() { +; CHECK: call x86_stdcallcc void @x86_stdcallcc + call x86_stdcallcc void @x86_stdcallcc() + ret void +} + +define void @call_x86_fastcallcc() { +; CHECK: call x86_fastcallcc void @x86_fastcallcc + call x86_fastcallcc void @x86_fastcallcc() + ret void +} + +define void @call_x86_thiscallcc() { +; CHECK: call x86_thiscallcc void @x86_thiscallcc + call x86_thiscallcc void @x86_thiscallcc() + ret void +} + +define void @call_arm_apcscc() { +; CHECK: call arm_apcscc void @arm_apcscc + call arm_apcscc void @arm_apcscc() + ret void +} + +define void @call_arm_aapcscc() { +; CHECK: call arm_aapcscc void @arm_aapcscc + call arm_aapcscc void @arm_aapcscc() + ret void +} + +define void @call_arm_aapcs_vfpcc() { +; CHECK: call arm_aapcs_vfpcc void @arm_aapcs_vfpcc + call arm_aapcs_vfpcc void @arm_aapcs_vfpcc() + ret void +} + +define void @call_msp430_intrcc() { +; CHECK: call msp430_intrcc void @msp430_intrcc + call msp430_intrcc void @msp430_intrcc() + ret void +} + +define void @call_ptx_kernel() { +; CHECK: call ptx_kernel void @ptx_kernel + call ptx_kernel void @ptx_kernel() + ret void +} + +define void @call_ptx_device() { +; CHECK: call ptx_device void @ptx_device + call ptx_device void @ptx_device() + ret void +} + diff --git a/test/Bitcode/calling-conventions.3.2.ll.bc b/test/Bitcode/calling-conventions.3.2.ll.bc new file mode 100644 index 000000000000..b3fad967db0e Binary files /dev/null and b/test/Bitcode/calling-conventions.3.2.ll.bc differ diff --git a/test/Bitcode/cmpxchg-upgrade.ll b/test/Bitcode/cmpxchg-upgrade.ll new file mode 100644 index 000000000000..d36ac1c17909 --- /dev/null +++ b/test/Bitcode/cmpxchg-upgrade.ll @@ -0,0 +1,23 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; cmpxchg-upgrade.ll.bc was produced by running a version of llvm-as from just +; before the IR change on this file. + +define void @test(i32* %addr) { + cmpxchg i32* %addr, i32 42, i32 0 monotonic +; CHECK: cmpxchg i32* %addr, i32 42, i32 0 monotonic monotonic + + cmpxchg i32* %addr, i32 42, i32 0 acquire +; CHECK: cmpxchg i32* %addr, i32 42, i32 0 acquire acquire + + cmpxchg i32* %addr, i32 42, i32 0 release +; CHECK: cmpxchg i32* %addr, i32 42, i32 0 release monotonic + + cmpxchg i32* %addr, i32 42, i32 0 acq_rel +; CHECK: cmpxchg i32* %addr, i32 42, i32 0 acq_rel acquire + + cmpxchg i32* %addr, i32 42, i32 0 seq_cst +; CHECK: cmpxchg i32* %addr, i32 42, i32 0 seq_cst seq_cst + + ret void +} \ No newline at end of file diff --git a/test/Bitcode/cmpxchg-upgrade.ll.bc b/test/Bitcode/cmpxchg-upgrade.ll.bc new file mode 100644 index 000000000000..922f2eb84edf Binary files /dev/null and b/test/Bitcode/cmpxchg-upgrade.ll.bc differ diff --git a/test/Bitcode/conversionInstructions.3.2.ll b/test/Bitcode/conversionInstructions.3.2.ll new file mode 100644 index 000000000000..4b3f27386eff --- /dev/null +++ b/test/Bitcode/conversionInstructions.3.2.ll @@ -0,0 +1,104 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; conversionOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread conversion instructions from +; older bitcode files. + +define void @trunc(i32 %src){ +entry: +; CHECK: %res1 = trunc i32 %src to i8 + %res1 = trunc i32 %src to i8 + + ret void +} + +define void @zext(i32 %src){ +entry: +; CHECK: %res1 = zext i32 %src to i64 + %res1 = zext i32 %src to i64 + + ret void +} + +define void @sext(i32 %src){ +entry: +; CHECK: %res1 = sext i32 %src to i64 + %res1 = sext i32 %src to i64 + + ret void +} + +define void @fptrunc(double %src){ +entry: +; CHECK: %res1 = fptrunc double %src to float + %res1 = fptrunc double %src to float + + ret void +} + +define void @fpext(float %src){ +entry: +; CHECK: %res1 = fpext float %src to double + %res1 = fpext float %src to double + + ret void +} + +define void @fptoui(float %src){ +entry: +; CHECK: %res1 = fptoui float %src to i32 + %res1 = fptoui float %src to i32 + + ret void +} + +define void @fptosi(float %src){ +entry: +; CHECK: %res1 = fptosi float %src to i32 + %res1 = fptosi float %src to i32 + + ret void +} + +define void @uitofp(i32 %src){ +entry: +; CHECK: %res1 = uitofp i32 %src to float + %res1 = uitofp i32 %src to float + + ret void +} + +define void @sitofp(i32 %src){ +entry: +; CHECK: %res1 = sitofp i32 %src to float + %res1 = sitofp i32 %src to float + + ret void +} + +define void @ptrtoint(i32* %src){ +entry: +; CHECK: %res1 = ptrtoint i32* %src to i8 + %res1 = ptrtoint i32* %src to i8 + + ret void +} + +define void @inttoptr(i32 %src){ +entry: +; CHECK: %res1 = inttoptr i32 %src to i32* + %res1 = inttoptr i32 %src to i32* + + ret void +} + +define void @bitcast(i32 %src1, i32* %src2){ +entry: +; CHECK: %res1 = bitcast i32 %src1 to i32 + %res1 = bitcast i32 %src1 to i32 + +; CHECK: %res2 = bitcast i32* %src2 to i64* + %res2 = bitcast i32* %src2 to i64* + + ret void +} \ No newline at end of file diff --git a/test/Bitcode/conversionInstructions.3.2.ll.bc b/test/Bitcode/conversionInstructions.3.2.ll.bc new file mode 100644 index 000000000000..fabf7dab6fb8 Binary files /dev/null and b/test/Bitcode/conversionInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/deprecated-linker_private-linker_private_weak.ll b/test/Bitcode/deprecated-linker_private-linker_private_weak.ll new file mode 100644 index 000000000000..12a527c7738f --- /dev/null +++ b/test/Bitcode/deprecated-linker_private-linker_private_weak.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as -o - %s | llvm-dis | FileCheck %s +; RUN: llvm-as -o /dev/null %s 2>&1 | FileCheck %s -check-prefix CHECK-WARNINGS + +@.linker_private = linker_private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +@.linker_private_weak = linker_private_weak unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 + +; CHECK: @.linker_private = private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +; CHECK: @.linker_private_weak = private unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 + +; CHECK-WARNINGS: warning: '.linker_private' is deprecated, treating as PrivateLinkage +; CHECK-WARNINGS: @.linker_private = linker_private unnamed_addr constant [15 x i8] c"linker_private\00", align 64 +; CHECK-WARNINGS: ^ + +; CHECK-WARNINGS: warning: '.linker_private_weak' is deprecated, treating as PrivateLinkage +; CHECK-WARNINGS: @.linker_private_weak = linker_private_weak unnamed_addr constant [20 x i8] c"linker_private_weak\00", align 64 +; CHECK-WARNINGS: ^ + diff --git a/test/Bitcode/drop-debug-info.ll b/test/Bitcode/drop-debug-info.ll index da4ae0c541eb..5123018577ee 100644 --- a/test/Bitcode/drop-debug-info.ll +++ b/test/Bitcode/drop-debug-info.ll @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: llvm-as < %s -o %t.bc 2>&1 >/dev/null | FileCheck -check-prefix=WARN %s +; RUN: llvm-dis < %t.bc | FileCheck %s define i32 @main() { entry: @@ -22,5 +23,6 @@ entry: !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 2} !12 = metadata !{i32 4, i32 0, metadata !4, null} +; WARN: warning: ignoring debug info with an invalid version (0) ; CHECK-NOT: !dbg ; CHECK-NOT: !llvm.dbg.cu diff --git a/test/Bitcode/global-variables.3.2.ll b/test/Bitcode/global-variables.3.2.ll new file mode 100644 index 000000000000..549d025549be --- /dev/null +++ b/test/Bitcode/global-variables.3.2.ll @@ -0,0 +1,41 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; global-variables.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not silently misread global variables attributes of +; older bitcode files. + +@global.var = global i32 1 +; CHECK: @global.var = global i32 1 + +@constant.var = constant i32 1 +; CHECK: @constant.var = constant i32 1 + +@noinit.var = global float undef +; CHECK: @noinit.var = global float undef + +@section.var = global i32 1, section "foo" +; CHECK: @section.var = global i32 1, section "foo" + +@align.var = global i64 undef, align 8 +; CHECK: @align.var = global i64 undef, align 8 + +@unnamed_addr.var = unnamed_addr global i8 1 +; CHECK: @unnamed_addr.var = unnamed_addr global i8 1 + +@default_addrspace.var = addrspace(0) global i8 1 +; CHECK: @default_addrspace.var = global i8 1 + +@non_default_addrspace.var = addrspace(1) global i8* undef +; CHECK: @non_default_addrspace.var = addrspace(1) global i8* undef + +@initialexec.var = thread_local(initialexec) global i32 0, align 4 +; CHECK: @initialexec.var = thread_local(initialexec) global i32 0, align 4 + +@localdynamic.var = thread_local(localdynamic) constant i32 0, align 4 +; CHECK: @localdynamic.var = thread_local(localdynamic) constant i32 0, align 4 + +@localexec.var = thread_local(localexec) constant i32 0, align 4 +; CHECK: @localexec.var = thread_local(localexec) constant i32 0, align 4 + +@string.var = private unnamed_addr constant [13 x i8] c"hello world\0A\00" +; CHECK: @string.var = private unnamed_addr constant [13 x i8] c"hello world\0A\00" diff --git a/test/Bitcode/global-variables.3.2.ll.bc b/test/Bitcode/global-variables.3.2.ll.bc new file mode 100644 index 000000000000..c105f2fb1831 Binary files /dev/null and b/test/Bitcode/global-variables.3.2.ll.bc differ diff --git a/test/Bitcode/inalloca.ll b/test/Bitcode/inalloca.ll new file mode 100644 index 000000000000..bad87a9b03f0 --- /dev/null +++ b/test/Bitcode/inalloca.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; inalloca should roundtrip. + +define void @foo(i32* inalloca %args) { + ret void +} +; CHECK-LABEL: define void @foo(i32* inalloca %args) + +define void @bar() { + ; Use the maximum alignment, since we stuff our bit with alignment. + %args = alloca inalloca i32, align 536870912 + call void @foo(i32* inalloca %args) + ret void +} +; CHECK-LABEL: define void @bar() { +; CHECK: %args = alloca inalloca i32, align 536870912 +; CHECK: call void @foo(i32* inalloca %args) diff --git a/test/Bitcode/linkage-types-3.2.ll b/test/Bitcode/linkage-types-3.2.ll new file mode 100644 index 000000000000..fd070efbd444 --- /dev/null +++ b/test/Bitcode/linkage-types-3.2.ll @@ -0,0 +1,128 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; linkage-types-3.2.ll.bc was generated by passing this file to llvm-as-3.2 +; The test checks that LLVM does not silently misread linkage types of +; older bitcode files. + +@common.var = common global i32 0 +; CHECK: @common.var = common global i32 0 + +@appending.var = appending global [8 x i32] undef +; CHECK: @appending.var = appending global [8 x i32] undef + +@extern_weak.var = extern_weak global i32 +; CHECK: @extern_weak.var = extern_weak global i32 + +@private.var = private constant i32 0 +; CHECK: @private.var = private constant i32 0 + +@linker_private.var = linker_private constant i32 0 +; CHECK: @linker_private.var = private constant i32 0 + +@linker_private_weak.var = linker_private_weak constant i32 0 +; CHECK: @linker_private_weak.var = private constant i32 0 + +@linker_private_weak_def_auto.var = linker_private_weak_def_auto constant i32 0 +; CHECK: @linker_private_weak_def_auto.var = constant i32 0 + +@internal.var = internal constant i32 0 +; CHECK: @internal.var = internal constant i32 0 + +@available_externally.var = available_externally constant i32 0 +; CHECK: @available_externally.var = available_externally constant i32 0 + +@linkonce.var = linkonce constant i32 0 +; CHECK: @linkonce.var = linkonce constant i32 0 + +@weak.var = weak constant i32 0 +; CHECK: @weak.var = weak constant i32 0 + +@linkonce_odr.var = linkonce_odr constant i32 0 +; CHECK: @linkonce_odr.var = linkonce_odr constant i32 0 + +@linkonce_odr_auto_hide.var = linkonce_odr_auto_hide constant i32 0 +; CHECK: @linkonce_odr_auto_hide.var = constant i32 0 + +@external.var = external constant i32 +; CHECK: @external.var = external constant i32 + +@dllexport.var = dllexport global i32 0 +; CHECK: @dllexport.var = dllexport global i32 0 + +@dllimport.var = dllimport global i32 +; CHECK: @dllimport.var = external dllimport global i32 + +define private void @private() +; CHECK: define private void @private +{ + ret void; +} + +define linker_private void @linker_private() +; CHECK: define private void @linker_private +{ + ret void; +} + +define linker_private_weak void @linker_private_weak() +; CHECK: define private void @linker_private_weak +{ + ret void; +} + +define linker_private_weak_def_auto void @linker_private_weak_def_auto() +; CHECK: define void @linker_private_weak_def_auto +{ + ret void; +} + +define internal void @internal() +; CHECK: define internal void @internal +{ + ret void; +} + +define available_externally void @available_externally() +; CHECK: define available_externally void @available_externally +{ + ret void; +} + +define linkonce void @linkonce() +; CHECK: define linkonce void @linkonce +{ + ret void; +} + +define weak void @weak() +; CHECK: define weak void @weak +{ + ret void; +} + +define linkonce_odr void @linkonce_odr() +; CHECK: define linkonce_odr void @linkonce_odr +{ + ret void; +} + +define linkonce_odr_auto_hide void @linkonce_odr_auto_hide() +; CHECK: define void @linkonce_odr_auto_hide +{ + ret void; +} + +define external void @external() +; CHECK: define void @external +{ + ret void; +} + +declare dllimport void @dllimport() +; CHECK: declare dllimport void @dllimport + +define dllexport void @dllexport() +; CHECK: define dllexport void @dllexport() +{ + ret void; +} diff --git a/test/Bitcode/linkage-types-3.2.ll.bc b/test/Bitcode/linkage-types-3.2.ll.bc new file mode 100644 index 000000000000..c856ddf7aa7b Binary files /dev/null and b/test/Bitcode/linkage-types-3.2.ll.bc differ diff --git a/test/Bitcode/local-linkage-default-visibility.3.4.ll b/test/Bitcode/local-linkage-default-visibility.3.4.ll new file mode 100644 index 000000000000..45a7b1213a8c --- /dev/null +++ b/test/Bitcode/local-linkage-default-visibility.3.4.ll @@ -0,0 +1,79 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; local-linkage-default-visibility.3.4.ll.bc was generated by passing this file +; to llvm-as-3.4. The test checks that LLVM upgrades visibility of symbols +; with local linkage to default visibility. + +@default.internal.var = internal global i32 0 +; CHECK: @default.internal.var = internal global i32 0 + +@hidden.internal.var = internal hidden global i32 0 +; CHECK: @hidden.internal.var = internal global i32 0 + +@protected.internal.var = internal protected global i32 0 +; CHECK: @protected.internal.var = internal global i32 0 + +@default.private.var = private global i32 0 +; CHECK: @default.private.var = private global i32 0 + +@hidden.private.var = private hidden global i32 0 +; CHECK: @hidden.private.var = private global i32 0 + +@protected.private.var = private protected global i32 0 +; CHECK: @protected.private.var = private global i32 0 + +@global = global i32 0 + +@default.internal.alias = alias internal i32* @global +; CHECK: @default.internal.alias = alias internal i32* @global + +@hidden.internal.alias = hidden alias internal i32* @global +; CHECK: @hidden.internal.alias = alias internal i32* @global + +@protected.internal.alias = protected alias internal i32* @global +; CHECK: @protected.internal.alias = alias internal i32* @global + +@default.private.alias = alias private i32* @global +; CHECK: @default.private.alias = alias private i32* @global + +@hidden.private.alias = hidden alias private i32* @global +; CHECK: @hidden.private.alias = alias private i32* @global + +@protected.private.alias = protected alias private i32* @global +; CHECK: @protected.private.alias = alias private i32* @global + +define internal void @default.internal() { +; CHECK: define internal void @default.internal +entry: + ret void +} + +define internal hidden void @hidden.internal() { +; CHECK: define internal void @hidden.internal +entry: + ret void +} + +define internal protected void @protected.internal() { +; CHECK: define internal void @protected.internal +entry: + ret void +} + +define private void @default.private() { +; CHECK: define private void @default.private +entry: + ret void +} + +define private hidden void @hidden.private() { +; CHECK: define private void @hidden.private +entry: + ret void +} + +define private protected void @protected.private() { +; CHECK: define private void @protected.private +entry: + ret void +} diff --git a/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc b/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc new file mode 100644 index 000000000000..6e49f7e365b7 Binary files /dev/null and b/test/Bitcode/local-linkage-default-visibility.3.4.ll.bc differ diff --git a/test/Bitcode/memInstructions.3.2.ll b/test/Bitcode/memInstructions.3.2.ll new file mode 100644 index 000000000000..e4cb6bdbe96b --- /dev/null +++ b/test/Bitcode/memInstructions.3.2.ll @@ -0,0 +1,328 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; memOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread memory related instructions of +; older bitcode files. + +define void @alloca(){ +entry: +; CHECK: %res1 = alloca i8 + %res1 = alloca i8 + +; CHECK-NEXT: %res2 = alloca i8, i32 2 + %res2 = alloca i8, i32 2 + +; CHECK-NEXT: %res3 = alloca i8, i32 2, align 4 + %res3 = alloca i8, i32 2, align 4 + +; CHECK-NEXT: %res4 = alloca i8, align 4 + %res4 = alloca i8, align 4 + + ret void +} + +define void @load(){ +entry: + %ptr1 = alloca i8 + store i8 2, i8* %ptr1 + +; CHECK: %res1 = load i8* %ptr1 + %res1 = load i8* %ptr1 + +; CHECK-NEXT: %res2 = load volatile i8* %ptr1 + %res2 = load volatile i8* %ptr1 + +; CHECK-NEXT: %res3 = load i8* %ptr1, align 1 + %res3 = load i8* %ptr1, align 1 + +; CHECK-NEXT: %res4 = load volatile i8* %ptr1, align 1 + %res4 = load volatile i8* %ptr1, align 1 + +; CHECK-NEXT: %res5 = load i8* %ptr1, !nontemporal !0 + %res5 = load i8* %ptr1, !nontemporal !0 + +; CHECK-NEXT: %res6 = load volatile i8* %ptr1, !nontemporal !0 + %res6 = load volatile i8* %ptr1, !nontemporal !0 + +; CHECK-NEXT: %res7 = load i8* %ptr1, align 1, !nontemporal !0 + %res7 = load i8* %ptr1, align 1, !nontemporal !0 + +; CHECK-NEXT: %res8 = load volatile i8* %ptr1, align 1, !nontemporal !0 + %res8 = load volatile i8* %ptr1, align 1, !nontemporal !0 + +; CHECK-NEXT: %res9 = load i8* %ptr1, !invariant.load !1 + %res9 = load i8* %ptr1, !invariant.load !1 + +; CHECK-NEXT: %res10 = load volatile i8* %ptr1, !invariant.load !1 + %res10 = load volatile i8* %ptr1, !invariant.load !1 + +; CHECK-NEXT: %res11 = load i8* %ptr1, align 1, !invariant.load !1 + %res11 = load i8* %ptr1, align 1, !invariant.load !1 + +; CHECK-NEXT: %res12 = load volatile i8* %ptr1, align 1, !invariant.load !1 + %res12 = load volatile i8* %ptr1, align 1, !invariant.load !1 + +; CHECK-NEXT: %res13 = load i8* %ptr1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}} + %res13 = load i8* %ptr1, !nontemporal !0, !invariant.load !1 + +; CHECK-NEXT: %res14 = load volatile i8* %ptr1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}} + %res14 = load volatile i8* %ptr1, !nontemporal !0, !invariant.load !1 + +; CHECK-NEXT: %res15 = load i8* %ptr1, align 1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}} + %res15 = load i8* %ptr1, align 1, !nontemporal !0, !invariant.load !1 + +; CHECK-NEXT: %res16 = load volatile i8* %ptr1, align 1, {{[(!nontemporal !0, !invariant.load !1) | (!invariant.load !1, !nontemporal !0)]}} + %res16 = load volatile i8* %ptr1, align 1, !nontemporal !0, !invariant.load !1 + + ret void +} + +define void @loadAtomic(){ +entry: + %ptr1 = alloca i8 + store i8 2, i8* %ptr1 + +; CHECK: %res1 = load atomic i8* %ptr1 unordered, align 1 + %res1 = load atomic i8* %ptr1 unordered, align 1 + +; CHECK-NEXT: %res2 = load atomic i8* %ptr1 monotonic, align 1 + %res2 = load atomic i8* %ptr1 monotonic, align 1 + +; CHECK-NEXT: %res3 = load atomic i8* %ptr1 acquire, align 1 + %res3 = load atomic i8* %ptr1 acquire, align 1 + +; CHECK-NEXT: %res4 = load atomic i8* %ptr1 seq_cst, align 1 + %res4 = load atomic i8* %ptr1 seq_cst, align 1 + +; CHECK-NEXT: %res5 = load atomic volatile i8* %ptr1 unordered, align 1 + %res5 = load atomic volatile i8* %ptr1 unordered, align 1 + +; CHECK-NEXT: %res6 = load atomic volatile i8* %ptr1 monotonic, align 1 + %res6 = load atomic volatile i8* %ptr1 monotonic, align 1 + +; CHECK-NEXT: %res7 = load atomic volatile i8* %ptr1 acquire, align 1 + %res7 = load atomic volatile i8* %ptr1 acquire, align 1 + +; CHECK-NEXT: %res8 = load atomic volatile i8* %ptr1 seq_cst, align 1 + %res8 = load atomic volatile i8* %ptr1 seq_cst, align 1 + +; CHECK-NEXT: %res9 = load atomic i8* %ptr1 singlethread unordered, align 1 + %res9 = load atomic i8* %ptr1 singlethread unordered, align 1 + +; CHECK-NEXT: %res10 = load atomic i8* %ptr1 singlethread monotonic, align 1 + %res10 = load atomic i8* %ptr1 singlethread monotonic, align 1 + +; CHECK-NEXT: %res11 = load atomic i8* %ptr1 singlethread acquire, align 1 + %res11 = load atomic i8* %ptr1 singlethread acquire, align 1 + +; CHECK-NEXT: %res12 = load atomic i8* %ptr1 singlethread seq_cst, align 1 + %res12 = load atomic i8* %ptr1 singlethread seq_cst, align 1 + +; CHECK-NEXT: %res13 = load atomic volatile i8* %ptr1 singlethread unordered, align 1 + %res13 = load atomic volatile i8* %ptr1 singlethread unordered, align 1 + +; CHECK-NEXT: %res14 = load atomic volatile i8* %ptr1 singlethread monotonic, align 1 + %res14 = load atomic volatile i8* %ptr1 singlethread monotonic, align 1 + +; CHECK-NEXT: %res15 = load atomic volatile i8* %ptr1 singlethread acquire, align 1 + %res15 = load atomic volatile i8* %ptr1 singlethread acquire, align 1 + +; CHECK-NEXT: %res16 = load atomic volatile i8* %ptr1 singlethread seq_cst, align 1 + %res16 = load atomic volatile i8* %ptr1 singlethread seq_cst, align 1 + + ret void +} + +define void @store(){ +entry: + %ptr1 = alloca i8 + +; CHECK: store i8 2, i8* %ptr1 + store i8 2, i8* %ptr1 + +; CHECK-NEXT: store volatile i8 2, i8* %ptr1 + store volatile i8 2, i8* %ptr1 + +; CHECK-NEXT: store i8 2, i8* %ptr1, align 1 + store i8 2, i8* %ptr1, align 1 + +; CHECK-NEXT: store volatile i8 2, i8* %ptr1, align 1 + store volatile i8 2, i8* %ptr1, align 1 + +; CHECK-NEXT: store i8 2, i8* %ptr1, !nontemporal !0 + store i8 2, i8* %ptr1, !nontemporal !0 + +; CHECK-NEXT: store volatile i8 2, i8* %ptr1, !nontemporal !0 + store volatile i8 2, i8* %ptr1, !nontemporal !0 + +; CHECK-NEXT: store i8 2, i8* %ptr1, align 1, !nontemporal !0 + store i8 2, i8* %ptr1, align 1, !nontemporal !0 + +; CHECK-NEXT: store volatile i8 2, i8* %ptr1, align 1, !nontemporal !0 + store volatile i8 2, i8* %ptr1, align 1, !nontemporal !0 + + ret void +} + +define void @storeAtomic(){ +entry: + %ptr1 = alloca i8 + +; CHECK: store atomic i8 2, i8* %ptr1 unordered, align 1 + store atomic i8 2, i8* %ptr1 unordered, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 monotonic, align 1 + store atomic i8 2, i8* %ptr1 monotonic, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 release, align 1 + store atomic i8 2, i8* %ptr1 release, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 seq_cst, align 1 + store atomic i8 2, i8* %ptr1 seq_cst, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 unordered, align 1 + store atomic volatile i8 2, i8* %ptr1 unordered, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 monotonic, align 1 + store atomic volatile i8 2, i8* %ptr1 monotonic, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 release, align 1 + store atomic volatile i8 2, i8* %ptr1 release, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 seq_cst, align 1 + store atomic volatile i8 2, i8* %ptr1 seq_cst, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread unordered, align 1 + store atomic i8 2, i8* %ptr1 singlethread unordered, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread monotonic, align 1 + store atomic i8 2, i8* %ptr1 singlethread monotonic, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread release, align 1 + store atomic i8 2, i8* %ptr1 singlethread release, align 1 + +; CHECK-NEXT: store atomic i8 2, i8* %ptr1 singlethread seq_cst, align 1 + store atomic i8 2, i8* %ptr1 singlethread seq_cst, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread unordered, align 1 + store atomic volatile i8 2, i8* %ptr1 singlethread unordered, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread monotonic, align 1 + store atomic volatile i8 2, i8* %ptr1 singlethread monotonic, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread release, align 1 + store atomic volatile i8 2, i8* %ptr1 singlethread release, align 1 + +; CHECK-NEXT: store atomic volatile i8 2, i8* %ptr1 singlethread seq_cst, align 1 + store atomic volatile i8 2, i8* %ptr1 singlethread seq_cst, align 1 + + ret void +} + +define void @cmpxchg(i32* %ptr,i32 %cmp,i32 %new){ +entry: + ;cmpxchg [volatile] * , , [singlethread] + +; CHECK: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new monotonic monotonic +; CHECK-NEXT: %res1 = extractvalue { i32, i1 } [[TMP]], 0 + %res1 = cmpxchg i32* %ptr, i32 %cmp, i32 %new monotonic monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new monotonic monotonic +; CHECK-NEXT: %res2 = extractvalue { i32, i1 } [[TMP]], 0 + %res2 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new monotonic monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic +; CHECK-NEXT: %res3 = extractvalue { i32, i1 } [[TMP]], 0 + %res3 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic +; CHECK-NEXT: %res4 = extractvalue { i32, i1 } [[TMP]], 0 + %res4 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread monotonic monotonic + + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new acquire acquire +; CHECK-NEXT: %res5 = extractvalue { i32, i1 } [[TMP]], 0 + %res5 = cmpxchg i32* %ptr, i32 %cmp, i32 %new acquire acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acquire acquire +; CHECK-NEXT: %res6 = extractvalue { i32, i1 } [[TMP]], 0 + %res6 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acquire acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire +; CHECK-NEXT: %res7 = extractvalue { i32, i1 } [[TMP]], 0 + %res7 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire +; CHECK-NEXT: %res8 = extractvalue { i32, i1 } [[TMP]], 0 + %res8 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acquire acquire + + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new release monotonic +; CHECK-NEXT: %res9 = extractvalue { i32, i1 } [[TMP]], 0 + %res9 = cmpxchg i32* %ptr, i32 %cmp, i32 %new release monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new release monotonic +; CHECK-NEXT: %res10 = extractvalue { i32, i1 } [[TMP]], 0 + %res10 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new release monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic +; CHECK-NEXT: %res11 = extractvalue { i32, i1 } [[TMP]], 0 + %res11 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic +; CHECK-NEXT: %res12 = extractvalue { i32, i1 } [[TMP]], 0 + %res12 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread release monotonic + + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new acq_rel acquire +; CHECK-NEXT: %res13 = extractvalue { i32, i1 } [[TMP]], 0 + %res13 = cmpxchg i32* %ptr, i32 %cmp, i32 %new acq_rel acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acq_rel acquire +; CHECK-NEXT: %res14 = extractvalue { i32, i1 } [[TMP]], 0 + %res14 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new acq_rel acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire +; CHECK-NEXT: %res15 = extractvalue { i32, i1 } [[TMP]], 0 + %res15 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire +; CHECK-NEXT: %res16 = extractvalue { i32, i1 } [[TMP]], 0 + %res16 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread acq_rel acquire + + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst +; CHECK-NEXT: %res17 = extractvalue { i32, i1 } [[TMP]], 0 + %res17 = cmpxchg i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst +; CHECK-NEXT: %res18 = extractvalue { i32, i1 } [[TMP]], 0 + %res18 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new seq_cst seq_cst + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst +; CHECK-NEXT: %res19 = extractvalue { i32, i1 } [[TMP]], 0 + %res19 = cmpxchg i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst + +; CHECK-NEXT: [[TMP:%[a-z0-9]+]] = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst +; CHECK-NEXT: %res20 = extractvalue { i32, i1 } [[TMP]], 0 + %res20 = cmpxchg volatile i32* %ptr, i32 %cmp, i32 %new singlethread seq_cst seq_cst + + ret void +} + +define void @getelementptr({i8, i8}* %s, <4 x i8*> %ptrs, <4 x i64> %offsets ){ +entry: +; CHECK: %res1 = getelementptr { i8, i8 }* %s, i32 1, i32 1 + %res1 = getelementptr {i8, i8}* %s, i32 1, i32 1 + +; CHECK-NEXT: %res2 = getelementptr inbounds { i8, i8 }* %s, i32 1, i32 1 + %res2 = getelementptr inbounds {i8, i8}* %s, i32 1, i32 1 + +; CHECK-NEXT: %res3 = getelementptr <4 x i8*> %ptrs, <4 x i64> %offsets + %res3 = getelementptr <4 x i8*> %ptrs, <4 x i64> %offsets + + ret void +} + +!0 = metadata !{ i32 1 } +!1 = metadata !{} \ No newline at end of file diff --git a/test/Bitcode/memInstructions.3.2.ll.bc b/test/Bitcode/memInstructions.3.2.ll.bc new file mode 100644 index 000000000000..d75954a301b6 Binary files /dev/null and b/test/Bitcode/memInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/miscInstructions.3.2.ll b/test/Bitcode/miscInstructions.3.2.ll new file mode 100644 index 000000000000..bceae20109c3 --- /dev/null +++ b/test/Bitcode/miscInstructions.3.2.ll @@ -0,0 +1,126 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; miscInstructions.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread miscellaneous instructions of +; older bitcode files. + +define void @icmp(i32 %x1, i32 %x2, i32* %ptr1, i32* %ptr2, <2 x i32> %vec1, <2 x i32> %vec2){ +entry: +; CHECK: %res1 = icmp eq i32 %x1, %x2 + %res1 = icmp eq i32 %x1, %x2 + +; CHECK-NEXT: %res2 = icmp ne i32 %x1, %x2 + %res2 = icmp ne i32 %x1, %x2 + +; CHECK-NEXT: %res3 = icmp ugt i32 %x1, %x2 + %res3 = icmp ugt i32 %x1, %x2 + +; CHECK-NEXT: %res4 = icmp uge i32 %x1, %x2 + %res4 = icmp uge i32 %x1, %x2 + +; CHECK-NEXT: %res5 = icmp ult i32 %x1, %x2 + %res5 = icmp ult i32 %x1, %x2 + +; CHECK-NEXT: %res6 = icmp ule i32 %x1, %x2 + %res6 = icmp ule i32 %x1, %x2 + +; CHECK-NEXT: %res7 = icmp sgt i32 %x1, %x2 + %res7 = icmp sgt i32 %x1, %x2 + +; CHECK-NEXT: %res8 = icmp sge i32 %x1, %x2 + %res8 = icmp sge i32 %x1, %x2 + +; CHECK-NEXT: %res9 = icmp slt i32 %x1, %x2 + %res9 = icmp slt i32 %x1, %x2 + +; CHECK-NEXT: %res10 = icmp sle i32 %x1, %x2 + %res10 = icmp sle i32 %x1, %x2 + +; CHECK-NEXT: %res11 = icmp eq i32* %ptr1, %ptr2 + %res11 = icmp eq i32* %ptr1, %ptr2 + +; CHECK-NEXT: %res12 = icmp eq <2 x i32> %vec1, %vec2 + %res12 = icmp eq <2 x i32> %vec1, %vec2 + + ret void +} + + +define void @fcmp(float %x1, float %x2, <2 x float> %vec1, <2 x float> %vec2){ +entry: +; CHECK: %res1 = fcmp oeq float %x1, %x2 + %res1 = fcmp oeq float %x1, %x2 + +; CHECK-NEXT: %res2 = fcmp one float %x1, %x2 + %res2 = fcmp one float %x1, %x2 + +; CHECK-NEXT: %res3 = fcmp ugt float %x1, %x2 + %res3 = fcmp ugt float %x1, %x2 + +; CHECK-NEXT: %res4 = fcmp uge float %x1, %x2 + %res4 = fcmp uge float %x1, %x2 + +; CHECK-NEXT: %res5 = fcmp ult float %x1, %x2 + %res5 = fcmp ult float %x1, %x2 + +; CHECK-NEXT: %res6 = fcmp ule float %x1, %x2 + %res6 = fcmp ule float %x1, %x2 + +; CHECK-NEXT: %res7 = fcmp ogt float %x1, %x2 + %res7 = fcmp ogt float %x1, %x2 + +; CHECK-NEXT: %res8 = fcmp oge float %x1, %x2 + %res8 = fcmp oge float %x1, %x2 + +; CHECK-NEXT: %res9 = fcmp olt float %x1, %x2 + %res9 = fcmp olt float %x1, %x2 + +; CHECK-NEXT: %res10 = fcmp ole float %x1, %x2 + %res10 = fcmp ole float %x1, %x2 + +; CHECK-NEXT: %res11 = fcmp ord float %x1, %x2 + %res11 = fcmp ord float %x1, %x2 + +; CHECK-NEXT: %res12 = fcmp ueq float %x1, %x2 + %res12 = fcmp ueq float %x1, %x2 + +; CHECK-NEXT: %res13 = fcmp une float %x1, %x2 + %res13 = fcmp une float %x1, %x2 + +; CHECK-NEXT: %res14 = fcmp uno float %x1, %x2 + %res14 = fcmp uno float %x1, %x2 + +; CHECK-NEXT: %res15 = fcmp true float %x1, %x2 + %res15 = fcmp true float %x1, %x2 + +; CHECK-NEXT: %res16 = fcmp false float %x1, %x2 + %res16 = fcmp false float %x1, %x2 + +; CHECK-NEXT: %res17 = fcmp oeq <2 x float> %vec1, %vec2 + %res17 = fcmp oeq <2 x float> %vec1, %vec2 + + ret void +} + +declare i32 @printf(i8* noalias nocapture, ...) + +define void @call(i32 %x, i8* %msg ){ +entry: + +; CHECK: %res1 = call i32 @test(i32 %x) + %res1 = call i32 @test(i32 %x) + +; CHECK-NEXT: %res2 = tail call i32 @test(i32 %x) + %res2 = tail call i32 @test(i32 %x) + +; CHECK-NEXT: %res3 = call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42) + %res3 = call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42) + + ret void +} + +define i32 @test(i32 %x){ +entry: + + ret i32 %x +} diff --git a/test/Bitcode/miscInstructions.3.2.ll.bc b/test/Bitcode/miscInstructions.3.2.ll.bc new file mode 100644 index 000000000000..9d479b506171 Binary files /dev/null and b/test/Bitcode/miscInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/old-aliases.ll b/test/Bitcode/old-aliases.ll new file mode 100644 index 000000000000..7a0eea2f3f24 --- /dev/null +++ b/test/Bitcode/old-aliases.ll @@ -0,0 +1,22 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; old-aliases.bc consist of this file assembled with an old llvm-as (3.5 trunk) +; from when aliases contained a ConstantExpr. + +@v1 = global i32 0 +; CHECK: @v1 = global i32 0 + +@v2 = global [1 x i32] zeroinitializer +; CHECK: @v2 = global [1 x i32] zeroinitializer + +@v3 = alias bitcast (i32* @v1 to i16*) +; CHECK: @v3 = alias bitcast (i32* @v1 to i16*) + +@v4 = alias getelementptr ([1 x i32]* @v2, i32 0, i32 0) +; CHECK: @v4 = alias getelementptr inbounds ([1 x i32]* @v2, i32 0, i32 0) + +@v5 = alias i32 addrspace(2)* addrspacecast (i32 addrspace(0)* @v1 to i32 addrspace(2)*) +; CHECK: @v5 = alias addrspacecast (i32* @v1 to i32 addrspace(2)*) + +@v6 = alias i16* @v3 +; CHECK: @v6 = alias i16* @v3 diff --git a/test/Bitcode/old-aliases.ll.bc b/test/Bitcode/old-aliases.ll.bc new file mode 100644 index 000000000000..1f157b2a0452 Binary files /dev/null and b/test/Bitcode/old-aliases.ll.bc differ diff --git a/test/Bitcode/pr18704.ll b/test/Bitcode/pr18704.ll new file mode 100644 index 000000000000..f05fe53259fa --- /dev/null +++ b/test/Bitcode/pr18704.ll @@ -0,0 +1,158 @@ +; RUN: not llvm-dis < %s.bc 2>&1 | FileCheck %s + +; CHECK: llvm-dis{{(\.EXE|\.exe)?}}: Never resolved value found in function + +; pr18704.ll.bc has an instruction referring to invalid type. +; The test checks that LLVM reports the error and doesn't access freed memory +; in doing so. + +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; +; diff --git a/test/Bitcode/pr18704.ll.bc b/test/Bitcode/pr18704.ll.bc new file mode 100644 index 000000000000..dbfcf37b82ab Binary files /dev/null and b/test/Bitcode/pr18704.ll.bc differ diff --git a/test/Bitcode/select.ll b/test/Bitcode/select.ll index 71e669a90cdc..08a3061394db 100644 --- a/test/Bitcode/select.ll +++ b/test/Bitcode/select.ll @@ -5,5 +5,5 @@ define <2 x i32> @main() { } ; CHECK: define <2 x i32> @main() { -; CHECK: ret <2 x i32> select (<2 x i1> , <2 x i32> zeroinitializer, <2 x i32> ) +; CHECK: ret <2 x i32> ; CHECK: } diff --git a/test/Bitcode/tailcall.ll b/test/Bitcode/tailcall.ll new file mode 100644 index 000000000000..765b47054cad --- /dev/null +++ b/test/Bitcode/tailcall.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Check that musttail and tail roundtrip. + +declare cc8191 void @t1_callee() +define cc8191 void @t1() { +; CHECK: tail call cc8191 void @t1_callee() + tail call cc8191 void @t1_callee() + ret void +} + +declare cc8191 void @t2_callee() +define cc8191 void @t2() { +; CHECK: musttail call cc8191 void @t2_callee() + musttail call cc8191 void @t2_callee() + ret void +} diff --git a/test/Bitcode/terminatorInstructions.3.2.ll b/test/Bitcode/terminatorInstructions.3.2.ll new file mode 100644 index 000000000000..31e78967ee0c --- /dev/null +++ b/test/Bitcode/terminatorInstructions.3.2.ll @@ -0,0 +1,47 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; TerminatorOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread terminator instructions from +; older bitcode files. + +define i32 @condbr(i1 %cond){ +entry: +; CHECK: br i1 %cond, label %TrueLabel, label %FalseLabel + br i1 %cond, label %TrueLabel, label %FalseLabel + + TrueLabel: + ret i32 1 + + FalseLabel: + ret i32 0 +} + +define i32 @uncondbr(){ +entry: +; CHECK: br label %uncondLabel + br label %uncondLabel + + uncondLabel: + ret i32 1 +} + +define i32 @indirectbr(i8* %Addr){ +entry: +; CHECK: indirectbr i8* %Addr, [label %bb1, label %bb2] + indirectbr i8* %Addr, [ label %bb1, label %bb2 ] + + bb1: + ret i32 1 + + bb2: + ret i32 0 +} + +define void @unreachable(){ +entry: +; CHECK: unreachable + unreachable + + ret void +} + diff --git a/test/Bitcode/terminatorInstructions.3.2.ll.bc b/test/Bitcode/terminatorInstructions.3.2.ll.bc new file mode 100644 index 000000000000..9d92ead8ad18 Binary files /dev/null and b/test/Bitcode/terminatorInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/upgrade-global-ctors.ll b/test/Bitcode/upgrade-global-ctors.ll new file mode 100644 index 000000000000..bd253a81620f --- /dev/null +++ b/test/Bitcode/upgrade-global-ctors.ll @@ -0,0 +1,3 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer diff --git a/test/Bitcode/upgrade-global-ctors.ll.bc b/test/Bitcode/upgrade-global-ctors.ll.bc new file mode 100644 index 000000000000..927fd91867e9 Binary files /dev/null and b/test/Bitcode/upgrade-global-ctors.ll.bc differ diff --git a/test/Bitcode/upgrade-loop-metadata.ll b/test/Bitcode/upgrade-loop-metadata.ll new file mode 100644 index 000000000000..67a8d3935926 --- /dev/null +++ b/test/Bitcode/upgrade-loop-metadata.ll @@ -0,0 +1,37 @@ +; Test to make sure loop vectorizer metadata is automatically upgraded. +; +; RUN: llvm-dis < %s.bc | FileCheck %s + +define void @_Z28loop_with_vectorize_metadatav() { +entry: + %i = alloca i32, align 4 + store i32 0, i32* %i, align 4 + br label %for.cond + +for.cond: ; preds = %for.inc, %entry + %0 = load i32* %i, align 4 + %cmp = icmp slt i32 %0, 16 + br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 + +for.body: ; preds = %for.cond + br label %for.inc + +for.inc: ; preds = %for.body + %1 = load i32* %i, align 4 + %inc = add nsw i32 %1, 1 + store i32 %inc, i32* %i, align 4 + br label %for.cond + +for.end: ; preds = %for.cond + ret void +} + +; CHECK: !{metadata !"llvm.loop.interleave.count", i32 4} +; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8} +; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true} + +!0 = metadata !{metadata !"clang version 3.5.0 (trunk 211528)"} +!1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4, metadata !4} +!2 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4} +!3 = metadata !{metadata !"llvm.vectorizer.width", i32 8} +!4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true} diff --git a/test/Bitcode/upgrade-loop-metadata.ll.bc b/test/Bitcode/upgrade-loop-metadata.ll.bc new file mode 100644 index 000000000000..3f218cb7feb4 Binary files /dev/null and b/test/Bitcode/upgrade-loop-metadata.ll.bc differ diff --git a/test/Bitcode/variableArgumentIntrinsic.3.2.ll b/test/Bitcode/variableArgumentIntrinsic.3.2.ll new file mode 100644 index 000000000000..35fe0e252822 --- /dev/null +++ b/test/Bitcode/variableArgumentIntrinsic.3.2.ll @@ -0,0 +1,33 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; vaArgIntrinsic.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread variable argument intrinsic instructions +; of older bitcode files. + +define i32 @varArgIntrinsic(i32 %X, ...) { + + %ap = alloca i8* + %ap2 = bitcast i8** %ap to i8* + +; CHECK: call void @llvm.va_start(i8* %ap2) + call void @llvm.va_start(i8* %ap2) + +; CHECK-NEXT: %tmp = va_arg i8** %ap, i32 + %tmp = va_arg i8** %ap, i32 + + %aq = alloca i8* + %aq2 = bitcast i8** %aq to i8* + +; CHECK: call void @llvm.va_copy(i8* %aq2, i8* %ap2) + call void @llvm.va_copy(i8* %aq2, i8* %ap2) +; CHECK-NEXT: call void @llvm.va_end(i8* %aq2) + call void @llvm.va_end(i8* %aq2) + +; CHECK-NEXT: call void @llvm.va_end(i8* %ap2) + call void @llvm.va_end(i8* %ap2) + ret i32 %tmp +} + +declare void @llvm.va_start(i8*) +declare void @llvm.va_copy(i8*, i8*) +declare void @llvm.va_end(i8*) \ No newline at end of file diff --git a/test/Bitcode/variableArgumentIntrinsic.3.2.ll.bc b/test/Bitcode/variableArgumentIntrinsic.3.2.ll.bc new file mode 100644 index 000000000000..066e102b1da9 Binary files /dev/null and b/test/Bitcode/variableArgumentIntrinsic.3.2.ll.bc differ diff --git a/test/Bitcode/vectorInstructions.3.2.ll b/test/Bitcode/vectorInstructions.3.2.ll new file mode 100644 index 000000000000..b24ef75ef081 --- /dev/null +++ b/test/Bitcode/vectorInstructions.3.2.ll @@ -0,0 +1,34 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; vectorOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not misread vector operations of +; older bitcode files. + +define void @extractelement(<2 x i8> %x1){ +entry: +; CHECK: %res1 = extractelement <2 x i8> %x1, i32 0 + %res1 = extractelement <2 x i8> %x1, i32 0 + + ret void +} + +define void @insertelement(<2 x i8> %x1){ +entry: +; CHECK: %res1 = insertelement <2 x i8> %x1, i8 0, i32 0 + %res1 = insertelement <2 x i8> %x1, i8 0, i32 0 + + ret void +} + +define void @shufflevector(<2 x i8> %x1){ +entry: +; CHECK: %res1 = shufflevector <2 x i8> %x1, <2 x i8> %x1, <2 x i32> + %res1 = shufflevector <2 x i8> %x1, <2 x i8> %x1, <2 x i32> + +; CHECK-NEXT: %res2 = shufflevector <2 x i8> %x1, <2 x i8> undef, <2 x i32> + %res2 = shufflevector <2 x i8> %x1, <2 x i8> undef, <2 x i32> + + ret void +} + + diff --git a/test/Bitcode/vectorInstructions.3.2.ll.bc b/test/Bitcode/vectorInstructions.3.2.ll.bc new file mode 100644 index 000000000000..b1727031701b Binary files /dev/null and b/test/Bitcode/vectorInstructions.3.2.ll.bc differ diff --git a/test/Bitcode/visibility-styles.3.2.ll b/test/Bitcode/visibility-styles.3.2.ll new file mode 100644 index 000000000000..ec2ee6832063 --- /dev/null +++ b/test/Bitcode/visibility-styles.3.2.ll @@ -0,0 +1,23 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; visibility-styles.3.2.ll.bc was generated by passing this file to llvm-as-3.2. +; The test checks that LLVM does not silently misread visibility styles of +; older bitcode files. + +@default.var = default global i32 0 +; CHECK: @default.var = global i32 0 + +@hidden.var = hidden global i32 0 +; CHECK: @hidden.var = hidden global i32 0 + +@protected.var = protected global i32 0 +; CHECK: @protected.var = protected global i32 0 + +declare default void @default() +; CHECK: declare void @default + +declare hidden void @hidden() +; CHECK: declare hidden void @hidden + +declare protected void @protected() +; CHECK: declare protected void @protected diff --git a/test/Bitcode/visibility-styles.3.2.ll.bc b/test/Bitcode/visibility-styles.3.2.ll.bc new file mode 100644 index 000000000000..e2f0b058cce6 Binary files /dev/null and b/test/Bitcode/visibility-styles.3.2.ll.bc differ diff --git a/test/Bitcode/weak-cmpxchg-upgrade.ll b/test/Bitcode/weak-cmpxchg-upgrade.ll new file mode 100644 index 000000000000..dbcd150633ed --- /dev/null +++ b/test/Bitcode/weak-cmpxchg-upgrade.ll @@ -0,0 +1,15 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s + +; cmpxchg-upgrade.ll.bc was produced by running a version of llvm-as from just +; before the IR change on this file. + +define i32 @test(i32* %addr, i32 %old, i32 %new) { +; CHECK: [[TMP:%.*]] = cmpxchg i32* %addr, i32 %old, i32 %new seq_cst monotonic +; CHECK: %val = extractvalue { i32, i1 } [[TMP]], 0 + %val = cmpxchg i32* %addr, i32 %old, i32 %new seq_cst monotonic + ret i32 %val +} + +define i32 @test(i32* %addr, i32 %old, i32 %new) { + ret i1 %val +} diff --git a/test/Bitcode/weak-cmpxchg-upgrade.ll.bc b/test/Bitcode/weak-cmpxchg-upgrade.ll.bc new file mode 100644 index 000000000000..f713c317d46f Binary files /dev/null and b/test/Bitcode/weak-cmpxchg-upgrade.ll.bc differ diff --git a/test/BugPoint/compile-custom.ll b/test/BugPoint/compile-custom.ll new file mode 100755 index 000000000000..d152f08626f8 --- /dev/null +++ b/test/BugPoint/compile-custom.ll @@ -0,0 +1,12 @@ +; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%python %s.py arg1 arg2" --output-prefix %t %s | FileCheck %s +; REQUIRES: loadable_module + +; Test that arguments are correctly passed in --compile-command. The output +; of bugpoint includes the output of the custom tool, so we just echo the args +; in the tool and check here. + +; CHECK: Error: arg1 arg2 + +define void @noop() { + ret void +} diff --git a/test/BugPoint/compile-custom.ll.py b/test/BugPoint/compile-custom.ll.py new file mode 100755 index 000000000000..4b9b30caadc8 --- /dev/null +++ b/test/BugPoint/compile-custom.ll.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +import sys + +# Currently any print-out from the custom tool is interpreted as a crash +# (i.e. test is still interesting) + +print("Error: " + ' '.join(sys.argv[1:])) + +sys.exit(1) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d6f7dab1287e..3e08a1638945 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,9 +15,11 @@ endif() # Set the depends list as a variable so that it can grow conditionally. # NOTE: Sync the substitutions in test/lit.cfg when adding to this list. set(LLVM_TEST_DEPENDS + llvm-config UnitTests BugpointPasses LLVMHello + bugpoint llc lli lli-child-target @@ -35,13 +37,15 @@ set(LLVM_TEST_DEPENDS llvm-mc llvm-mcmarkup llvm-nm + llvm-size llvm-objdump + llvm-profdata llvm-readobj llvm-rtdyld llvm-symbolizer + llvm-tblgen macho-dump opt - profile_rt-shared FileCheck count not diff --git a/test/CodeGen/AArch64/128bit_load_store.ll b/test/CodeGen/AArch64/128bit_load_store.ll new file mode 100644 index 000000000000..a6f077698e40 --- /dev/null +++ b/test/CodeGen/AArch64/128bit_load_store.ll @@ -0,0 +1,53 @@ +; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=neon | FileCheck %s --check-prefix=CHECK + +define void @test_store_f128(fp128* %ptr, fp128 %val) #0 { +; CHECK-LABEL: test_store_f128 +; CHECK: str {{q[0-9]+}}, [{{x[0-9]+}}] +entry: + store fp128 %val, fp128* %ptr, align 16 + ret void +} + +define fp128 @test_load_f128(fp128* readonly %ptr) #2 { +; CHECK-LABEL: test_load_f128 +; CHECK: ldr {{q[0-9]+}}, [{{x[0-9]+}}] +entry: + %0 = load fp128* %ptr, align 16 + ret fp128 %0 +} + +define void @test_vstrq_p128(i128* %ptr, i128 %val) #0 { +; CHECK-LABEL: test_vstrq_p128 +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [{{x[0-9]+}}] + +entry: + %0 = bitcast i128* %ptr to fp128* + %1 = bitcast i128 %val to fp128 + store fp128 %1, fp128* %0, align 16 + ret void +} + +define i128 @test_vldrq_p128(i128* readonly %ptr) #2 { +; CHECK-LABEL: test_vldrq_p128 +; CHECK: ldp {{x[0-9]+}}, {{x[0-9]+}}, [{{x[0-9]+}}] + +entry: + %0 = bitcast i128* %ptr to fp128* + %1 = load fp128* %0, align 16 + %2 = bitcast fp128 %1 to i128 + ret i128 %2 +} + +define void @test_ld_st_p128(i128* nocapture %ptr) #0 { +; CHECK-LABEL: test_ld_st_p128 +; CHECK: ldr {{q[0-9]+}}, [{{x[0-9]+}}] +; CHECK-NEXT: str {{q[0-9]+}}, [{{x[0-9]+}}, #16] +entry: + %0 = bitcast i128* %ptr to fp128* + %1 = load fp128* %0, align 16 + %add.ptr = getelementptr inbounds i128* %ptr, i64 1 + %2 = bitcast i128* %add.ptr to fp128* + store fp128 %1, fp128* %2, align 16 + ret void +} + diff --git a/test/CodeGen/AArch64/aarch64-address-type-promotion-assertion.ll b/test/CodeGen/AArch64/aarch64-address-type-promotion-assertion.ll new file mode 100644 index 000000000000..2df9c375bdce --- /dev/null +++ b/test/CodeGen/AArch64/aarch64-address-type-promotion-assertion.ll @@ -0,0 +1,55 @@ +; RUN: llc -O3 -mcpu=cortex-a53 -mtriple=aarch64--linux-gnu %s -o - | FileCheck %s +; PR20188: don't crash when merging sexts. + +; CHECK: foo: +define void @foo() unnamed_addr align 2 { +entry: + br label %invoke.cont145 + +invoke.cont145: + %or.cond = and i1 undef, false + br i1 %or.cond, label %if.then274, label %invoke.cont145 + +if.then274: + %0 = load i32* null, align 4 + br i1 undef, label %invoke.cont291, label %if.else313 + +invoke.cont291: + %idxprom.i.i.i605 = sext i32 %0 to i64 + %arrayidx.i.i.i607 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i605 + %idxprom.i.i.i596 = sext i32 %0 to i64 + %arrayidx.i.i.i598 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i596 + br label %if.end356 + +if.else313: + %cmp314 = fcmp olt double undef, 0.000000e+00 + br i1 %cmp314, label %invoke.cont317, label %invoke.cont353 + +invoke.cont317: + br i1 undef, label %invoke.cont326, label %invoke.cont334 + +invoke.cont326: + %idxprom.i.i.i587 = sext i32 %0 to i64 + %arrayidx.i.i.i589 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i587 + %sub329 = fsub fast double undef, undef + br label %invoke.cont334 + +invoke.cont334: + %lo.1 = phi double [ %sub329, %invoke.cont326 ], [ undef, %invoke.cont317 ] + br i1 undef, label %invoke.cont342, label %if.end356 + +invoke.cont342: + %idxprom.i.i.i578 = sext i32 %0 to i64 + %arrayidx.i.i.i580 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i578 + br label %if.end356 + +invoke.cont353: + %idxprom.i.i.i572 = sext i32 %0 to i64 + %arrayidx.i.i.i574 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i572 + br label %if.end356 + +if.end356: + %lo.2 = phi double [ 0.000000e+00, %invoke.cont291 ], [ %lo.1, %invoke.cont342 ], [ undef, %invoke.cont353 ], [ %lo.1, %invoke.cont334 ] + call void null(i32 %0, double %lo.2) + unreachable +} diff --git a/test/CodeGen/AArch64/aarch64-address-type-promotion.ll b/test/CodeGen/AArch64/aarch64-address-type-promotion.ll new file mode 100644 index 000000000000..ee90d199b458 --- /dev/null +++ b/test/CodeGen/AArch64/aarch64-address-type-promotion.ll @@ -0,0 +1,28 @@ +; RUN: llc < %s -o - | 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-n32:64" +target triple = "arm64-apple-macosx10.9" + +; Check that sexts get promoted above adds. +define void @foo(i32* nocapture %a, i32 %i) { +entry: +; CHECK-LABEL: _foo: +; CHECK: add +; CHECK-NEXT: ldp +; CHECK-NEXT: add +; CHECK-NEXT: str +; CHECK-NEXT: ret + %add = add nsw i32 %i, 1 + %idxprom = sext i32 %add to i64 + %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom + %0 = load i32* %arrayidx, align 4 + %add1 = add nsw i32 %i, 2 + %idxprom2 = sext i32 %add1 to i64 + %arrayidx3 = getelementptr inbounds i32* %a, i64 %idxprom2 + %1 = load i32* %arrayidx3, align 4 + %add4 = add nsw i32 %1, %0 + %idxprom5 = sext i32 %i to i64 + %arrayidx6 = getelementptr inbounds i32* %a, i64 %idxprom5 + store i32 %add4, i32* %arrayidx6, align 4 + ret void +} diff --git a/test/CodeGen/AArch64/aarch64-neon-v1i1-setcc.ll b/test/CodeGen/AArch64/aarch64-neon-v1i1-setcc.ll new file mode 100644 index 000000000000..c932253049e2 --- /dev/null +++ b/test/CodeGen/AArch64/aarch64-neon-v1i1-setcc.ll @@ -0,0 +1,69 @@ +; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon -fp-contract=fast | FileCheck %s +; arm64 has a separate copy as aarch64-neon-v1i1-setcc.ll + +; This file test the DAG node like "v1i1 SETCC v1i64, v1i64". As the v1i1 type +; is illegal in AArch64 backend, the legalizer tries to scalarize this node. +; As the v1i64 operands of SETCC are legal types, they will not be scalarized. +; Currently the type legalizer will have an assertion failure as it assumes all +; operands of SETCC have been legalized. +; FIXME: If the algorithm of type scalarization is improved and can legaize +; "v1i1 SETCC" correctly, these test cases are not needed. + +define i64 @test_sext_extr_cmp_0(<1 x i64> %v1, <1 x i64> %v2) { +; CHECK-LABEL: test_sext_extr_cmp_0: +; CHECK: cmp {{x[0-9]+}}, {{x[0-9]+}} + %1 = icmp sge <1 x i64> %v1, %v2 + %2 = extractelement <1 x i1> %1, i32 0 + %vget_lane = sext i1 %2 to i64 + ret i64 %vget_lane +} + +define i64 @test_sext_extr_cmp_1(<1 x double> %v1, <1 x double> %v2) { +; CHECK-LABEL: test_sext_extr_cmp_1: +; CHECK: fcmp {{d[0-9]+}}, {{d[0-9]+}} + %1 = fcmp oeq <1 x double> %v1, %v2 + %2 = extractelement <1 x i1> %1, i32 0 + %vget_lane = sext i1 %2 to i64 + ret i64 %vget_lane +} + +define <1 x i64> @test_select_v1i1_0(<1 x i64> %v1, <1 x i64> %v2, <1 x i64> %v3) { +; CHECK-LABEL: test_select_v1i1_0: +; CHECK: cmeq d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}} +; CHECK: bic v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b + %1 = icmp eq <1 x i64> %v1, %v2 + %res = select <1 x i1> %1, <1 x i64> zeroinitializer, <1 x i64> %v3 + ret <1 x i64> %res +} + +define <1 x i64> @test_select_v1i1_1(<1 x double> %v1, <1 x double> %v2, <1 x i64> %v3) { +; CHECK-LABEL: test_select_v1i1_1: +; CHECK: fcmeq d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}} +; CHECK: bic v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b + %1 = fcmp oeq <1 x double> %v1, %v2 + %res = select <1 x i1> %1, <1 x i64> zeroinitializer, <1 x i64> %v3 + ret <1 x i64> %res +} + +define <1 x double> @test_select_v1i1_2(<1 x i64> %v1, <1 x i64> %v2, <1 x double> %v3) { +; CHECK-LABEL: test_select_v1i1_2: +; CHECK: cmeq d{{[0-9]+}}, d{{[0-9]+}}, d{{[0-9]+}} +; CHECK: bic v{{[0-9]+}}.8b, v{{[0-9]+}}.8b, v{{[0-9]+}}.8b + %1 = icmp eq <1 x i64> %v1, %v2 + %res = select <1 x i1> %1, <1 x double> zeroinitializer, <1 x double> %v3 + ret <1 x double> %res +} + +define i32 @test_br_extr_cmp(<1 x i64> %v1, <1 x i64> %v2) { +; CHECK-LABEL: test_br_extr_cmp: +; CHECK: cmp x{{[0-9]+}}, x{{[0-9]+}} + %1 = icmp eq <1 x i64> %v1, %v2 + %2 = extractelement <1 x i1> %1, i32 0 + br i1 %2, label %if.end, label %if.then + +if.then: + ret i32 0; + +if.end: + ret i32 1; +} diff --git a/test/CodeGen/AArch64/adc.ll b/test/CodeGen/AArch64/adc.ll index 26fd3e66b798..892573ba06b1 100644 --- a/test/CodeGen/AArch64/adc.ll +++ b/test/CodeGen/AArch64/adc.ll @@ -1,15 +1,20 @@ -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s +; RUN: llc -verify-machineinstrs < %s -mtriple=arm64-apple-ios7.0 | FileCheck --check-prefix=CHECK --check-prefix=CHECK-LE %s +; RUN: llc -verify-machineinstrs < %s -mtriple=arm64_be-none-linux-gnu | FileCheck --check-prefix=CHECK --check-prefix=CHECK-BE %s define i128 @test_simple(i128 %a, i128 %b, i128 %c) { ; CHECK-LABEL: test_simple: %valadd = add i128 %a, %b -; CHECK: adds [[ADDLO:x[0-9]+]], x0, x2 -; CHECK-NEXT: adcs [[ADDHI:x[0-9]+]], x1, x3 +; CHECK-LE: adds [[ADDLO:x[0-9]+]], x0, x2 +; CHECK-LE-NEXT: adcs [[ADDHI:x[0-9]+]], x1, x3 +; CHECK-BE: adds [[ADDLO:x[0-9]+]], x1, x3 +; CHECK-BE-NEXT: adcs [[ADDHI:x[0-9]+]], x0, x2 %valsub = sub i128 %valadd, %c -; CHECK: subs x0, [[ADDLO]], x4 -; CHECK: sbcs x1, [[ADDHI]], x5 +; CHECK-LE: subs x0, [[ADDLO]], x4 +; CHECK-LE: sbcs x1, [[ADDHI]], x5 +; CHECK-BE: subs x1, [[ADDLO]], x5 +; CHECK-BE: sbcs x0, [[ADDHI]], x4 ret i128 %valsub ; CHECK: ret @@ -19,8 +24,10 @@ define i128 @test_imm(i128 %a) { ; CHECK-LABEL: test_imm: %val = add i128 %a, 12 -; CHECK: adds x0, x0, #12 -; CHECK: adcs x1, x1, {{x[0-9]|xzr}} +; CHECK-LE: adds x0, x0, #12 +; CHECK-LE: adcs x1, x1, {{x[0-9]|xzr}} +; CHECK-BE: adds x1, x1, #12 +; CHECK-BE: adcs x0, x0, {{x[0-9]|xzr}} ret i128 %val ; CHECK: ret @@ -32,8 +39,10 @@ define i128 @test_shifted(i128 %a, i128 %b) { %rhs = shl i128 %b, 45 %val = add i128 %a, %rhs -; CHECK: adds x0, x0, x2, lsl #45 -; CHECK: adcs x1, x1, {{x[0-9]}} +; CHECK-LE: adds x0, x0, x2, lsl #45 +; CHECK-LE: adcs x1, x1, {{x[0-9]}} +; CHECK-BE: adds x1, x1, x3, lsl #45 +; CHECK-BE: adcs x0, x0, {{x[0-9]}} ret i128 %val ; CHECK: ret @@ -46,8 +55,10 @@ define i128 @test_extended(i128 %a, i16 %b) { %rhs = shl i128 %ext, 3 %val = add i128 %a, %rhs -; CHECK: adds x0, x0, w2, sxth #3 -; CHECK: adcs x1, x1, {{x[0-9]}} +; CHECK-LE: adds x0, x0, w2, sxth #3 +; CHECK-LE: adcs x1, x1, {{x[0-9]}} +; CHECK-BE: adds x1, x1, w2, sxth #3 +; CHECK-BE: adcs x0, x0, {{x[0-9]}} ret i128 %val ; CHECK: ret diff --git a/test/CodeGen/AArch64/addsub-shifted.ll b/test/CodeGen/AArch64/addsub-shifted.ll index 269c1e8143b2..0a93edd8290a 100644 --- a/test/CodeGen/AArch64/addsub-shifted.ll +++ b/test/CodeGen/AArch64/addsub-shifted.ll @@ -1,4 +1,4 @@ -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s +; RUN: llc -verify-machineinstrs %s -o - -mtriple=arm64-apple-ios7.0 | FileCheck %s @var32 = global i32 0 @var64 = global i64 0 @@ -35,7 +35,7 @@ define void @test_lsl_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift4a = shl i32 %lhs4a, 15 %val4a = sub i32 0, %shift4a store volatile i32 %val4a, i32* @var32 -; CHECK: sub {{w[0-9]+}}, wzr, {{w[0-9]+}}, lsl #15 +; CHECK: neg {{w[0-9]+}}, {{w[0-9]+}}, lsl #15 %rhs5 = load volatile i64* @var64 %shift5 = shl i64 %rhs5, 18 @@ -66,7 +66,7 @@ define void @test_lsl_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift8a = shl i64 %lhs8a, 60 %val8a = sub i64 0, %shift8a store volatile i64 %val8a, i64* @var64 -; CHECK: sub {{x[0-9]+}}, xzr, {{x[0-9]+}}, lsl #60 +; CHECK: neg {{x[0-9]+}}, {{x[0-9]+}}, lsl #60 ret void ; CHECK: ret @@ -99,7 +99,7 @@ define void @test_lsr_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift4a = lshr i32 %lhs32, 15 %val4a = sub i32 0, %shift4a store volatile i32 %val4a, i32* @var32 -; CHECK: sub {{w[0-9]+}}, wzr, {{w[0-9]+}}, lsr #15 +; CHECK: neg {{w[0-9]+}}, {{w[0-9]+}}, lsr #15 %shift5 = lshr i64 %rhs64, 18 %val5 = add i64 %lhs64, %shift5 @@ -125,7 +125,7 @@ define void @test_lsr_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift8a = lshr i64 %lhs64, 45 %val8a = sub i64 0, %shift8a store volatile i64 %val8a, i64* @var64 -; CHECK: sub {{x[0-9]+}}, xzr, {{x[0-9]+}}, lsr #45 +; CHECK: neg {{x[0-9]+}}, {{x[0-9]+}}, lsr #45 ret void ; CHECK: ret @@ -158,7 +158,7 @@ define void @test_asr_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift4a = ashr i32 %lhs32, 15 %val4a = sub i32 0, %shift4a store volatile i32 %val4a, i32* @var32 -; CHECK: sub {{w[0-9]+}}, wzr, {{w[0-9]+}}, asr #15 +; CHECK: neg {{w[0-9]+}}, {{w[0-9]+}}, asr #15 %shift5 = ashr i64 %rhs64, 18 %val5 = add i64 %lhs64, %shift5 @@ -184,7 +184,7 @@ define void @test_asr_arith(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { %shift8a = ashr i64 %lhs64, 45 %val8a = sub i64 0, %shift8a store volatile i64 %val8a, i64* @var64 -; CHECK: sub {{x[0-9]+}}, xzr, {{x[0-9]+}}, asr #45 +; CHECK: neg {{x[0-9]+}}, {{x[0-9]+}}, asr #45 ret void ; CHECK: ret @@ -245,7 +245,7 @@ define i32 @test_cmn(i32 %lhs32, i32 %rhs32, i64 %lhs64, i64 %rhs64) { br i1 %tst1, label %t2, label %end ; Important that this isn't lowered to a cmn instruction because if %rhs32 == ; 0 then the results will differ. -; CHECK: sub [[RHS:w[0-9]+]], wzr, {{w[0-9]+}}, lsl #13 +; CHECK: neg [[RHS:w[0-9]+]], {{w[0-9]+}}, lsl #13 ; CHECK: cmp {{w[0-9]+}}, [[RHS]] t2: @@ -268,7 +268,7 @@ t4: %tst4 = icmp slt i64 %lhs64, %val4 br i1 %tst4, label %t5, label %end ; Again, it's important that cmn isn't used here in case %rhs64 == 0. -; CHECK: sub [[RHS:x[0-9]+]], xzr, {{x[0-9]+}}, lsl #43 +; CHECK: neg [[RHS:x[0-9]+]], {{x[0-9]+}}, lsl #43 ; CHECK: cmp {{x[0-9]+}}, [[RHS]] t5: diff --git a/test/CodeGen/AArch64/addsub.ll b/test/CodeGen/AArch64/addsub.ll index 4d46d04b80f1..b85fdbb14ce2 100644 --- a/test/CodeGen/AArch64/addsub.ll +++ b/test/CodeGen/AArch64/addsub.ll @@ -1,4 +1,4 @@ -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s +; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-linux-gnu | FileCheck %s ; Note that this should be refactored (for efficiency if nothing else) ; when the PCS is implemented so we don't have to worry about the @@ -28,12 +28,12 @@ define void @add_small() { define void @add_med() { ; CHECK-LABEL: add_med: -; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, #3567, lsl #12 +; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{#3567, lsl #12|#14610432}} %val32 = load i32* @var_i32 %newval32 = add i32 %val32, 14610432 ; =0xdef000 store i32 %newval32, i32* @var_i32 -; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #4095, lsl #12 +; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{#4095, lsl #12|#16773120}} %val64 = load i64* @var_i64 %newval64 = add i64 %val64, 16773120 ; =0xfff000 store i64 %newval64, i64* @var_i64 @@ -62,12 +62,12 @@ define void @sub_small() { define void @sub_med() { ; CHECK-LABEL: sub_med: -; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, #3567, lsl #12 +; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{#3567, lsl #12|#14610432}} %val32 = load i32* @var_i32 %newval32 = sub i32 %val32, 14610432 ; =0xdef000 store i32 %newval32, i32* @var_i32 -; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, #4095, lsl #12 +; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{#4095, lsl #12|#16773120}} %val64 = load i64* @var_i64 %newval64 = sub i64 %val64, 16773120 ; =0xfff000 store i64 %newval64, i64* @var_i64 @@ -80,13 +80,13 @@ define void @testing() { %val = load i32* @var_i32 ; CHECK: cmp {{w[0-9]+}}, #4095 -; CHECK: b.ne .LBB4_6 +; CHECK: b.ne [[RET:.?LBB[0-9]+_[0-9]+]] %cmp_pos_small = icmp ne i32 %val, 4095 br i1 %cmp_pos_small, label %ret, label %test2 test2: -; CHECK: cmp {{w[0-9]+}}, #3567, lsl #12 -; CHECK: b.lo .LBB4_6 +; CHECK: cmp {{w[0-9]+}}, {{#3567, lsl #12|#14610432}} +; CHECK: b.lo [[RET]] %newval2 = add i32 %val, 1 store i32 %newval2, i32* @var_i32 %cmp_pos_big = icmp ult i32 %val, 14610432 @@ -94,7 +94,7 @@ test2: test3: ; CHECK: cmp {{w[0-9]+}}, #123 -; CHECK: b.lt .LBB4_6 +; CHECK: b.lt [[RET]] %newval3 = add i32 %val, 2 store i32 %newval3, i32* @var_i32 %cmp_pos_slt = icmp slt i32 %val, 123 @@ -102,7 +102,7 @@ test3: test4: ; CHECK: cmp {{w[0-9]+}}, #321 -; CHECK: b.gt .LBB4_6 +; CHECK: b.gt [[RET]] %newval4 = add i32 %val, 3 store i32 %newval4, i32* @var_i32 %cmp_pos_sgt = icmp sgt i32 %val, 321 @@ -110,7 +110,7 @@ test4: test5: ; CHECK: cmn {{w[0-9]+}}, #444 -; CHECK: b.gt .LBB4_6 +; CHECK: b.gt [[RET]] %newval5 = add i32 %val, 4 store i32 %newval5, i32* @var_i32 %cmp_neg_uge = icmp sgt i32 %val, -444 diff --git a/test/CodeGen/AArch64/addsub_ext.ll b/test/CodeGen/AArch64/addsub_ext.ll index f0e11c652240..ceea8a08ecee 100644 --- a/test/CodeGen/AArch64/addsub_ext.ll +++ b/test/CodeGen/AArch64/addsub_ext.ll @@ -1,11 +1,11 @@ -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s +; RUN: llc -verify-machineinstrs %s -o - -mtriple=aarch64-linux-gnu -aarch64-atomic-cfg-tidy=0 | FileCheck %s @var8 = global i8 0 @var16 = global i16 0 @var32 = global i32 0 @var64 = global i64 0 -define void @addsub_i8rhs() { +define void @addsub_i8rhs() minsize { ; CHECK-LABEL: addsub_i8rhs: %val8_tmp = load i8* @var8 %lhs32 = load i32* @var32 @@ -80,7 +80,7 @@ end: ret void } -define void @addsub_i16rhs() { +define void @addsub_i16rhs() minsize { ; CHECK-LABEL: addsub_i16rhs: %val16_tmp = load i16* @var16 %lhs32 = load i32* @var32 @@ -158,7 +158,7 @@ end: ; N.b. we could probably check more here ("add w2, w3, w1, uxtw" for ; example), but the remaining instructions are probably not idiomatic ; in the face of "add/sub (shifted register)" so I don't intend to. -define void @addsub_i32rhs() { +define void @addsub_i32rhs() minsize { ; CHECK-LABEL: addsub_i32rhs: %val32_tmp = load i32* @var32 %lhs64 = load i64* @var64 diff --git a/test/CodeGen/AArch64/alloca.ll b/test/CodeGen/AArch64/alloca.ll index 1d3c0a02ac87..f93efbc42e65 100644 --- a/test/CodeGen/AArch64/alloca.ll +++ b/test/CodeGen/AArch64/alloca.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs < %s | FileCheck %s -; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-NOFP %s +; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s --check-prefix=CHECK +; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-NOFP-ARM64 %s declare void @use_addr(i8*) @@ -8,23 +8,22 @@ define void @test_simple_alloca(i64 %n) { %buf = alloca i8, i64 %n ; Make sure we align the stack change to 16 bytes: -; CHECK-DAG: add [[SPDELTA:x[0-9]+]], x0, #15 -; CHECK-DAG: and x0, [[SPDELTA]], #0xfffffffffffffff0 +; CHECK: {{mov|add}} x29 +; CHECK: mov [[TMP:x[0-9]+]], sp +; CHECK: add [[SPDELTA_TMP:x[0-9]+]], x0, #15 +; CHECK: and [[SPDELTA:x[0-9]+]], [[SPDELTA_TMP]], #0xfffffffffffffff0 ; Make sure we change SP. It would be surprising if anything but x0 were used ; for the final sp, but it could be if it was then moved into x0. -; CHECK-DAG: mov [[TMP:x[0-9]+]], sp -; CHECK-DAG: sub x0, [[TMP]], [[SPDELTA]] -; CHECK: mov sp, x0 +; CHECK: sub [[NEWSP:x[0-9]+]], [[TMP]], [[SPDELTA]] +; CHECK: mov sp, [[NEWSP]] call void @use_addr(i8* %buf) ; CHECK: bl use_addr ret void ; Make sure epilogue restores sp from fp -; CHECK: sub sp, x29, #16 -; CHECK: ldp x29, x30, [sp, #16] -; CHECK: add sp, sp, #32 +; CHECK: {{sub|mov}} sp, x29 ; CHECK: ret } @@ -32,57 +31,70 @@ declare void @use_addr_loc(i8*, i64*) define i64 @test_alloca_with_local(i64 %n) { ; CHECK-LABEL: test_alloca_with_local: -; CHECK: sub sp, sp, #32 -; CHECK: stp x29, x30, [sp, #16] +; CHECK-DAG: sub sp, sp, [[LOCAL_STACK:#[0-9]+]] +; CHECK-DAG: {{mov|add}} x29, sp %loc = alloca i64 %buf = alloca i8, i64 %n ; Make sure we align the stack change to 16 bytes: -; CHECK-DAG: add [[SPDELTA:x[0-9]+]], x0, #15 -; CHECK-DAG: and x0, [[SPDELTA]], #0xfffffffffffffff0 +; CHECK: mov [[TMP:x[0-9]+]], sp +; CHECK: add [[SPDELTA_TMP:x[0-9]+]], x0, #15 +; CHECK: and [[SPDELTA:x[0-9]+]], [[SPDELTA_TMP]], #0xfffffffffffffff0 ; Make sure we change SP. It would be surprising if anything but x0 were used ; for the final sp, but it could be if it was then moved into x0. -; CHECK-DAG: mov [[TMP:x[0-9]+]], sp -; CHECK-DAG: sub x0, [[TMP]], [[SPDELTA]] -; CHECK: mov sp, x0 +; CHECK: sub [[NEWSP:x[0-9]+]], [[TMP]], [[SPDELTA]] +; CHECK: mov sp, [[NEWSP]] - ; Obviously suboptimal code here, but it to get &local in x1 -; CHECK: sub [[TMP:x[0-9]+]], x29, [[LOC_FROM_FP:#[0-9]+]] -; CHECK: add x1, [[TMP]], #0 +; CHECK: sub {{x[0-9]+}}, x29, #[[LOC_FROM_FP:[0-9]+]] call void @use_addr_loc(i8* %buf, i64* %loc) ; CHECK: bl use_addr %val = load i64* %loc -; CHECK: sub x[[TMP:[0-9]+]], x29, [[LOC_FROM_FP]] -; CHECK: ldr x0, [x[[TMP]]] + +; CHECK: ldur x0, [x29, #-[[LOC_FROM_FP]]] ret i64 %val ; Make sure epilogue restores sp from fp -; CHECK: sub sp, x29, #16 -; CHECK: ldp x29, x30, [sp, #16] -; CHECK: add sp, sp, #32 +; CHECK: {{sub|mov}} sp, x29 ; CHECK: ret } define void @test_variadic_alloca(i64 %n, ...) { -; CHECK: test_variadic_alloca: - -; CHECK: sub sp, sp, #208 -; CHECK: stp x29, x30, [sp, #192] -; CHECK: add x29, sp, #192 -; CHECK: sub [[TMP:x[0-9]+]], x29, #192 -; CHECK: add x8, [[TMP]], #0 -; CHECK-FP: str q7, [x8, #112] +; CHECK-LABEL: test_variadic_alloca: + ; [...] -; CHECK-FP: str q1, [x8, #16] -; CHECK-NOFP: sub sp, sp, #80 -; CHECK-NOFP: stp x29, x30, [sp, #64] -; CHECK-NOFP: add x29, sp, #64 -; CHECK-NOFP: sub [[TMP:x[0-9]+]], x29, #64 -; CHECK-NOFP: add x8, [[TMP]], #0 + +; CHECK-NOFP-AARCH64: sub sp, sp, #80 +; CHECK-NOFP-AARCH64: stp x29, x30, [sp, #64] +; CHECK-NOFP-AARCH64: add x29, sp, #64 +; CHECK-NOFP-AARCH64: sub [[TMP:x[0-9]+]], x29, #64 +; CHECK-NOFP-AARCH64: add x8, [[TMP]], #0 + + +; CHECK: stp x29, x30, [sp, #-16]! +; CHECK: mov x29, sp +; CHECK: sub sp, sp, #192 +; CHECK: stp q6, q7, [x29, #-96] +; [...] +; CHECK: stp q0, q1, [x29, #-192] + +; CHECK: stp x6, x7, [x29, #-16] +; [...] +; CHECK: stp x2, x3, [x29, #-48] + +; CHECK-NOFP-ARM64: stp x29, x30, [sp, #-16]! +; CHECK-NOFP-ARM64: mov x29, sp +; CHECK-NOFP-ARM64: sub sp, sp, #64 +; CHECK-NOFP-ARM64: stp x6, x7, [x29, #-16] +; [...] +; CHECK-NOFP-ARM64: stp x4, x5, [x29, #-32] +; [...] +; CHECK-NOFP-ARM64: stp x2, x3, [x29, #-48] +; [...] +; CHECK-NOFP-ARM64: mov x8, sp %addr = alloca i8, i64 %n @@ -90,23 +102,24 @@ define void @test_variadic_alloca(i64 %n, ...) { ; CHECK: bl use_addr ret void -; CHECK: sub sp, x29, #192 -; CHECK: ldp x29, x30, [sp, #192] -; CHECK: add sp, sp, #208 -; CHECK-NOFP: sub sp, x29, #64 -; CHECK-NOFP: ldp x29, x30, [sp, #64] -; CHECK-NOFP: add sp, sp, #80 +; CHECK-NOFP-AARCH64: sub sp, x29, #64 +; CHECK-NOFP-AARCH64: ldp x29, x30, [sp, #64] +; CHECK-NOFP-AARCH64: add sp, sp, #80 + +; CHECK-NOFP-ARM64: mov sp, x29 +; CHECK-NOFP-ARM64: ldp x29, x30, [sp], #16 } define void @test_alloca_large_frame(i64 %n) { ; CHECK-LABEL: test_alloca_large_frame: -; CHECK: sub sp, sp, #496 -; CHECK: stp x29, x30, [sp, #480] -; CHECK: add x29, sp, #480 -; CHECK: sub sp, sp, #48 -; CHECK: sub sp, sp, #1953, lsl #12 + +; CHECK: stp x20, x19, [sp, #-32]! +; CHECK: stp x29, x30, [sp, #16] +; CHECK: add x29, sp, #16 +; CHECK: sub sp, sp, #1953, lsl #12 +; CHECK: sub sp, sp, #512 %addr1 = alloca i8, i64 %n %addr2 = alloca i64, i64 1000000 @@ -114,9 +127,10 @@ define void @test_alloca_large_frame(i64 %n) { call void @use_addr_loc(i8* %addr1, i64* %addr2) ret void -; CHECK: sub sp, x29, #480 -; CHECK: ldp x29, x30, [sp, #480] -; CHECK: add sp, sp, #496 + +; CHECK: sub sp, x29, #16 +; CHECK: ldp x29, x30, [sp, #16] +; CHECK: ldp x20, x19, [sp], #32 } declare i8* @llvm.stacksave() @@ -124,7 +138,6 @@ declare void @llvm.stackrestore(i8*) define void @test_scoped_alloca(i64 %n) { ; CHECK-LABEL: test_scoped_alloca: -; CHECK: sub sp, sp, #32 %sp = call i8* @llvm.stacksave() ; CHECK: mov [[SAVED_SP:x[0-9]+]], sp diff --git a/test/CodeGen/AArch64/analyze-branch.ll b/test/CodeGen/AArch64/analyze-branch.ll index 36bc2e00d238..6616b27c45b7 100644 --- a/test/CodeGen/AArch64/analyze-branch.ll +++ b/test/CodeGen/AArch64/analyze-branch.ll @@ -168,7 +168,7 @@ define void @test_TBZ_fallthrough_nottaken(i64 %in) nounwind { %tst = icmp eq i64 %bit, 0 br i1 %tst, label %true, label %false, !prof !1 -; CHECK: tbz {{x[0-9]+}}, #15, [[TRUE:.LBB[0-9]+_[0-9]+]] +; CHECK: tbz {{[wx][0-9]+}}, #15, [[TRUE:.LBB[0-9]+_[0-9]+]] ; CHECK-NEXT: // BB# ; CHECK-NEXT: bl test_false @@ -213,7 +213,7 @@ define void @test_TBNZ_fallthrough_nottaken(i64 %in) nounwind { %tst = icmp ne i64 %bit, 0 br i1 %tst, label %true, label %false, !prof !1 -; CHECK: tbnz {{x[0-9]+}}, #15, [[TRUE:.LBB[0-9]+_[0-9]+]] +; CHECK: tbnz {{[wx][0-9]+}}, #15, [[TRUE:.LBB[0-9]+_[0-9]+]] ; CHECK-NEXT: // BB# ; CHECK-NEXT: bl test_false diff --git a/test/CodeGen/AArch64/arm64-2011-03-09-CPSRSpill.ll b/test/CodeGen/AArch64/arm64-2011-03-09-CPSRSpill.ll new file mode 100644 index 000000000000..6fb7c3fb5e0a --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2011-03-09-CPSRSpill.ll @@ -0,0 +1,47 @@ +; RUN: llc < %s -mtriple=arm64-apple-darwin + +; Can't copy or spill / restore CPSR. +; rdar://9105206 + +define fastcc void @t() ssp align 2 { +entry: + br i1 undef, label %bb3.i, label %bb2.i + +bb2.i: ; preds = %entry + br label %bb3.i + +bb3.i: ; preds = %bb2.i, %entry + br i1 undef, label %_ZN12gjkepa2_impl3EPA6appendERNS0_5sListEPNS0_5sFaceE.exit71, label %bb.i69 + +bb.i69: ; preds = %bb3.i + br label %_ZN12gjkepa2_impl3EPA6appendERNS0_5sListEPNS0_5sFaceE.exit71 + +_ZN12gjkepa2_impl3EPA6appendERNS0_5sListEPNS0_5sFaceE.exit71: ; preds = %bb.i69, %bb3.i + %0 = select i1 undef, float 0.000000e+00, float undef + %1 = fdiv float %0, undef + %2 = fcmp ult float %1, 0xBF847AE140000000 + %storemerge9 = select i1 %2, float %1, float 0.000000e+00 + store float %storemerge9, float* undef, align 4 + br i1 undef, label %bb42, label %bb47 + +bb42: ; preds = %_ZN12gjkepa2_impl3EPA6appendERNS0_5sListEPNS0_5sFaceE.exit71 + br i1 undef, label %bb46, label %bb53 + +bb46: ; preds = %bb42 + br label %bb48 + +bb47: ; preds = %_ZN12gjkepa2_impl3EPA6appendERNS0_5sListEPNS0_5sFaceE.exit71 + br label %bb48 + +bb48: ; preds = %bb47, %bb46 + br i1 undef, label %bb1.i14, label %bb.i13 + +bb.i13: ; preds = %bb48 + br label %bb1.i14 + +bb1.i14: ; preds = %bb.i13, %bb48 + br label %bb53 + +bb53: ; preds = %bb1.i14, %bb42 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll b/test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll new file mode 100644 index 000000000000..2b083d804912 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll @@ -0,0 +1,45 @@ +; RUN: llc < %s -mtriple=arm64-apple-darwin + +; rdar://9146594 + +define void @drt_vsprintf() nounwind ssp { +entry: + %do_tab_convert = alloca i32, align 4 + br i1 undef, label %if.then24, label %if.else295, !dbg !13 + +if.then24: ; preds = %entry + unreachable + +if.else295: ; preds = %entry + call void @llvm.dbg.declare(metadata !{i32* %do_tab_convert}, metadata !16), !dbg !18 + store i32 0, i32* %do_tab_convert, align 4, !dbg !19 + unreachable +} + +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone + +!llvm.dbg.gv = !{!0} +!llvm.dbg.sp = !{!1, !7, !10, !11, !12} + +!0 = metadata !{i32 589876, i32 0, metadata !1, metadata !"vsplive", metadata !"vsplive", metadata !"", metadata !2, i32 617, metadata !6, i32 1, i32 1, null, null} ; [ DW_TAG_variable ] +!1 = metadata !{i32 589870, metadata !20, metadata !2, metadata !"drt_vsprintf", metadata !"drt_vsprintf", metadata !"", i32 616, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!2 = metadata !{i32 589865, metadata !20} ; [ DW_TAG_file_type ] +!3 = metadata !{i32 589841, metadata !20, i32 12, metadata !"clang version 3.0 (http://llvm.org/git/clang.git git:/git/puzzlebox/clang.git/ c4d1aea01c4444eb81bdbf391f1be309127c3cf1)", i1 true, metadata !"", i32 0, metadata !21, metadata !21, null, null, null, metadata !""} ; [ DW_TAG_compile_unit ] +!4 = metadata !{i32 589845, metadata !20, metadata !2, metadata !"", i32 0, i64 0, i64 0, i32 0, i32 0, null, metadata !5, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] +!5 = metadata !{metadata !6} +!6 = metadata !{i32 589860, null, metadata !3, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] +!7 = metadata !{i32 589870, metadata !20, metadata !2, metadata !"putc_mem", metadata !"putc_mem", metadata !"", i32 30, metadata !8, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!8 = metadata !{i32 589845, metadata !20, metadata !2, metadata !"", i32 0, i64 0, i64 0, i32 0, i32 0, null, metadata !9, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] +!9 = metadata !{null} +!10 = metadata !{i32 589870, metadata !20, metadata !2, metadata !"print_double", metadata !"print_double", metadata !"", i32 203, metadata !4, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!11 = metadata !{i32 589870, metadata !20, metadata !2, metadata !"print_number", metadata !"print_number", metadata !"", i32 75, metadata !4, i1 true, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, null, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!12 = metadata !{i32 589870, metadata !20, metadata !2, metadata !"get_flags", metadata !"get_flags", metadata !"", i32 508, metadata !8, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, null, i32 0} ; [ DW_TAG_subprogram ] +!13 = metadata !{i32 653, i32 5, metadata !14, null} +!14 = metadata !{i32 589835, metadata !20, metadata !15, i32 652, i32 35, i32 2} ; [ DW_TAG_lexical_block ] +!15 = metadata !{i32 589835, metadata !20, metadata !1, i32 616, i32 1, i32 0} ; [ DW_TAG_lexical_block ] +!16 = metadata !{i32 590080, metadata !17, metadata !"do_tab_convert", metadata !2, i32 853, metadata !6, i32 0, null} ; [ DW_TAG_auto_variable ] +!17 = metadata !{i32 589835, metadata !20, metadata !14, i32 850, i32 12, i32 33} ; [ DW_TAG_lexical_block ] +!18 = metadata !{i32 853, i32 11, metadata !17, null} +!19 = metadata !{i32 853, i32 29, metadata !17, null} +!20 = metadata !{metadata !"print.i", metadata !"/Volumes/Ebi/echeng/radars/r9146594"} +!21 = metadata !{i32 0} diff --git a/test/CodeGen/AArch64/arm64-2011-03-21-Unaligned-Frame-Index.ll b/test/CodeGen/AArch64/arm64-2011-03-21-Unaligned-Frame-Index.ll new file mode 100644 index 000000000000..6f0ec34fc1dd --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2011-03-21-Unaligned-Frame-Index.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s -march=arm64 | FileCheck %s +define void @foo(i64 %val) { +; CHECK: foo +; The stack frame store is not 64-bit aligned. Make sure we use an +; instruction that can handle that. +; CHECK: stur x0, [sp, #20] + %a = alloca [49 x i32], align 4 + %p32 = getelementptr inbounds [49 x i32]* %a, i64 0, i64 2 + %p = bitcast i32* %p32 to i64* + store i64 %val, i64* %p, align 8 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2011-04-21-CPSRBug.ll b/test/CodeGen/AArch64/arm64-2011-04-21-CPSRBug.ll new file mode 100644 index 000000000000..88232fcc0b4d --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2011-04-21-CPSRBug.ll @@ -0,0 +1,26 @@ +; RUN: llc < %s -mtriple=arm64-apple-iOS5.0 + +; CPSR is not allocatable so fast allocatable wouldn't mark them killed. +; rdar://9313272 + +define hidden void @t() nounwind { +entry: + %cmp = icmp eq i32* null, undef + %frombool = zext i1 %cmp to i8 + store i8 %frombool, i8* undef, align 1 + %tmp4 = load i8* undef, align 1 + %tobool = trunc i8 %tmp4 to i1 + br i1 %tobool, label %land.lhs.true, label %if.end + +land.lhs.true: ; preds = %entry + unreachable + +if.end: ; preds = %entry + br i1 undef, label %land.lhs.true14, label %if.end33 + +land.lhs.true14: ; preds = %if.end + unreachable + +if.end33: ; preds = %if.end + unreachable +} diff --git a/test/CodeGen/AArch64/arm64-2011-10-18-LdStOptBug.ll b/test/CodeGen/AArch64/arm64-2011-10-18-LdStOptBug.ll new file mode 100644 index 000000000000..8f99bc30a554 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2011-10-18-LdStOptBug.ll @@ -0,0 +1,31 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s + +; Can't fold the increment by 1<<12 into a post-increment load +; rdar://10301335 + +@test_data = common global i32 0, align 4 + +define void @t() nounwind ssp { +; CHECK-LABEL: t: +entry: + br label %for.body + +for.body: +; CHECK: for.body +; CHECK: ldr w{{[0-9]+}}, [x{{[0-9]+}}] +; CHECK: add x[[REG:[0-9]+]], +; CHECK: x[[REG]], #1, lsl #12 + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %0 = shl nsw i64 %indvars.iv, 12 + %add = add nsw i64 %0, 34628173824 + %1 = inttoptr i64 %add to i32* + %2 = load volatile i32* %1, align 4096 + store volatile i32 %2, i32* @test_data, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, 200 + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2012-01-11-ComparisonDAGCrash.ll b/test/CodeGen/AArch64/arm64-2012-01-11-ComparisonDAGCrash.ll new file mode 100644 index 000000000000..d47dbb28164c --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-01-11-ComparisonDAGCrash.ll @@ -0,0 +1,40 @@ +; RUN: llc < %s -march=arm64 + +; The target lowering for integer comparisons was replacing some DAG nodes +; during operation legalization, which resulted in dangling pointers, +; cycles in DAGs, and eventually crashes. This is the testcase for +; one of those crashes. (rdar://10653656) + +define void @test(i1 zeroext %IsArrow) nounwind ssp align 2 { +entry: + br i1 undef, label %return, label %lor.lhs.false + +lor.lhs.false: + br i1 undef, label %return, label %if.end + +if.end: + %tmp.i = load i64* undef, align 8 + %and.i.i.i = and i64 %tmp.i, -16 + br i1 %IsArrow, label %if.else_crit_edge, label %if.end32 + +if.else_crit_edge: + br i1 undef, label %if.end32, label %return + +if.end32: + %0 = icmp ult i32 undef, 3 + %1 = zext i64 %tmp.i to i320 + %.pn.v = select i1 %0, i320 128, i320 64 + %.pn = shl i320 %1, %.pn.v + %ins346392 = or i320 %.pn, 0 + store i320 %ins346392, i320* undef, align 8 + br i1 undef, label %sw.bb.i.i, label %exit + +sw.bb.i.i: + unreachable + +exit: + unreachable + +return: + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2012-05-07-DAGCombineVectorExtract.ll b/test/CodeGen/AArch64/arm64-2012-05-07-DAGCombineVectorExtract.ll new file mode 100644 index 000000000000..a4d37e48685f --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-05-07-DAGCombineVectorExtract.ll @@ -0,0 +1,20 @@ +; RUN: llc < %s -march=arm64 | FileCheck %s + +define i32 @foo(<4 x i32> %a, i32 %n) nounwind { +; CHECK-LABEL: foo: +; CHECK: fmov w0, s0 +; CHECK-NEXT: ret + %b = bitcast <4 x i32> %a to i128 + %c = trunc i128 %b to i32 + ret i32 %c +} + +define i64 @bar(<2 x i64> %a, i64 %n) nounwind { +; CHECK-LABEL: bar: +; CHECK: fmov x0, d0 +; CHECK-NEXT: ret + %b = bitcast <2 x i64> %a to i128 + %c = trunc i128 %b to i64 + ret i64 %c +} + diff --git a/test/CodeGen/AArch64/arm64-2012-05-07-MemcpyAlignBug.ll b/test/CodeGen/AArch64/arm64-2012-05-07-MemcpyAlignBug.ll new file mode 100644 index 000000000000..d59b0d004380 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-05-07-MemcpyAlignBug.ll @@ -0,0 +1,21 @@ +; RUN: llc < %s -march arm64 -mcpu=cyclone | FileCheck %s +; + +@b = private unnamed_addr constant [3 x i32] [i32 1768775988, i32 1685481784, i32 1836253201], align 4 + +; The important thing for this test is that we need an unaligned load of `l_b' +; ("ldr w2, [x1, #8]" in this case). + +; CHECK: adrp x[[PAGE:[0-9]+]], {{l_b@PAGE|.Lb}} +; CHECK: add x[[ADDR:[0-9]+]], x[[PAGE]], {{l_b@PAGEOFF|:lo12:.Lb}} +; CHECK-NEXT: ldr [[VAL:w[0-9]+]], [x[[ADDR]], #8] +; CHECK-NEXT: str [[VAL]], [x0, #8] +; CHECK-NEXT: ldr [[VAL2:x[0-9]+]], [x[[ADDR]]] +; CHECK-NEXT: str [[VAL2]], [x0] + +define void @foo(i8* %a) { + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast ([3 x i32]* @b to i8*), i64 12, i32 4, i1 false) + ret void +} + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind diff --git a/test/CodeGen/AArch64/arm64-2012-05-09-LOADgot-bug.ll b/test/CodeGen/AArch64/arm64-2012-05-09-LOADgot-bug.ll new file mode 100644 index 000000000000..7da2d2ca513e --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-05-09-LOADgot-bug.ll @@ -0,0 +1,22 @@ +; RUN: llc -mtriple=arm64-apple-ios < %s | FileCheck %s +; RUN: llc -mtriple=arm64-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefix=CHECK-LINUX +; + +define hidden void @t(i64* %addr) optsize ssp { +entry: + store i64 zext (i32 ptrtoint (i64 (i32)* @x to i32) to i64), i64* %addr, align 8 +; CHECK: adrp x{{[0-9]+}}, _x@GOTPAGE +; CHECK: ldr x{{[0-9]+}}, [x{{[0-9]+}}, _x@GOTPAGEOFF] +; CHECK-NEXT: and x{{[0-9]+}}, x{{[0-9]+}}, #0xffffffff +; CHECK-NEXT: str x{{[0-9]+}}, [x{{[0-9]+}}] + ret void +} + +declare i64 @x(i32) optsize + +; Worth checking the Linux code is sensible too: only way to access +; the GOT is via a 64-bit load. Just loading wN is unacceptable +; (there's no ELF relocation to do that). + +; CHECK-LINUX: adrp {{x[0-9]+}}, :got:x +; CHECK-LINUX: ldr {{x[0-9]+}}, [{{x[0-9]+}}, :got_lo12:x] diff --git a/test/CodeGen/AArch64/arm64-2012-05-22-LdStOptBug.ll b/test/CodeGen/AArch64/arm64-2012-05-22-LdStOptBug.ll new file mode 100644 index 000000000000..4b037db9c84b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-05-22-LdStOptBug.ll @@ -0,0 +1,50 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios -verify-machineinstrs | FileCheck %s + +; LdStOpt bug created illegal instruction: +; %D1, %D2 = LDPSi %X0, 1 +; rdar://11512047 + +%0 = type opaque +%struct.CGRect = type { %struct.CGPoint, %struct.CGSize } +%struct.CGPoint = type { double, double } +%struct.CGSize = type { double, double } + +@"OBJC_IVAR_$_UIScreen._bounds" = external hidden global i64, section "__DATA, __objc_ivar", align 8 + +define hidden %struct.CGRect @t(%0* nocapture %self, i8* nocapture %_cmd) nounwind readonly optsize ssp { +entry: +; CHECK-LABEL: t: +; CHECK: ldp d{{[0-9]+}}, d{{[0-9]+}} + %ivar = load i64* @"OBJC_IVAR_$_UIScreen._bounds", align 8, !invariant.load !4 + %0 = bitcast %0* %self to i8* + %add.ptr = getelementptr inbounds i8* %0, i64 %ivar + %add.ptr10.0 = bitcast i8* %add.ptr to double* + %tmp11 = load double* %add.ptr10.0, align 8 + %add.ptr.sum = add i64 %ivar, 8 + %add.ptr10.1 = getelementptr inbounds i8* %0, i64 %add.ptr.sum + %1 = bitcast i8* %add.ptr10.1 to double* + %tmp12 = load double* %1, align 8 + %add.ptr.sum17 = add i64 %ivar, 16 + %add.ptr4.1 = getelementptr inbounds i8* %0, i64 %add.ptr.sum17 + %add.ptr4.1.0 = bitcast i8* %add.ptr4.1 to double* + %tmp = load double* %add.ptr4.1.0, align 8 + %add.ptr4.1.sum = add i64 %ivar, 24 + %add.ptr4.1.1 = getelementptr inbounds i8* %0, i64 %add.ptr4.1.sum + %2 = bitcast i8* %add.ptr4.1.1 to double* + %tmp5 = load double* %2, align 8 + %insert14 = insertvalue %struct.CGPoint undef, double %tmp11, 0 + %insert16 = insertvalue %struct.CGPoint %insert14, double %tmp12, 1 + %insert = insertvalue %struct.CGRect undef, %struct.CGPoint %insert16, 0 + %insert7 = insertvalue %struct.CGSize undef, double %tmp, 0 + %insert9 = insertvalue %struct.CGSize %insert7, double %tmp5, 1 + %insert3 = insertvalue %struct.CGRect %insert, %struct.CGSize %insert9, 1 + ret %struct.CGRect %insert3 +} + +!llvm.module.flags = !{!0, !1, !2, !3} + +!0 = metadata !{i32 1, metadata !"Objective-C Version", i32 2} +!1 = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0} +!2 = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__DATA, __objc_imageinfo, regular, no_dead_strip"} +!3 = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0} +!4 = metadata !{} diff --git a/test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll b/test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll new file mode 100644 index 000000000000..168e921bcc02 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll @@ -0,0 +1,67 @@ +; RUN: llc -march=arm64 -O0 < %s | FileCheck %s +; RUN: llc -march=arm64 -O3 < %s | FileCheck %s + +@.str = private unnamed_addr constant [9 x i8] c"%lf %lu\0A\00", align 1 +@.str1 = private unnamed_addr constant [8 x i8] c"%lf %u\0A\00", align 1 +@.str2 = private unnamed_addr constant [8 x i8] c"%f %lu\0A\00", align 1 +@.str3 = private unnamed_addr constant [7 x i8] c"%f %u\0A\00", align 1 + +define void @testDouble(double %d) ssp { +; CHECK-LABEL: testDouble: +; CHECK: fcvtzu x{{[0-9]+}}, d{{[0-9]+}} +; CHECK: fcvtzu w{{[0-9]+}}, d{{[0-9]+}} +entry: + %d.addr = alloca double, align 8 + store double %d, double* %d.addr, align 8 + %0 = load double* %d.addr, align 8 + %1 = load double* %d.addr, align 8 + %conv = fptoui double %1 to i64 + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), double %0, i64 %conv) + %2 = load double* %d.addr, align 8 + %3 = load double* %d.addr, align 8 + %conv1 = fptoui double %3 to i32 + %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str1, i32 0, i32 0), double %2, i32 %conv1) + ret void +} + +declare i32 @printf(i8*, ...) + +define void @testFloat(float %f) ssp { +; CHECK-LABEL: testFloat: +; CHECK: fcvtzu x{{[0-9]+}}, s{{[0-9]+}} +; CHECK: fcvtzu w{{[0-9]+}}, s{{[0-9]+}} +entry: + %f.addr = alloca float, align 4 + store float %f, float* %f.addr, align 4 + %0 = load float* %f.addr, align 4 + %conv = fpext float %0 to double + %1 = load float* %f.addr, align 4 + %conv1 = fptoui float %1 to i64 + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str2, i32 0, i32 0), double %conv, i64 %conv1) + %2 = load float* %f.addr, align 4 + %conv2 = fpext float %2 to double + %3 = load float* %f.addr, align 4 + %conv3 = fptoui float %3 to i32 + %call4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str3, i32 0, i32 0), double %conv2, i32 %conv3) + ret void +} + +define i32 @main(i32 %argc, i8** %argv) ssp { +entry: + %retval = alloca i32, align 4 + %argc.addr = alloca i32, align 4 + %argv.addr = alloca i8**, align 8 + store i32 0, i32* %retval + store i32 %argc, i32* %argc.addr, align 4 + store i8** %argv, i8*** %argv.addr, align 8 + call void @testDouble(double 1.159198e+01) + call void @testFloat(float 0x40272F1800000000) + ret i32 0 +} + +!llvm.module.flags = !{!0, !1, !2, !3} + +!0 = metadata !{i32 1, metadata !"Objective-C Version", i32 2} +!1 = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0} +!2 = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__DATA, __objc_imageinfo, regular, no_dead_strip"} +!3 = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0} diff --git a/test/CodeGen/AArch64/arm64-2012-07-11-InstrEmitterBug.ll b/test/CodeGen/AArch64/arm64-2012-07-11-InstrEmitterBug.ll new file mode 100644 index 000000000000..55ecfb5d2bd6 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2012-07-11-InstrEmitterBug.ll @@ -0,0 +1,56 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios +; rdar://11849816 + +@shlib_path_substitutions = external hidden unnamed_addr global i8**, align 8 + +declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readnone + +declare noalias i8* @xmalloc(i64) optsize + +declare i64 @strlen(i8* nocapture) nounwind readonly optsize + +declare i8* @__strcpy_chk(i8*, i8*, i64) nounwind optsize + +declare i8* @__strcat_chk(i8*, i8*, i64) nounwind optsize + +declare noalias i8* @xstrdup(i8*) optsize + +define i8* @dyld_fix_path(i8* %path) nounwind optsize ssp { +entry: + br i1 undef, label %if.end56, label %for.cond + +for.cond: ; preds = %entry + br i1 undef, label %for.cond10, label %for.body + +for.body: ; preds = %for.cond + unreachable + +for.cond10: ; preds = %for.cond + br i1 undef, label %if.end56, label %for.body14 + +for.body14: ; preds = %for.cond10 + %call22 = tail call i64 @strlen(i8* undef) nounwind optsize + %sext = shl i64 %call22, 32 + %conv30 = ashr exact i64 %sext, 32 + %add29 = sub i64 0, %conv30 + %sub = add i64 %add29, 0 + %add31 = shl i64 %sub, 32 + %sext59 = add i64 %add31, 4294967296 + %conv33 = ashr exact i64 %sext59, 32 + %call34 = tail call noalias i8* @xmalloc(i64 %conv33) nounwind optsize + br i1 undef, label %cond.false45, label %cond.true43 + +cond.true43: ; preds = %for.body14 + unreachable + +cond.false45: ; preds = %for.body14 + %add.ptr = getelementptr inbounds i8* %path, i64 %conv30 + unreachable + +if.end56: ; preds = %for.cond10, %entry + ret i8* null +} + +declare i32 @strncmp(i8* nocapture, i8* nocapture, i64) nounwind readonly optsize + +declare i8* @strcpy(i8*, i8* nocapture) nounwind diff --git a/test/CodeGen/AArch64/arm64-2013-01-13-ffast-fcmp.ll b/test/CodeGen/AArch64/arm64-2013-01-13-ffast-fcmp.ll new file mode 100644 index 000000000000..e2c43d953bb9 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2013-01-13-ffast-fcmp.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple -fp-contract=fast | FileCheck %s --check-prefix=FAST + +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-n32:64-S128" +target triple = "arm64-apple-ios7.0.0" + +;FAST-LABEL: _Z9example25v: +;FAST: fcmgt.4s +;FAST: ret + +;CHECK-LABEL: _Z9example25v: +;CHECK: fcmgt.4s +;CHECK: ret + +define <4 x i32> @_Z9example25v( <4 x float> %N0, <4 x float> %N1) { + %A = fcmp olt <4 x float> %N0, %N1 + %B = zext <4 x i1> %A to <4 x i32> + ret <4 x i32> %B +} diff --git a/test/CodeGen/AArch64/arm64-2013-01-23-frem-crash.ll b/test/CodeGen/AArch64/arm64-2013-01-23-frem-crash.ll new file mode 100644 index 000000000000..94511243a49f --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2013-01-23-frem-crash.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -march=arm64 +; Make sure we are not crashing on this test. + +define void @autogen_SD13158() { +entry: + %B26 = frem float 0.000000e+00, undef + br i1 undef, label %CF, label %CF77 + +CF: ; preds = %CF, %CF76 + store float %B26, float* undef + br i1 undef, label %CF, label %CF77 + +CF77: ; preds = %CF + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2013-01-23-sext-crash.ll b/test/CodeGen/AArch64/arm64-2013-01-23-sext-crash.ll new file mode 100644 index 000000000000..404027bfd5f3 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2013-01-23-sext-crash.ll @@ -0,0 +1,37 @@ +; RUN: llc < %s -march=arm64 + +; Make sure we are not crashing on this test. + +define void @autogen_SD12881() { +BB: + %B17 = ashr <4 x i32> zeroinitializer, zeroinitializer + br label %CF + +CF: ; preds = %CF83, %CF, %BB + br i1 undef, label %CF, label %CF83 + +CF83: ; preds = %CF + %FC70 = sitofp <4 x i32> %B17 to <4 x double> + br label %CF +} + + +define void @autogen_SD12881_2() { +BB: + %B17 = ashr <4 x i32> zeroinitializer, zeroinitializer + br label %CF + +CF: ; preds = %CF83, %CF, %BB + br i1 undef, label %CF, label %CF83 + +CF83: ; preds = %CF + %FC70 = uitofp <4 x i32> %B17 to <4 x double> + br label %CF +} + +define void @_Z12my_example2bv() nounwind noinline ssp { +entry: + %0 = fptosi <2 x double> undef to <2 x i32> + store <2 x i32> %0, <2 x i32>* undef, align 8 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-2013-02-12-shufv8i8.ll b/test/CodeGen/AArch64/arm64-2013-02-12-shufv8i8.ll new file mode 100644 index 000000000000..a350ba1472c9 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-2013-02-12-shufv8i8.ll @@ -0,0 +1,11 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple + +;CHECK-LABEL: Shuff: +;CHECK: tbl.8b +;CHECK: ret +define <8 x i8 > @Shuff(<8 x i8> %in, <8 x i8>* %out) nounwind ssp { + %value = shufflevector <8 x i8> %in, <8 x i8> zeroinitializer, <8 x i32> + ret <8 x i8> %value +} + + diff --git a/test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll b/test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll new file mode 100644 index 000000000000..c4597d5a4815 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll @@ -0,0 +1,67 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple -aarch64-simd-scalar=true -asm-verbose=false | FileCheck %s +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=generic -aarch64-simd-scalar=true -asm-verbose=false | FileCheck %s -check-prefix=GENERIC + +define <2 x i64> @bar(<2 x i64> %a, <2 x i64> %b) nounwind readnone { +; CHECK-LABEL: bar: +; CHECK: add.2d v[[REG:[0-9]+]], v0, v1 +; CHECK: add d[[REG3:[0-9]+]], d[[REG]], d1 +; CHECK: sub d[[REG2:[0-9]+]], d[[REG]], d1 +; GENERIC-LABEL: bar: +; GENERIC: add v[[REG:[0-9]+]].2d, v0.2d, v1.2d +; GENERIC: add d[[REG3:[0-9]+]], d[[REG]], d1 +; GENERIC: sub d[[REG2:[0-9]+]], d[[REG]], d1 + %add = add <2 x i64> %a, %b + %vgetq_lane = extractelement <2 x i64> %add, i32 0 + %vgetq_lane2 = extractelement <2 x i64> %b, i32 0 + %add3 = add i64 %vgetq_lane, %vgetq_lane2 + %sub = sub i64 %vgetq_lane, %vgetq_lane2 + %vecinit = insertelement <2 x i64> undef, i64 %add3, i32 0 + %vecinit8 = insertelement <2 x i64> %vecinit, i64 %sub, i32 1 + ret <2 x i64> %vecinit8 +} + +define double @subdd_su64(<2 x i64> %a, <2 x i64> %b) nounwind readnone { +; CHECK-LABEL: subdd_su64: +; CHECK: sub d0, d1, d0 +; CHECK-NEXT: ret +; GENERIC-LABEL: subdd_su64: +; GENERIC: sub d0, d1, d0 +; GENERIC-NEXT: ret + %vecext = extractelement <2 x i64> %a, i32 0 + %vecext1 = extractelement <2 x i64> %b, i32 0 + %sub.i = sub nsw i64 %vecext1, %vecext + %retval = bitcast i64 %sub.i to double + ret double %retval +} + +define double @vaddd_su64(<2 x i64> %a, <2 x i64> %b) nounwind readnone { +; CHECK-LABEL: vaddd_su64: +; CHECK: add d0, d1, d0 +; CHECK-NEXT: ret +; GENERIC-LABEL: vaddd_su64: +; GENERIC: add d0, d1, d0 +; GENERIC-NEXT: ret + %vecext = extractelement <2 x i64> %a, i32 0 + %vecext1 = extractelement <2 x i64> %b, i32 0 + %add.i = add nsw i64 %vecext1, %vecext + %retval = bitcast i64 %add.i to double + ret double %retval +} + +; sub MI doesn't access dsub register. +define double @add_sub_su64(<2 x i64> %a, <2 x i64> %b) nounwind readnone { +; CHECK-LABEL: add_sub_su64: +; CHECK: add d0, d1, d0 +; CHECK: sub d0, {{d[0-9]+}}, d0 +; CHECK-NEXT: ret +; GENERIC-LABEL: add_sub_su64: +; GENERIC: add d0, d1, d0 +; GENERIC: sub d0, {{d[0-9]+}}, d0 +; GENERIC-NEXT: ret + %vecext = extractelement <2 x i64> %a, i32 0 + %vecext1 = extractelement <2 x i64> %b, i32 0 + %add.i = add i64 %vecext1, %vecext + %sub.i = sub i64 0, %add.i + %retval = bitcast i64 %sub.i to double + ret double %retval +} diff --git a/test/CodeGen/AArch64/arm64-AnInfiniteLoopInDAGCombine.ll b/test/CodeGen/AArch64/arm64-AnInfiniteLoopInDAGCombine.ll new file mode 100644 index 000000000000..a73b70718019 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-AnInfiniteLoopInDAGCombine.ll @@ -0,0 +1,23 @@ +; RUN: llc < %s -march=arm64 + +; This test case tests an infinite loop bug in DAG combiner. +; It just tries to do the following replacing endlessly: +; (1) Replacing.3 0x2c509f0: v4i32 = any_extend 0x2c4cd08 [ORD=4] +; With: 0x2c4d128: v4i32 = sign_extend 0x2c4cd08 [ORD=4] +; +; (2) Replacing.2 0x2c4d128: v4i32 = sign_extend 0x2c4cd08 [ORD=4] +; With: 0x2c509f0: v4i32 = any_extend 0x2c4cd08 [ORD=4] +; As we think the (2) optimization from SIGN_EXTEND to ANY_EXTEND is +; an optimization to replace unused bits with undefined bits, we remove +; the (1) optimization (It doesn't make sense to replace undefined bits +; with signed bits). + +define <4 x i32> @infiniteLoop(<4 x i32> %in0, <4 x i16> %in1) { +entry: + %cmp.i = icmp sge <4 x i16> %in1, + %sext.i = sext <4 x i1> %cmp.i to <4 x i32> + %mul.i = mul <4 x i32> %in0, %sext.i + %sext = shl <4 x i32> %mul.i, + %vmovl.i.i = ashr <4 x i32> %sext, + ret <4 x i32> %vmovl.i.i +} \ No newline at end of file diff --git a/test/CodeGen/AArch64/arm64-EXT-undef-mask.ll b/test/CodeGen/AArch64/arm64-EXT-undef-mask.ll new file mode 100644 index 000000000000..1b2d54317c23 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-EXT-undef-mask.ll @@ -0,0 +1,23 @@ +; RUN: llc < %s -O0 -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s + +; The following 2 test cases test shufflevector with beginning UNDEF mask. +define <8 x i16> @test_vext_undef_traverse(<8 x i16> %in) { +;CHECK-LABEL: test_vext_undef_traverse: +;CHECK: {{ext.16b.*v0, #4}} + %vext = shufflevector <8 x i16> , <8 x i16> %in, <8 x i32> + ret <8 x i16> %vext +} + +define <8 x i16> @test_vext_undef_traverse2(<8 x i16> %in) { +;CHECK-LABEL: test_vext_undef_traverse2: +;CHECK: {{ext.16b.*v0, #6}} + %vext = shufflevector <8 x i16> %in, <8 x i16> , <8 x i32> + ret <8 x i16> %vext +} + +define <8 x i8> @test_vext_undef_traverse3(<8 x i8> %in) { +;CHECK-LABEL: test_vext_undef_traverse3: +;CHECK: {{ext.8b.*v0, #6}} + %vext = shufflevector <8 x i8> %in, <8 x i8> , <8 x i32> + ret <8 x i8> %vext +} diff --git a/test/CodeGen/AArch64/arm64-aapcs.ll b/test/CodeGen/AArch64/arm64-aapcs.ll new file mode 100644 index 000000000000..127a7cc0a155 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-aapcs.ll @@ -0,0 +1,125 @@ +; RUN: llc -mtriple=arm64-linux-gnu -enable-misched=false < %s | FileCheck %s + +@var = global i32 0, align 4 + +define i128 @test_i128_align(i32, i128 %arg, i32 %after) { + store i32 %after, i32* @var, align 4 +; CHECK: str w4, [{{x[0-9]+}}, :lo12:var] + + ret i128 %arg +; CHECK: mov x0, x2 +; CHECK: mov x1, x3 +} + +@var64 = global i64 0, align 8 + + ; Check stack slots are 64-bit at all times. +define void @test_stack_slots([8 x i32], i1 %bool, i8 %char, i16 %short, + i32 %int, i64 %long) { + ; Part of last store. Blasted scheduler. +; CHECK: ldr [[LONG:x[0-9]+]], [sp, #32] + + %ext_bool = zext i1 %bool to i64 + store volatile i64 %ext_bool, i64* @var64, align 8 +; CHECK: ldrb w[[EXT:[0-9]+]], [sp] +; CHECK: and x[[EXTED:[0-9]+]], x[[EXT]], #0x1 +; CHECK: str x[[EXTED]], [{{x[0-9]+}}, :lo12:var64] + + %ext_char = zext i8 %char to i64 + store volatile i64 %ext_char, i64* @var64, align 8 +; CHECK: ldrb w[[EXT:[0-9]+]], [sp, #8] +; CHECK: str x[[EXT]], [{{x[0-9]+}}, :lo12:var64] + + %ext_short = zext i16 %short to i64 + store volatile i64 %ext_short, i64* @var64, align 8 +; CHECK: ldrh w[[EXT:[0-9]+]], [sp, #16] +; CHECK: str x[[EXT]], [{{x[0-9]+}}, :lo12:var64] + + %ext_int = zext i32 %int to i64 + store volatile i64 %ext_int, i64* @var64, align 8 +; CHECK: ldr{{b?}} w[[EXT:[0-9]+]], [sp, #24] +; CHECK: str x[[EXT]], [{{x[0-9]+}}, :lo12:var64] + + store volatile i64 %long, i64* @var64, align 8 +; CHECK: str [[LONG]], [{{x[0-9]+}}, :lo12:var64] + + ret void +} + +; Make sure the callee does extensions (in the absence of zext/sext +; keyword on args) while we're here. + +define void @test_extension(i1 %bool, i8 %char, i16 %short, i32 %int) { + %ext_bool = zext i1 %bool to i64 + store volatile i64 %ext_bool, i64* @var64 +; CHECK: and [[EXT:x[0-9]+]], x0, #0x1 +; CHECK: str [[EXT]], [{{x[0-9]+}}, :lo12:var64] + + %ext_char = sext i8 %char to i64 + store volatile i64 %ext_char, i64* @var64 +; CHECK: sxtb [[EXT:x[0-9]+]], w1 +; CHECK: str [[EXT]], [{{x[0-9]+}}, :lo12:var64] + + %ext_short = zext i16 %short to i64 + store volatile i64 %ext_short, i64* @var64 +; CHECK: and [[EXT:x[0-9]+]], x2, #0xffff +; CHECK: str [[EXT]], [{{x[0-9]+}}, :lo12:var64] + + %ext_int = zext i32 %int to i64 + store volatile i64 %ext_int, i64* @var64 +; CHECK: ubfx [[EXT:x[0-9]+]], x3, #0, #32 +; CHECK: str [[EXT]], [{{x[0-9]+}}, :lo12:var64] + + ret void +} + +declare void @variadic(i32 %a, ...) + + ; Under AAPCS variadic functions have the same calling convention as + ; others. The extra arguments should go in registers rather than on the stack. +define void @test_variadic() { + call void(i32, ...)* @variadic(i32 0, i64 1, double 2.0) +; CHECK: fmov d0, #2.0 +; CHECK: orr w1, wzr, #0x1 +; CHECK: bl variadic + ret void +} + +; We weren't marking x7 as used after deciding that the i128 didn't fit into +; registers and putting the first half on the stack, so the *second* half went +; into x7. Yuck! +define i128 @test_i128_shadow([7 x i64] %x0_x6, i128 %sp) { +; CHECK-LABEL: test_i128_shadow: +; CHECK: ldp x0, x1, [sp] + + ret i128 %sp +} + +; This test is to check if fp128 can be correctly handled on stack. +define fp128 @test_fp128([8 x float] %arg0, fp128 %arg1) { +; CHECK-LABEL: test_fp128: +; CHECK: ldr {{q[0-9]+}}, [sp] + ret fp128 %arg1 +} + +; Check if VPR can be correctly pass by stack. +define <2 x double> @test_vreg_stack([8 x <2 x double>], <2 x double> %varg_stack) { +entry: +; CHECK-LABEL: test_vreg_stack: +; CHECK: ldr {{q[0-9]+}}, [sp] + ret <2 x double> %varg_stack; +} + +; Check that f16 can be passed and returned (ACLE 2.0 extension) +define half @test_half(float, half %arg) { +; CHECK-LABEL: test_half: +; CHECK: mov v0.16b, v{{[0-9]+}}.16b + ret half %arg; +} + +; Check that f16 constants are materialized correctly +define half @test_half_const() { +; CHECK-LABEL: test_half_const: +; CHECK: ldr h0, [x{{[0-9]+}}, :lo12:{{.*}}] + ret half 0xH4248 +} diff --git a/test/CodeGen/AArch64/arm64-abi-varargs.ll b/test/CodeGen/AArch64/arm64-abi-varargs.ll new file mode 100644 index 000000000000..92db392cd041 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-abi-varargs.ll @@ -0,0 +1,191 @@ +; RUN: llc < %s -march=arm64 -mcpu=cyclone -enable-misched=false | FileCheck %s +target triple = "arm64-apple-ios7.0.0" + +; rdar://13625505 +; Here we have 9 fixed integer arguments the 9th argument in on stack, the +; varargs start right after at 8-byte alignment. +define void @fn9(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7, i32 %a8, i32 %a9, ...) nounwind noinline ssp { +; CHECK-LABEL: fn9: +; 9th fixed argument +; CHECK: ldr {{w[0-9]+}}, [sp, #64] +; CHECK: add [[ARGS:x[0-9]+]], sp, #72 +; CHECK: add {{x[0-9]+}}, [[ARGS]], #8 +; First vararg +; CHECK: ldr {{w[0-9]+}}, [sp, #72] +; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #8 +; Second vararg +; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}] +; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #8 +; Third vararg +; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}] + %1 = alloca i32, align 4 + %2 = alloca i32, align 4 + %3 = alloca i32, align 4 + %4 = alloca i32, align 4 + %5 = alloca i32, align 4 + %6 = alloca i32, align 4 + %7 = alloca i32, align 4 + %8 = alloca i32, align 4 + %9 = alloca i32, align 4 + %args = alloca i8*, align 8 + %a10 = alloca i32, align 4 + %a11 = alloca i32, align 4 + %a12 = alloca i32, align 4 + store i32 %a1, i32* %1, align 4 + store i32 %a2, i32* %2, align 4 + store i32 %a3, i32* %3, align 4 + store i32 %a4, i32* %4, align 4 + store i32 %a5, i32* %5, align 4 + store i32 %a6, i32* %6, align 4 + store i32 %a7, i32* %7, align 4 + store i32 %a8, i32* %8, align 4 + store i32 %a9, i32* %9, align 4 + %10 = bitcast i8** %args to i8* + call void @llvm.va_start(i8* %10) + %11 = va_arg i8** %args, i32 + store i32 %11, i32* %a10, align 4 + %12 = va_arg i8** %args, i32 + store i32 %12, i32* %a11, align 4 + %13 = va_arg i8** %args, i32 + store i32 %13, i32* %a12, align 4 + ret void +} + +declare void @llvm.va_start(i8*) nounwind + +define i32 @main() nounwind ssp { +; CHECK-LABEL: main: +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] +; CHECK: str {{x[0-9]+}}, [sp, #8] +; CHECK: str {{w[0-9]+}}, [sp] + %a1 = alloca i32, align 4 + %a2 = alloca i32, align 4 + %a3 = alloca i32, align 4 + %a4 = alloca i32, align 4 + %a5 = alloca i32, align 4 + %a6 = alloca i32, align 4 + %a7 = alloca i32, align 4 + %a8 = alloca i32, align 4 + %a9 = alloca i32, align 4 + %a10 = alloca i32, align 4 + %a11 = alloca i32, align 4 + %a12 = alloca i32, align 4 + store i32 1, i32* %a1, align 4 + store i32 2, i32* %a2, align 4 + store i32 3, i32* %a3, align 4 + store i32 4, i32* %a4, align 4 + store i32 5, i32* %a5, align 4 + store i32 6, i32* %a6, align 4 + store i32 7, i32* %a7, align 4 + store i32 8, i32* %a8, align 4 + store i32 9, i32* %a9, align 4 + store i32 10, i32* %a10, align 4 + store i32 11, i32* %a11, align 4 + store i32 12, i32* %a12, align 4 + %1 = load i32* %a1, align 4 + %2 = load i32* %a2, align 4 + %3 = load i32* %a3, align 4 + %4 = load i32* %a4, align 4 + %5 = load i32* %a5, align 4 + %6 = load i32* %a6, align 4 + %7 = load i32* %a7, align 4 + %8 = load i32* %a8, align 4 + %9 = load i32* %a9, align 4 + %10 = load i32* %a10, align 4 + %11 = load i32* %a11, align 4 + %12 = load i32* %a12, align 4 + call void (i32, i32, i32, i32, i32, i32, i32, i32, i32, ...)* @fn9(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12) + ret i32 0 +} + +;rdar://13668483 +@.str = private unnamed_addr constant [4 x i8] c"fmt\00", align 1 +define void @foo(i8* %fmt, ...) nounwind { +entry: +; CHECK-LABEL: foo: +; CHECK: orr {{x[0-9]+}}, {{x[0-9]+}}, #0x8 +; CHECK: ldr {{w[0-9]+}}, [sp, #48] +; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #15 +; CHECK: and x[[ADDR:[0-9]+]], {{x[0-9]+}}, #0xfffffffffffffff0 +; CHECK: ldr {{q[0-9]+}}, [x[[ADDR]]] + %fmt.addr = alloca i8*, align 8 + %args = alloca i8*, align 8 + %vc = alloca i32, align 4 + %vv = alloca <4 x i32>, align 16 + store i8* %fmt, i8** %fmt.addr, align 8 + %args1 = bitcast i8** %args to i8* + call void @llvm.va_start(i8* %args1) + %0 = va_arg i8** %args, i32 + store i32 %0, i32* %vc, align 4 + %1 = va_arg i8** %args, <4 x i32> + store <4 x i32> %1, <4 x i32>* %vv, align 16 + ret void +} + +define void @bar(i32 %x, <4 x i32> %y) nounwind { +entry: +; CHECK-LABEL: bar: +; CHECK: str {{q[0-9]+}}, [sp, #16] +; CHECK: str {{x[0-9]+}}, [sp] + %x.addr = alloca i32, align 4 + %y.addr = alloca <4 x i32>, align 16 + store i32 %x, i32* %x.addr, align 4 + store <4 x i32> %y, <4 x i32>* %y.addr, align 16 + %0 = load i32* %x.addr, align 4 + %1 = load <4 x i32>* %y.addr, align 16 + call void (i8*, ...)* @foo(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %0, <4 x i32> %1) + ret void +} + +; rdar://13668927 +; When passing 16-byte aligned small structs as vararg, make sure the caller +; side is 16-byte aligned on stack. +%struct.s41 = type { i32, i16, i32, i16 } +define void @foo2(i8* %fmt, ...) nounwind { +entry: +; CHECK-LABEL: foo2: +; CHECK: orr {{x[0-9]+}}, {{x[0-9]+}}, #0x8 +; CHECK: ldr {{w[0-9]+}}, [sp, #48] +; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, #15 +; CHECK: and x[[ADDR:[0-9]+]], {{x[0-9]+}}, #0xfffffffffffffff0 +; CHECK: ldr {{q[0-9]+}}, [x[[ADDR]]] + %fmt.addr = alloca i8*, align 8 + %args = alloca i8*, align 8 + %vc = alloca i32, align 4 + %vs = alloca %struct.s41, align 16 + store i8* %fmt, i8** %fmt.addr, align 8 + %args1 = bitcast i8** %args to i8* + call void @llvm.va_start(i8* %args1) + %0 = va_arg i8** %args, i32 + store i32 %0, i32* %vc, align 4 + %ap.cur = load i8** %args + %1 = getelementptr i8* %ap.cur, i32 15 + %2 = ptrtoint i8* %1 to i64 + %3 = and i64 %2, -16 + %ap.align = inttoptr i64 %3 to i8* + %ap.next = getelementptr i8* %ap.align, i32 16 + store i8* %ap.next, i8** %args + %4 = bitcast i8* %ap.align to %struct.s41* + %5 = bitcast %struct.s41* %vs to i8* + %6 = bitcast %struct.s41* %4 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %5, i8* %6, i64 16, i32 16, i1 false) + ret void +} +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind + +define void @bar2(i32 %x, i128 %s41.coerce) nounwind { +entry: +; CHECK-LABEL: bar2: +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] +; CHECK: str {{x[0-9]+}}, [sp] + %x.addr = alloca i32, align 4 + %s41 = alloca %struct.s41, align 16 + store i32 %x, i32* %x.addr, align 4 + %0 = bitcast %struct.s41* %s41 to i128* + store i128 %s41.coerce, i128* %0, align 1 + %1 = load i32* %x.addr, align 4 + %2 = bitcast %struct.s41* %s41 to i128* + %3 = load i128* %2, align 1 + call void (i8*, ...)* @foo2(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), i32 %1, i128 %3) + ret void +} diff --git a/test/CodeGen/AArch64/arm64-abi.ll b/test/CodeGen/AArch64/arm64-abi.ll new file mode 100644 index 000000000000..a955029b3725 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-abi.ll @@ -0,0 +1,239 @@ +; RUN: llc < %s -debug -march=arm64 -mcpu=cyclone -enable-misched=false | FileCheck %s +; RUN: llc < %s -O0 | FileCheck -check-prefix=FAST %s +; REQUIRES: asserts +target triple = "arm64-apple-darwin" + +; rdar://9932559 +define i64 @i8i16callee(i64 %a1, i64 %a2, i64 %a3, i8 signext %a4, i16 signext %a5, i64 %a6, i64 %a7, i64 %a8, i8 signext %b1, i16 signext %b2, i8 signext %b3, i8 signext %b4) nounwind readnone noinline { +entry: +; CHECK-LABEL: i8i16callee: +; The 8th, 9th, 10th and 11th arguments are passed at sp, sp+2, sp+4, sp+5. +; They are i8, i16, i8 and i8. +; CHECK-DAG: ldrsb {{w[0-9]+}}, [sp, #5] +; CHECK-DAG: ldrsb {{w[0-9]+}}, [sp, #4] +; CHECK-DAG: ldrsh {{w[0-9]+}}, [sp, #2] +; CHECK-DAG: ldrsb {{w[0-9]+}}, [sp] +; FAST-LABEL: i8i16callee: +; FAST-DAG: ldrsb {{w[0-9]+}}, [sp, #5] +; FAST-DAG: ldrsb {{w[0-9]+}}, [sp, #4] +; FAST-DAG: ldrsh {{w[0-9]+}}, [sp, #2] +; FAST-DAG: ldrsb {{w[0-9]+}}, [sp] + %conv = sext i8 %a4 to i64 + %conv3 = sext i16 %a5 to i64 + %conv8 = sext i8 %b1 to i64 + %conv9 = sext i16 %b2 to i64 + %conv11 = sext i8 %b3 to i64 + %conv13 = sext i8 %b4 to i64 + %add10 = add i64 %a2, %a1 + %add12 = add i64 %add10, %a3 + %add14 = add i64 %add12, %conv + %add = add i64 %add14, %conv3 + %add1 = add i64 %add, %a6 + %add2 = add i64 %add1, %a7 + %add4 = add i64 %add2, %a8 + %add5 = add i64 %add4, %conv8 + %add6 = add i64 %add5, %conv9 + %add7 = add i64 %add6, %conv11 + %add15 = add i64 %add7, %conv13 + %sext = shl i64 %add15, 32 + %conv17 = ashr exact i64 %sext, 32 + ret i64 %conv17 +} + +define i32 @i8i16caller() nounwind readnone { +entry: +; CHECK: i8i16caller +; The 8th, 9th, 10th and 11th arguments are passed at sp, sp+2, sp+4, sp+5. +; They are i8, i16, i8 and i8. +; CHECK-DAG: strb {{w[0-9]+}}, [sp, #5] +; CHECK-DAG: strb {{w[0-9]+}}, [sp, #4] +; CHECK-DAG: strh {{w[0-9]+}}, [sp, #2] +; CHECK-DAG: strb {{w[0-9]+}}, [sp] +; CHECK: bl +; FAST: i8i16caller +; FAST: strb {{w[0-9]+}}, [sp] +; FAST: strh {{w[0-9]+}}, [sp, #2] +; FAST: strb {{w[0-9]+}}, [sp, #4] +; FAST: strb {{w[0-9]+}}, [sp, #5] +; FAST: bl + %call = tail call i64 @i8i16callee(i64 0, i64 1, i64 2, i8 signext 3, i16 signext 4, i64 5, i64 6, i64 7, i8 signext 97, i16 signext 98, i8 signext 99, i8 signext 100) + %conv = trunc i64 %call to i32 + ret i32 %conv +} + +; rdar://12651543 +define double @circle_center([2 x float] %a) nounwind ssp { + %call = tail call double @ext([2 x float] %a) nounwind +; CHECK: circle_center +; CHECK: bl + ret double %call +} +declare double @ext([2 x float]) + +; rdar://12656141 +; 16-byte vector should be aligned at 16-byte when passing on stack. +; A double argument will be passed on stack, so vecotr should be at sp+16. +define double @fixed_4i(<4 x i32>* nocapture %in) nounwind { +entry: +; CHECK: fixed_4i +; CHECK: str [[REG_1:q[0-9]+]], [sp, #16] +; FAST: fixed_4i +; FAST: sub sp, sp, #64 +; FAST: mov x[[ADDR:[0-9]+]], sp +; FAST: str [[REG_1:q[0-9]+]], [x[[ADDR]], #16] + %0 = load <4 x i32>* %in, align 16 + %call = tail call double @args_vec_4i(double 3.000000e+00, <4 x i32> %0, <4 x i32> %0, <4 x i32> %0, <4 x i32> %0, <4 x i32> %0, <4 x i32> %0, <4 x i32> %0, double 3.000000e+00, <4 x i32> %0, i8 signext 3) + ret double %call +} +declare double @args_vec_4i(double, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>, double, <4 x i32>, i8 signext) + +; rdar://12695237 +; d8 at sp, i in register w0. +@g_d = common global double 0.000000e+00, align 8 +define void @test1(float %f1, double %d1, double %d2, double %d3, double %d4, + double %d5, double %d6, double %d7, double %d8, i32 %i) nounwind ssp { +entry: +; CHECK: test1 +; CHECK: ldr [[REG_1:d[0-9]+]], [sp] +; CHECK: scvtf [[REG_2:s[0-9]+]], w0 +; CHECK: fadd s0, [[REG_2]], s0 + %conv = sitofp i32 %i to float + %add = fadd float %conv, %f1 + %conv1 = fpext float %add to double + %add2 = fadd double %conv1, %d7 + %add3 = fadd double %add2, %d8 + store double %add3, double* @g_d, align 8 + ret void +} + +; i9 at sp, d1 in register s0. +define void @test2(i32 %i1, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, float %d1) nounwind ssp { +entry: +; CHECK: test2 +; CHECK: scvtf [[REG_2:s[0-9]+]], w0 +; CHECK: fadd s0, [[REG_2]], s0 +; CHECK: ldr [[REG_1:s[0-9]+]], [sp] + %conv = sitofp i32 %i1 to float + %add = fadd float %conv, %d1 + %conv1 = fpext float %add to double + %conv2 = sitofp i32 %i8 to double + %add3 = fadd double %conv2, %conv1 + %conv4 = sitofp i32 %i9 to double + %add5 = fadd double %conv4, %add3 + store double %add5, double* @g_d, align 8 + ret void +} + +; rdar://12648441 +; Check alignment on stack for v64, f64, i64, f32, i32. +define double @test3(<2 x i32>* nocapture %in) nounwind { +entry: +; CHECK: test3 +; CHECK: str [[REG_1:d[0-9]+]], [sp, #8] +; FAST: test3 +; FAST: sub sp, sp, #32 +; FAST: mov x[[ADDR:[0-9]+]], sp +; FAST: str [[REG_1:d[0-9]+]], [x[[ADDR]], #8] + %0 = load <2 x i32>* %in, align 8 + %call = tail call double @args_vec_2i(double 3.000000e+00, <2 x i32> %0, + <2 x i32> %0, <2 x i32> %0, <2 x i32> %0, <2 x i32> %0, <2 x i32> %0, + <2 x i32> %0, float 3.000000e+00, <2 x i32> %0, i8 signext 3) + ret double %call +} +declare double @args_vec_2i(double, <2 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, + <2 x i32>, <2 x i32>, <2 x i32>, float, <2 x i32>, i8 signext) + +define double @test4(double* nocapture %in) nounwind { +entry: +; CHECK: test4 +; CHECK: str [[REG_1:d[0-9]+]], [sp, #8] +; CHECK: str [[REG_2:w[0-9]+]], [sp] +; CHECK: orr w0, wzr, #0x3 + %0 = load double* %in, align 8 + %call = tail call double @args_f64(double 3.000000e+00, double %0, double %0, + double %0, double %0, double %0, double %0, double %0, + float 3.000000e+00, double %0, i8 signext 3) + ret double %call +} +declare double @args_f64(double, double, double, double, double, double, double, + double, float, double, i8 signext) + +define i64 @test5(i64* nocapture %in) nounwind { +entry: +; CHECK: test5 +; CHECK: strb [[REG_3:w[0-9]+]], [sp, #16] +; CHECK: str [[REG_1:x[0-9]+]], [sp, #8] +; CHECK: str [[REG_2:w[0-9]+]], [sp] + %0 = load i64* %in, align 8 + %call = tail call i64 @args_i64(i64 3, i64 %0, i64 %0, i64 %0, i64 %0, i64 %0, + i64 %0, i64 %0, i32 3, i64 %0, i8 signext 3) + ret i64 %call +} +declare i64 @args_i64(i64, i64, i64, i64, i64, i64, i64, i64, i32, i64, + i8 signext) + +define i32 @test6(float* nocapture %in) nounwind { +entry: +; CHECK: test6 +; CHECK: strb [[REG_2:w[0-9]+]], [sp, #8] +; CHECK: str [[REG_1:s[0-9]+]], [sp, #4] +; CHECK: strh [[REG_3:w[0-9]+]], [sp] + %0 = load float* %in, align 4 + %call = tail call i32 @args_f32(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, + i32 7, i32 8, float 1.0, float 2.0, float 3.0, float 4.0, float 5.0, + float 6.0, float 7.0, float 8.0, i16 signext 3, float %0, + i8 signext 3) + ret i32 %call +} +declare i32 @args_f32(i32, i32, i32, i32, i32, i32, i32, i32, + float, float, float, float, float, float, float, float, + i16 signext, float, i8 signext) + +define i32 @test7(i32* nocapture %in) nounwind { +entry: +; CHECK: test7 +; CHECK: strb [[REG_2:w[0-9]+]], [sp, #8] +; CHECK: str [[REG_1:w[0-9]+]], [sp, #4] +; CHECK: strh [[REG_3:w[0-9]+]], [sp] + %0 = load i32* %in, align 4 + %call = tail call i32 @args_i32(i32 3, i32 %0, i32 %0, i32 %0, i32 %0, i32 %0, + i32 %0, i32 %0, i16 signext 3, i32 %0, i8 signext 4) + ret i32 %call +} +declare i32 @args_i32(i32, i32, i32, i32, i32, i32, i32, i32, i16 signext, i32, + i8 signext) + +define i32 @test8(i32 %argc, i8** nocapture %argv) nounwind { +entry: +; CHECK: test8 +; CHECK: strb {{w[0-9]+}}, [sp, #3] +; CHECK: strb wzr, [sp, #2] +; CHECK: strb {{w[0-9]+}}, [sp, #1] +; CHECK: strb wzr, [sp] +; CHECK: bl +; FAST: test8 +; FAST: strb {{w[0-9]+}}, [sp] +; FAST: strb {{w[0-9]+}}, [sp, #1] +; FAST: strb {{w[0-9]+}}, [sp, #2] +; FAST: strb {{w[0-9]+}}, [sp, #3] +; FAST: bl + tail call void @args_i1(i1 zeroext false, i1 zeroext true, i1 zeroext false, + i1 zeroext true, i1 zeroext false, i1 zeroext true, + i1 zeroext false, i1 zeroext true, i1 zeroext false, + i1 zeroext true, i1 zeroext false, i1 zeroext true) + ret i32 0 +} + +declare void @args_i1(i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext, + i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext, + i1 zeroext, i1 zeroext, i1 zeroext, i1 zeroext) + +define i32 @i1_stack_incoming(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f, + i64 %g, i64 %h, i64 %i, i1 zeroext %j) { +; CHECK-LABEL: i1_stack_incoming: +; CHECK: ldrb w0, [sp, #8] +; CHECK: ret + %v = zext i1 %j to i32 + ret i32 %v +} diff --git a/test/CodeGen/AArch64/arm64-abi_align.ll b/test/CodeGen/AArch64/arm64-abi_align.ll new file mode 100644 index 000000000000..44c5a07ce39a --- /dev/null +++ b/test/CodeGen/AArch64/arm64-abi_align.ll @@ -0,0 +1,532 @@ +; RUN: llc < %s -march=arm64 -mcpu=cyclone -enable-misched=false | FileCheck %s +; RUN: llc < %s -O0 | FileCheck -check-prefix=FAST %s +target triple = "arm64-apple-darwin" + +; rdar://12648441 +; Generated from arm64-arguments.c with -O2. +; Test passing structs with size < 8, < 16 and > 16 +; with alignment of 16 and without + +; Structs with size < 8 +%struct.s38 = type { i32, i16 } +; With alignment of 16, the size will be padded to multiple of 16 bytes. +%struct.s39 = type { i32, i16, [10 x i8] } +; Structs with size < 16 +%struct.s40 = type { i32, i16, i32, i16 } +%struct.s41 = type { i32, i16, i32, i16 } +; Structs with size > 16 +%struct.s42 = type { i32, i16, i32, i16, i32, i16 } +%struct.s43 = type { i32, i16, i32, i16, i32, i16, [10 x i8] } + +@g38 = common global %struct.s38 zeroinitializer, align 4 +@g38_2 = common global %struct.s38 zeroinitializer, align 4 +@g39 = common global %struct.s39 zeroinitializer, align 16 +@g39_2 = common global %struct.s39 zeroinitializer, align 16 +@g40 = common global %struct.s40 zeroinitializer, align 4 +@g40_2 = common global %struct.s40 zeroinitializer, align 4 +@g41 = common global %struct.s41 zeroinitializer, align 16 +@g41_2 = common global %struct.s41 zeroinitializer, align 16 +@g42 = common global %struct.s42 zeroinitializer, align 4 +@g42_2 = common global %struct.s42 zeroinitializer, align 4 +@g43 = common global %struct.s43 zeroinitializer, align 16 +@g43_2 = common global %struct.s43 zeroinitializer, align 16 + +; structs with size < 8 bytes, passed via i64 in x1 and x2 +define i32 @f38(i32 %i, i64 %s1.coerce, i64 %s2.coerce) #0 { +entry: +; CHECK: f38 +; CHECK: add w[[A:[0-9]+]], w1, w0 +; CHECK: add {{w[0-9]+}}, w[[A]], w2 + %s1.sroa.0.0.extract.trunc = trunc i64 %s1.coerce to i32 + %s1.sroa.1.4.extract.shift = lshr i64 %s1.coerce, 32 + %s2.sroa.0.0.extract.trunc = trunc i64 %s2.coerce to i32 + %s2.sroa.1.4.extract.shift = lshr i64 %s2.coerce, 32 + %sext8 = shl nuw nsw i64 %s1.sroa.1.4.extract.shift, 16 + %sext = trunc i64 %sext8 to i32 + %conv = ashr exact i32 %sext, 16 + %sext1011 = shl nuw nsw i64 %s2.sroa.1.4.extract.shift, 16 + %sext10 = trunc i64 %sext1011 to i32 + %conv6 = ashr exact i32 %sext10, 16 + %add = add i32 %s1.sroa.0.0.extract.trunc, %i + %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +define i32 @caller38() #1 { +entry: +; CHECK: caller38 +; CHECK: ldr x1, +; CHECK: ldr x2, + %0 = load i64* bitcast (%struct.s38* @g38 to i64*), align 4 + %1 = load i64* bitcast (%struct.s38* @g38_2 to i64*), align 4 + %call = tail call i32 @f38(i32 3, i64 %0, i64 %1) #5 + ret i32 %call +} + +declare i32 @f38_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, i64 %s1.coerce, i64 %s2.coerce) #0 + +; structs with size < 8 bytes, passed on stack at [sp+8] and [sp+16] +; i9 at [sp] +define i32 @caller38_stack() #1 { +entry: +; CHECK: caller38_stack +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + %0 = load i64* bitcast (%struct.s38* @g38 to i64*), align 4 + %1 = load i64* bitcast (%struct.s38* @g38_2 to i64*), align 4 + %call = tail call i32 @f38_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, + i32 7, i32 8, i32 9, i64 %0, i64 %1) #5 + ret i32 %call +} + +; structs with size < 8 bytes, alignment of 16 +; passed via i128 in x1 and x3 +define i32 @f39(i32 %i, i128 %s1.coerce, i128 %s2.coerce) #0 { +entry: +; CHECK: f39 +; CHECK: add w[[A:[0-9]+]], w1, w0 +; CHECK: add {{w[0-9]+}}, w[[A]], w3 + %s1.sroa.0.0.extract.trunc = trunc i128 %s1.coerce to i32 + %s1.sroa.1.4.extract.shift = lshr i128 %s1.coerce, 32 + %s2.sroa.0.0.extract.trunc = trunc i128 %s2.coerce to i32 + %s2.sroa.1.4.extract.shift = lshr i128 %s2.coerce, 32 + %sext8 = shl nuw nsw i128 %s1.sroa.1.4.extract.shift, 16 + %sext = trunc i128 %sext8 to i32 + %conv = ashr exact i32 %sext, 16 + %sext1011 = shl nuw nsw i128 %s2.sroa.1.4.extract.shift, 16 + %sext10 = trunc i128 %sext1011 to i32 + %conv6 = ashr exact i32 %sext10, 16 + %add = add i32 %s1.sroa.0.0.extract.trunc, %i + %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +define i32 @caller39() #1 { +entry: +; CHECK: caller39 +; CHECK: ldp x1, x2, +; CHECK: ldp x3, x4, + %0 = load i128* bitcast (%struct.s39* @g39 to i128*), align 16 + %1 = load i128* bitcast (%struct.s39* @g39_2 to i128*), align 16 + %call = tail call i32 @f39(i32 3, i128 %0, i128 %1) #5 + ret i32 %call +} + +declare i32 @f39_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, i128 %s1.coerce, i128 %s2.coerce) #0 + +; structs with size < 8 bytes, alignment 16 +; passed on stack at [sp+16] and [sp+32] +define i32 @caller39_stack() #1 { +entry: +; CHECK: caller39_stack +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32] +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + %0 = load i128* bitcast (%struct.s39* @g39 to i128*), align 16 + %1 = load i128* bitcast (%struct.s39* @g39_2 to i128*), align 16 + %call = tail call i32 @f39_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, + i32 7, i32 8, i32 9, i128 %0, i128 %1) #5 + ret i32 %call +} + +; structs with size < 16 bytes +; passed via i128 in x1 and x3 +define i32 @f40(i32 %i, [2 x i64] %s1.coerce, [2 x i64] %s2.coerce) #0 { +entry: +; CHECK: f40 +; CHECK: add w[[A:[0-9]+]], w1, w0 +; CHECK: add {{w[0-9]+}}, w[[A]], w3 + %s1.coerce.fca.0.extract = extractvalue [2 x i64] %s1.coerce, 0 + %s2.coerce.fca.0.extract = extractvalue [2 x i64] %s2.coerce, 0 + %s1.sroa.0.0.extract.trunc = trunc i64 %s1.coerce.fca.0.extract to i32 + %s2.sroa.0.0.extract.trunc = trunc i64 %s2.coerce.fca.0.extract to i32 + %s1.sroa.0.4.extract.shift = lshr i64 %s1.coerce.fca.0.extract, 32 + %sext8 = shl nuw nsw i64 %s1.sroa.0.4.extract.shift, 16 + %sext = trunc i64 %sext8 to i32 + %conv = ashr exact i32 %sext, 16 + %s2.sroa.0.4.extract.shift = lshr i64 %s2.coerce.fca.0.extract, 32 + %sext1011 = shl nuw nsw i64 %s2.sroa.0.4.extract.shift, 16 + %sext10 = trunc i64 %sext1011 to i32 + %conv6 = ashr exact i32 %sext10, 16 + %add = add i32 %s1.sroa.0.0.extract.trunc, %i + %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +define i32 @caller40() #1 { +entry: +; CHECK: caller40 +; CHECK: ldp x1, x2, +; CHECK: ldp x3, x4, + %0 = load [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4 + %1 = load [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4 + %call = tail call i32 @f40(i32 3, [2 x i64] %0, [2 x i64] %1) #5 + ret i32 %call +} + +declare i32 @f40_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, [2 x i64] %s1.coerce, [2 x i64] %s2.coerce) #0 + +; structs with size < 16 bytes +; passed on stack at [sp+8] and [sp+24] +define i32 @caller40_stack() #1 { +entry: +; CHECK: caller40_stack +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #24] +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #8] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + %0 = load [2 x i64]* bitcast (%struct.s40* @g40 to [2 x i64]*), align 4 + %1 = load [2 x i64]* bitcast (%struct.s40* @g40_2 to [2 x i64]*), align 4 + %call = tail call i32 @f40_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, + i32 7, i32 8, i32 9, [2 x i64] %0, [2 x i64] %1) #5 + ret i32 %call +} + +; structs with size < 16 bytes, alignment of 16 +; passed via i128 in x1 and x3 +define i32 @f41(i32 %i, i128 %s1.coerce, i128 %s2.coerce) #0 { +entry: +; CHECK: f41 +; CHECK: add w[[A:[0-9]+]], w1, w0 +; CHECK: add {{w[0-9]+}}, w[[A]], w3 + %s1.sroa.0.0.extract.trunc = trunc i128 %s1.coerce to i32 + %s1.sroa.1.4.extract.shift = lshr i128 %s1.coerce, 32 + %s2.sroa.0.0.extract.trunc = trunc i128 %s2.coerce to i32 + %s2.sroa.1.4.extract.shift = lshr i128 %s2.coerce, 32 + %sext8 = shl nuw nsw i128 %s1.sroa.1.4.extract.shift, 16 + %sext = trunc i128 %sext8 to i32 + %conv = ashr exact i32 %sext, 16 + %sext1011 = shl nuw nsw i128 %s2.sroa.1.4.extract.shift, 16 + %sext10 = trunc i128 %sext1011 to i32 + %conv6 = ashr exact i32 %sext10, 16 + %add = add i32 %s1.sroa.0.0.extract.trunc, %i + %add3 = add i32 %add, %s2.sroa.0.0.extract.trunc + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +define i32 @caller41() #1 { +entry: +; CHECK: caller41 +; CHECK: ldp x1, x2, +; CHECK: ldp x3, x4, + %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 + %1 = load i128* bitcast (%struct.s41* @g41_2 to i128*), align 16 + %call = tail call i32 @f41(i32 3, i128 %0, i128 %1) #5 + ret i32 %call +} + +declare i32 @f41_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, i128 %s1.coerce, i128 %s2.coerce) #0 + +; structs with size < 16 bytes, alignment of 16 +; passed on stack at [sp+16] and [sp+32] +define i32 @caller41_stack() #1 { +entry: +; CHECK: caller41_stack +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #32] +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp, #16] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 + %1 = load i128* bitcast (%struct.s41* @g41_2 to i128*), align 16 + %call = tail call i32 @f41_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, + i32 7, i32 8, i32 9, i128 %0, i128 %1) #5 + ret i32 %call +} + +; structs with size of 22 bytes, passed indirectly in x1 and x2 +define i32 @f42(i32 %i, %struct.s42* nocapture %s1, %struct.s42* nocapture %s2) #2 { +entry: +; CHECK: f42 +; CHECK: ldr w[[A:[0-9]+]], [x1] +; CHECK: ldr w[[B:[0-9]+]], [x2] +; CHECK: add w[[C:[0-9]+]], w[[A]], w0 +; CHECK: add {{w[0-9]+}}, w[[C]], w[[B]] +; FAST: f42 +; FAST: ldr w[[A:[0-9]+]], [x1] +; FAST: ldr w[[B:[0-9]+]], [x2] +; FAST: add w[[C:[0-9]+]], w[[A]], w0 +; FAST: add {{w[0-9]+}}, w[[C]], w[[B]] + %i1 = getelementptr inbounds %struct.s42* %s1, i64 0, i32 0 + %0 = load i32* %i1, align 4, !tbaa !0 + %i2 = getelementptr inbounds %struct.s42* %s2, i64 0, i32 0 + %1 = load i32* %i2, align 4, !tbaa !0 + %s = getelementptr inbounds %struct.s42* %s1, i64 0, i32 1 + %2 = load i16* %s, align 2, !tbaa !3 + %conv = sext i16 %2 to i32 + %s5 = getelementptr inbounds %struct.s42* %s2, i64 0, i32 1 + %3 = load i16* %s5, align 2, !tbaa !3 + %conv6 = sext i16 %3 to i32 + %add = add i32 %0, %i + %add3 = add i32 %add, %1 + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +; For s1, we allocate a 22-byte space, pass its address via x1 +define i32 @caller42() #3 { +entry: +; CHECK: caller42 +; CHECK: str {{x[0-9]+}}, [sp, #48] +; CHECK: str {{q[0-9]+}}, [sp, #32] +; CHECK: str {{x[0-9]+}}, [sp, #16] +; CHECK: str {{q[0-9]+}}, [sp] +; CHECK: add x1, sp, #32 +; CHECK: mov x2, sp +; Space for s1 is allocated at sp+32 +; Space for s2 is allocated at sp + +; FAST: caller42 +; FAST: sub sp, sp, #96 +; Space for s1 is allocated at fp-24 = sp+72 +; Space for s2 is allocated at sp+48 +; FAST: sub x[[A:[0-9]+]], x29, #24 +; FAST: add x[[A:[0-9]+]], sp, #48 +; Call memcpy with size = 24 (0x18) +; FAST: orr {{x[0-9]+}}, xzr, #0x18 + %tmp = alloca %struct.s42, align 4 + %tmp1 = alloca %struct.s42, align 4 + %0 = bitcast %struct.s42* %tmp to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4 + %1 = bitcast %struct.s42* %tmp1 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4 + %call = call i32 @f42(i32 3, %struct.s42* %tmp, %struct.s42* %tmp1) #5 + ret i32 %call +} + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #4 + +declare i32 @f42_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, %struct.s42* nocapture %s1, + %struct.s42* nocapture %s2) #2 + +define i32 @caller42_stack() #3 { +entry: +; CHECK: caller42_stack +; CHECK: mov x29, sp +; CHECK: sub sp, sp, #96 +; CHECK: stur {{x[0-9]+}}, [x29, #-16] +; CHECK: stur {{q[0-9]+}}, [x29, #-32] +; CHECK: str {{x[0-9]+}}, [sp, #48] +; CHECK: str {{q[0-9]+}}, [sp, #32] +; Space for s1 is allocated at x29-32 = sp+64 +; Space for s2 is allocated at sp+32 +; CHECK: add x[[B:[0-9]+]], sp, #32 +; CHECK: str x[[B]], [sp, #16] +; CHECK: sub x[[A:[0-9]+]], x29, #32 +; Address of s1 is passed on stack at sp+8 +; CHECK: str x[[A]], [sp, #8] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + +; FAST: caller42_stack +; Space for s1 is allocated at fp-24 +; Space for s2 is allocated at fp-48 +; FAST: sub x[[A:[0-9]+]], x29, #24 +; FAST: sub x[[B:[0-9]+]], x29, #48 +; Call memcpy with size = 24 (0x18) +; FAST: orr {{x[0-9]+}}, xzr, #0x18 +; FAST: str {{w[0-9]+}}, [sp] +; Address of s1 is passed on stack at sp+8 +; FAST: str {{x[0-9]+}}, [sp, #8] +; FAST: str {{x[0-9]+}}, [sp, #16] + %tmp = alloca %struct.s42, align 4 + %tmp1 = alloca %struct.s42, align 4 + %0 = bitcast %struct.s42* %tmp to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4 + %1 = bitcast %struct.s42* %tmp1 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4 + %call = call i32 @f42_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, + i32 8, i32 9, %struct.s42* %tmp, %struct.s42* %tmp1) #5 + ret i32 %call +} + +; structs with size of 22 bytes, alignment of 16 +; passed indirectly in x1 and x2 +define i32 @f43(i32 %i, %struct.s43* nocapture %s1, %struct.s43* nocapture %s2) #2 { +entry: +; CHECK: f43 +; CHECK: ldr w[[A:[0-9]+]], [x1] +; CHECK: ldr w[[B:[0-9]+]], [x2] +; CHECK: add w[[C:[0-9]+]], w[[A]], w0 +; CHECK: add {{w[0-9]+}}, w[[C]], w[[B]] +; FAST: f43 +; FAST: ldr w[[A:[0-9]+]], [x1] +; FAST: ldr w[[B:[0-9]+]], [x2] +; FAST: add w[[C:[0-9]+]], w[[A]], w0 +; FAST: add {{w[0-9]+}}, w[[C]], w[[B]] + %i1 = getelementptr inbounds %struct.s43* %s1, i64 0, i32 0 + %0 = load i32* %i1, align 4, !tbaa !0 + %i2 = getelementptr inbounds %struct.s43* %s2, i64 0, i32 0 + %1 = load i32* %i2, align 4, !tbaa !0 + %s = getelementptr inbounds %struct.s43* %s1, i64 0, i32 1 + %2 = load i16* %s, align 2, !tbaa !3 + %conv = sext i16 %2 to i32 + %s5 = getelementptr inbounds %struct.s43* %s2, i64 0, i32 1 + %3 = load i16* %s5, align 2, !tbaa !3 + %conv6 = sext i16 %3 to i32 + %add = add i32 %0, %i + %add3 = add i32 %add, %1 + %add4 = add i32 %add3, %conv + %add7 = add i32 %add4, %conv6 + ret i32 %add7 +} + +define i32 @caller43() #3 { +entry: +; CHECK: caller43 +; CHECK: str {{q[0-9]+}}, [sp, #48] +; CHECK: str {{q[0-9]+}}, [sp, #32] +; CHECK: str {{q[0-9]+}}, [sp, #16] +; CHECK: str {{q[0-9]+}}, [sp] +; CHECK: add x1, sp, #32 +; CHECK: mov x2, sp +; Space for s1 is allocated at sp+32 +; Space for s2 is allocated at sp + +; FAST: caller43 +; FAST: mov x29, sp +; Space for s1 is allocated at sp+32 +; Space for s2 is allocated at sp +; FAST: add x1, sp, #32 +; FAST: mov x2, sp +; FAST: str {{x[0-9]+}}, [sp, #32] +; FAST: str {{x[0-9]+}}, [sp, #40] +; FAST: str {{x[0-9]+}}, [sp, #48] +; FAST: str {{x[0-9]+}}, [sp, #56] +; FAST: str {{x[0-9]+}}, [sp] +; FAST: str {{x[0-9]+}}, [sp, #8] +; FAST: str {{x[0-9]+}}, [sp, #16] +; FAST: str {{x[0-9]+}}, [sp, #24] + %tmp = alloca %struct.s43, align 16 + %tmp1 = alloca %struct.s43, align 16 + %0 = bitcast %struct.s43* %tmp to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4 + %1 = bitcast %struct.s43* %tmp1 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4 + %call = call i32 @f43(i32 3, %struct.s43* %tmp, %struct.s43* %tmp1) #5 + ret i32 %call +} + +declare i32 @f43_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6, + i32 %i7, i32 %i8, i32 %i9, %struct.s43* nocapture %s1, + %struct.s43* nocapture %s2) #2 + +define i32 @caller43_stack() #3 { +entry: +; CHECK: caller43_stack +; CHECK: mov x29, sp +; CHECK: sub sp, sp, #96 +; CHECK: stur {{q[0-9]+}}, [x29, #-16] +; CHECK: stur {{q[0-9]+}}, [x29, #-32] +; CHECK: str {{q[0-9]+}}, [sp, #48] +; CHECK: str {{q[0-9]+}}, [sp, #32] +; Space for s1 is allocated at x29-32 = sp+64 +; Space for s2 is allocated at sp+32 +; CHECK: add x[[B:[0-9]+]], sp, #32 +; CHECK: str x[[B]], [sp, #16] +; CHECK: sub x[[A:[0-9]+]], x29, #32 +; Address of s1 is passed on stack at sp+8 +; CHECK: str x[[A]], [sp, #8] +; CHECK: movz w[[C:[0-9]+]], #0x9 +; CHECK: str w[[C]], [sp] + +; FAST: caller43_stack +; FAST: sub sp, sp, #96 +; Space for s1 is allocated at fp-32 = sp+64 +; Space for s2 is allocated at sp+32 +; FAST: sub x[[A:[0-9]+]], x29, #32 +; FAST: add x[[B:[0-9]+]], sp, #32 +; FAST: stur {{x[0-9]+}}, [x29, #-32] +; FAST: stur {{x[0-9]+}}, [x29, #-24] +; FAST: stur {{x[0-9]+}}, [x29, #-16] +; FAST: stur {{x[0-9]+}}, [x29, #-8] +; FAST: str {{x[0-9]+}}, [sp, #32] +; FAST: str {{x[0-9]+}}, [sp, #40] +; FAST: str {{x[0-9]+}}, [sp, #48] +; FAST: str {{x[0-9]+}}, [sp, #56] +; FAST: str {{w[0-9]+}}, [sp] +; Address of s1 is passed on stack at sp+8 +; FAST: str {{x[0-9]+}}, [sp, #8] +; FAST: str {{x[0-9]+}}, [sp, #16] + %tmp = alloca %struct.s43, align 16 + %tmp1 = alloca %struct.s43, align 16 + %0 = bitcast %struct.s43* %tmp to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4 + %1 = bitcast %struct.s43* %tmp1 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4 + %call = call i32 @f43_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, + i32 8, i32 9, %struct.s43* %tmp, %struct.s43* %tmp1) #5 + ret i32 %call +} + +; rdar://13668927 +; Check that we don't split an i128. +declare i32 @callee_i128_split(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, + i32 %i6, i32 %i7, i128 %s1, i32 %i8) + +define i32 @i128_split() { +entry: +; CHECK: i128_split +; "i128 %0" should be on stack at [sp]. +; "i32 8" should be on stack at [sp, #16]. +; CHECK: str {{w[0-9]+}}, [sp, #16] +; CHECK: stp {{x[0-9]+}}, {{x[0-9]+}}, [sp] +; FAST: i128_split +; FAST: sub sp, sp, #48 +; FAST: mov x[[ADDR:[0-9]+]], sp +; FAST: str {{w[0-9]+}}, [x[[ADDR]], #16] +; Load/Store opt is disabled with -O0, so the i128 is split. +; FAST: str {{x[0-9]+}}, [x[[ADDR]], #8] +; FAST: str {{x[0-9]+}}, [x[[ADDR]]] + %0 = load i128* bitcast (%struct.s41* @g41 to i128*), align 16 + %call = tail call i32 @callee_i128_split(i32 1, i32 2, i32 3, i32 4, i32 5, + i32 6, i32 7, i128 %0, i32 8) #5 + ret i32 %call +} + +declare i32 @callee_i64(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, + i32 %i6, i32 %i7, i64 %s1, i32 %i8) + +define i32 @i64_split() { +entry: +; CHECK: i64_split +; "i64 %0" should be in register x7. +; "i32 8" should be on stack at [sp]. +; CHECK: ldr x7, [{{x[0-9]+}}] +; CHECK: str {{w[0-9]+}}, [sp] +; FAST: i64_split +; FAST: ldr x7, [{{x[0-9]+}}] +; FAST: str {{w[0-9]+}}, [sp] + %0 = load i64* bitcast (%struct.s41* @g41 to i64*), align 16 + %call = tail call i32 @callee_i64(i32 1, i32 2, i32 3, i32 4, i32 5, + i32 6, i32 7, i64 %0, i32 8) #5 + ret i32 %call +} + +attributes #0 = { noinline nounwind readnone "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" } +attributes #1 = { nounwind readonly "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" } +attributes #2 = { noinline nounwind readonly "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" } +attributes #3 = { nounwind "fp-contract-model"="standard" "relocation-model"="pic" "ssp-buffers-size"="8" } +attributes #4 = { nounwind } +attributes #5 = { nobuiltin } + +!0 = metadata !{metadata !"int", metadata !1} +!1 = metadata !{metadata !"omnipotent char", metadata !2} +!2 = metadata !{metadata !"Simple C/C++ TBAA"} +!3 = metadata !{metadata !"short", metadata !1} +!4 = metadata !{i64 0, i64 4, metadata !0, i64 4, i64 2, metadata !3, i64 8, i64 4, metadata !0, i64 12, i64 2, metadata !3, i64 16, i64 4, metadata !0, i64 20, i64 2, metadata !3} diff --git a/test/CodeGen/AArch64/arm64-addp.ll b/test/CodeGen/AArch64/arm64-addp.ll new file mode 100644 index 000000000000..3f1e5c5d44e3 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-addp.ll @@ -0,0 +1,32 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple -mcpu=cyclone | FileCheck %s + +define double @foo(<2 x double> %a) nounwind { +; CHECK-LABEL: foo: +; CHECK: faddp.2d d0, v0 +; CHECK-NEXT: ret + %lane0.i = extractelement <2 x double> %a, i32 0 + %lane1.i = extractelement <2 x double> %a, i32 1 + %vpaddd.i = fadd double %lane0.i, %lane1.i + ret double %vpaddd.i +} + +define i64 @foo0(<2 x i64> %a) nounwind { +; CHECK-LABEL: foo0: +; CHECK: addp.2d d0, v0 +; CHECK-NEXT: fmov x0, d0 +; CHECK-NEXT: ret + %lane0.i = extractelement <2 x i64> %a, i32 0 + %lane1.i = extractelement <2 x i64> %a, i32 1 + %vpaddd.i = add i64 %lane0.i, %lane1.i + ret i64 %vpaddd.i +} + +define float @foo1(<2 x float> %a) nounwind { +; CHECK-LABEL: foo1: +; CHECK: faddp.2s +; CHECK-NEXT: ret + %lane0.i = extractelement <2 x float> %a, i32 0 + %lane1.i = extractelement <2 x float> %a, i32 1 + %vpaddd.i = fadd float %lane0.i, %lane1.i + ret float %vpaddd.i +} diff --git a/test/CodeGen/AArch64/arm64-addr-mode-folding.ll b/test/CodeGen/AArch64/arm64-addr-mode-folding.ll new file mode 100644 index 000000000000..08fb8c90c484 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-addr-mode-folding.ll @@ -0,0 +1,171 @@ +; RUN: llc -O3 -mtriple arm64-apple-ios3 %s -o - | FileCheck %s +; + +@block = common global i8* null, align 8 + +define i32 @fct(i32 %i1, i32 %i2) { +; CHECK: @fct +; Sign extension is used more than once, thus it should not be folded. +; CodeGenPrepare is not sharing sext across uses, thus this is folded because +; of that. +; _CHECK-NOT_: , sxtw] +entry: + %idxprom = sext i32 %i1 to i64 + %0 = load i8** @block, align 8 + %arrayidx = getelementptr inbounds i8* %0, i64 %idxprom + %1 = load i8* %arrayidx, align 1 + %idxprom1 = sext i32 %i2 to i64 + %arrayidx2 = getelementptr inbounds i8* %0, i64 %idxprom1 + %2 = load i8* %arrayidx2, align 1 + %cmp = icmp eq i8 %1, %2 + br i1 %cmp, label %if.end, label %if.then + +if.then: ; preds = %entry + %cmp7 = icmp ugt i8 %1, %2 + %conv8 = zext i1 %cmp7 to i32 + br label %return + +if.end: ; preds = %entry + %inc = add nsw i32 %i1, 1 + %inc9 = add nsw i32 %i2, 1 + %idxprom10 = sext i32 %inc to i64 + %arrayidx11 = getelementptr inbounds i8* %0, i64 %idxprom10 + %3 = load i8* %arrayidx11, align 1 + %idxprom12 = sext i32 %inc9 to i64 + %arrayidx13 = getelementptr inbounds i8* %0, i64 %idxprom12 + %4 = load i8* %arrayidx13, align 1 + %cmp16 = icmp eq i8 %3, %4 + br i1 %cmp16, label %if.end23, label %if.then18 + +if.then18: ; preds = %if.end + %cmp21 = icmp ugt i8 %3, %4 + %conv22 = zext i1 %cmp21 to i32 + br label %return + +if.end23: ; preds = %if.end + %inc24 = add nsw i32 %i1, 2 + %inc25 = add nsw i32 %i2, 2 + %idxprom26 = sext i32 %inc24 to i64 + %arrayidx27 = getelementptr inbounds i8* %0, i64 %idxprom26 + %5 = load i8* %arrayidx27, align 1 + %idxprom28 = sext i32 %inc25 to i64 + %arrayidx29 = getelementptr inbounds i8* %0, i64 %idxprom28 + %6 = load i8* %arrayidx29, align 1 + %cmp32 = icmp eq i8 %5, %6 + br i1 %cmp32, label %return, label %if.then34 + +if.then34: ; preds = %if.end23 + %cmp37 = icmp ugt i8 %5, %6 + %conv38 = zext i1 %cmp37 to i32 + br label %return + +return: ; preds = %if.end23, %if.then34, %if.then18, %if.then + %retval.0 = phi i32 [ %conv8, %if.then ], [ %conv22, %if.then18 ], [ %conv38, %if.then34 ], [ 1, %if.end23 ] + ret i32 %retval.0 +} + +define i32 @fct1(i32 %i1, i32 %i2) optsize { +; CHECK: @fct1 +; Addressing are folded when optimizing for code size. +; CHECK: , sxtw] +; CHECK: , sxtw] +entry: + %idxprom = sext i32 %i1 to i64 + %0 = load i8** @block, align 8 + %arrayidx = getelementptr inbounds i8* %0, i64 %idxprom + %1 = load i8* %arrayidx, align 1 + %idxprom1 = sext i32 %i2 to i64 + %arrayidx2 = getelementptr inbounds i8* %0, i64 %idxprom1 + %2 = load i8* %arrayidx2, align 1 + %cmp = icmp eq i8 %1, %2 + br i1 %cmp, label %if.end, label %if.then + +if.then: ; preds = %entry + %cmp7 = icmp ugt i8 %1, %2 + %conv8 = zext i1 %cmp7 to i32 + br label %return + +if.end: ; preds = %entry + %inc = add nsw i32 %i1, 1 + %inc9 = add nsw i32 %i2, 1 + %idxprom10 = sext i32 %inc to i64 + %arrayidx11 = getelementptr inbounds i8* %0, i64 %idxprom10 + %3 = load i8* %arrayidx11, align 1 + %idxprom12 = sext i32 %inc9 to i64 + %arrayidx13 = getelementptr inbounds i8* %0, i64 %idxprom12 + %4 = load i8* %arrayidx13, align 1 + %cmp16 = icmp eq i8 %3, %4 + br i1 %cmp16, label %if.end23, label %if.then18 + +if.then18: ; preds = %if.end + %cmp21 = icmp ugt i8 %3, %4 + %conv22 = zext i1 %cmp21 to i32 + br label %return + +if.end23: ; preds = %if.end + %inc24 = add nsw i32 %i1, 2 + %inc25 = add nsw i32 %i2, 2 + %idxprom26 = sext i32 %inc24 to i64 + %arrayidx27 = getelementptr inbounds i8* %0, i64 %idxprom26 + %5 = load i8* %arrayidx27, align 1 + %idxprom28 = sext i32 %inc25 to i64 + %arrayidx29 = getelementptr inbounds i8* %0, i64 %idxprom28 + %6 = load i8* %arrayidx29, align 1 + %cmp32 = icmp eq i8 %5, %6 + br i1 %cmp32, label %return, label %if.then34 + +if.then34: ; preds = %if.end23 + %cmp37 = icmp ugt i8 %5, %6 + %conv38 = zext i1 %cmp37 to i32 + br label %return + +return: ; preds = %if.end23, %if.then34, %if.then18, %if.then + %retval.0 = phi i32 [ %conv8, %if.then ], [ %conv22, %if.then18 ], [ %conv38, %if.then34 ], [ 1, %if.end23 ] + ret i32 %retval.0 +} + +; CHECK: @test +; CHECK-NOT: , uxtw #2] +define i32 @test(i32* %array, i8 zeroext %c, i32 %arg) { +entry: + %conv = zext i8 %c to i32 + %add = sub i32 0, %arg + %tobool = icmp eq i32 %conv, %add + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %idxprom = zext i8 %c to i64 + %arrayidx = getelementptr inbounds i32* %array, i64 %idxprom + %0 = load volatile i32* %arrayidx, align 4 + %1 = load volatile i32* %arrayidx, align 4 + %add3 = add nsw i32 %1, %0 + br label %if.end + +if.end: ; preds = %entry, %if.then + %res.0 = phi i32 [ %add3, %if.then ], [ 0, %entry ] + ret i32 %res.0 +} + + +; CHECK: @test2 +; CHECK: , uxtw #2] +; CHECK: , uxtw #2] +define i32 @test2(i32* %array, i8 zeroext %c, i32 %arg) optsize { +entry: + %conv = zext i8 %c to i32 + %add = sub i32 0, %arg + %tobool = icmp eq i32 %conv, %add + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %idxprom = zext i8 %c to i64 + %arrayidx = getelementptr inbounds i32* %array, i64 %idxprom + %0 = load volatile i32* %arrayidx, align 4 + %1 = load volatile i32* %arrayidx, align 4 + %add3 = add nsw i32 %1, %0 + br label %if.end + +if.end: ; preds = %entry, %if.then + %res.0 = phi i32 [ %add3, %if.then ], [ 0, %entry ] + ret i32 %res.0 +} diff --git a/test/CodeGen/AArch64/arm64-addr-type-promotion.ll b/test/CodeGen/AArch64/arm64-addr-type-promotion.ll new file mode 100644 index 000000000000..1a3ca8bd5b8c --- /dev/null +++ b/test/CodeGen/AArch64/arm64-addr-type-promotion.ll @@ -0,0 +1,82 @@ +; RUN: llc -march arm64 < %s | FileCheck %s +; rdar://13452552 +; ModuleID = 'reduced_test.ll' +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-n32:64-S128" +target triple = "arm64-apple-ios3.0.0" + +@block = common global i8* null, align 8 + +define zeroext i8 @fullGtU(i32 %i1, i32 %i2) { +; CHECK: fullGtU +; CHECK: adrp [[PAGE:x[0-9]+]], _block@GOTPAGE +; CHECK: ldr [[ADDR:x[0-9]+]], {{\[}}[[PAGE]], _block@GOTPAGEOFF] +; CHECK-NEXT: ldr [[BLOCKBASE:x[0-9]+]], {{\[}}[[ADDR]]] +; CHECK-NEXT: ldrb [[BLOCKVAL1:w[0-9]+]], {{\[}}[[BLOCKBASE]], w0, sxtw] +; CHECK-NEXT: ldrb [[BLOCKVAL2:w[0-9]+]], {{\[}}[[BLOCKBASE]], w1, sxtw] +; CHECK-NEXT cmp [[BLOCKVAL1]], [[BLOCKVAL2]] +; CHECK-NEXT b.ne +; Next BB +; CHECK: add [[BLOCKBASE2:x[0-9]+]], [[BLOCKBASE]], w1, sxtw +; CHECK-NEXT: add [[BLOCKBASE1:x[0-9]+]], [[BLOCKBASE]], w0, sxtw +; CHECK-NEXT: ldrb [[LOADEDVAL1:w[0-9]+]], {{\[}}[[BLOCKBASE1]], #1] +; CHECK-NEXT: ldrb [[LOADEDVAL2:w[0-9]+]], {{\[}}[[BLOCKBASE2]], #1] +; CHECK-NEXT: cmp [[LOADEDVAL1]], [[LOADEDVAL2]] +; CHECK-NEXT: b.ne +; Next BB +; CHECK: ldrb [[LOADEDVAL3:w[0-9]+]], {{\[}}[[BLOCKBASE1]], #2] +; CHECK-NEXT: ldrb [[LOADEDVAL4:w[0-9]+]], {{\[}}[[BLOCKBASE2]], #2] +; CHECK-NEXT: cmp [[LOADEDVAL3]], [[LOADEDVAL4]] +entry: + %idxprom = sext i32 %i1 to i64 + %tmp = load i8** @block, align 8 + %arrayidx = getelementptr inbounds i8* %tmp, i64 %idxprom + %tmp1 = load i8* %arrayidx, align 1 + %idxprom1 = sext i32 %i2 to i64 + %arrayidx2 = getelementptr inbounds i8* %tmp, i64 %idxprom1 + %tmp2 = load i8* %arrayidx2, align 1 + %cmp = icmp eq i8 %tmp1, %tmp2 + br i1 %cmp, label %if.end, label %if.then + +if.then: ; preds = %entry + %cmp7 = icmp ugt i8 %tmp1, %tmp2 + %conv9 = zext i1 %cmp7 to i8 + br label %return + +if.end: ; preds = %entry + %inc = add nsw i32 %i1, 1 + %inc10 = add nsw i32 %i2, 1 + %idxprom11 = sext i32 %inc to i64 + %arrayidx12 = getelementptr inbounds i8* %tmp, i64 %idxprom11 + %tmp3 = load i8* %arrayidx12, align 1 + %idxprom13 = sext i32 %inc10 to i64 + %arrayidx14 = getelementptr inbounds i8* %tmp, i64 %idxprom13 + %tmp4 = load i8* %arrayidx14, align 1 + %cmp17 = icmp eq i8 %tmp3, %tmp4 + br i1 %cmp17, label %if.end25, label %if.then19 + +if.then19: ; preds = %if.end + %cmp22 = icmp ugt i8 %tmp3, %tmp4 + %conv24 = zext i1 %cmp22 to i8 + br label %return + +if.end25: ; preds = %if.end + %inc26 = add nsw i32 %i1, 2 + %inc27 = add nsw i32 %i2, 2 + %idxprom28 = sext i32 %inc26 to i64 + %arrayidx29 = getelementptr inbounds i8* %tmp, i64 %idxprom28 + %tmp5 = load i8* %arrayidx29, align 1 + %idxprom30 = sext i32 %inc27 to i64 + %arrayidx31 = getelementptr inbounds i8* %tmp, i64 %idxprom30 + %tmp6 = load i8* %arrayidx31, align 1 + %cmp34 = icmp eq i8 %tmp5, %tmp6 + br i1 %cmp34, label %return, label %if.then36 + +if.then36: ; preds = %if.end25 + %cmp39 = icmp ugt i8 %tmp5, %tmp6 + %conv41 = zext i1 %cmp39 to i8 + br label %return + +return: ; preds = %if.then36, %if.end25, %if.then19, %if.then + %retval.0 = phi i8 [ %conv9, %if.then ], [ %conv24, %if.then19 ], [ %conv41, %if.then36 ], [ 0, %if.end25 ] + ret i8 %retval.0 +} diff --git a/test/CodeGen/AArch64/arm64-addrmode.ll b/test/CodeGen/AArch64/arm64-addrmode.ll new file mode 100644 index 000000000000..700fba80149a --- /dev/null +++ b/test/CodeGen/AArch64/arm64-addrmode.ll @@ -0,0 +1,72 @@ +; RUN: llc -march=arm64 < %s | FileCheck %s +; rdar://10232252 + +@object = external hidden global i64, section "__DATA, __objc_ivar", align 8 + +; base + offset (imm9) +; CHECK: @t1 +; CHECK: ldr xzr, [x{{[0-9]+}}, #8] +; CHECK: ret +define void @t1() { + %incdec.ptr = getelementptr inbounds i64* @object, i64 1 + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} + +; base + offset (> imm9) +; CHECK: @t2 +; CHECK: sub [[ADDREG:x[0-9]+]], x{{[0-9]+}}, #264 +; CHECK: ldr xzr, [ +; CHECK: [[ADDREG]]] +; CHECK: ret +define void @t2() { + %incdec.ptr = getelementptr inbounds i64* @object, i64 -33 + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} + +; base + unsigned offset (> imm9 and <= imm12 * size of type in bytes) +; CHECK: @t3 +; CHECK: ldr xzr, [x{{[0-9]+}}, #32760] +; CHECK: ret +define void @t3() { + %incdec.ptr = getelementptr inbounds i64* @object, i64 4095 + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} + +; base + unsigned offset (> imm12 * size of type in bytes) +; CHECK: @t4 +; CHECK: add [[ADDREG:x[0-9]+]], x{{[0-9]+}}, #8, lsl #12 +; CHECK: ldr xzr, [ +; CHECK: [[ADDREG]]] +; CHECK: ret +define void @t4() { + %incdec.ptr = getelementptr inbounds i64* @object, i64 4096 + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} + +; base + reg +; CHECK: @t5 +; CHECK: ldr xzr, [x{{[0-9]+}}, x{{[0-9]+}}, lsl #3] +; CHECK: ret +define void @t5(i64 %a) { + %incdec.ptr = getelementptr inbounds i64* @object, i64 %a + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} + +; base + reg + imm +; CHECK: @t6 +; CHECK: add [[ADDREG:x[0-9]+]], x{{[0-9]+}}, x{{[0-9]+}}, lsl #3 +; CHECK-NEXT: add [[ADDREG]], [[ADDREG]], #8, lsl #12 +; CHECK: ldr xzr, [ +; CHECK: [[ADDREG]]] +; CHECK: ret +define void @t6(i64 %a) { + %tmp1 = getelementptr inbounds i64* @object, i64 %a + %incdec.ptr = getelementptr inbounds i64* %tmp1, i64 4096 + %tmp = load volatile i64* %incdec.ptr, align 8 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-alloc-no-stack-realign.ll b/test/CodeGen/AArch64/arm64-alloc-no-stack-realign.ll new file mode 100644 index 000000000000..f396bc991708 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-alloc-no-stack-realign.ll @@ -0,0 +1,21 @@ +; RUN: llc < %s -mtriple=arm64-apple-darwin -enable-misched=false | FileCheck %s + +; rdar://12713765 +; Make sure we are not creating stack objects that are assumed to be 64-byte +; aligned. +@T3_retval = common global <16 x float> zeroinitializer, align 16 + +define void @test(<16 x float>* noalias sret %agg.result) nounwind ssp { +entry: +; CHECK: test +; CHECK: stp [[Q1:q[0-9]+]], [[Q2:q[0-9]+]], [sp, #32] +; CHECK: stp [[Q1:q[0-9]+]], [[Q2:q[0-9]+]], [sp] +; CHECK: stp [[Q1:q[0-9]+]], [[Q2:q[0-9]+]], {{\[}}[[BASE:x[0-9]+]], #32] +; CHECK: stp [[Q1:q[0-9]+]], [[Q2:q[0-9]+]], {{\[}}[[BASE]]] + %retval = alloca <16 x float>, align 16 + %0 = load <16 x float>* @T3_retval, align 16 + store <16 x float> %0, <16 x float>* %retval + %1 = load <16 x float>* %retval + store <16 x float> %1, <16 x float>* %agg.result, align 16 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll b/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll new file mode 100644 index 000000000000..3750f31b3734 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll @@ -0,0 +1,29 @@ +; RUN: llc -march=arm64 -mcpu=cyclone < %s | FileCheck %s + +; CHECK: foo +; CHECK: ldr w[[REG:[0-9]+]], [x19, #264] +; CHECK: str w[[REG]], [x19, #132] +; CHECK: ldr w{{[0-9]+}}, [x19, #264] + +define i32 @foo(i32 %a) nounwind { + %retval = alloca i32, align 4 + %a.addr = alloca i32, align 4 + %arr = alloca [32 x i32], align 4 + %i = alloca i32, align 4 + %arr2 = alloca [32 x i32], align 4 + %j = alloca i32, align 4 + store i32 %a, i32* %a.addr, align 4 + %tmp = load i32* %a.addr, align 4 + %tmp1 = zext i32 %tmp to i64 + %v = mul i64 4, %tmp1 + %vla = alloca i8, i64 %v, align 4 + %tmp2 = bitcast i8* %vla to i32* + %tmp3 = load i32* %a.addr, align 4 + store i32 %tmp3, i32* %i, align 4 + %tmp4 = load i32* %a.addr, align 4 + store i32 %tmp4, i32* %j, align 4 + %tmp5 = load i32* %j, align 4 + store i32 %tmp5, i32* %retval + %x = load i32* %retval + ret i32 %x +} diff --git a/test/CodeGen/AArch64/arm64-andCmpBrToTBZ.ll b/test/CodeGen/AArch64/arm64-andCmpBrToTBZ.ll new file mode 100644 index 000000000000..419497722f4c --- /dev/null +++ b/test/CodeGen/AArch64/arm64-andCmpBrToTBZ.ll @@ -0,0 +1,72 @@ +; RUN: llc -O1 -march=arm64 -enable-andcmp-sinking=true < %s | FileCheck %s +; ModuleID = 'and-cbz-extr-mr.bc' +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-n32:64-S128" +target triple = "arm64-apple-ios7.0.0" + +define zeroext i1 @foo(i1 %IsEditable, i1 %isTextField, i8* %str1, i8* %str2, i8* %str3, i8* %str4, i8* %str5, i8* %str6, i8* %str7, i8* %str8, i8* %str9, i8* %str10, i8* %str11, i8* %str12, i8* %str13, i32 %int1, i8* %str14) unnamed_addr #0 align 2 { +; CHECK: _foo: +entry: + %tobool = icmp eq i8* %str14, null + br i1 %tobool, label %return, label %if.end + +; CHECK: %if.end +; CHECK: tbz +if.end: ; preds = %entry + %and.i.i.i = and i32 %int1, 4 + %tobool.i.i.i = icmp eq i32 %and.i.i.i, 0 + br i1 %tobool.i.i.i, label %if.end12, label %land.rhs.i + +land.rhs.i: ; preds = %if.end + %cmp.i.i.i = icmp eq i8* %str12, %str13 + br i1 %cmp.i.i.i, label %if.then3, label %lor.rhs.i.i.i + +lor.rhs.i.i.i: ; preds = %land.rhs.i + %cmp.i13.i.i.i = icmp eq i8* %str10, %str11 + br i1 %cmp.i13.i.i.i, label %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit, label %if.end5 + +_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit: ; preds = %lor.rhs.i.i.i + %cmp.i.i.i.i = icmp eq i8* %str8, %str9 + br i1 %cmp.i.i.i.i, label %if.then3, label %if.end5 + +if.then3: ; preds = %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit, %land.rhs.i + %tmp11 = load i8* %str14, align 8 + %tmp12 = and i8 %tmp11, 2 + %tmp13 = icmp ne i8 %tmp12, 0 + br label %return + +if.end5: ; preds = %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit, %lor.rhs.i.i.i +; CHECK: %if.end5 +; CHECK: tbz + br i1 %tobool.i.i.i, label %if.end12, label %land.rhs.i19 + +land.rhs.i19: ; preds = %if.end5 + %cmp.i.i.i18 = icmp eq i8* %str6, %str7 + br i1 %cmp.i.i.i18, label %if.then7, label %lor.rhs.i.i.i23 + +lor.rhs.i.i.i23: ; preds = %land.rhs.i19 + %cmp.i13.i.i.i22 = icmp eq i8* %str3, %str4 + br i1 %cmp.i13.i.i.i22, label %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit28, label %if.end12 + +_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit28: ; preds = %lor.rhs.i.i.i23 + %cmp.i.i.i.i26 = icmp eq i8* %str1, %str2 + br i1 %cmp.i.i.i.i26, label %if.then7, label %if.end12 + +if.then7: ; preds = %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit28, %land.rhs.i19 + br i1 %isTextField, label %if.then9, label %if.end12 + +if.then9: ; preds = %if.then7 + %tmp23 = load i8* %str5, align 8 + %tmp24 = and i8 %tmp23, 2 + %tmp25 = icmp ne i8 %tmp24, 0 + br label %return + +if.end12: ; preds = %if.then7, %_ZNK7WebCore4Node10hasTagNameERKNS_13QualifiedNameE.exit28, %lor.rhs.i.i.i23, %if.end5, %if.end + %lnot = xor i1 %IsEditable, true + br label %return + +return: ; preds = %if.end12, %if.then9, %if.then3, %entry + %retval.0 = phi i1 [ %tmp13, %if.then3 ], [ %tmp25, %if.then9 ], [ %lnot, %if.end12 ], [ true, %entry ] + ret i1 %retval.0 +} + +attributes #0 = { nounwind ssp } diff --git a/test/CodeGen/AArch64/arm64-ands-bad-peephole.ll b/test/CodeGen/AArch64/arm64-ands-bad-peephole.ll new file mode 100644 index 000000000000..38661a5f38f3 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-ands-bad-peephole.ll @@ -0,0 +1,31 @@ +; RUN: llc %s -o - -aarch64-atomic-cfg-tidy=0 | FileCheck %s +; Check that ANDS (tst) is not merged with ADD when the immediate +; is not 0. +; +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios" + +; CHECK-LABEL: tst1: +; CHECK: add [[REG:w[0-9]+]], w{{[0-9]+}}, #1 +; CHECK: tst [[REG]], #0x1 +define void @tst1(i1 %tst, i32 %true) { +entry: + br i1 %tst, label %for.end, label %for.body + +for.body: ; preds = %for.body, %entry + %result.09 = phi i32 [ %add2.result.0, %for.body ], [ 1, %entry ] + %i.08 = phi i32 [ %inc, %for.body ], [ 2, %entry ] + %and = and i32 %i.08, 1 + %cmp1 = icmp eq i32 %and, 0 + %add2.result.0 = select i1 %cmp1, i32 %true, i32 %result.09 + %inc = add nsw i32 %i.08, 1 + %cmp = icmp slt i32 %i.08, %true + br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge + +for.cond.for.end_crit_edge: ; preds = %for.body + %add2.result.0.lcssa = phi i32 [ %add2.result.0, %for.body ] + br label %for.end + +for.end: ; preds = %for.cond.for.end_crit_edge, %entry + ret void +} diff --git a/test/CodeGen/AArch64/arm64-anyregcc-crash.ll b/test/CodeGen/AArch64/arm64-anyregcc-crash.ll new file mode 100644 index 000000000000..241cf974c05b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-anyregcc-crash.ll @@ -0,0 +1,19 @@ +; RUN: not llc < %s -mtriple=arm64-apple-darwin 2>&1 | FileCheck %s +; +; Check that misuse of anyregcc results in a compile time error. + +; CHECK: LLVM ERROR: ran out of registers during register allocation +define i64 @anyreglimit(i64 %v1, i64 %v2, i64 %v3, i64 %v4, i64 %v5, i64 %v6, i64 %v7, i64 %v8, + i64 %v9, i64 %v10, i64 %v11, i64 %v12, i64 %v13, i64 %v14, i64 %v15, i64 %v16, + i64 %v17, i64 %v18, i64 %v19, i64 %v20, i64 %v21, i64 %v22, i64 %v23, i64 %v24, + i64 %v25, i64 %v26, i64 %v27, i64 %v28, i64 %v29, i64 %v30, i64 %v31, i64 %v32) { +entry: + %result = tail call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 12, i32 15, i8* inttoptr (i64 0 to i8*), i32 32, + i64 %v1, i64 %v2, i64 %v3, i64 %v4, i64 %v5, i64 %v6, i64 %v7, i64 %v8, + i64 %v9, i64 %v10, i64 %v11, i64 %v12, i64 %v13, i64 %v14, i64 %v15, i64 %v16, + i64 %v17, i64 %v18, i64 %v19, i64 %v20, i64 %v21, i64 %v22, i64 %v23, i64 %v24, + i64 %v25, i64 %v26, i64 %v27, i64 %v28, i64 %v29, i64 %v30, i64 %v31, i64 %v32) + ret i64 %result +} + +declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...) diff --git a/test/CodeGen/AArch64/arm64-anyregcc.ll b/test/CodeGen/AArch64/arm64-anyregcc.ll new file mode 100644 index 000000000000..e26875d52f99 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-anyregcc.ll @@ -0,0 +1,363 @@ +; RUN: llc < %s -mtriple=arm64-apple-darwin | FileCheck %s + +; Stackmap Header: no constants - 6 callsites +; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps +; CHECK-NEXT: __LLVM_StackMaps: +; Header +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 0 +; CHECK-NEXT: .short 0 +; Num Functions +; CHECK-NEXT: .long 8 +; Num LargeConstants +; CHECK-NEXT: .long 0 +; Num Callsites +; CHECK-NEXT: .long 8 + +; Functions and stack size +; CHECK-NEXT: .quad _test +; CHECK-NEXT: .quad 16 +; CHECK-NEXT: .quad _property_access1 +; CHECK-NEXT: .quad 16 +; CHECK-NEXT: .quad _property_access2 +; CHECK-NEXT: .quad 32 +; CHECK-NEXT: .quad _property_access3 +; CHECK-NEXT: .quad 32 +; CHECK-NEXT: .quad _anyreg_test1 +; CHECK-NEXT: .quad 16 +; CHECK-NEXT: .quad _anyreg_test2 +; CHECK-NEXT: .quad 16 +; CHECK-NEXT: .quad _patchpoint_spilldef +; CHECK-NEXT: .quad 112 +; CHECK-NEXT: .quad _patchpoint_spillargs +; CHECK-NEXT: .quad 128 + + +; test +; CHECK-LABEL: .long L{{.*}}-_test +; CHECK-NEXT: .short 0 +; 3 locations +; CHECK-NEXT: .short 3 +; Loc 0: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 4 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 4 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 2: Constant 3 +; CHECK-NEXT: .byte 4 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short 0 +; CHECK-NEXT: .long 3 +define i64 @test() nounwind ssp uwtable { +entry: + call anyregcc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 0, i32 16, i8* null, i32 2, i32 1, i32 2, i64 3) + ret i64 0 +} + +; property access 1 - %obj is an anyreg call argument and should therefore be in a register +; CHECK-LABEL: .long L{{.*}}-_property_access1 +; CHECK-NEXT: .short 0 +; 2 locations +; CHECK-NEXT: .short 2 +; Loc 0: Register <-- this is the return register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +define i64 @property_access1(i8* %obj) nounwind ssp uwtable { +entry: + %f = inttoptr i64 281474417671919 to i8* + %ret = call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 1, i32 20, i8* %f, i32 1, i8* %obj) + ret i64 %ret +} + +; property access 2 - %obj is an anyreg call argument and should therefore be in a register +; CHECK-LABEL: .long L{{.*}}-_property_access2 +; CHECK-NEXT: .short 0 +; 2 locations +; CHECK-NEXT: .short 2 +; Loc 0: Register <-- this is the return register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +define i64 @property_access2() nounwind ssp uwtable { +entry: + %obj = alloca i64, align 8 + %f = inttoptr i64 281474417671919 to i8* + %ret = call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 2, i32 20, i8* %f, i32 1, i64* %obj) + ret i64 %ret +} + +; property access 3 - %obj is a frame index +; CHECK-LABEL: .long L{{.*}}-_property_access3 +; CHECK-NEXT: .short 0 +; 2 locations +; CHECK-NEXT: .short 2 +; Loc 0: Register <-- this is the return register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Direct FP - 8 +; CHECK-NEXT: .byte 2 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short 29 +; CHECK-NEXT: .long -8 +define i64 @property_access3() nounwind ssp uwtable { +entry: + %obj = alloca i64, align 8 + %f = inttoptr i64 281474417671919 to i8* + %ret = call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 3, i32 20, i8* %f, i32 0, i64* %obj) + ret i64 %ret +} + +; anyreg_test1 +; CHECK-LABEL: .long L{{.*}}-_anyreg_test1 +; CHECK-NEXT: .short 0 +; 14 locations +; CHECK-NEXT: .short 14 +; Loc 0: Register <-- this is the return register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 2: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 3: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 4: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 5: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 6: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 7: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 8: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 9: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 10: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 11: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 12: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 13: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +define i64 @anyreg_test1(i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9, i8* %a10, i8* %a11, i8* %a12, i8* %a13) nounwind ssp uwtable { +entry: + %f = inttoptr i64 281474417671919 to i8* + %ret = call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 4, i32 20, i8* %f, i32 13, i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9, i8* %a10, i8* %a11, i8* %a12, i8* %a13) + ret i64 %ret +} + +; anyreg_test2 +; CHECK-LABEL: .long L{{.*}}-_anyreg_test2 +; CHECK-NEXT: .short 0 +; 14 locations +; CHECK-NEXT: .short 14 +; Loc 0: Register <-- this is the return register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 2: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 3: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 4: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 5: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 6: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 7: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 8: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 9: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 10: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 11: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 12: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 13: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +define i64 @anyreg_test2(i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9, i8* %a10, i8* %a11, i8* %a12, i8* %a13) nounwind ssp uwtable { +entry: + %f = inttoptr i64 281474417671919 to i8* + %ret = call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 5, i32 20, i8* %f, i32 8, i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9, i8* %a10, i8* %a11, i8* %a12, i8* %a13) + ret i64 %ret +} + +; Test spilling the return value of an anyregcc call. +; +; [JS] Assertion: "Folded a def to a non-store!" +; +; CHECK-LABEL: .long L{{.*}}-_patchpoint_spilldef +; CHECK-NEXT: .short 0 +; CHECK-NEXT: .short 3 +; Loc 0: Register (some register that will be spilled to the stack) +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +define i64 @patchpoint_spilldef(i64 %p1, i64 %p2, i64 %p3, i64 %p4) { +entry: + %result = tail call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 12, i32 16, i8* inttoptr (i64 0 to i8*), i32 2, i64 %p1, i64 %p2) + tail call void asm sideeffect "nop", "~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{x29},~{x30},~{x31}"() nounwind + ret i64 %result +} + +; Test spilling the arguments of an anyregcc call. +; +; [JS] AnyRegCC argument ends up being spilled +; +; CHECK-LABEL: .long L{{.*}}-_patchpoint_spillargs +; CHECK-NEXT: .short 0 +; CHECK-NEXT: .short 5 +; Loc 0: Return a register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 1: Arg0 in a Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 2: Arg1 in a Register +; CHECK-NEXT: .byte 1 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short {{[0-9]+}} +; CHECK-NEXT: .long 0 +; Loc 3: Arg2 spilled to FP -96 +; CHECK-NEXT: .byte 3 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short 29 +; CHECK-NEXT: .long -96 +; Loc 4: Arg3 spilled to FP - 88 +; CHECK-NEXT: .byte 3 +; CHECK-NEXT: .byte 8 +; CHECK-NEXT: .short 29 +; CHECK-NEXT: .long -88 +define i64 @patchpoint_spillargs(i64 %p1, i64 %p2, i64 %p3, i64 %p4) { +entry: + tail call void asm sideeffect "nop", "~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{x29},~{x30},~{x31}"() nounwind + %result = tail call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 13, i32 16, i8* inttoptr (i64 0 to i8*), i32 2, i64 %p1, i64 %p2, i64 %p3, i64 %p4) + ret i64 %result +} + +declare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...) +declare i64 @llvm.experimental.patchpoint.i64(i64, i32, i8*, i32, ...) diff --git a/test/CodeGen/AArch64/arm64-arith-saturating.ll b/test/CodeGen/AArch64/arm64-arith-saturating.ll new file mode 100644 index 000000000000..78cd1fcb1a21 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-arith-saturating.ll @@ -0,0 +1,153 @@ +; RUN: llc < %s -march=arm64 -mcpu=cyclone | FileCheck %s + +define i32 @qadds(<4 x i32> %b, <4 x i32> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: qadds: +; CHECK: sqadd s0, s0, s1 + %vecext = extractelement <4 x i32> %b, i32 0 + %vecext1 = extractelement <4 x i32> %c, i32 0 + %vqadd.i = tail call i32 @llvm.aarch64.neon.sqadd.i32(i32 %vecext, i32 %vecext1) nounwind + ret i32 %vqadd.i +} + +define i64 @qaddd(<2 x i64> %b, <2 x i64> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: qaddd: +; CHECK: sqadd d0, d0, d1 + %vecext = extractelement <2 x i64> %b, i32 0 + %vecext1 = extractelement <2 x i64> %c, i32 0 + %vqadd.i = tail call i64 @llvm.aarch64.neon.sqadd.i64(i64 %vecext, i64 %vecext1) nounwind + ret i64 %vqadd.i +} + +define i32 @uqadds(<4 x i32> %b, <4 x i32> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: uqadds: +; CHECK: uqadd s0, s0, s1 + %vecext = extractelement <4 x i32> %b, i32 0 + %vecext1 = extractelement <4 x i32> %c, i32 0 + %vqadd.i = tail call i32 @llvm.aarch64.neon.uqadd.i32(i32 %vecext, i32 %vecext1) nounwind + ret i32 %vqadd.i +} + +define i64 @uqaddd(<2 x i64> %b, <2 x i64> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: uqaddd: +; CHECK: uqadd d0, d0, d1 + %vecext = extractelement <2 x i64> %b, i32 0 + %vecext1 = extractelement <2 x i64> %c, i32 0 + %vqadd.i = tail call i64 @llvm.aarch64.neon.uqadd.i64(i64 %vecext, i64 %vecext1) nounwind + ret i64 %vqadd.i +} + +declare i64 @llvm.aarch64.neon.uqadd.i64(i64, i64) nounwind readnone +declare i32 @llvm.aarch64.neon.uqadd.i32(i32, i32) nounwind readnone +declare i64 @llvm.aarch64.neon.sqadd.i64(i64, i64) nounwind readnone +declare i32 @llvm.aarch64.neon.sqadd.i32(i32, i32) nounwind readnone + +define i32 @qsubs(<4 x i32> %b, <4 x i32> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: qsubs: +; CHECK: sqsub s0, s0, s1 + %vecext = extractelement <4 x i32> %b, i32 0 + %vecext1 = extractelement <4 x i32> %c, i32 0 + %vqsub.i = tail call i32 @llvm.aarch64.neon.sqsub.i32(i32 %vecext, i32 %vecext1) nounwind + ret i32 %vqsub.i +} + +define i64 @qsubd(<2 x i64> %b, <2 x i64> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: qsubd: +; CHECK: sqsub d0, d0, d1 + %vecext = extractelement <2 x i64> %b, i32 0 + %vecext1 = extractelement <2 x i64> %c, i32 0 + %vqsub.i = tail call i64 @llvm.aarch64.neon.sqsub.i64(i64 %vecext, i64 %vecext1) nounwind + ret i64 %vqsub.i +} + +define i32 @uqsubs(<4 x i32> %b, <4 x i32> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: uqsubs: +; CHECK: uqsub s0, s0, s1 + %vecext = extractelement <4 x i32> %b, i32 0 + %vecext1 = extractelement <4 x i32> %c, i32 0 + %vqsub.i = tail call i32 @llvm.aarch64.neon.uqsub.i32(i32 %vecext, i32 %vecext1) nounwind + ret i32 %vqsub.i +} + +define i64 @uqsubd(<2 x i64> %b, <2 x i64> %c) nounwind readnone optsize ssp { +; CHECK-LABEL: uqsubd: +; CHECK: uqsub d0, d0, d1 + %vecext = extractelement <2 x i64> %b, i32 0 + %vecext1 = extractelement <2 x i64> %c, i32 0 + %vqsub.i = tail call i64 @llvm.aarch64.neon.uqsub.i64(i64 %vecext, i64 %vecext1) nounwind + ret i64 %vqsub.i +} + +declare i64 @llvm.aarch64.neon.uqsub.i64(i64, i64) nounwind readnone +declare i32 @llvm.aarch64.neon.uqsub.i32(i32, i32) nounwind readnone +declare i64 @llvm.aarch64.neon.sqsub.i64(i64, i64) nounwind readnone +declare i32 @llvm.aarch64.neon.sqsub.i32(i32, i32) nounwind readnone + +define i32 @qabss(<4 x i32> %b, <4 x i32> %c) nounwind readnone { +; CHECK-LABEL: qabss: +; CHECK: sqabs s0, s0 +; CHECK: ret + %vecext = extractelement <4 x i32> %b, i32 0 + %vqabs.i = tail call i32 @llvm.aarch64.neon.sqabs.i32(i32 %vecext) nounwind + ret i32 %vqabs.i +} + +define i64 @qabsd(<2 x i64> %b, <2 x i64> %c) nounwind readnone { +; CHECK-LABEL: qabsd: +; CHECK: sqabs d0, d0 +; CHECK: ret + %vecext = extractelement <2 x i64> %b, i32 0 + %vqabs.i = tail call i64 @llvm.aarch64.neon.sqabs.i64(i64 %vecext) nounwind + ret i64 %vqabs.i +} + +define i32 @qnegs(<4 x i32> %b, <4 x i32> %c) nounwind readnone { +; CHECK-LABEL: qnegs: +; CHECK: sqneg s0, s0 +; CHECK: ret + %vecext = extractelement <4 x i32> %b, i32 0 + %vqneg.i = tail call i32 @llvm.aarch64.neon.sqneg.i32(i32 %vecext) nounwind + ret i32 %vqneg.i +} + +define i64 @qnegd(<2 x i64> %b, <2 x i64> %c) nounwind readnone { +; CHECK-LABEL: qnegd: +; CHECK: sqneg d0, d0 +; CHECK: ret + %vecext = extractelement <2 x i64> %b, i32 0 + %vqneg.i = tail call i64 @llvm.aarch64.neon.sqneg.i64(i64 %vecext) nounwind + ret i64 %vqneg.i +} + +declare i64 @llvm.aarch64.neon.sqneg.i64(i64) nounwind readnone +declare i32 @llvm.aarch64.neon.sqneg.i32(i32) nounwind readnone +declare i64 @llvm.aarch64.neon.sqabs.i64(i64) nounwind readnone +declare i32 @llvm.aarch64.neon.sqabs.i32(i32) nounwind readnone + + +define i32 @vqmovund(<2 x i64> %b) nounwind readnone { +; CHECK-LABEL: vqmovund: +; CHECK: sqxtun s0, d0 + %vecext = extractelement <2 x i64> %b, i32 0 + %vqmovun.i = tail call i32 @llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64 %vecext) nounwind + ret i32 %vqmovun.i +} + +define i32 @vqmovnd_s(<2 x i64> %b) nounwind readnone { +; CHECK-LABEL: vqmovnd_s: +; CHECK: sqxtn s0, d0 + %vecext = extractelement <2 x i64> %b, i32 0 + %vqmovn.i = tail call i32 @llvm.aarch64.neon.scalar.sqxtn.i32.i64(i64 %vecext) nounwind + ret i32 %vqmovn.i +} + +define i32 @vqmovnd_u(<2 x i64> %b) nounwind readnone { +; CHECK-LABEL: vqmovnd_u: +; CHECK: uqxtn s0, d0 + %vecext = extractelement <2 x i64> %b, i32 0 + %vqmovn.i = tail call i32 @llvm.aarch64.neon.scalar.uqxtn.i32.i64(i64 %vecext) nounwind + ret i32 %vqmovn.i +} + +declare i32 @llvm.aarch64.neon.scalar.uqxtn.i32.i64(i64) nounwind readnone +declare i32 @llvm.aarch64.neon.scalar.sqxtn.i32.i64(i64) nounwind readnone +declare i32 @llvm.aarch64.neon.scalar.sqxtun.i32.i64(i64) nounwind readnone diff --git a/test/CodeGen/AArch64/arm64-arith.ll b/test/CodeGen/AArch64/arm64-arith.ll new file mode 100644 index 000000000000..f36e706b15dd --- /dev/null +++ b/test/CodeGen/AArch64/arm64-arith.ll @@ -0,0 +1,270 @@ +; RUN: llc < %s -march=arm64 -asm-verbose=false | FileCheck %s + +define i32 @t1(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t1: +; CHECK: add w0, w1, w0 +; CHECK: ret + %add = add i32 %b, %a + ret i32 %add +} + +define i32 @t2(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t2: +; CHECK: udiv w0, w0, w1 +; CHECK: ret + %udiv = udiv i32 %a, %b + ret i32 %udiv +} + +define i64 @t3(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t3: +; CHECK: udiv x0, x0, x1 +; CHECK: ret + %udiv = udiv i64 %a, %b + ret i64 %udiv +} + +define i32 @t4(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t4: +; CHECK: sdiv w0, w0, w1 +; CHECK: ret + %sdiv = sdiv i32 %a, %b + ret i32 %sdiv +} + +define i64 @t5(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t5: +; CHECK: sdiv x0, x0, x1 +; CHECK: ret + %sdiv = sdiv i64 %a, %b + ret i64 %sdiv +} + +define i32 @t6(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t6: +; CHECK: lsl w0, w0, w1 +; CHECK: ret + %shl = shl i32 %a, %b + ret i32 %shl +} + +define i64 @t7(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t7: +; CHECK: lsl x0, x0, x1 +; CHECK: ret + %shl = shl i64 %a, %b + ret i64 %shl +} + +define i32 @t8(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t8: +; CHECK: lsr w0, w0, w1 +; CHECK: ret + %lshr = lshr i32 %a, %b + ret i32 %lshr +} + +define i64 @t9(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t9: +; CHECK: lsr x0, x0, x1 +; CHECK: ret + %lshr = lshr i64 %a, %b + ret i64 %lshr +} + +define i32 @t10(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t10: +; CHECK: asr w0, w0, w1 +; CHECK: ret + %ashr = ashr i32 %a, %b + ret i32 %ashr +} + +define i64 @t11(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t11: +; CHECK: asr x0, x0, x1 +; CHECK: ret + %ashr = ashr i64 %a, %b + ret i64 %ashr +} + +define i32 @t12(i16 %a, i32 %x) nounwind ssp { +entry: +; CHECK-LABEL: t12: +; CHECK: add w0, w1, w0, sxth +; CHECK: ret + %c = sext i16 %a to i32 + %e = add i32 %x, %c + ret i32 %e +} + +define i32 @t13(i16 %a, i32 %x) nounwind ssp { +entry: +; CHECK-LABEL: t13: +; CHECK: add w0, w1, w0, sxth #2 +; CHECK: ret + %c = sext i16 %a to i32 + %d = shl i32 %c, 2 + %e = add i32 %x, %d + ret i32 %e +} + +define i64 @t14(i16 %a, i64 %x) nounwind ssp { +entry: +; CHECK-LABEL: t14: +; CHECK: add x0, x1, w0, uxth #3 +; CHECK: ret + %c = zext i16 %a to i64 + %d = shl i64 %c, 3 + %e = add i64 %x, %d + ret i64 %e +} + +; rdar://9160598 +define i64 @t15(i64 %a, i64 %x) nounwind ssp { +entry: +; CHECK-LABEL: t15: +; CHECK: add x0, x1, w0, uxtw +; CHECK: ret + %b = and i64 %a, 4294967295 + %c = add i64 %x, %b + ret i64 %c +} + +define i64 @t16(i64 %x) nounwind ssp { +entry: +; CHECK-LABEL: t16: +; CHECK: lsl x0, x0, #1 +; CHECK: ret + %a = shl i64 %x, 1 + ret i64 %a +} + +; rdar://9166974 +define i64 @t17(i16 %a, i64 %x) nounwind ssp { +entry: +; CHECK-LABEL: t17: +; CHECK: sxth [[REG:x[0-9]+]], w0 +; CHECK: neg x0, [[REG]], lsl #32 +; CHECK: ret + %tmp16 = sext i16 %a to i64 + %tmp17 = mul i64 %tmp16, -4294967296 + ret i64 %tmp17 +} + +define i32 @t18(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t18: +; CHECK: sdiv w0, w0, w1 +; CHECK: ret + %sdiv = call i32 @llvm.aarch64.sdiv.i32(i32 %a, i32 %b) + ret i32 %sdiv +} + +define i64 @t19(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t19: +; CHECK: sdiv x0, x0, x1 +; CHECK: ret + %sdiv = call i64 @llvm.aarch64.sdiv.i64(i64 %a, i64 %b) + ret i64 %sdiv +} + +define i32 @t20(i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t20: +; CHECK: udiv w0, w0, w1 +; CHECK: ret + %udiv = call i32 @llvm.aarch64.udiv.i32(i32 %a, i32 %b) + ret i32 %udiv +} + +define i64 @t21(i64 %a, i64 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: t21: +; CHECK: udiv x0, x0, x1 +; CHECK: ret + %udiv = call i64 @llvm.aarch64.udiv.i64(i64 %a, i64 %b) + ret i64 %udiv +} + +declare i32 @llvm.aarch64.sdiv.i32(i32, i32) nounwind readnone +declare i64 @llvm.aarch64.sdiv.i64(i64, i64) nounwind readnone +declare i32 @llvm.aarch64.udiv.i32(i32, i32) nounwind readnone +declare i64 @llvm.aarch64.udiv.i64(i64, i64) nounwind readnone + +; 32-bit not. +define i32 @inv_32(i32 %x) nounwind ssp { +entry: +; CHECK: inv_32 +; CHECK: mvn w0, w0 +; CHECK: ret + %inv = xor i32 %x, -1 + ret i32 %inv +} + +; 64-bit not. +define i64 @inv_64(i64 %x) nounwind ssp { +entry: +; CHECK: inv_64 +; CHECK: mvn x0, x0 +; CHECK: ret + %inv = xor i64 %x, -1 + ret i64 %inv +} + +; Multiplying by a power of two plus or minus one is better done via shift +; and add/sub rather than the madd/msub instructions. The latter are 4+ cycles, +; and the former are two (total for the two instruction sequence for subtract). +define i32 @f0(i32 %a) nounwind readnone ssp { +; CHECK-LABEL: f0: +; CHECK-NEXT: add w0, w0, w0, lsl #3 +; CHECK-NEXT: ret + %res = mul i32 %a, 9 + ret i32 %res +} + +define i64 @f1(i64 %a) nounwind readnone ssp { +; CHECK-LABEL: f1: +; CHECK-NEXT: lsl x8, x0, #4 +; CHECK-NEXT: sub x0, x8, x0 +; CHECK-NEXT: ret + %res = mul i64 %a, 15 + ret i64 %res +} + +define i32 @f2(i32 %a) nounwind readnone ssp { +; CHECK-LABEL: f2: +; CHECK-NEXT: lsl w8, w0, #3 +; CHECK-NEXT: sub w0, w8, w0 +; CHECK-NEXT: ret + %res = mul nsw i32 %a, 7 + ret i32 %res +} + +define i64 @f3(i64 %a) nounwind readnone ssp { +; CHECK-LABEL: f3: +; CHECK-NEXT: add x0, x0, x0, lsl #4 +; CHECK-NEXT: ret + %res = mul nsw i64 %a, 17 + ret i64 %res +} + +define i32 @f4(i32 %a) nounwind readnone ssp { +; CHECK-LABEL: f4: +; CHECK-NEXT: add w0, w0, w0, lsl #1 +; CHECK-NEXT: ret + %res = mul i32 %a, 3 + ret i32 %res +} diff --git a/test/CodeGen/AArch64/arm64-arm64-dead-def-elimination-flag.ll b/test/CodeGen/AArch64/arm64-arm64-dead-def-elimination-flag.ll new file mode 100644 index 000000000000..0904b62c4032 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-arm64-dead-def-elimination-flag.ll @@ -0,0 +1,16 @@ +; RUN: llc -march=arm64 -aarch64-dead-def-elimination=false < %s | FileCheck %s + +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios7.0.0" + +; Function Attrs: nounwind ssp uwtable +define i32 @test1() #0 { + %tmp1 = alloca i8 + %tmp2 = icmp eq i8* %tmp1, null + %tmp3 = zext i1 %tmp2 to i32 + + ret i32 %tmp3 + + ; CHECK-LABEL: test1 + ; CHECK: adds {{x[0-9]+}}, sp, #15 +} diff --git a/test/CodeGen/AArch64/arm64-atomic-128.ll b/test/CodeGen/AArch64/arm64-atomic-128.ll new file mode 100644 index 000000000000..3377849f6698 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-atomic-128.ll @@ -0,0 +1,228 @@ +; RUN: llc < %s -march=arm64 -mtriple=arm64-linux-gnu -verify-machineinstrs -mcpu=cyclone | FileCheck %s + +@var = global i128 0 + +define i128 @val_compare_and_swap(i128* %p, i128 %oldval, i128 %newval) { +; CHECK-LABEL: val_compare_and_swap: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[RESULTLO:x[0-9]+]], [[RESULTHI:x[0-9]+]], [x[[ADDR:[0-9]+]]] +; CHECK-DAG: eor [[MISMATCH_LO:x[0-9]+]], [[RESULTLO]], x2 +; CHECK-DAG: eor [[MISMATCH_HI:x[0-9]+]], [[RESULTHI]], x3 +; CHECK: orr [[MISMATCH:x[0-9]+]], [[MISMATCH_LO]], [[MISMATCH_HI]] +; CHECK: cbnz [[MISMATCH]], [[DONE:.LBB[0-9]+_[0-9]+]] +; CHECK: stxp [[SCRATCH_RES:w[0-9]+]], x4, x5, [x[[ADDR]]] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] +; CHECK: [[DONE]]: + %pair = cmpxchg i128* %p, i128 %oldval, i128 %newval acquire acquire + %val = extractvalue { i128, i1 } %pair, 0 + ret i128 %val +} + +define void @fetch_and_nand(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_nand: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK-DAG: and [[TMP_REGLO:x[0-9]+]], [[DEST_REGLO]], x2 +; CHECK-DAG: and [[TMP_REGHI:x[0-9]+]], [[DEST_REGHI]], x3 +; CHECK-DAG: mvn [[SCRATCH_REGLO:x[0-9]+]], [[TMP_REGLO]] +; CHECK-DAG: mvn [[SCRATCH_REGHI:x[0-9]+]], [[TMP_REGHI]] +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw nand i128* %p, i128 %bits release + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_or(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_or: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK-DAG: orr [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2 +; CHECK-DAG: orr [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3 +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw or i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_add(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_add: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: adds [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2 +; CHECK: adcs [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3 +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw add i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_sub(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_sub: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: subs [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2 +; CHECK: sbcs [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3 +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw sub i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_min(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_min: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: cmp [[DEST_REGLO]], x2 +; CHECK: cset [[LOCMP:w[0-9]+]], ls +; CHECK: cmp [[DEST_REGHI:x[0-9]+]], x3 +; CHECK: cset [[HICMP:w[0-9]+]], le +; CHECK: csel [[CMP:w[0-9]+]], [[LOCMP]], [[HICMP]], eq +; CHECK: cmp [[CMP]], #0 +; CHECK-DAG: csel [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3, ne +; CHECK-DAG: csel [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2, ne +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw min i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_max(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_max: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: cmp [[DEST_REGLO]], x2 +; CHECK: cset [[LOCMP:w[0-9]+]], hi +; CHECK: cmp [[DEST_REGHI:x[0-9]+]], x3 +; CHECK: cset [[HICMP:w[0-9]+]], gt +; CHECK: csel [[CMP:w[0-9]+]], [[LOCMP]], [[HICMP]], eq +; CHECK: cmp [[CMP]], #0 +; CHECK-DAG: csel [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3, ne +; CHECK-DAG: csel [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2, ne +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw max i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_umin(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_umin: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: cmp [[DEST_REGLO]], x2 +; CHECK: cset [[LOCMP:w[0-9]+]], ls +; CHECK: cmp [[DEST_REGHI:x[0-9]+]], x3 +; CHECK: cset [[HICMP:w[0-9]+]], ls +; CHECK: csel [[CMP:w[0-9]+]], [[LOCMP]], [[HICMP]], eq +; CHECK: cmp [[CMP]], #0 +; CHECK-DAG: csel [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3, ne +; CHECK-DAG: csel [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2, ne +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw umin i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define void @fetch_and_umax(i128* %p, i128 %bits) { +; CHECK-LABEL: fetch_and_umax: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp [[DEST_REGLO:x[0-9]+]], [[DEST_REGHI:x[0-9]+]], [x0] +; CHECK: cmp [[DEST_REGLO]], x2 +; CHECK: cset [[LOCMP:w[0-9]+]], hi +; CHECK: cmp [[DEST_REGHI:x[0-9]+]], x3 +; CHECK: cset [[HICMP:w[0-9]+]], hi +; CHECK: csel [[CMP:w[0-9]+]], [[LOCMP]], [[HICMP]], eq +; CHECK: cmp [[CMP]], #0 +; CHECK-DAG: csel [[SCRATCH_REGHI:x[0-9]+]], [[DEST_REGHI]], x3, ne +; CHECK-DAG: csel [[SCRATCH_REGLO:x[0-9]+]], [[DEST_REGLO]], x2, ne +; CHECK: stlxp [[SCRATCH_RES:w[0-9]+]], [[SCRATCH_REGLO]], [[SCRATCH_REGHI]], [x0] +; CHECK: cbnz [[SCRATCH_RES]], [[LABEL]] + +; CHECK-DAG: str [[DEST_REGHI]] +; CHECK-DAG: str [[DEST_REGLO]] + %val = atomicrmw umax i128* %p, i128 %bits seq_cst + store i128 %val, i128* @var, align 16 + ret void +} + +define i128 @atomic_load_seq_cst(i128* %p) { +; CHECK-LABEL: atomic_load_seq_cst: +; CHECK-NOT: dmb +; CHECK-LABEL: ldaxp +; CHECK-NOT: dmb + %r = load atomic i128* %p seq_cst, align 16 + ret i128 %r +} + +define i128 @atomic_load_relaxed(i128* %p) { +; CHECK-LABEL: atomic_load_relaxed: +; CHECK-NOT: dmb +; CHECK: ldxp [[LO:x[0-9]+]], [[HI:x[0-9]+]], [x0] +; CHECK-NOT: dmb + %r = load atomic i128* %p monotonic, align 16 + ret i128 %r +} + + +define void @atomic_store_seq_cst(i128 %in, i128* %p) { +; CHECK-LABEL: atomic_store_seq_cst: +; CHECK-NOT: dmb +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxp xzr, xzr, [x2] +; CHECK: stlxp [[SUCCESS:w[0-9]+]], x0, x1, [x2] +; CHECK: cbnz [[SUCCESS]], [[LABEL]] +; CHECK-NOT: dmb + store atomic i128 %in, i128* %p seq_cst, align 16 + ret void +} + +define void @atomic_store_release(i128 %in, i128* %p) { +; CHECK-LABEL: atomic_store_release: +; CHECK-NOT: dmb +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxp xzr, xzr, [x2] +; CHECK: stlxp [[SUCCESS:w[0-9]+]], x0, x1, [x2] +; CHECK: cbnz [[SUCCESS]], [[LABEL]] +; CHECK-NOT: dmb + store atomic i128 %in, i128* %p release, align 16 + ret void +} + +define void @atomic_store_relaxed(i128 %in, i128* %p) { +; CHECK-LABEL: atomic_store_relaxed: +; CHECK-NOT: dmb +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxp xzr, xzr, [x2] +; CHECK: stxp [[SUCCESS:w[0-9]+]], x0, x1, [x2] +; CHECK: cbnz [[SUCCESS]], [[LABEL]] +; CHECK-NOT: dmb + store atomic i128 %in, i128* %p unordered, align 16 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-atomic.ll b/test/CodeGen/AArch64/arm64-atomic.ll new file mode 100644 index 000000000000..b56f91ddd111 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-atomic.ll @@ -0,0 +1,335 @@ +; RUN: llc < %s -march=arm64 -verify-machineinstrs -mcpu=cyclone | FileCheck %s + +define i32 @val_compare_and_swap(i32* %p) { +; CHECK-LABEL: val_compare_and_swap: +; CHECK: orr [[NEWVAL_REG:w[0-9]+]], wzr, #0x4 +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxr [[RESULT:w[0-9]+]], [x0] +; CHECK: cmp [[RESULT]], #7 +; CHECK: b.ne [[LABEL2:.?LBB[0-9]+_[0-9]+]] +; CHECK: stxr [[SCRATCH_REG:w[0-9]+]], [[NEWVAL_REG]], [x0] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] +; CHECK: [[LABEL2]]: + %pair = cmpxchg i32* %p, i32 7, i32 4 acquire acquire + %val = extractvalue { i32, i1 } %pair, 0 + ret i32 %val +} + +define i64 @val_compare_and_swap_64(i64* %p) { +; CHECK-LABEL: val_compare_and_swap_64: +; CHECK: orr w[[NEWVAL_REG:[0-9]+]], wzr, #0x4 +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxr [[RESULT:x[0-9]+]], [x0] +; CHECK: cmp [[RESULT]], #7 +; CHECK: b.ne [[LABEL2:.?LBB[0-9]+_[0-9]+]] +; CHECK-NOT: stxr x[[NEWVAL_REG]], x[[NEWVAL_REG]] +; CHECK: stxr [[SCRATCH_REG:w[0-9]+]], x[[NEWVAL_REG]], [x0] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] +; CHECK: [[LABEL2]]: + %pair = cmpxchg i64* %p, i64 7, i64 4 monotonic monotonic + %val = extractvalue { i64, i1 } %pair, 0 + ret i64 %val +} + +define i32 @fetch_and_nand(i32* %p) { +; CHECK-LABEL: fetch_and_nand: +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxr w[[DEST_REG:[0-9]+]], [x0] +; CHECK: mvn [[TMP_REG:w[0-9]+]], w[[DEST_REG]] +; CHECK: orr [[SCRATCH2_REG:w[0-9]+]], [[TMP_REG]], #0xfffffff8 +; CHECK-NOT: stlxr [[SCRATCH2_REG]], [[SCRATCH2_REG]] +; CHECK: stlxr [[SCRATCH_REG:w[0-9]+]], [[SCRATCH2_REG]], [x0] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] +; CHECK: mov x0, x[[DEST_REG]] + %val = atomicrmw nand i32* %p, i32 7 release + ret i32 %val +} + +define i64 @fetch_and_nand_64(i64* %p) { +; CHECK-LABEL: fetch_and_nand_64: +; CHECK: mov x[[ADDR:[0-9]+]], x0 +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxr x[[DEST_REG:[0-9]+]], [x[[ADDR]]] +; CHECK: mvn w[[TMP_REG:[0-9]+]], w[[DEST_REG]] +; CHECK: orr [[SCRATCH2_REG:x[0-9]+]], x[[TMP_REG]], #0xfffffffffffffff8 +; CHECK: stlxr [[SCRATCH_REG:w[0-9]+]], [[SCRATCH2_REG]], [x[[ADDR]]] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] + + %val = atomicrmw nand i64* %p, i64 7 acq_rel + ret i64 %val +} + +define i32 @fetch_and_or(i32* %p) { +; CHECK-LABEL: fetch_and_or: +; CHECK: movz [[OLDVAL_REG:w[0-9]+]], #0x5 +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldaxr w[[DEST_REG:[0-9]+]], [x0] +; CHECK: orr [[SCRATCH2_REG:w[0-9]+]], w[[DEST_REG]], [[OLDVAL_REG]] +; CHECK-NOT: stlxr [[SCRATCH2_REG]], [[SCRATCH2_REG]] +; CHECK: stlxr [[SCRATCH_REG:w[0-9]+]], [[SCRATCH2_REG]], [x0] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] +; CHECK: mov x0, x[[DEST_REG]] + %val = atomicrmw or i32* %p, i32 5 seq_cst + ret i32 %val +} + +define i64 @fetch_and_or_64(i64* %p) { +; CHECK: fetch_and_or_64: +; CHECK: mov x[[ADDR:[0-9]+]], x0 +; CHECK: [[LABEL:.?LBB[0-9]+_[0-9]+]]: +; CHECK: ldxr [[DEST_REG:x[0-9]+]], [x[[ADDR]]] +; CHECK: orr [[SCRATCH2_REG:x[0-9]+]], [[DEST_REG]], #0x7 +; CHECK: stxr [[SCRATCH_REG:w[0-9]+]], [[SCRATCH2_REG]], [x[[ADDR]]] +; CHECK: cbnz [[SCRATCH_REG]], [[LABEL]] + %val = atomicrmw or i64* %p, i64 7 monotonic + ret i64 %val +} + +define void @acquire_fence() { + fence acquire + ret void + ; CHECK-LABEL: acquire_fence: + ; CHECK: dmb ishld +} + +define void @release_fence() { + fence release + ret void + ; CHECK-LABEL: release_fence: + ; CHECK: dmb ish{{$}} +} + +define void @seq_cst_fence() { + fence seq_cst + ret void + ; CHECK-LABEL: seq_cst_fence: + ; CHECK: dmb ish{{$}} +} + +define i32 @atomic_load(i32* %p) { + %r = load atomic i32* %p seq_cst, align 4 + ret i32 %r + ; CHECK-LABEL: atomic_load: + ; CHECK: ldar +} + +define i8 @atomic_load_relaxed_8(i8* %p, i32 %off32) { +; CHECK-LABEL: atomic_load_relaxed_8: + %ptr_unsigned = getelementptr i8* %p, i32 4095 + %val_unsigned = load atomic i8* %ptr_unsigned monotonic, align 1 +; CHECK: ldrb {{w[0-9]+}}, [x0, #4095] + + %ptr_regoff = getelementptr i8* %p, i32 %off32 + %val_regoff = load atomic i8* %ptr_regoff unordered, align 1 + %tot1 = add i8 %val_unsigned, %val_regoff +; CHECK: ldrb {{w[0-9]+}}, [x0, w1, sxtw] + + %ptr_unscaled = getelementptr i8* %p, i32 -256 + %val_unscaled = load atomic i8* %ptr_unscaled monotonic, align 1 + %tot2 = add i8 %tot1, %val_unscaled +; CHECK: ldurb {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i8* %p, i32 1191936 ; 0x123000 (i.e. ADD imm) + %val_random = load atomic i8* %ptr_random unordered, align 1 + %tot3 = add i8 %tot2, %val_random +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: ldrb {{w[0-9]+}}, [x[[ADDR]]] + + ret i8 %tot3 +} + +define i16 @atomic_load_relaxed_16(i16* %p, i32 %off32) { +; CHECK-LABEL: atomic_load_relaxed_16: + %ptr_unsigned = getelementptr i16* %p, i32 4095 + %val_unsigned = load atomic i16* %ptr_unsigned monotonic, align 2 +; CHECK: ldrh {{w[0-9]+}}, [x0, #8190] + + %ptr_regoff = getelementptr i16* %p, i32 %off32 + %val_regoff = load atomic i16* %ptr_regoff unordered, align 2 + %tot1 = add i16 %val_unsigned, %val_regoff +; CHECK: ldrh {{w[0-9]+}}, [x0, w1, sxtw #1] + + %ptr_unscaled = getelementptr i16* %p, i32 -128 + %val_unscaled = load atomic i16* %ptr_unscaled monotonic, align 2 + %tot2 = add i16 %tot1, %val_unscaled +; CHECK: ldurh {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i16* %p, i32 595968 ; 0x123000/2 (i.e. ADD imm) + %val_random = load atomic i16* %ptr_random unordered, align 2 + %tot3 = add i16 %tot2, %val_random +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: ldrh {{w[0-9]+}}, [x[[ADDR]]] + + ret i16 %tot3 +} + +define i32 @atomic_load_relaxed_32(i32* %p, i32 %off32) { +; CHECK-LABEL: atomic_load_relaxed_32: + %ptr_unsigned = getelementptr i32* %p, i32 4095 + %val_unsigned = load atomic i32* %ptr_unsigned monotonic, align 4 +; CHECK: ldr {{w[0-9]+}}, [x0, #16380] + + %ptr_regoff = getelementptr i32* %p, i32 %off32 + %val_regoff = load atomic i32* %ptr_regoff unordered, align 4 + %tot1 = add i32 %val_unsigned, %val_regoff +; CHECK: ldr {{w[0-9]+}}, [x0, w1, sxtw #2] + + %ptr_unscaled = getelementptr i32* %p, i32 -64 + %val_unscaled = load atomic i32* %ptr_unscaled monotonic, align 4 + %tot2 = add i32 %tot1, %val_unscaled +; CHECK: ldur {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i32* %p, i32 297984 ; 0x123000/4 (i.e. ADD imm) + %val_random = load atomic i32* %ptr_random unordered, align 4 + %tot3 = add i32 %tot2, %val_random +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: ldr {{w[0-9]+}}, [x[[ADDR]]] + + ret i32 %tot3 +} + +define i64 @atomic_load_relaxed_64(i64* %p, i32 %off32) { +; CHECK-LABEL: atomic_load_relaxed_64: + %ptr_unsigned = getelementptr i64* %p, i32 4095 + %val_unsigned = load atomic i64* %ptr_unsigned monotonic, align 8 +; CHECK: ldr {{x[0-9]+}}, [x0, #32760] + + %ptr_regoff = getelementptr i64* %p, i32 %off32 + %val_regoff = load atomic i64* %ptr_regoff unordered, align 8 + %tot1 = add i64 %val_unsigned, %val_regoff +; CHECK: ldr {{x[0-9]+}}, [x0, w1, sxtw #3] + + %ptr_unscaled = getelementptr i64* %p, i32 -32 + %val_unscaled = load atomic i64* %ptr_unscaled monotonic, align 8 + %tot2 = add i64 %tot1, %val_unscaled +; CHECK: ldur {{x[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i64* %p, i32 148992 ; 0x123000/8 (i.e. ADD imm) + %val_random = load atomic i64* %ptr_random unordered, align 8 + %tot3 = add i64 %tot2, %val_random +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: ldr {{x[0-9]+}}, [x[[ADDR]]] + + ret i64 %tot3 +} + + +define void @atomc_store(i32* %p) { + store atomic i32 4, i32* %p seq_cst, align 4 + ret void + ; CHECK-LABEL: atomc_store: + ; CHECK: stlr +} + +define void @atomic_store_relaxed_8(i8* %p, i32 %off32, i8 %val) { +; CHECK-LABEL: atomic_store_relaxed_8: + %ptr_unsigned = getelementptr i8* %p, i32 4095 + store atomic i8 %val, i8* %ptr_unsigned monotonic, align 1 +; CHECK: strb {{w[0-9]+}}, [x0, #4095] + + %ptr_regoff = getelementptr i8* %p, i32 %off32 + store atomic i8 %val, i8* %ptr_regoff unordered, align 1 +; CHECK: strb {{w[0-9]+}}, [x0, w1, sxtw] + + %ptr_unscaled = getelementptr i8* %p, i32 -256 + store atomic i8 %val, i8* %ptr_unscaled monotonic, align 1 +; CHECK: sturb {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i8* %p, i32 1191936 ; 0x123000 (i.e. ADD imm) + store atomic i8 %val, i8* %ptr_random unordered, align 1 +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: strb {{w[0-9]+}}, [x[[ADDR]]] + + ret void +} + +define void @atomic_store_relaxed_16(i16* %p, i32 %off32, i16 %val) { +; CHECK-LABEL: atomic_store_relaxed_16: + %ptr_unsigned = getelementptr i16* %p, i32 4095 + store atomic i16 %val, i16* %ptr_unsigned monotonic, align 2 +; CHECK: strh {{w[0-9]+}}, [x0, #8190] + + %ptr_regoff = getelementptr i16* %p, i32 %off32 + store atomic i16 %val, i16* %ptr_regoff unordered, align 2 +; CHECK: strh {{w[0-9]+}}, [x0, w1, sxtw #1] + + %ptr_unscaled = getelementptr i16* %p, i32 -128 + store atomic i16 %val, i16* %ptr_unscaled monotonic, align 2 +; CHECK: sturh {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i16* %p, i32 595968 ; 0x123000/2 (i.e. ADD imm) + store atomic i16 %val, i16* %ptr_random unordered, align 2 +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: strh {{w[0-9]+}}, [x[[ADDR]]] + + ret void +} + +define void @atomic_store_relaxed_32(i32* %p, i32 %off32, i32 %val) { +; CHECK-LABEL: atomic_store_relaxed_32: + %ptr_unsigned = getelementptr i32* %p, i32 4095 + store atomic i32 %val, i32* %ptr_unsigned monotonic, align 4 +; CHECK: str {{w[0-9]+}}, [x0, #16380] + + %ptr_regoff = getelementptr i32* %p, i32 %off32 + store atomic i32 %val, i32* %ptr_regoff unordered, align 4 +; CHECK: str {{w[0-9]+}}, [x0, w1, sxtw #2] + + %ptr_unscaled = getelementptr i32* %p, i32 -64 + store atomic i32 %val, i32* %ptr_unscaled monotonic, align 4 +; CHECK: stur {{w[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i32* %p, i32 297984 ; 0x123000/4 (i.e. ADD imm) + store atomic i32 %val, i32* %ptr_random unordered, align 4 +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: str {{w[0-9]+}}, [x[[ADDR]]] + + ret void +} + +define void @atomic_store_relaxed_64(i64* %p, i32 %off32, i64 %val) { +; CHECK-LABEL: atomic_store_relaxed_64: + %ptr_unsigned = getelementptr i64* %p, i32 4095 + store atomic i64 %val, i64* %ptr_unsigned monotonic, align 8 +; CHECK: str {{x[0-9]+}}, [x0, #32760] + + %ptr_regoff = getelementptr i64* %p, i32 %off32 + store atomic i64 %val, i64* %ptr_regoff unordered, align 8 +; CHECK: str {{x[0-9]+}}, [x0, w1, sxtw #3] + + %ptr_unscaled = getelementptr i64* %p, i32 -32 + store atomic i64 %val, i64* %ptr_unscaled monotonic, align 8 +; CHECK: stur {{x[0-9]+}}, [x0, #-256] + + %ptr_random = getelementptr i64* %p, i32 148992 ; 0x123000/8 (i.e. ADD imm) + store atomic i64 %val, i64* %ptr_random unordered, align 8 +; CHECK: add x[[ADDR:[0-9]+]], x0, #291, lsl #12 +; CHECK: str {{x[0-9]+}}, [x[[ADDR]]] + + ret void +} + +; rdar://11531169 +; rdar://11531308 + +%"class.X::Atomic" = type { %struct.x_atomic_t } +%struct.x_atomic_t = type { i32 } + +@counter = external hidden global %"class.X::Atomic", align 4 + +define i32 @next_id() nounwind optsize ssp align 2 { +entry: + %0 = atomicrmw add i32* getelementptr inbounds (%"class.X::Atomic"* @counter, i64 0, i32 0, i32 0), i32 1 seq_cst + %add.i = add i32 %0, 1 + %tobool = icmp eq i32 %add.i, 0 + br i1 %tobool, label %if.else, label %return + +if.else: ; preds = %entry + %1 = atomicrmw add i32* getelementptr inbounds (%"class.X::Atomic"* @counter, i64 0, i32 0, i32 0), i32 1 seq_cst + %add.i2 = add i32 %1, 1 + br label %return + +return: ; preds = %if.else, %entry + %retval.0 = phi i32 [ %add.i2, %if.else ], [ %add.i, %entry ] + ret i32 %retval.0 +} diff --git a/test/CodeGen/AArch64/arm64-basic-pic.ll b/test/CodeGen/AArch64/arm64-basic-pic.ll new file mode 100644 index 000000000000..9fdb1e91385b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-basic-pic.ll @@ -0,0 +1,54 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -verify-machineinstrs -relocation-model=pic %s -o - | FileCheck %s + +@var = global i32 0 + +define i32 @get_globalvar() { +; CHECK-LABEL: get_globalvar: + + %val = load i32* @var +; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var +; CHECK: ldr x[[GOTLOC:[0-9]+]], [x[[GOTHI]], :got_lo12:var] +; CHECK: ldr w0, [x[[GOTLOC]]] + + ret i32 %val +} + +define i32* @get_globalvaraddr() { +; CHECK-LABEL: get_globalvaraddr: + + %val = load i32* @var +; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var +; CHECK: ldr x0, [x[[GOTHI]], :got_lo12:var] + + ret i32* @var +} + +@hiddenvar = hidden global i32 0 + +define i32 @get_hiddenvar() { +; CHECK-LABEL: get_hiddenvar: + + %val = load i32* @hiddenvar +; CHECK: adrp x[[HI:[0-9]+]], hiddenvar +; CHECK: ldr w0, [x[[HI]], :lo12:hiddenvar] + + ret i32 %val +} + +define i32* @get_hiddenvaraddr() { +; CHECK-LABEL: get_hiddenvaraddr: + + %val = load i32* @hiddenvar +; CHECK: adrp [[HI:x[0-9]+]], hiddenvar +; CHECK: add x0, [[HI]], :lo12:hiddenvar + + ret i32* @hiddenvar +} + +define void()* @get_func() { +; CHECK-LABEL: get_func: + + ret void()* bitcast(void()*()* @get_func to void()*) +; CHECK: adrp x[[GOTHI:[0-9]+]], :got:get_func +; CHECK: ldr x0, [x[[GOTHI]], :got_lo12:get_func] +} diff --git a/test/CodeGen/AArch64/arm64-big-endian-bitconverts.ll b/test/CodeGen/AArch64/arm64-big-endian-bitconverts.ll new file mode 100644 index 000000000000..f0e968b2c177 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-endian-bitconverts.ll @@ -0,0 +1,1101 @@ +; RUN: llc -mtriple arm64_be < %s -aarch64-load-store-opt=false -O1 -o - | FileCheck %s +; RUN: llc -mtriple arm64_be < %s -aarch64-load-store-opt=false -O0 -fast-isel=true -o - | FileCheck %s + +; CHECK-LABEL: test_i64_f64: +define void @test_i64_f64(double* %p, i64* %q) { +; CHECK: ldr +; CHECK: str + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v1i64: +define void @test_i64_v1i64(<1 x i64>* %p, i64* %q) { +; CHECK: ldr +; CHECK: str + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v2f32: +define void @test_i64_v2f32(<2 x float>* %p, i64* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v2i32: +define void @test_i64_v2i32(<2 x i32>* %p, i64* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v4i16: +define void @test_i64_v4i16(<4 x i16>* %p, i64* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: str + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v8i8: +define void @test_i64_v8i8(<8 x i8>* %p, i64* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: str + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to i64 + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_f64_i64: +define void @test_f64_i64(i64* %p, double* %q) { +; CHECK: ldr +; CHECK: str + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v1i64: +define void @test_f64_v1i64(<1 x i64>* %p, double* %q) { +; CHECK: ldr +; CHECK: str + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v2f32: +define void @test_f64_v2f32(<2 x float>* %p, double* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v2i32: +define void @test_f64_v2i32(<2 x i32>* %p, double* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v4i16: +define void @test_f64_v4i16(<4 x i16>* %p, double* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: str + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v8i8: +define void @test_f64_v8i8(<8 x i8>* %p, double* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: str + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to double + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_v1i64_i64: +define void @test_v1i64_i64(i64* %p, <1 x i64>* %q) { +; CHECK: ldr +; CHECK: str + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_f64: +define void @test_v1i64_f64(double* %p, <1 x i64>* %q) { +; CHECK: ldr +; CHECK: str + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v2f32: +define void @test_v1i64_v2f32(<2 x float>* %p, <1 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v2i32: +define void @test_v1i64_v2i32(<2 x i32>* %p, <1 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: str + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v4i16: +define void @test_v1i64_v4i16(<4 x i16>* %p, <1 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: str + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v8i8: +define void @test_v1i64_v8i8(<8 x i8>* %p, <1 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: str + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to <1 x i64> + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_i64: +define void @test_v2f32_i64(i64* %p, <2 x float>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_f64: +define void @test_v2f32_f64(double* %p, <2 x float>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v1i64: +define void @test_v2f32_v1i64(<1 x i64>* %p, <2 x float>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v2i32: +define void @test_v2f32_v2i32(<2 x i32>* %p, <2 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v4i16: +define void @test_v2f32_v4i16(<4 x i16>* %p, <2 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev32 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v8i8: +define void @test_v2f32_v8i8(<8 x i8>* %p, <2 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev32 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to <2 x float> + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_i64: +define void @test_v2i32_i64(i64* %p, <2 x i32>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_f64: +define void @test_v2i32_f64(double* %p, <2 x i32>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v1i64: +define void @test_v2i32_v1i64(<1 x i64>* %p, <2 x i32>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v2f32: +define void @test_v2i32_v2f32(<2 x float>* %p, <2 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v4i16: +define void @test_v2i32_v4i16(<4 x i16>* %p, <2 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev32 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v8i8: +define void @test_v2i32_v8i8(<8 x i8>* %p, <2 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev32 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.2s } + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to <2 x i32> + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_i64: +define void @test_v4i16_i64(i64* %p, <4 x i16>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_f64: +define void @test_v4i16_f64(double* %p, <4 x i16>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v1i64: +define void @test_v4i16_v1i64(<1 x i64>* %p, <4 x i16>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v2f32: +define void @test_v4i16_v2f32(<2 x float>* %p, <4 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev32 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v2i32: +define void @test_v4i16_v2i32(<2 x i32>* %p, <4 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev32 v{{[0-9]+}}.4h +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v8i8: +define void @test_v4i16_v8i8(<8 x i8>* %p, <4 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8b } +; CHECK: rev16 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.4h } + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = bitcast <8 x i8> %2 to <4 x i16> + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_i64: +define void @test_v8i8_i64(i64* %p, <8 x i8>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = bitcast i64 %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_f64: +define void @test_v8i8_f64(double* %p, <8 x i8>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = bitcast double %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v1i64: +define void @test_v8i8_v1i64(<1 x i64>* %p, <8 x i8>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = bitcast <1 x i64> %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v2f32: +define void @test_v8i8_v2f32(<2 x float>* %p, <8 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev32 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = bitcast <2 x float> %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v2i32: +define void @test_v8i8_v2i32(<2 x i32>* %p, <8 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2s } +; CHECK: rev32 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = bitcast <2 x i32> %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v4i16: +define void @test_v8i8_v4i16(<4 x i16>* %p, <8 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4h } +; CHECK: rev16 v{{[0-9]+}}.8b +; CHECK: st1 { v{{[0-9]+}}.8b } + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = bitcast <4 x i16> %2 to <8 x i8> + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_f128_v2f64: +define void @test_f128_v2f64(<2 x double>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: ext +; CHECK: str + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v2i64: +define void @test_f128_v2i64(<2 x i64>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: ext +; CHECK: str + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v4f32: +define void @test_f128_v4f32(<4 x float>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: str q + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v4i32: +define void @test_f128_v4i32(<4 x i32>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: str + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v8i16: +define void @test_f128_v8i16(<8 x i16>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: str + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v16i8: +define void @test_f128_v16i8(<16 x i8>* %p, fp128* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: ext +; CHECK: str q + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to fp128 + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_v2f64_f128: +define void @test_v2f64_f128(fp128* %p, <2 x double>* %q) { +; CHECK: ldr +; CHECK: ext +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v2i64: +define void @test_v2f64_v2i64(<2 x i64>* %p, <2 x double>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v4f32: +define void @test_v2f64_v4f32(<4 x float>* %p, <2 x double>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v4i32: +define void @test_v2f64_v4i32(<4 x i32>* %p, <2 x double>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v8i16: +define void @test_v2f64_v8i16(<8 x i16>* %p, <2 x double>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v16i8: +define void @test_v2f64_v16i8(<16 x i8>* %p, <2 x double>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to <2 x double> + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_f128: +define void @test_v2i64_f128(fp128* %p, <2 x i64>* %q) { +; CHECK: ldr +; CHECK: ext +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v2f64: +define void @test_v2i64_v2f64(<2 x double>* %p, <2 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v4f32: +define void @test_v2i64_v4f32(<4 x float>* %p, <2 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v4i32: +define void @test_v2i64_v4i32(<4 x i32>* %p, <2 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v8i16: +define void @test_v2i64_v8i16(<8 x i16>* %p, <2 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v16i8: +define void @test_v2i64_v16i8(<16 x i8>* %p, <2 x i64>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to <2 x i64> + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_f128: +define void @test_v4f32_f128(fp128* %p, <4 x float>* %q) { +; CHECK: ldr q +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v2f64: +define void @test_v4f32_v2f64(<2 x double>* %p, <4 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v2i64: +define void @test_v4f32_v2i64(<2 x i64>* %p, <4 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v4i32: +define void @test_v4f32_v4i32(<4 x i32>* %p, <4 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v8i16: +define void @test_v4f32_v8i16(<8 x i16>* %p, <4 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev32 v{{[0-9]+}}.8h +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v16i8: +define void @test_v4f32_v16i8(<16 x i8>* %p, <4 x float>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: rev32 v{{[0-9]+}}.16b +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.2d } + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to <4 x float> + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_f128: +define void @test_v4i32_f128(fp128* %p, <4 x i32>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v2f64: +define void @test_v4i32_v2f64(<2 x double>* %p, <4 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v2i64: +define void @test_v4i32_v2i64(<2 x i64>* %p, <4 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v4f32: +define void @test_v4i32_v4f32(<4 x float>* %p, <4 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v8i16: +define void @test_v4i32_v8i16(<8 x i16>* %p, <4 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev32 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v16i8: +define void @test_v4i32_v16i8(<16 x i8>* %p, <4 x i32>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: rev32 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.4s } + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to <4 x i32> + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_f128: +define void @test_v8i16_f128(fp128* %p, <8 x i16>* %q) { +; CHECK: ldr +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v2f64: +define void @test_v8i16_v2f64(<2 x double>* %p, <8 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v2i64: +define void @test_v8i16_v2i64(<2 x i64>* %p, <8 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v4f32: +define void @test_v8i16_v4f32(<4 x float>* %p, <8 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev32 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v4i32: +define void @test_v8i16_v4i32(<4 x i32>* %p, <8 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev32 v{{[0-9]+}}.8h +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v16i8: +define void @test_v8i16_v16i8(<16 x i8>* %p, <8 x i16>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.16b } +; CHECK: rev16 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.8h } + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = bitcast <16 x i8> %2 to <8 x i16> + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_f128: +define void @test_v16i8_f128(fp128* %p, <16 x i8>* %q) { +; CHECK: ldr q +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = bitcast fp128 %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v2f64: +define void @test_v16i8_v2f64(<2 x double>* %p, <16 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = bitcast <2 x double> %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v2i64: +define void @test_v16i8_v2i64(<2 x i64>* %p, <16 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = bitcast <2 x i64> %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v4f32: +define void @test_v16i8_v4f32(<4 x float>* %p, <16 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.2d } +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: rev32 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = bitcast <4 x float> %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v4i32: +define void @test_v16i8_v4i32(<4 x i32>* %p, <16 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.4s } +; CHECK: rev32 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = bitcast <4 x i32> %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v8i16: +define void @test_v16i8_v8i16(<8 x i16>* %p, <16 x i8>* %q) { +; CHECK: ld1 { v{{[0-9]+}}.8h } +; CHECK: rev16 v{{[0-9]+}}.16b +; CHECK: st1 { v{{[0-9]+}}.16b } + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = bitcast <8 x i16> %2 to <16 x i8> + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} diff --git a/test/CodeGen/AArch64/arm64-big-endian-eh.ll b/test/CodeGen/AArch64/arm64-big-endian-eh.ll new file mode 100644 index 000000000000..93e7da98de21 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-endian-eh.ll @@ -0,0 +1,73 @@ +; RUN: llc -mtriple arm64_be-linux-gnu -filetype obj < %s | llvm-objdump -s - | FileCheck %s + +; ARM EHABI for big endian +; This test case checks whether CIE length record is laid out in big endian format. +; +; This is the LLVM assembly generated from following C++ code: +; +; extern void foo(int); +; void test(int a, int b) { +; try { +; foo(a); +; } catch (...) { +; foo(b); +; } +;} + +define void @_Z4testii(i32 %a, i32 %b) #0 { +entry: + invoke void @_Z3fooi(i32 %a) + to label %try.cont unwind label %lpad + +lpad: ; preds = %entry + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + catch i8* null + %1 = extractvalue { i8*, i32 } %0, 0 + %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2 + invoke void @_Z3fooi(i32 %b) + to label %invoke.cont2 unwind label %lpad1 + +invoke.cont2: ; preds = %lpad + tail call void @__cxa_end_catch() + br label %try.cont + +try.cont: ; preds = %entry, %invoke.cont2 + ret void + +lpad1: ; preds = %lpad + %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup + invoke void @__cxa_end_catch() + to label %eh.resume unwind label %terminate.lpad + +eh.resume: ; preds = %lpad1 + resume { i8*, i32 } %3 + +terminate.lpad: ; preds = %lpad1 + %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + catch i8* null + %5 = extractvalue { i8*, i32 } %4, 0 + tail call void @__clang_call_terminate(i8* %5) #3 + unreachable +} + +declare void @_Z3fooi(i32) #0 + +declare i32 @__gxx_personality_v0(...) + +declare i8* @__cxa_begin_catch(i8*) + +declare void @__cxa_end_catch() + +; Function Attrs: noinline noreturn nounwind +define linkonce_odr hidden void @__clang_call_terminate(i8*) #1 { + %2 = tail call i8* @__cxa_begin_catch(i8* %0) #2 + tail call void @_ZSt9terminatev() #3 + unreachable +} + +declare void @_ZSt9terminatev() + +; CHECK-LABEL: Contents of section .eh_frame: +; CHECK-NEXT: 0000 0000001c + diff --git a/test/CodeGen/AArch64/arm64-big-endian-varargs.ll b/test/CodeGen/AArch64/arm64-big-endian-varargs.ll new file mode 100644 index 000000000000..d7b26b975231 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-endian-varargs.ll @@ -0,0 +1,58 @@ +; RUN: llc < %s | FileCheck %s + +; Vararg saving must save Q registers using the equivalent of STR/STP. + +target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128" +target triple = "arm64_be-arm-none-eabi" + +%struct.__va_list = type { i8*, i8*, i8*, i32, i32 } + +declare void @llvm.va_start(i8*) nounwind +declare void @llvm.va_end(i8*) nounwind + +define double @callee(i32 %a, ...) { +; CHECK: stp +; CHECK: stp +; CHECK: stp +; CHECK: stp +; CHECK: stp +; CHECK: stp +entry: + %vl = alloca %struct.__va_list, align 8 + %vl1 = bitcast %struct.__va_list* %vl to i8* + call void @llvm.va_start(i8* %vl1) + %vr_offs_p = getelementptr inbounds %struct.__va_list* %vl, i64 0, i32 4 + %vr_offs = load i32* %vr_offs_p, align 4 + %0 = icmp sgt i32 %vr_offs, -1 + br i1 %0, label %vaarg.on_stack, label %vaarg.maybe_reg + +vaarg.maybe_reg: ; preds = %entry + %new_reg_offs = add i32 %vr_offs, 16 + store i32 %new_reg_offs, i32* %vr_offs_p, align 4 + %inreg = icmp slt i32 %new_reg_offs, 1 + br i1 %inreg, label %vaarg.in_reg, label %vaarg.on_stack + +vaarg.in_reg: ; preds = %vaarg.maybe_reg + %reg_top_p = getelementptr inbounds %struct.__va_list* %vl, i64 0, i32 2 + %reg_top = load i8** %reg_top_p, align 8 + %1 = sext i32 %vr_offs to i64 + %2 = getelementptr i8* %reg_top, i64 %1 + %3 = ptrtoint i8* %2 to i64 + %align_be = add i64 %3, 8 + %4 = inttoptr i64 %align_be to i8* + br label %vaarg.end + +vaarg.on_stack: ; preds = %vaarg.maybe_reg, %entry + %stack_p = getelementptr inbounds %struct.__va_list* %vl, i64 0, i32 0 + %stack = load i8** %stack_p, align 8 + %new_stack = getelementptr i8* %stack, i64 8 + store i8* %new_stack, i8** %stack_p, align 8 + br label %vaarg.end + +vaarg.end: ; preds = %vaarg.on_stack, %vaarg.in_reg + %.sink = phi i8* [ %4, %vaarg.in_reg ], [ %stack, %vaarg.on_stack ] + %5 = bitcast i8* %.sink to double* + %6 = load double* %5, align 8 + call void @llvm.va_end(i8* %vl1) + ret double %6 +} diff --git a/test/CodeGen/AArch64/arm64-big-endian-vector-callee.ll b/test/CodeGen/AArch64/arm64-big-endian-vector-callee.ll new file mode 100644 index 000000000000..1dcccf106a29 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-endian-vector-callee.ll @@ -0,0 +1,848 @@ +; RUN: llc -mtriple arm64_be < %s -aarch64-load-store-opt=false -o - | FileCheck %s +; RUN: llc -mtriple arm64_be < %s -fast-isel=true -aarch64-load-store-opt=false -o - | FileCheck %s + +; CHECK-LABEL: test_i64_f64: +define i64 @test_i64_f64(double %p) { +; CHECK-NOT: rev + %1 = fadd double %p, %p + %2 = bitcast double %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_i64_v1i64: +define i64 @test_i64_v1i64(<1 x i64> %p) { +; CHECK-NOT: rev + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_i64_v2f32: +define i64 @test_i64_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_i64_v2i32: +define i64 @test_i64_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_i64_v4i16: +define i64 @test_i64_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_i64_v8i8: +define i64 @test_i64_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to i64 + %3 = add i64 %2, %2 + ret i64 %3 +} + +; CHECK-LABEL: test_f64_i64: +define double @test_f64_i64(i64 %p) { +; CHECK-NOT: rev + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_f64_v1i64: +define double @test_f64_v1i64(<1 x i64> %p) { +; CHECK-NOT: rev + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_f64_v2f32: +define double @test_f64_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_f64_v2i32: +define double @test_f64_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_f64_v4i16: +define double @test_f64_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_f64_v8i8: +define double @test_f64_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to double + %3 = fadd double %2, %2 + ret double %3 +} + +; CHECK-LABEL: test_v1i64_i64: +define <1 x i64> @test_v1i64_i64(i64 %p) { +; CHECK-NOT: rev + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v1i64_f64: +define <1 x i64> @test_v1i64_f64(double %p) { +; CHECK-NOT: rev + %1 = fadd double %p, %p + %2 = bitcast double %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v1i64_v2f32: +define <1 x i64> @test_v1i64_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v1i64_v2i32: +define <1 x i64> @test_v1i64_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v1i64_v4i16: +define <1 x i64> @test_v1i64_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v1i64_v8i8: +define <1 x i64> @test_v1i64_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to <1 x i64> + %3 = add <1 x i64> %2, %2 + ret <1 x i64> %3 +} + +; CHECK-LABEL: test_v2f32_i64: +define <2 x float> @test_v2f32_i64(i64 %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2f32_f64: +define <2 x float> @test_v2f32_f64(double %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd double %p, %p + %2 = bitcast double %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2f32_v1i64: +define <2 x float> @test_v2f32_v1i64(<1 x i64> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2f32_v2i32: +define <2 x float> @test_v2f32_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2f32_v4i16: +define <2 x float> @test_v2f32_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2f32_v8i8: +define <2 x float> @test_v2f32_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to <2 x float> + %3 = fadd <2 x float> %2, %2 + ret <2 x float> %3 +} + +; CHECK-LABEL: test_v2i32_i64: +define <2 x i32> @test_v2i32_i64(i64 %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v2i32_f64: +define <2 x i32> @test_v2i32_f64(double %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd double %p, %p + %2 = bitcast double %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v2i32_v1i64: +define <2 x i32> @test_v2i32_v1i64(<1 x i64> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v2i32_v2f32: +define <2 x i32> @test_v2i32_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v2i32_v4i16: +define <2 x i32> @test_v2i32_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v2i32_v8i8: +define <2 x i32> @test_v2i32_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to <2 x i32> + %3 = add <2 x i32> %2, %2 + ret <2 x i32> %3 +} + +; CHECK-LABEL: test_v4i16_i64: +define <4 x i16> @test_v4i16_i64(i64 %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v4i16_f64: +define <4 x i16> @test_v4i16_f64(double %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = fadd double %p, %p + %2 = bitcast double %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v4i16_v1i64: +define <4 x i16> @test_v4i16_v1i64(<1 x i64> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v4i16_v2f32: +define <4 x i16> @test_v4i16_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v4i16_v2i32: +define <4 x i16> @test_v4i16_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v4i16_v8i8: +define <4 x i16> @test_v4i16_v8i8(<8 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = add <8 x i8> %p, %p + %2 = bitcast <8 x i8> %1 to <4 x i16> + %3 = add <4 x i16> %2, %2 + ret <4 x i16> %3 +} + +; CHECK-LABEL: test_v8i8_i64: +define <8 x i8> @test_v8i8_i64(i64 %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add i64 %p, %p + %2 = bitcast i64 %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_v8i8_f64: +define <8 x i8> @test_v8i8_f64(double %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = fadd double %p, %p + %2 = bitcast double %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_v8i8_v1i64: +define <8 x i8> @test_v8i8_v1i64(<1 x i64> %p) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <1 x i64> %p, %p + %2 = bitcast <1 x i64> %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_v8i8_v2f32: +define <8 x i8> @test_v8i8_v2f32(<2 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = fadd <2 x float> %p, %p + %2 = bitcast <2 x float> %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_v8i8_v2i32: +define <8 x i8> @test_v8i8_v2i32(<2 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <2 x i32> %p, %p + %2 = bitcast <2 x i32> %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_v8i8_v4i16: +define <8 x i8> @test_v8i8_v4i16(<4 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = add <4 x i16> %p, %p + %2 = bitcast <4 x i16> %1 to <8 x i8> + %3 = add <8 x i8> %2, %2 + ret <8 x i8> %3 +} + +; CHECK-LABEL: test_f128_v2f64: +define fp128 @test_f128_v2f64(<2 x double> %p) { +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_f128_v2i64: +define fp128 @test_f128_v2i64(<2 x i64> %p) { +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_f128_v4f32: +define fp128 @test_f128_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_f128_v4i32: +define fp128 @test_f128_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_f128_v8i16: +define fp128 @test_f128_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_f128_v16i8: +define fp128 @test_f128_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to fp128 + %3 = fadd fp128 %2, %2 + ret fp128 %3 +} + +; CHECK-LABEL: test_v2f64_f128: +define <2 x double> @test_v2f64_f128(fp128 %p) { +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2f64_v2i64: +define <2 x double> @test_v2f64_v2i64(<2 x i64> %p) { +; CHECK: ext +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2f64_v4f32: +define <2 x double> @test_v2f64_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2f64_v4i32: +define <2 x double> @test_v2f64_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2f64_v8i16: +define <2 x double> @test_v2f64_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2f64_v16i8: +define <2 x double> @test_v2f64_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to <2 x double> + %3 = fadd <2 x double> %2, %2 + ret <2 x double> %3 +} + +; CHECK-LABEL: test_v2i64_f128: +define <2 x i64> @test_v2i64_f128(fp128 %p) { +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v2i64_v2f64: +define <2 x i64> @test_v2i64_v2f64(<2 x double> %p) { +; CHECK: ext +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v2i64_v4f32: +define <2 x i64> @test_v2i64_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v2i64_v4i32: +define <2 x i64> @test_v2i64_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v2i64_v8i16: +define <2 x i64> @test_v2i64_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v2i64_v16i8: +define <2 x i64> @test_v2i64_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to <2 x i64> + %3 = add <2 x i64> %2, %2 + ret <2 x i64> %3 +} + +; CHECK-LABEL: test_v4f32_f128: +define <4 x float> @test_v4f32_f128(fp128 %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4f32_v2f64: +define <4 x float> @test_v4f32_v2f64(<2 x double> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4f32_v2i64: +define <4 x float> @test_v4f32_v2i64(<2 x i64> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4f32_v4i32: +define <4 x float> @test_v4f32_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4f32_v8i16: +define <4 x float> @test_v4f32_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4f32_v16i8: +define <4 x float> @test_v4f32_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to <4 x float> + %3 = fadd <4 x float> %2, %2 + ret <4 x float> %3 +} + +; CHECK-LABEL: test_v4i32_f128: +define <4 x i32> @test_v4i32_f128(fp128 %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v4i32_v2f64: +define <4 x i32> @test_v4i32_v2f64(<2 x double> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v4i32_v2i64: +define <4 x i32> @test_v4i32_v2i64(<2 x i64> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v4i32_v4f32: +define <4 x i32> @test_v4i32_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v4i32_v8i16: +define <4 x i32> @test_v4i32_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v4i32_v16i8: +define <4 x i32> @test_v4i32_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to <4 x i32> + %3 = add <4 x i32> %2, %2 + ret <4 x i32> %3 +} + +; CHECK-LABEL: test_v8i16_f128: +define <8 x i16> @test_v8i16_f128(fp128 %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v8i16_v2f64: +define <8 x i16> @test_v8i16_v2f64(<2 x double> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v8i16_v2i64: +define <8 x i16> @test_v8i16_v2i64(<2 x i64> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v8i16_v4f32: +define <8 x i16> @test_v8i16_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v8i16_v4i32: +define <8 x i16> @test_v8i16_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v8i16_v16i8: +define <8 x i16> @test_v8i16_v16i8(<16 x i8> %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = add <16 x i8> %p, %p + %2 = bitcast <16 x i8> %1 to <8 x i16> + %3 = add <8 x i16> %2, %2 + ret <8 x i16> %3 +} + +; CHECK-LABEL: test_v16i8_f128: +define <16 x i8> @test_v16i8_f128(fp128 %p) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = fadd fp128 %p, %p + %2 = bitcast fp128 %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} + +; CHECK-LABEL: test_v16i8_v2f64: +define <16 x i8> @test_v16i8_v2f64(<2 x double> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = fadd <2 x double> %p, %p + %2 = bitcast <2 x double> %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} + +; CHECK-LABEL: test_v16i8_v2i64: +define <16 x i8> @test_v16i8_v2i64(<2 x i64> %p) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = add <2 x i64> %p, %p + %2 = bitcast <2 x i64> %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} + +; CHECK-LABEL: test_v16i8_v4f32: +define <16 x i8> @test_v16i8_v4f32(<4 x float> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = fadd <4 x float> %p, %p + %2 = bitcast <4 x float> %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} + +; CHECK-LABEL: test_v16i8_v4i32: +define <16 x i8> @test_v16i8_v4i32(<4 x i32> %p) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = add <4 x i32> %p, %p + %2 = bitcast <4 x i32> %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} + +; CHECK-LABEL: test_v16i8_v8i16: +define <16 x i8> @test_v16i8_v8i16(<8 x i16> %p) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = add <8 x i16> %p, %p + %2 = bitcast <8 x i16> %1 to <16 x i8> + %3 = add <16 x i8> %2, %2 + ret <16 x i8> %3 +} diff --git a/test/CodeGen/AArch64/arm64-big-endian-vector-caller.ll b/test/CodeGen/AArch64/arm64-big-endian-vector-caller.ll new file mode 100644 index 000000000000..9a12b7a01153 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-endian-vector-caller.ll @@ -0,0 +1,1100 @@ +; RUN: llc -mtriple arm64_be < %s -aarch64-load-store-opt=false -o - | FileCheck %s +; RUN: llc -mtriple arm64_be < %s -aarch64-load-store-opt=false -fast-isel=true -O0 -o - | FileCheck %s + +; CHECK-LABEL: test_i64_f64: +declare i64 @test_i64_f64_helper(double %p) +define void @test_i64_f64(double* %p, i64* %q) { +; CHECK-NOT: rev + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call i64 @test_i64_f64_helper(double %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v1i64: +declare i64 @test_i64_v1i64_helper(<1 x i64> %p) +define void @test_i64_v1i64(<1 x i64>* %p, i64* %q) { +; CHECK-NOT: rev + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call i64 @test_i64_v1i64_helper(<1 x i64> %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v2f32: +declare i64 @test_i64_v2f32_helper(<2 x float> %p) +define void @test_i64_v2f32(<2 x float>* %p, i64* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call i64 @test_i64_v2f32_helper(<2 x float> %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v2i32: +declare i64 @test_i64_v2i32_helper(<2 x i32> %p) +define void @test_i64_v2i32(<2 x i32>* %p, i64* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call i64 @test_i64_v2i32_helper(<2 x i32> %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v4i16: +declare i64 @test_i64_v4i16_helper(<4 x i16> %p) +define void @test_i64_v4i16(<4 x i16>* %p, i64* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call i64 @test_i64_v4i16_helper(<4 x i16> %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_i64_v8i8: +declare i64 @test_i64_v8i8_helper(<8 x i8> %p) +define void @test_i64_v8i8(<8 x i8>* %p, i64* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call i64 @test_i64_v8i8_helper(<8 x i8> %2) + %4 = add i64 %3, %3 + store i64 %4, i64* %q + ret void +} + +; CHECK-LABEL: test_f64_i64: +declare double @test_f64_i64_helper(i64 %p) +define void @test_f64_i64(i64* %p, double* %q) { +; CHECK-NOT: rev + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call double @test_f64_i64_helper(i64 %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v1i64: +declare double @test_f64_v1i64_helper(<1 x i64> %p) +define void @test_f64_v1i64(<1 x i64>* %p, double* %q) { +; CHECK-NOT: rev + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call double @test_f64_v1i64_helper(<1 x i64> %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v2f32: +declare double @test_f64_v2f32_helper(<2 x float> %p) +define void @test_f64_v2f32(<2 x float>* %p, double* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call double @test_f64_v2f32_helper(<2 x float> %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v2i32: +declare double @test_f64_v2i32_helper(<2 x i32> %p) +define void @test_f64_v2i32(<2 x i32>* %p, double* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call double @test_f64_v2i32_helper(<2 x i32> %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v4i16: +declare double @test_f64_v4i16_helper(<4 x i16> %p) +define void @test_f64_v4i16(<4 x i16>* %p, double* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call double @test_f64_v4i16_helper(<4 x i16> %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_f64_v8i8: +declare double @test_f64_v8i8_helper(<8 x i8> %p) +define void @test_f64_v8i8(<8 x i8>* %p, double* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call double @test_f64_v8i8_helper(<8 x i8> %2) + %4 = fadd double %3, %3 + store double %4, double* %q + ret void +} + +; CHECK-LABEL: test_v1i64_i64: +declare <1 x i64> @test_v1i64_i64_helper(i64 %p) +define void @test_v1i64_i64(i64* %p, <1 x i64>* %q) { +; CHECK-NOT: rev + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call <1 x i64> @test_v1i64_i64_helper(i64 %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_f64: +declare <1 x i64> @test_v1i64_f64_helper(double %p) +define void @test_v1i64_f64(double* %p, <1 x i64>* %q) { +; CHECK-NOT: rev + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call <1 x i64> @test_v1i64_f64_helper(double %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v2f32: +declare <1 x i64> @test_v1i64_v2f32_helper(<2 x float> %p) +define void @test_v1i64_v2f32(<2 x float>* %p, <1 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call <1 x i64> @test_v1i64_v2f32_helper(<2 x float> %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v2i32: +declare <1 x i64> @test_v1i64_v2i32_helper(<2 x i32> %p) +define void @test_v1i64_v2i32(<2 x i32>* %p, <1 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call <1 x i64> @test_v1i64_v2i32_helper(<2 x i32> %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v4i16: +declare <1 x i64> @test_v1i64_v4i16_helper(<4 x i16> %p) +define void @test_v1i64_v4i16(<4 x i16>* %p, <1 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call <1 x i64> @test_v1i64_v4i16_helper(<4 x i16> %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v1i64_v8i8: +declare <1 x i64> @test_v1i64_v8i8_helper(<8 x i8> %p) +define void @test_v1i64_v8i8(<8 x i8>* %p, <1 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call <1 x i64> @test_v1i64_v8i8_helper(<8 x i8> %2) + %4 = add <1 x i64> %3, %3 + store <1 x i64> %4, <1 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_i64: +declare <2 x float> @test_v2f32_i64_helper(i64 %p) +define void @test_v2f32_i64(i64* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call <2 x float> @test_v2f32_i64_helper(i64 %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_f64: +declare <2 x float> @test_v2f32_f64_helper(double %p) +define void @test_v2f32_f64(double* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call <2 x float> @test_v2f32_f64_helper(double %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v1i64: +declare <2 x float> @test_v2f32_v1i64_helper(<1 x i64> %p) +define void @test_v2f32_v1i64(<1 x i64>* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call <2 x float> @test_v2f32_v1i64_helper(<1 x i64> %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v2i32: +declare <2 x float> @test_v2f32_v2i32_helper(<2 x i32> %p) +define void @test_v2f32_v2i32(<2 x i32>* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call <2 x float> @test_v2f32_v2i32_helper(<2 x i32> %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v4i16: +declare <2 x float> @test_v2f32_v4i16_helper(<4 x i16> %p) +define void @test_v2f32_v4i16(<4 x i16>* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call <2 x float> @test_v2f32_v4i16_helper(<4 x i16> %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2f32_v8i8: +declare <2 x float> @test_v2f32_v8i8_helper(<8 x i8> %p) +define void @test_v2f32_v8i8(<8 x i8>* %p, <2 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call <2 x float> @test_v2f32_v8i8_helper(<8 x i8> %2) + %4 = fadd <2 x float> %3, %3 + store <2 x float> %4, <2 x float>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_i64: +declare <2 x i32> @test_v2i32_i64_helper(i64 %p) +define void @test_v2i32_i64(i64* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call <2 x i32> @test_v2i32_i64_helper(i64 %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_f64: +declare <2 x i32> @test_v2i32_f64_helper(double %p) +define void @test_v2i32_f64(double* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call <2 x i32> @test_v2i32_f64_helper(double %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v1i64: +declare <2 x i32> @test_v2i32_v1i64_helper(<1 x i64> %p) +define void @test_v2i32_v1i64(<1 x i64>* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call <2 x i32> @test_v2i32_v1i64_helper(<1 x i64> %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v2f32: +declare <2 x i32> @test_v2i32_v2f32_helper(<2 x float> %p) +define void @test_v2i32_v2f32(<2 x float>* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call <2 x i32> @test_v2i32_v2f32_helper(<2 x float> %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v4i16: +declare <2 x i32> @test_v2i32_v4i16_helper(<4 x i16> %p) +define void @test_v2i32_v4i16(<4 x i16>* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call <2 x i32> @test_v2i32_v4i16_helper(<4 x i16> %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v2i32_v8i8: +declare <2 x i32> @test_v2i32_v8i8_helper(<8 x i8> %p) +define void @test_v2i32_v8i8(<8 x i8>* %p, <2 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.2s + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call <2 x i32> @test_v2i32_v8i8_helper(<8 x i8> %2) + %4 = add <2 x i32> %3, %3 + store <2 x i32> %4, <2 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_i64: +declare <4 x i16> @test_v4i16_i64_helper(i64 %p) +define void @test_v4i16_i64(i64* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call <4 x i16> @test_v4i16_i64_helper(i64 %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_f64: +declare <4 x i16> @test_v4i16_f64_helper(double %p) +define void @test_v4i16_f64(double* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call <4 x i16> @test_v4i16_f64_helper(double %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v1i64: +declare <4 x i16> @test_v4i16_v1i64_helper(<1 x i64> %p) +define void @test_v4i16_v1i64(<1 x i64>* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call <4 x i16> @test_v4i16_v1i64_helper(<1 x i64> %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v2f32: +declare <4 x i16> @test_v4i16_v2f32_helper(<2 x float> %p) +define void @test_v4i16_v2f32(<2 x float>* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call <4 x i16> @test_v4i16_v2f32_helper(<2 x float> %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v2i32: +declare <4 x i16> @test_v4i16_v2i32_helper(<2 x i32> %p) +define void @test_v4i16_v2i32(<2 x i32>* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call <4 x i16> @test_v4i16_v2i32_helper(<2 x i32> %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v4i16_v8i8: +declare <4 x i16> @test_v4i16_v8i8_helper(<8 x i8> %p) +define void @test_v4i16_v8i8(<8 x i8>* %p, <4 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b +; CHECK: rev64 v{{[0-9]+}}.4h + %1 = load <8 x i8>* %p + %2 = add <8 x i8> %1, %1 + %3 = call <4 x i16> @test_v4i16_v8i8_helper(<8 x i8> %2) + %4 = add <4 x i16> %3, %3 + store <4 x i16> %4, <4 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_i64: +declare <8 x i8> @test_v8i8_i64_helper(i64 %p) +define void @test_v8i8_i64(i64* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load i64* %p + %2 = add i64 %1, %1 + %3 = call <8 x i8> @test_v8i8_i64_helper(i64 %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_f64: +declare <8 x i8> @test_v8i8_f64_helper(double %p) +define void @test_v8i8_f64(double* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load double* %p + %2 = fadd double %1, %1 + %3 = call <8 x i8> @test_v8i8_f64_helper(double %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v1i64: +declare <8 x i8> @test_v8i8_v1i64_helper(<1 x i64> %p) +define void @test_v8i8_v1i64(<1 x i64>* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <1 x i64>* %p + %2 = add <1 x i64> %1, %1 + %3 = call <8 x i8> @test_v8i8_v1i64_helper(<1 x i64> %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v2f32: +declare <8 x i8> @test_v8i8_v2f32_helper(<2 x float> %p) +define void @test_v8i8_v2f32(<2 x float>* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <2 x float>* %p + %2 = fadd <2 x float> %1, %1 + %3 = call <8 x i8> @test_v8i8_v2f32_helper(<2 x float> %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v2i32: +declare <8 x i8> @test_v8i8_v2i32_helper(<2 x i32> %p) +define void @test_v8i8_v2i32(<2 x i32>* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.2s +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <2 x i32>* %p + %2 = add <2 x i32> %1, %1 + %3 = call <8 x i8> @test_v8i8_v2i32_helper(<2 x i32> %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v8i8_v4i16: +declare <8 x i8> @test_v8i8_v4i16_helper(<4 x i16> %p) +define void @test_v8i8_v4i16(<4 x i16>* %p, <8 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4h +; CHECK: rev64 v{{[0-9]+}}.8b + %1 = load <4 x i16>* %p + %2 = add <4 x i16> %1, %1 + %3 = call <8 x i8> @test_v8i8_v4i16_helper(<4 x i16> %2) + %4 = add <8 x i8> %3, %3 + store <8 x i8> %4, <8 x i8>* %q + ret void +} + +; CHECK-LABEL: test_f128_v2f64: +declare fp128 @test_f128_v2f64_helper(<2 x double> %p) +define void @test_f128_v2f64(<2 x double>* %p, fp128* %q) { +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call fp128 @test_f128_v2f64_helper(<2 x double> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v2i64: +declare fp128 @test_f128_v2i64_helper(<2 x i64> %p) +define void @test_f128_v2i64(<2 x i64>* %p, fp128* %q) { +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call fp128 @test_f128_v2i64_helper(<2 x i64> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v4f32: +declare fp128 @test_f128_v4f32_helper(<4 x float> %p) +define void @test_f128_v4f32(<4 x float>* %p, fp128* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call fp128 @test_f128_v4f32_helper(<4 x float> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v4i32: +declare fp128 @test_f128_v4i32_helper(<4 x i32> %p) +define void @test_f128_v4i32(<4 x i32>* %p, fp128* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call fp128 @test_f128_v4i32_helper(<4 x i32> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v8i16: +declare fp128 @test_f128_v8i16_helper(<8 x i16> %p) +define void @test_f128_v8i16(<8 x i16>* %p, fp128* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call fp128 @test_f128_v8i16_helper(<8 x i16> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_f128_v16i8: +declare fp128 @test_f128_v16i8_helper(<16 x i8> %p) +define void @test_f128_v16i8(<16 x i8>* %p, fp128* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call fp128 @test_f128_v16i8_helper(<16 x i8> %2) + %4 = fadd fp128 %3, %3 + store fp128 %4, fp128* %q + ret void +} + +; CHECK-LABEL: test_v2f64_f128: +declare <2 x double> @test_v2f64_f128_helper(fp128 %p) +define void @test_v2f64_f128(fp128* %p, <2 x double>* %q) { +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <2 x double> @test_v2f64_f128_helper(fp128 %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v2i64: +declare <2 x double> @test_v2f64_v2i64_helper(<2 x i64> %p) +define void @test_v2f64_v2i64(<2 x i64>* %p, <2 x double>* %q) { +; CHECK: ext +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call <2 x double> @test_v2f64_v2i64_helper(<2 x i64> %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v4f32: +declare <2 x double> @test_v2f64_v4f32_helper(<4 x float> %p) +define void @test_v2f64_v4f32(<4 x float>* %p, <2 x double>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call <2 x double> @test_v2f64_v4f32_helper(<4 x float> %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v4i32: +declare <2 x double> @test_v2f64_v4i32_helper(<4 x i32> %p) +define void @test_v2f64_v4i32(<4 x i32>* %p, <2 x double>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call <2 x double> @test_v2f64_v4i32_helper(<4 x i32> %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v8i16: +declare <2 x double> @test_v2f64_v8i16_helper(<8 x i16> %p) +define void @test_v2f64_v8i16(<8 x i16>* %p, <2 x double>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call <2 x double> @test_v2f64_v8i16_helper(<8 x i16> %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2f64_v16i8: +declare <2 x double> @test_v2f64_v16i8_helper(<16 x i8> %p) +define void @test_v2f64_v16i8(<16 x i8>* %p, <2 x double>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call <2 x double> @test_v2f64_v16i8_helper(<16 x i8> %2) + %4 = fadd <2 x double> %3, %3 + store <2 x double> %4, <2 x double>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_f128: +declare <2 x i64> @test_v2i64_f128_helper(fp128 %p) +define void @test_v2i64_f128(fp128* %p, <2 x i64>* %q) { +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <2 x i64> @test_v2i64_f128_helper(fp128 %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v2f64: +declare <2 x i64> @test_v2i64_v2f64_helper(<2 x double> %p) +define void @test_v2i64_v2f64(<2 x double>* %p, <2 x i64>* %q) { +; CHECK: ext +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call <2 x i64> @test_v2i64_v2f64_helper(<2 x double> %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v4f32: +declare <2 x i64> @test_v2i64_v4f32_helper(<4 x float> %p) +define void @test_v2i64_v4f32(<4 x float>* %p, <2 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call <2 x i64> @test_v2i64_v4f32_helper(<4 x float> %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v4i32: +declare <2 x i64> @test_v2i64_v4i32_helper(<4 x i32> %p) +define void @test_v2i64_v4i32(<4 x i32>* %p, <2 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call <2 x i64> @test_v2i64_v4i32_helper(<4 x i32> %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v8i16: +declare <2 x i64> @test_v2i64_v8i16_helper(<8 x i16> %p) +define void @test_v2i64_v8i16(<8 x i16>* %p, <2 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call <2 x i64> @test_v2i64_v8i16_helper(<8 x i16> %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v2i64_v16i8: +declare <2 x i64> @test_v2i64_v16i8_helper(<16 x i8> %p) +define void @test_v2i64_v16i8(<16 x i8>* %p, <2 x i64>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call <2 x i64> @test_v2i64_v16i8_helper(<16 x i8> %2) + %4 = add <2 x i64> %3, %3 + store <2 x i64> %4, <2 x i64>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_f128: +declare <4 x float> @test_v4f32_f128_helper(fp128 %p) +define void @test_v4f32_f128(fp128* %p, <4 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <4 x float> @test_v4f32_f128_helper(fp128 %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v2f64: +declare <4 x float> @test_v4f32_v2f64_helper(<2 x double> %p) +define void @test_v4f32_v2f64(<2 x double>* %p, <4 x float>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call <4 x float> @test_v4f32_v2f64_helper(<2 x double> %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v2i64: +declare <4 x float> @test_v4f32_v2i64_helper(<2 x i64> %p) +define void @test_v4f32_v2i64(<2 x i64>* %p, <4 x float>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call <4 x float> @test_v4f32_v2i64_helper(<2 x i64> %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v4i32: +declare <4 x float> @test_v4f32_v4i32_helper(<4 x i32> %p) +define void @test_v4f32_v4i32(<4 x i32>* %p, <4 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call <4 x float> @test_v4f32_v4i32_helper(<4 x i32> %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v8i16: +declare <4 x float> @test_v4f32_v8i16_helper(<8 x i16> %p) +define void @test_v4f32_v8i16(<8 x i16>* %p, <4 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call <4 x float> @test_v4f32_v8i16_helper(<8 x i16> %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4f32_v16i8: +declare <4 x float> @test_v4f32_v16i8_helper(<16 x i8> %p) +define void @test_v4f32_v16i8(<16 x i8>* %p, <4 x float>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call <4 x float> @test_v4f32_v16i8_helper(<16 x i8> %2) + %4 = fadd <4 x float> %3, %3 + store <4 x float> %4, <4 x float>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_f128: +declare <4 x i32> @test_v4i32_f128_helper(fp128 %p) +define void @test_v4i32_f128(fp128* %p, <4 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <4 x i32> @test_v4i32_f128_helper(fp128 %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v2f64: +declare <4 x i32> @test_v4i32_v2f64_helper(<2 x double> %p) +define void @test_v4i32_v2f64(<2 x double>* %p, <4 x i32>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call <4 x i32> @test_v4i32_v2f64_helper(<2 x double> %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v2i64: +declare <4 x i32> @test_v4i32_v2i64_helper(<2 x i64> %p) +define void @test_v4i32_v2i64(<2 x i64>* %p, <4 x i32>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call <4 x i32> @test_v4i32_v2i64_helper(<2 x i64> %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v4f32: +declare <4 x i32> @test_v4i32_v4f32_helper(<4 x float> %p) +define void @test_v4i32_v4f32(<4 x float>* %p, <4 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call <4 x i32> @test_v4i32_v4f32_helper(<4 x float> %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v8i16: +declare <4 x i32> @test_v4i32_v8i16_helper(<8 x i16> %p) +define void @test_v4i32_v8i16(<8 x i16>* %p, <4 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call <4 x i32> @test_v4i32_v8i16_helper(<8 x i16> %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v4i32_v16i8: +declare <4 x i32> @test_v4i32_v16i8_helper(<16 x i8> %p) +define void @test_v4i32_v16i8(<16 x i8>* %p, <4 x i32>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call <4 x i32> @test_v4i32_v16i8_helper(<16 x i8> %2) + %4 = add <4 x i32> %3, %3 + store <4 x i32> %4, <4 x i32>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_f128: +declare <8 x i16> @test_v8i16_f128_helper(fp128 %p) +define void @test_v8i16_f128(fp128* %p, <8 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <8 x i16> @test_v8i16_f128_helper(fp128 %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v2f64: +declare <8 x i16> @test_v8i16_v2f64_helper(<2 x double> %p) +define void @test_v8i16_v2f64(<2 x double>* %p, <8 x i16>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call <8 x i16> @test_v8i16_v2f64_helper(<2 x double> %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v2i64: +declare <8 x i16> @test_v8i16_v2i64_helper(<2 x i64> %p) +define void @test_v8i16_v2i64(<2 x i64>* %p, <8 x i16>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call <8 x i16> @test_v8i16_v2i64_helper(<2 x i64> %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v4f32: +declare <8 x i16> @test_v8i16_v4f32_helper(<4 x float> %p) +define void @test_v8i16_v4f32(<4 x float>* %p, <8 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call <8 x i16> @test_v8i16_v4f32_helper(<4 x float> %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v4i32: +declare <8 x i16> @test_v8i16_v4i32_helper(<4 x i32> %p) +define void @test_v8i16_v4i32(<4 x i32>* %p, <8 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call <8 x i16> @test_v8i16_v4i32_helper(<4 x i32> %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v8i16_v16i8: +declare <8 x i16> @test_v8i16_v16i8_helper(<16 x i8> %p) +define void @test_v8i16_v16i8(<16 x i8>* %p, <8 x i16>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext + %1 = load <16 x i8>* %p + %2 = add <16 x i8> %1, %1 + %3 = call <8 x i16> @test_v8i16_v16i8_helper(<16 x i8> %2) + %4 = add <8 x i16> %3, %3 + store <8 x i16> %4, <8 x i16>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_f128: +declare <16 x i8> @test_v16i8_f128_helper(fp128 %p) +define void @test_v16i8_f128(fp128* %p, <16 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load fp128* %p + %2 = fadd fp128 %1, %1 + %3 = call <16 x i8> @test_v16i8_f128_helper(fp128 %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v2f64: +declare <16 x i8> @test_v16i8_v2f64_helper(<2 x double> %p) +define void @test_v16i8_v2f64(<2 x double>* %p, <16 x i8>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <2 x double>* %p + %2 = fadd <2 x double> %1, %1 + %3 = call <16 x i8> @test_v16i8_v2f64_helper(<2 x double> %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v2i64: +declare <16 x i8> @test_v16i8_v2i64_helper(<2 x i64> %p) +define void @test_v16i8_v2i64(<2 x i64>* %p, <16 x i8>* %q) { +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <2 x i64>* %p + %2 = add <2 x i64> %1, %1 + %3 = call <16 x i8> @test_v16i8_v2i64_helper(<2 x i64> %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v4f32: +declare <16 x i8> @test_v16i8_v4f32_helper(<4 x float> %p) +define void @test_v16i8_v4f32(<4 x float>* %p, <16 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <4 x float>* %p + %2 = fadd <4 x float> %1, %1 + %3 = call <16 x i8> @test_v16i8_v4f32_helper(<4 x float> %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v4i32: +declare <16 x i8> @test_v16i8_v4i32_helper(<4 x i32> %p) +define void @test_v16i8_v4i32(<4 x i32>* %p, <16 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.4s +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <4 x i32>* %p + %2 = add <4 x i32> %1, %1 + %3 = call <16 x i8> @test_v16i8_v4i32_helper(<4 x i32> %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} + +; CHECK-LABEL: test_v16i8_v8i16: +declare <16 x i8> @test_v16i8_v8i16_helper(<8 x i16> %p) +define void @test_v16i8_v8i16(<8 x i16>* %p, <16 x i8>* %q) { +; CHECK: rev64 v{{[0-9]+}}.8h +; CHECK: ext +; CHECK: rev64 v{{[0-9]+}}.16b +; CHECK: ext + %1 = load <8 x i16>* %p + %2 = add <8 x i16> %1, %1 + %3 = call <16 x i8> @test_v16i8_v8i16_helper(<8 x i16> %2) + %4 = add <16 x i8> %3, %3 + store <16 x i8> %4, <16 x i8>* %q + ret void +} diff --git a/test/CodeGen/AArch64/arm64-big-imm-offsets.ll b/test/CodeGen/AArch64/arm64-big-imm-offsets.ll new file mode 100644 index 000000000000..a56df07a49ac --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-imm-offsets.ll @@ -0,0 +1,14 @@ +; RUN: llc -march=arm64 < %s + + +; Make sure large offsets aren't mistaken for valid immediate offsets. +; +define void @f(i32* nocapture %p) { +entry: + %a = ptrtoint i32* %p to i64 + %ao = add i64 %a, 25769803792 + %b = inttoptr i64 %ao to i32* + store volatile i32 0, i32* %b, align 4 + store volatile i32 0, i32* %b, align 4 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-big-stack.ll b/test/CodeGen/AArch64/arm64-big-stack.ll new file mode 100644 index 000000000000..3f91bb3c2482 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-big-stack.ll @@ -0,0 +1,21 @@ +; RUN: llc < %s | FileCheck %s +target triple = "arm64-apple-macosx10" + +; Check that big stacks are generated correctly. +; Currently, this is done by a sequence of sub instructions, +; which can encode immediate with a 12 bits mask an optionally +; shift left (up to 12). I.e., 16773120 is the biggest value. +; +; CHECK-LABEL: foo: +; CHECK: sub sp, sp, #4095, lsl #12 +; CHECK: sub sp, sp, #4095, lsl #12 +; CHECK: sub sp, sp, #2, lsl #12 +define void @foo() nounwind ssp { +entry: + %buffer = alloca [33554432 x i8], align 1 + %arraydecay = getelementptr inbounds [33554432 x i8]* %buffer, i64 0, i64 0 + call void @doit(i8* %arraydecay) nounwind + ret void +} + +declare void @doit(i8*) diff --git a/test/CodeGen/AArch64/arm64-bitfield-extract.ll b/test/CodeGen/AArch64/arm64-bitfield-extract.ll new file mode 100644 index 000000000000..112efddd4fad --- /dev/null +++ b/test/CodeGen/AArch64/arm64-bitfield-extract.ll @@ -0,0 +1,532 @@ +; RUN: opt -codegenprepare -mtriple=arm64-apple=ios -S -o - %s | FileCheck --check-prefix=OPT %s +; RUN: llc < %s -march=arm64 | FileCheck %s +%struct.X = type { i8, i8, [2 x i8] } +%struct.Y = type { i32, i8 } +%struct.Z = type { i8, i8, [2 x i8], i16 } +%struct.A = type { i64, i8 } + +define void @foo(%struct.X* nocapture %x, %struct.Y* nocapture %y) nounwind optsize ssp { +; CHECK-LABEL: foo: +; CHECK: ubfx +; CHECK-NOT: and +; CHECK: ret + + %tmp = bitcast %struct.X* %x to i32* + %tmp1 = load i32* %tmp, align 4 + %b = getelementptr inbounds %struct.Y* %y, i64 0, i32 1 + %bf.clear = lshr i32 %tmp1, 3 + %bf.clear.lobit = and i32 %bf.clear, 1 + %frombool = trunc i32 %bf.clear.lobit to i8 + store i8 %frombool, i8* %b, align 1 + ret void +} + +define i32 @baz(i64 %cav1.coerce) nounwind { +; CHECK-LABEL: baz: +; CHECK: sbfx w0, w0, #0, #4 + %tmp = trunc i64 %cav1.coerce to i32 + %tmp1 = shl i32 %tmp, 28 + %bf.val.sext = ashr exact i32 %tmp1, 28 + ret i32 %bf.val.sext +} + +define i32 @bar(i64 %cav1.coerce) nounwind { +; CHECK-LABEL: bar: +; CHECK: sbfx w0, w0, #4, #6 + %tmp = trunc i64 %cav1.coerce to i32 + %cav1.sroa.0.1.insert = shl i32 %tmp, 22 + %tmp1 = ashr i32 %cav1.sroa.0.1.insert, 26 + ret i32 %tmp1 +} + +define void @fct1(%struct.Z* nocapture %x, %struct.A* nocapture %y) nounwind optsize ssp { +; CHECK-LABEL: fct1: +; CHECK: ubfx +; CHECK-NOT: and +; CHECK: ret + + %tmp = bitcast %struct.Z* %x to i64* + %tmp1 = load i64* %tmp, align 4 + %b = getelementptr inbounds %struct.A* %y, i64 0, i32 0 + %bf.clear = lshr i64 %tmp1, 3 + %bf.clear.lobit = and i64 %bf.clear, 1 + store i64 %bf.clear.lobit, i64* %b, align 8 + ret void +} + +define i64 @fct2(i64 %cav1.coerce) nounwind { +; CHECK-LABEL: fct2: +; CHECK: sbfx x0, x0, #0, #36 + %tmp = shl i64 %cav1.coerce, 28 + %bf.val.sext = ashr exact i64 %tmp, 28 + ret i64 %bf.val.sext +} + +define i64 @fct3(i64 %cav1.coerce) nounwind { +; CHECK-LABEL: fct3: +; CHECK: sbfx x0, x0, #4, #38 + %cav1.sroa.0.1.insert = shl i64 %cav1.coerce, 22 + %tmp1 = ashr i64 %cav1.sroa.0.1.insert, 26 + ret i64 %tmp1 +} + +define void @fct4(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct4: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #16, #24 +; CHECK-NEXT: str [[REG1]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -16777216 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 16777215 + %or = or i64 %and, %and1 + store i64 %or, i64* %y, align 8 + ret void +} + +define void @fct5(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct5: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #16, #3 +; CHECK-NEXT: str [[REG1]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -8 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 7 + %or = or i32 %and, %and1 + store i32 %or, i32* %y, align 8 + ret void +} + +; Check if we can still catch bfm instruction when we drop some low bits +define void @fct6(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct6: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: lsr [[REG2:w[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -8 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 7 + %or = or i32 %and, %and1 + %shr1 = lshr i32 %or, 2 + store i32 %shr1, i32* %y, align 8 + ret void +} + + +; Check if we can still catch bfm instruction when we drop some high bits +define void @fct7(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct7: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #16, #3 +; lsl is an alias of ubfm +; CHECK-NEXT: lsl [[REG2:w[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -8 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 7 + %or = or i32 %and, %and1 + %shl = shl i32 %or, 2 + store i32 %shl, i32* %y, align 8 + ret void +} + + +; Check if we can still catch bfm instruction when we drop some low bits +; (i64 version) +define void @fct8(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct8: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: lsr [[REG2:x[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -8 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 7 + %or = or i64 %and, %and1 + %shr1 = lshr i64 %or, 2 + store i64 %shr1, i64* %y, align 8 + ret void +} + + +; Check if we can still catch bfm instruction when we drop some high bits +; (i64 version) +define void @fct9(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct9: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: lsl [[REG2:x[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -8 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 7 + %or = or i64 %and, %and1 + %shl = shl i64 %or, 2 + store i64 %shl, i64* %y, align 8 + ret void +} + +; Check if we can catch bfm instruction when lsb is 0 (i.e., no lshr) +; (i32 version) +define void @fct10(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct10: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #0, #3 +; lsl is an alias of ubfm +; CHECK-NEXT: lsl [[REG2:w[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -8 + %and1 = and i32 %x, 7 + %or = or i32 %and, %and1 + %shl = shl i32 %or, 2 + store i32 %shl, i32* %y, align 8 + ret void +} + +; Check if we can catch bfm instruction when lsb is 0 (i.e., no lshr) +; (i64 version) +define void @fct11(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct11: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #0, #3 +; lsl is an alias of ubfm +; CHECK-NEXT: lsl [[REG2:x[0-9]+]], [[REG1]], #2 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -8 + %and1 = and i64 %x, 7 + %or = or i64 %and, %and1 + %shl = shl i64 %or, 2 + store i64 %shl, i64* %y, align 8 + ret void +} + +define zeroext i1 @fct12bis(i32 %tmp2) unnamed_addr nounwind ssp align 2 { +; CHECK-LABEL: fct12bis: +; CHECK-NOT: and +; CHECK: ubfx w0, w0, #11, #1 + %and.i.i = and i32 %tmp2, 2048 + %tobool.i.i = icmp ne i32 %and.i.i, 0 + ret i1 %tobool.i.i +} + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits +define void @fct12(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct12: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: ubfx [[REG2:w[0-9]+]], [[REG1]], #2, #28 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -8 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 7 + %or = or i32 %and, %and1 + %shl = shl i32 %or, 2 + %shr2 = lshr i32 %shl, 4 + store i32 %shr2, i32* %y, align 8 + ret void +} + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits +; (i64 version) +define void @fct13(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct13: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: ubfx [[REG2:x[0-9]+]], [[REG1]], #2, #60 +; CHECK-NEXT: str [[REG2]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -8 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 7 + %or = or i64 %and, %and1 + %shl = shl i64 %or, 2 + %shr2 = lshr i64 %shl, 4 + store i64 %shr2, i64* %y, align 8 + ret void +} + + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits +define void @fct14(i32* nocapture %y, i32 %x, i32 %x1) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct14: +; CHECK: ldr [[REG1:w[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], w1, #16, #8 +; lsr is an alias of ubfm +; CHECK-NEXT: lsr [[REG2:w[0-9]+]], [[REG1]], #4 +; CHECK-NEXT: bfxil [[REG2]], w2, #5, #3 +; lsl is an alias of ubfm +; CHECK-NEXT: lsl [[REG3:w[0-9]+]], [[REG2]], #2 +; CHECK-NEXT: str [[REG3]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, -256 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 255 + %or = or i32 %and, %and1 + %shl = lshr i32 %or, 4 + %and2 = and i32 %shl, -8 + %shr1 = lshr i32 %x1, 5 + %and3 = and i32 %shr1, 7 + %or1 = or i32 %and2, %and3 + %shl1 = shl i32 %or1, 2 + store i32 %shl1, i32* %y, align 8 + ret void +} + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits +; (i64 version) +define void @fct15(i64* nocapture %y, i64 %x, i64 %x1) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct15: +; CHECK: ldr [[REG1:x[0-9]+]], +; CHECK-NEXT: bfxil [[REG1]], x1, #16, #8 +; lsr is an alias of ubfm +; CHECK-NEXT: lsr [[REG2:x[0-9]+]], [[REG1]], #4 +; CHECK-NEXT: bfxil [[REG2]], x2, #5, #3 +; lsl is an alias of ubfm +; CHECK-NEXT: lsl [[REG3:x[0-9]+]], [[REG2]], #2 +; CHECK-NEXT: str [[REG3]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, -256 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 255 + %or = or i64 %and, %and1 + %shl = lshr i64 %or, 4 + %and2 = and i64 %shl, -8 + %shr1 = lshr i64 %x1, 5 + %and3 = and i64 %shr1, 7 + %or1 = or i64 %and2, %and3 + %shl1 = shl i64 %or1, 2 + store i64 %shl1, i64* %y, align 8 + ret void +} + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits and a masking operation has to be kept +define void @fct16(i32* nocapture %y, i32 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct16: +; CHECK: ldr [[REG1:w[0-9]+]], +; Create the constant +; CHECK: movz [[REGCST:w[0-9]+]], #0x1a, lsl #16 +; CHECK: movk [[REGCST]], #0x8160 +; Do the masking +; CHECK: and [[REG2:w[0-9]+]], [[REG1]], [[REGCST]] +; CHECK-NEXT: bfxil [[REG2]], w1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: ubfx [[REG3:w[0-9]+]], [[REG2]], #2, #28 +; CHECK-NEXT: str [[REG3]], +; CHECK-NEXT: ret + %0 = load i32* %y, align 8 + %and = and i32 %0, 1737056 + %shr = lshr i32 %x, 16 + %and1 = and i32 %shr, 7 + %or = or i32 %and, %and1 + %shl = shl i32 %or, 2 + %shr2 = lshr i32 %shl, 4 + store i32 %shr2, i32* %y, align 8 + ret void +} + + +; Check if we can still catch bfm instruction when we drop some high bits +; and some low bits and a masking operation has to be kept +; (i64 version) +define void @fct17(i64* nocapture %y, i64 %x) nounwind optsize inlinehint ssp { +entry: +; CHECK-LABEL: fct17: +; CHECK: ldr [[REG1:x[0-9]+]], +; Create the constant +; CHECK: movz w[[REGCST:[0-9]+]], #0x1a, lsl #16 +; CHECK: movk w[[REGCST]], #0x8160 +; Do the masking +; CHECK: and [[REG2:x[0-9]+]], [[REG1]], x[[REGCST]] +; CHECK-NEXT: bfxil [[REG2]], x1, #16, #3 +; lsr is an alias of ubfm +; CHECK-NEXT: ubfx [[REG3:x[0-9]+]], [[REG2]], #2, #60 +; CHECK-NEXT: str [[REG3]], +; CHECK-NEXT: ret + %0 = load i64* %y, align 8 + %and = and i64 %0, 1737056 + %shr = lshr i64 %x, 16 + %and1 = and i64 %shr, 7 + %or = or i64 %and, %and1 + %shl = shl i64 %or, 2 + %shr2 = lshr i64 %shl, 4 + store i64 %shr2, i64* %y, align 8 + ret void +} + +define i64 @fct18(i32 %xor72) nounwind ssp { +; CHECK-LABEL: fct18: +; CHECK: ubfx x0, x0, #9, #8 + %shr81 = lshr i32 %xor72, 9 + %conv82 = zext i32 %shr81 to i64 + %result = and i64 %conv82, 255 + ret i64 %result +} + +; Using the access to the global array to keep the instruction and control flow. +@first_ones = external global [65536 x i8] + +; Function Attrs: nounwind readonly ssp +define i32 @fct19(i64 %arg1) nounwind readonly ssp { +; CHECK-LABEL: fct19: +entry: + %x.sroa.1.0.extract.shift = lshr i64 %arg1, 16 + %x.sroa.1.0.extract.trunc = trunc i64 %x.sroa.1.0.extract.shift to i16 + %x.sroa.3.0.extract.shift = lshr i64 %arg1, 32 + %x.sroa.5.0.extract.shift = lshr i64 %arg1, 48 + %tobool = icmp eq i64 %x.sroa.5.0.extract.shift, 0 + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %arrayidx3 = getelementptr inbounds [65536 x i8]* @first_ones, i64 0, i64 %x.sroa.5.0.extract.shift + %0 = load i8* %arrayidx3, align 1 + %conv = zext i8 %0 to i32 + br label %return + +; OPT-LABEL: if.end +if.end: ; preds = %entry +; OPT: lshr +; CHECK: ubfx [[REG1:x[0-9]+]], [[REG2:x[0-9]+]], #32, #16 + %x.sroa.3.0.extract.trunc = trunc i64 %x.sroa.3.0.extract.shift to i16 + %tobool6 = icmp eq i16 %x.sroa.3.0.extract.trunc, 0 +; CHECK: cbz + br i1 %tobool6, label %if.end13, label %if.then7 + +; OPT-LABEL: if.then7 +if.then7: ; preds = %if.end +; OPT: lshr +; "and" should be combined to "ubfm" while "ubfm" should be removed by cse. +; So neither of them should be in the assemble code. +; CHECK-NOT: and +; CHECK-NOT: ubfm + %idxprom10 = and i64 %x.sroa.3.0.extract.shift, 65535 + %arrayidx11 = getelementptr inbounds [65536 x i8]* @first_ones, i64 0, i64 %idxprom10 + %1 = load i8* %arrayidx11, align 1 + %conv12 = zext i8 %1 to i32 + %add = add nsw i32 %conv12, 16 + br label %return + +; OPT-LABEL: if.end13 +if.end13: ; preds = %if.end +; OPT: lshr +; OPT: trunc +; CHECK: ubfx [[REG3:x[0-9]+]], [[REG4:x[0-9]+]], #16, #16 + %tobool16 = icmp eq i16 %x.sroa.1.0.extract.trunc, 0 +; CHECK: cbz + br i1 %tobool16, label %return, label %if.then17 + +; OPT-LABEL: if.then17 +if.then17: ; preds = %if.end13 +; OPT: lshr +; "and" should be combined to "ubfm" while "ubfm" should be removed by cse. +; So neither of them should be in the assemble code. +; CHECK-NOT: and +; CHECK-NOT: ubfm + %idxprom20 = and i64 %x.sroa.1.0.extract.shift, 65535 + %arrayidx21 = getelementptr inbounds [65536 x i8]* @first_ones, i64 0, i64 %idxprom20 + %2 = load i8* %arrayidx21, align 1 + %conv22 = zext i8 %2 to i32 + %add23 = add nsw i32 %conv22, 32 + br label %return + +return: ; preds = %if.end13, %if.then17, %if.then7, %if.then +; CHECK: ret + %retval.0 = phi i32 [ %conv, %if.then ], [ %add, %if.then7 ], [ %add23, %if.then17 ], [ 64, %if.end13 ] + ret i32 %retval.0 +} + +; Make sure we do not assert if the immediate in and is bigger than i64. +; PR19503. +; OPT-LABEL: @fct20 +; OPT: lshr +; OPT-NOT: lshr +; OPT: ret +; CHECK-LABEL: fct20: +; CHECK: ret +define i80 @fct20(i128 %a, i128 %b) { +entry: + %shr = lshr i128 %a, 18 + %conv = trunc i128 %shr to i80 + %tobool = icmp eq i128 %b, 0 + br i1 %tobool, label %then, label %end +then: + %and = and i128 %shr, 483673642326615442599424 + %conv2 = trunc i128 %and to i80 + br label %end +end: + %conv3 = phi i80 [%conv, %entry], [%conv2, %then] + ret i80 %conv3 +} + +; Check if we can still catch UBFX when "AND" is used by SHL. +; CHECK-LABEL: fct21: +; CHECK: ubfx +@arr = external global [8 x [64 x i64]] +define i64 @fct21(i64 %x) { +entry: + %shr = lshr i64 %x, 4 + %and = and i64 %shr, 15 + %arrayidx = getelementptr inbounds [8 x [64 x i64]]* @arr, i64 0, i64 0, i64 %and + %0 = load i64* %arrayidx, align 8 + ret i64 %0 +} + +define i16 @test_ignored_rightbits(i32 %dst, i32 %in) { +; CHECK-LABEL: test_ignored_rightbits: + + %positioned_field = shl i32 %in, 3 + %positioned_masked_field = and i32 %positioned_field, 120 + %masked_dst = and i32 %dst, 7 + %insertion = or i32 %masked_dst, %positioned_masked_field +; CHECK: {{bfm|bfi|bfxil}} + + %shl16 = shl i32 %insertion, 8 + %or18 = or i32 %shl16, %insertion + %conv19 = trunc i32 %or18 to i16 +; CHECK: bfi {{w[0-9]+}}, {{w[0-9]+}}, #8, #7 + + ret i16 %conv19 +} diff --git a/test/CodeGen/AArch64/arm64-blockaddress.ll b/test/CodeGen/AArch64/arm64-blockaddress.ll new file mode 100644 index 000000000000..ac4f19e65dff --- /dev/null +++ b/test/CodeGen/AArch64/arm64-blockaddress.ll @@ -0,0 +1,30 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s +; RUN: llc < %s -mtriple=arm64-linux-gnu | FileCheck %s --check-prefix=CHECK-LINUX +; RUN: llc < %s -mtriple=arm64-linux-gnu -code-model=large| FileCheck %s --check-prefix=CHECK-LARGE + +; rdar://9188695 + +define i64 @t() nounwind ssp { +entry: +; CHECK-LABEL: t: +; CHECK: adrp [[REG:x[0-9]+]], Ltmp1@PAGE +; CHECK: add {{x[0-9]+}}, [[REG]], Ltmp1@PAGEOFF + +; CHECK-LINUX-LABEL: t: +; CHECK-LINUX: adrp [[REG:x[0-9]+]], .Ltmp1 +; CHECK-LINUX: add {{x[0-9]+}}, [[REG]], :lo12:.Ltmp1 + +; CHECK-LARGE-LABEL: t: +; CHECK-LARGE: movz [[ADDR_REG:x[0-9]+]], #:abs_g3:[[DEST_LBL:.Ltmp[0-9]+]] +; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g2_nc:[[DEST_LBL]] +; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g1_nc:[[DEST_LBL]] +; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g0_nc:[[DEST_LBL]] + + %recover = alloca i64, align 8 + store volatile i64 ptrtoint (i8* blockaddress(@t, %mylabel) to i64), i64* %recover, align 8 + br label %mylabel + +mylabel: + %tmp = load volatile i64* %recover, align 8 + ret i64 %tmp +} diff --git a/test/CodeGen/AArch64/arm64-build-vector.ll b/test/CodeGen/AArch64/arm64-build-vector.ll new file mode 100644 index 000000000000..d0f6db080551 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-build-vector.ll @@ -0,0 +1,59 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s + +; Check that building up a vector w/ only one non-zero lane initializes +; intelligently. +define void @one_lane(i32* nocapture %out_int, i32 %skip0) nounwind { +; CHECK-LABEL: one_lane: +; CHECK: dup.16b v[[REG:[0-9]+]], wzr +; CHECK-NEXT: ins.b v[[REG]][0], w1 +; v and q are aliases, and str is preferred against st.16b when possible +; rdar://11246289 +; CHECK: str q[[REG]], [x0] +; CHECK: ret + %conv = trunc i32 %skip0 to i8 + %vset_lane = insertelement <16 x i8> , i8 %conv, i32 0 + %tmp = bitcast i32* %out_int to <4 x i32>* + %tmp1 = bitcast <16 x i8> %vset_lane to <4 x i32> + store <4 x i32> %tmp1, <4 x i32>* %tmp, align 16 + ret void +} + +; Check that building a vector from floats doesn't insert an unnecessary +; copy for lane zero. +define <4 x float> @foo(float %a, float %b, float %c, float %d) nounwind { +; CHECK-LABEL: foo: +; CHECK-NOT: ins.s v0[0], v0[0] +; CHECK: ins.s v0[1], v1[0] +; CHECK: ins.s v0[2], v2[0] +; CHECK: ins.s v0[3], v3[0] +; CHECK: ret + %1 = insertelement <4 x float> undef, float %a, i32 0 + %2 = insertelement <4 x float> %1, float %b, i32 1 + %3 = insertelement <4 x float> %2, float %c, i32 2 + %4 = insertelement <4 x float> %3, float %d, i32 3 + ret <4 x float> %4 +} + +define <8 x i16> @build_all_zero(<8 x i16> %a) #1 { +; CHECK-LABEL: build_all_zero: +; CHECK: movz w[[GREG:[0-9]+]], #0xae80 +; CHECK-NEXT: fmov s[[FREG:[0-9]+]], w[[GREG]] +; CHECK-NEXT: mul.8h v0, v0, v[[FREG]] + %b = add <8 x i16> %a, + %c = mul <8 x i16> %b, + ret <8 x i16> %c +} + +; There is an optimization in DAG Combiner as following: +; fold (concat_vectors (BUILD_VECTOR A, B, ...), (BUILD_VECTOR C, D, ...)) +; -> (BUILD_VECTOR A, B, ..., C, D, ...) +; This case checks when A,B and C,D are different types, there should be no +; assertion failure. +define <8 x i16> @concat_2_build_vector(<4 x i16> %in0) { +; CHECK-LABEL: concat_2_build_vector: +; CHECK: movi + %vshl_n = shl <4 x i16> %in0, + %vshl_n2 = shl <4 x i16> %vshl_n, + %shuffle.i = shufflevector <4 x i16> %vshl_n2, <4 x i16> zeroinitializer, <8 x i32> + ret <8 x i16> %shuffle.i +} \ No newline at end of file diff --git a/test/CodeGen/AArch64/arm64-call-tailcalls.ll b/test/CodeGen/AArch64/arm64-call-tailcalls.ll new file mode 100644 index 000000000000..487c1d9bec3b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-call-tailcalls.ll @@ -0,0 +1,91 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s + +@t = weak global i32 ()* null +@x = external global i32, align 4 + +define void @t2() { +; CHECK-LABEL: t2: +; CHECK: adrp x[[GOTADDR:[0-9]+]], _t@GOTPAGE +; CHECK: ldr x[[ADDR:[0-9]+]], [x[[GOTADDR]], _t@GOTPAGEOFF] +; CHECK: ldr x[[DEST:[0-9]+]], [x[[ADDR]]] +; CHECK: br x[[DEST]] + %tmp = load i32 ()** @t + %tmp.upgrd.2 = tail call i32 %tmp() + ret void +} + +define void @t3() { +; CHECK-LABEL: t3: +; CHECK: b _t2 + tail call void @t2() + ret void +} + +define double @t4(double %a) nounwind readonly ssp { +; CHECK-LABEL: t4: +; CHECK: b _sin + %tmp = tail call double @sin(double %a) nounwind readonly + ret double %tmp +} + +define float @t5(float %a) nounwind readonly ssp { +; CHECK-LABEL: t5: +; CHECK: b _sinf + %tmp = tail call float @sinf(float %a) nounwind readonly + ret float %tmp +} + +define void @t7() nounwind { +; CHECK-LABEL: t7: +; CHECK: b _foo +; CHECK: b _bar + + br i1 undef, label %bb, label %bb1.lr.ph + +bb1.lr.ph: ; preds = %entry + tail call void @bar() nounwind + ret void + +bb: ; preds = %entry + tail call void @foo() nounwind + ret void +} + +define i32 @t8(i32 %x) nounwind ssp { +; CHECK-LABEL: t8: +; CHECK: b _a +; CHECK: b _b +; CHECK: b _c + %and = and i32 %x, 1 + %tobool = icmp eq i32 %and, 0 + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %call = tail call i32 @a(i32 %x) nounwind + br label %return + +if.end: ; preds = %entry + %and1 = and i32 %x, 2 + %tobool2 = icmp eq i32 %and1, 0 + br i1 %tobool2, label %if.end5, label %if.then3 + +if.then3: ; preds = %if.end + %call4 = tail call i32 @b(i32 %x) nounwind + br label %return + +if.end5: ; preds = %if.end + %call6 = tail call i32 @c(i32 %x) nounwind + br label %return + +return: ; preds = %if.end5, %if.then3, %if.then + %retval.0 = phi i32 [ %call, %if.then ], [ %call4, %if.then3 ], [ %call6, %if.end5 ] + ret i32 %retval.0 +} + +declare float @sinf(float) nounwind readonly +declare double @sin(double) nounwind readonly +declare void @bar() nounwind +declare void @foo() nounwind +declare i32 @a(i32) +declare i32 @b(i32) +declare i32 @c(i32) diff --git a/test/CodeGen/AArch64/arm64-cast-opt.ll b/test/CodeGen/AArch64/arm64-cast-opt.ll new file mode 100644 index 000000000000..65a871d43685 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-cast-opt.ll @@ -0,0 +1,31 @@ +; RUN: llc -O3 -march=arm64 -mtriple arm64-apple-ios5.0.0 < %s | FileCheck %s +; +; Zero truncation is not necessary when the values are extended properly +; already. + +@block = common global i8* null, align 8 + +define zeroext i8 @foo(i32 %i1, i32 %i2) { +; CHECK-LABEL: foo: +; CHECK: cset +; CHECK-NOT: and +entry: + %idxprom = sext i32 %i1 to i64 + %0 = load i8** @block, align 8 + %arrayidx = getelementptr inbounds i8* %0, i64 %idxprom + %1 = load i8* %arrayidx, align 1 + %idxprom1 = sext i32 %i2 to i64 + %arrayidx2 = getelementptr inbounds i8* %0, i64 %idxprom1 + %2 = load i8* %arrayidx2, align 1 + %cmp = icmp eq i8 %1, %2 + br i1 %cmp, label %return, label %if.then + +if.then: ; preds = %entry + %cmp7 = icmp ugt i8 %1, %2 + %conv9 = zext i1 %cmp7 to i8 + br label %return + +return: ; preds = %entry, %if.then + %retval.0 = phi i8 [ %conv9, %if.then ], [ 1, %entry ] + ret i8 %retval.0 +} diff --git a/test/CodeGen/AArch64/arm64-ccmp-heuristics.ll b/test/CodeGen/AArch64/arm64-ccmp-heuristics.ll new file mode 100644 index 000000000000..664a26cafe4d --- /dev/null +++ b/test/CodeGen/AArch64/arm64-ccmp-heuristics.ll @@ -0,0 +1,190 @@ +; RUN: llc < %s -mcpu=cyclone -verify-machineinstrs -aarch64-ccmp | FileCheck %s +target triple = "arm64-apple-ios7.0.0" + +@channelColumns = external global i64 +@channelTracks = external global i64 +@mazeRoute = external hidden unnamed_addr global i8*, align 8 +@TOP = external global i64* +@BOT = external global i64* +@netsAssign = external global i64* + +; Function from yacr2/maze.c +; The branch at the end of %if.then is driven by %cmp5 and %cmp6. +; Isel converts the and i1 into two branches, and arm64-ccmp should not convert +; it back again. %cmp6 has much higher latency than %cmp5. +; CHECK: Maze1 +; CHECK: %if.then +; CHECK: cmp x{{[0-9]+}}, #2 +; CHECK-NEXT b.cc +; CHECK: %if.then +; CHECK: cmp x{{[0-9]+}}, #2 +; CHECK-NEXT b.cc +define i32 @Maze1() nounwind ssp { +entry: + %0 = load i64* @channelColumns, align 8, !tbaa !0 + %cmp90 = icmp eq i64 %0, 0 + br i1 %cmp90, label %for.end, label %for.body + +for.body: ; preds = %for.inc, %entry + %1 = phi i64 [ %0, %entry ], [ %37, %for.inc ] + %i.092 = phi i64 [ 1, %entry ], [ %inc53, %for.inc ] + %numLeft.091 = phi i32 [ 0, %entry ], [ %numLeft.1, %for.inc ] + %2 = load i8** @mazeRoute, align 8, !tbaa !3 + %arrayidx = getelementptr inbounds i8* %2, i64 %i.092 + %3 = load i8* %arrayidx, align 1, !tbaa !1 + %tobool = icmp eq i8 %3, 0 + br i1 %tobool, label %for.inc, label %if.then + +if.then: ; preds = %for.body + %4 = load i64** @TOP, align 8, !tbaa !3 + %arrayidx1 = getelementptr inbounds i64* %4, i64 %i.092 + %5 = load i64* %arrayidx1, align 8, !tbaa !0 + %6 = load i64** @netsAssign, align 8, !tbaa !3 + %arrayidx2 = getelementptr inbounds i64* %6, i64 %5 + %7 = load i64* %arrayidx2, align 8, !tbaa !0 + %8 = load i64** @BOT, align 8, !tbaa !3 + %arrayidx3 = getelementptr inbounds i64* %8, i64 %i.092 + %9 = load i64* %arrayidx3, align 8, !tbaa !0 + %arrayidx4 = getelementptr inbounds i64* %6, i64 %9 + %10 = load i64* %arrayidx4, align 8, !tbaa !0 + %cmp5 = icmp ugt i64 %i.092, 1 + %cmp6 = icmp ugt i64 %10, 1 + %or.cond = and i1 %cmp5, %cmp6 + br i1 %or.cond, label %land.lhs.true7, label %if.else + +land.lhs.true7: ; preds = %if.then + %11 = load i64* @channelTracks, align 8, !tbaa !0 + %add = add i64 %11, 1 + %call = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 %add, i64 %10, i64 0, i64 %7, i32 -1, i32 -1) + %tobool8 = icmp eq i32 %call, 0 + br i1 %tobool8, label %land.lhs.true7.if.else_crit_edge, label %if.then9 + +land.lhs.true7.if.else_crit_edge: ; preds = %land.lhs.true7 + %.pre = load i64* @channelColumns, align 8, !tbaa !0 + br label %if.else + +if.then9: ; preds = %land.lhs.true7 + %12 = load i8** @mazeRoute, align 8, !tbaa !3 + %arrayidx10 = getelementptr inbounds i8* %12, i64 %i.092 + store i8 0, i8* %arrayidx10, align 1, !tbaa !1 + %13 = load i64** @TOP, align 8, !tbaa !3 + %arrayidx11 = getelementptr inbounds i64* %13, i64 %i.092 + %14 = load i64* %arrayidx11, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %14) + %15 = load i64** @BOT, align 8, !tbaa !3 + %arrayidx12 = getelementptr inbounds i64* %15, i64 %i.092 + %16 = load i64* %arrayidx12, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %16) + br label %for.inc + +if.else: ; preds = %land.lhs.true7.if.else_crit_edge, %if.then + %17 = phi i64 [ %.pre, %land.lhs.true7.if.else_crit_edge ], [ %1, %if.then ] + %cmp13 = icmp ult i64 %i.092, %17 + %or.cond89 = and i1 %cmp13, %cmp6 + br i1 %or.cond89, label %land.lhs.true16, label %if.else24 + +land.lhs.true16: ; preds = %if.else + %18 = load i64* @channelTracks, align 8, !tbaa !0 + %add17 = add i64 %18, 1 + %call18 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 %add17, i64 %10, i64 0, i64 %7, i32 1, i32 -1) + %tobool19 = icmp eq i32 %call18, 0 + br i1 %tobool19, label %if.else24, label %if.then20 + +if.then20: ; preds = %land.lhs.true16 + %19 = load i8** @mazeRoute, align 8, !tbaa !3 + %arrayidx21 = getelementptr inbounds i8* %19, i64 %i.092 + store i8 0, i8* %arrayidx21, align 1, !tbaa !1 + %20 = load i64** @TOP, align 8, !tbaa !3 + %arrayidx22 = getelementptr inbounds i64* %20, i64 %i.092 + %21 = load i64* %arrayidx22, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %21) + %22 = load i64** @BOT, align 8, !tbaa !3 + %arrayidx23 = getelementptr inbounds i64* %22, i64 %i.092 + %23 = load i64* %arrayidx23, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %23) + br label %for.inc + +if.else24: ; preds = %land.lhs.true16, %if.else + br i1 %cmp5, label %land.lhs.true26, label %if.else36 + +land.lhs.true26: ; preds = %if.else24 + %24 = load i64* @channelTracks, align 8, !tbaa !0 + %cmp27 = icmp ult i64 %7, %24 + br i1 %cmp27, label %land.lhs.true28, label %if.else36 + +land.lhs.true28: ; preds = %land.lhs.true26 + %add29 = add i64 %24, 1 + %call30 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 0, i64 %7, i64 %add29, i64 %10, i32 -1, i32 1) + %tobool31 = icmp eq i32 %call30, 0 + br i1 %tobool31, label %if.else36, label %if.then32 + +if.then32: ; preds = %land.lhs.true28 + %25 = load i8** @mazeRoute, align 8, !tbaa !3 + %arrayidx33 = getelementptr inbounds i8* %25, i64 %i.092 + store i8 0, i8* %arrayidx33, align 1, !tbaa !1 + %26 = load i64** @TOP, align 8, !tbaa !3 + %arrayidx34 = getelementptr inbounds i64* %26, i64 %i.092 + %27 = load i64* %arrayidx34, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %27) + %28 = load i64** @BOT, align 8, !tbaa !3 + %arrayidx35 = getelementptr inbounds i64* %28, i64 %i.092 + %29 = load i64* %arrayidx35, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %29) + br label %for.inc + +if.else36: ; preds = %land.lhs.true28, %land.lhs.true26, %if.else24 + %30 = load i64* @channelColumns, align 8, !tbaa !0 + %cmp37 = icmp ult i64 %i.092, %30 + br i1 %cmp37, label %land.lhs.true38, label %if.else48 + +land.lhs.true38: ; preds = %if.else36 + %31 = load i64* @channelTracks, align 8, !tbaa !0 + %cmp39 = icmp ult i64 %7, %31 + br i1 %cmp39, label %land.lhs.true40, label %if.else48 + +land.lhs.true40: ; preds = %land.lhs.true38 + %add41 = add i64 %31, 1 + %call42 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 0, i64 %7, i64 %add41, i64 %10, i32 1, i32 1) + %tobool43 = icmp eq i32 %call42, 0 + br i1 %tobool43, label %if.else48, label %if.then44 + +if.then44: ; preds = %land.lhs.true40 + %32 = load i8** @mazeRoute, align 8, !tbaa !3 + %arrayidx45 = getelementptr inbounds i8* %32, i64 %i.092 + store i8 0, i8* %arrayidx45, align 1, !tbaa !1 + %33 = load i64** @TOP, align 8, !tbaa !3 + %arrayidx46 = getelementptr inbounds i64* %33, i64 %i.092 + %34 = load i64* %arrayidx46, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %34) + %35 = load i64** @BOT, align 8, !tbaa !3 + %arrayidx47 = getelementptr inbounds i64* %35, i64 %i.092 + %36 = load i64* %arrayidx47, align 8, !tbaa !0 + tail call fastcc void @CleanNet(i64 %36) + br label %for.inc + +if.else48: ; preds = %land.lhs.true40, %land.lhs.true38, %if.else36 + %inc = add nsw i32 %numLeft.091, 1 + br label %for.inc + +for.inc: ; preds = %if.else48, %if.then44, %if.then32, %if.then20, %if.then9, %for.body + %numLeft.1 = phi i32 [ %numLeft.091, %if.then9 ], [ %numLeft.091, %if.then20 ], [ %numLeft.091, %if.then32 ], [ %numLeft.091, %if.then44 ], [ %inc, %if.else48 ], [ %numLeft.091, %for.body ] + %inc53 = add i64 %i.092, 1 + %37 = load i64* @channelColumns, align 8, !tbaa !0 + %cmp = icmp ugt i64 %inc53, %37 + br i1 %cmp, label %for.end, label %for.body + +for.end: ; preds = %for.inc, %entry + %numLeft.0.lcssa = phi i32 [ 0, %entry ], [ %numLeft.1, %for.inc ] + ret i32 %numLeft.0.lcssa +} + +; Materializable +declare hidden fastcc i32 @Maze1Mech(i64, i64, i64, i64, i64, i32, i32) nounwind ssp + +; Materializable +declare hidden fastcc void @CleanNet(i64) nounwind ssp + +!0 = metadata !{metadata !"long", metadata !1} +!1 = metadata !{metadata !"omnipotent char", metadata !2} +!2 = metadata !{metadata !"Simple C/C++ TBAA"} +!3 = metadata !{metadata !"any pointer", metadata !1} diff --git a/test/CodeGen/AArch64/arm64-ccmp.ll b/test/CodeGen/AArch64/arm64-ccmp.ll new file mode 100644 index 000000000000..63965f9538b5 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-ccmp.ll @@ -0,0 +1,289 @@ +; RUN: llc < %s -mcpu=cyclone -verify-machineinstrs -aarch64-ccmp -aarch64-stress-ccmp | FileCheck %s +target triple = "arm64-apple-ios" + +; CHECK: single_same +; CHECK: cmp w0, #5 +; CHECK-NEXT: ccmp w1, #17, #4, ne +; CHECK-NEXT: b.ne +; CHECK: %if.then +; CHECK: bl _foo +; CHECK: %if.end +define i32 @single_same(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 5 + %cmp1 = icmp eq i32 %b, 17 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Different condition codes for the two compares. +; CHECK: single_different +; CHECK: cmp w0, #6 +; CHECK-NEXT: ccmp w1, #17, #0, ge +; CHECK-NEXT: b.eq +; CHECK: %if.then +; CHECK: bl _foo +; CHECK: %if.end +define i32 @single_different(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp sle i32 %a, 5 + %cmp1 = icmp ne i32 %b, 17 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Second block clobbers the flags, can't convert (easily). +; CHECK: single_flagclobber +; CHECK: cmp +; CHECK: b.eq +; CHECK: cmp +; CHECK: b.gt +define i32 @single_flagclobber(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 5 + br i1 %cmp, label %if.then, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %cmp1 = icmp slt i32 %b, 7 + %mul = shl nsw i32 %b, 1 + %add = add nsw i32 %b, 1 + %cond = select i1 %cmp1, i32 %mul, i32 %add + %cmp2 = icmp slt i32 %cond, 17 + br i1 %cmp2, label %if.then, label %if.end + +if.then: ; preds = %lor.lhs.false, %entry + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: ; preds = %if.then, %lor.lhs.false + ret i32 7 +} + +; Second block clobbers the flags and ends with a tbz terminator. +; CHECK: single_flagclobber_tbz +; CHECK: cmp +; CHECK: b.eq +; CHECK: cmp +; CHECK: tbz +define i32 @single_flagclobber_tbz(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 5 + br i1 %cmp, label %if.then, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %cmp1 = icmp slt i32 %b, 7 + %mul = shl nsw i32 %b, 1 + %add = add nsw i32 %b, 1 + %cond = select i1 %cmp1, i32 %mul, i32 %add + %and = and i32 %cond, 8 + %cmp2 = icmp ne i32 %and, 0 + br i1 %cmp2, label %if.then, label %if.end + +if.then: ; preds = %lor.lhs.false, %entry + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: ; preds = %if.then, %lor.lhs.false + ret i32 7 +} + +; Speculatively execute division by zero. +; The sdiv/udiv instructions do not trap when the divisor is zero, so they are +; safe to speculate. +; CHECK: speculate_division +; CHECK-NOT: cmp +; CHECK: sdiv +; CHECK: cmp +; CHECK-NEXT: ccmp +define i32 @speculate_division(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp sgt i32 %a, 0 + br i1 %cmp, label %land.lhs.true, label %if.end + +land.lhs.true: + %div = sdiv i32 %b, %a + %cmp1 = icmp slt i32 %div, 17 + br i1 %cmp1, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Floating point compare. +; CHECK: single_fcmp +; CHECK: cmp +; CHECK-NOT: b. +; CHECK: fccmp {{.*}}, #8, ge +; CHECK: b.lt +define i32 @single_fcmp(i32 %a, float %b) nounwind ssp { +entry: + %cmp = icmp sgt i32 %a, 0 + br i1 %cmp, label %land.lhs.true, label %if.end + +land.lhs.true: + %conv = sitofp i32 %a to float + %div = fdiv float %b, %conv + %cmp1 = fcmp oge float %div, 1.700000e+01 + br i1 %cmp1, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Chain multiple compares. +; CHECK: multi_different +; CHECK: cmp +; CHECK: ccmp +; CHECK: ccmp +; CHECK: b. +define void @multi_different(i32 %a, i32 %b, i32 %c) nounwind ssp { +entry: + %cmp = icmp sgt i32 %a, %b + br i1 %cmp, label %land.lhs.true, label %if.end + +land.lhs.true: + %div = sdiv i32 %b, %a + %cmp1 = icmp eq i32 %div, 5 + %cmp4 = icmp sgt i32 %div, %c + %or.cond = and i1 %cmp1, %cmp4 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret void +} + +; Convert a cbz in the head block. +; CHECK: cbz_head +; CHECK: cmp w0, #0 +; CHECK: ccmp +define i32 @cbz_head(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 0 + %cmp1 = icmp ne i32 %b, 17 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Check that the immediate operand is in range. The ccmp instruction encodes a +; smaller range of immediates than subs/adds. +; The ccmp immediates must be in the range 0-31. +; CHECK: immediate_range +; CHECK-NOT: ccmp +define i32 @immediate_range(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 5 + %cmp1 = icmp eq i32 %b, 32 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Convert a cbz in the second block. +; CHECK: cbz_second +; CHECK: cmp w0, #0 +; CHECK: ccmp w1, #0, #0, ne +; CHECK: b.eq +define i32 @cbz_second(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 0 + %cmp1 = icmp ne i32 %b, 0 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} + +; Convert a cbnz in the second block. +; CHECK: cbnz_second +; CHECK: cmp w0, #0 +; CHECK: ccmp w1, #0, #4, ne +; CHECK: b.ne +define i32 @cbnz_second(i32 %a, i32 %b) nounwind ssp { +entry: + %cmp = icmp eq i32 %a, 0 + %cmp1 = icmp eq i32 %b, 0 + %or.cond = or i1 %cmp, %cmp1 + br i1 %or.cond, label %if.then, label %if.end + +if.then: + %call = tail call i32 @foo() nounwind + br label %if.end + +if.end: + ret i32 7 +} +declare i32 @foo() + +%str1 = type { %str2 } +%str2 = type { [24 x i8], i8*, i32, %str1*, i32, [4 x i8], %str1*, %str1*, %str1*, %str1*, %str1*, %str1*, %str1*, %str1*, %str1*, i8*, i8, i8*, %str1*, i8* } + +; Test case distilled from 126.gcc. +; The phi in sw.bb.i.i gets multiple operands for the %entry predecessor. +; CHECK: build_modify_expr +define void @build_modify_expr() nounwind ssp { +entry: + switch i32 undef, label %sw.bb.i.i [ + i32 69, label %if.end85 + i32 70, label %if.end85 + i32 71, label %if.end85 + i32 72, label %if.end85 + i32 73, label %if.end85 + i32 105, label %if.end85 + i32 106, label %if.end85 + ] + +if.end85: + ret void + +sw.bb.i.i: + %ref.tr.i.i = phi %str1* [ %0, %sw.bb.i.i ], [ undef, %entry ] + %operands.i.i = getelementptr inbounds %str1* %ref.tr.i.i, i64 0, i32 0, i32 2 + %arrayidx.i.i = bitcast i32* %operands.i.i to %str1** + %0 = load %str1** %arrayidx.i.i, align 8 + %code1.i.i.phi.trans.insert = getelementptr inbounds %str1* %0, i64 0, i32 0, i32 0, i64 16 + br label %sw.bb.i.i +} diff --git a/test/CodeGen/AArch64/arm64-clrsb.ll b/test/CodeGen/AArch64/arm64-clrsb.ll new file mode 100644 index 000000000000..042e52e5e781 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-clrsb.ll @@ -0,0 +1,36 @@ +; RUN: llc < %s -march=arm64 | FileCheck %s + +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios7.0.0" + +; Function Attrs: nounwind readnone +declare i32 @llvm.ctlz.i32(i32, i1) #0 +declare i64 @llvm.ctlz.i64(i64, i1) #1 + +; Function Attrs: nounwind ssp +define i32 @clrsb32(i32 %x) #2 { +entry: + %shr = ashr i32 %x, 31 + %xor = xor i32 %shr, %x + %mul = shl i32 %xor, 1 + %add = or i32 %mul, 1 + %0 = tail call i32 @llvm.ctlz.i32(i32 %add, i1 false) + + ret i32 %0 +; CHECK-LABEL: clrsb32 +; CHECK: cls [[TEMP:w[0-9]+]], [[TEMP]] +} + +; Function Attrs: nounwind ssp +define i64 @clrsb64(i64 %x) #3 { +entry: + %shr = ashr i64 %x, 63 + %xor = xor i64 %shr, %x + %mul = shl nsw i64 %xor, 1 + %add = or i64 %mul, 1 + %0 = tail call i64 @llvm.ctlz.i64(i64 %add, i1 false) + + ret i64 %0 +; CHECK-LABEL: clrsb64 +; CHECK: cls [[TEMP:x[0-9]+]], [[TEMP]] +} diff --git a/test/CodeGen/AArch64/arm64-coalesce-ext.ll b/test/CodeGen/AArch64/arm64-coalesce-ext.ll new file mode 100644 index 000000000000..9420bf3bb593 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-coalesce-ext.ll @@ -0,0 +1,17 @@ +; RUN: llc -march=arm64 -mtriple=arm64-apple-darwin < %s | FileCheck %s +; Check that the peephole optimizer knows about sext and zext instructions. +; CHECK: test1sext +define i32 @test1sext(i64 %A, i64 %B, i32* %P, i64 *%P2) nounwind { + %C = add i64 %A, %B + ; CHECK: add x[[SUM:[0-9]+]], x0, x1 + %D = trunc i64 %C to i32 + %E = shl i64 %C, 32 + %F = ashr i64 %E, 32 + ; CHECK: sxtw x[[EXT:[0-9]+]], w[[SUM]] + store volatile i64 %F, i64 *%P2 + ; CHECK: str x[[EXT]] + store volatile i32 %D, i32* %P + ; Reuse low bits of extended register, don't extend live range of SUM. + ; CHECK: str w[[SUM]] + ret i32 %D +} diff --git a/test/CodeGen/AArch64/arm64-code-model-large-abs.ll b/test/CodeGen/AArch64/arm64-code-model-large-abs.ll new file mode 100644 index 000000000000..264da2da25bc --- /dev/null +++ b/test/CodeGen/AArch64/arm64-code-model-large-abs.ll @@ -0,0 +1,72 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -code-model=large < %s | FileCheck %s + +@var8 = global i8 0 +@var16 = global i16 0 +@var32 = global i32 0 +@var64 = global i64 0 + +define i8* @global_addr() { +; CHECK-LABEL: global_addr: + ret i8* @var8 + ; The movz/movk calculation should end up returned directly in x0. +; CHECK: movz x0, #:abs_g3:var8 +; CHECK: movk x0, #:abs_g2_nc:var8 +; CHECK: movk x0, #:abs_g1_nc:var8 +; CHECK: movk x0, #:abs_g0_nc:var8 +; CHECK-NEXT: ret +} + +define i8 @global_i8() { +; CHECK-LABEL: global_i8: + %val = load i8* @var8 + ret i8 %val +; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var8 +; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var8 +; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var8 +; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var8 +; CHECK: ldrb w0, [x[[ADDR_REG]]] +} + +define i16 @global_i16() { +; CHECK-LABEL: global_i16: + %val = load i16* @var16 + ret i16 %val +; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var16 +; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var16 +; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var16 +; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var16 +; CHECK: ldrh w0, [x[[ADDR_REG]]] +} + +define i32 @global_i32() { +; CHECK-LABEL: global_i32: + %val = load i32* @var32 + ret i32 %val +; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var32 +; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var32 +; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var32 +; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var32 +; CHECK: ldr w0, [x[[ADDR_REG]]] +} + +define i64 @global_i64() { +; CHECK-LABEL: global_i64: + %val = load i64* @var64 + ret i64 %val +; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:var64 +; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:var64 +; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:var64 +; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:var64 +; CHECK: ldr x0, [x[[ADDR_REG]]] +} + +define <2 x i64> @constpool() { +; CHECK-LABEL: constpool: + ret <2 x i64> + +; CHECK: movz x[[ADDR_REG:[0-9]+]], #:abs_g3:[[CPADDR:.LCPI[0-9]+_[0-9]+]] +; CHECK: movk x[[ADDR_REG]], #:abs_g2_nc:[[CPADDR]] +; CHECK: movk x[[ADDR_REG]], #:abs_g1_nc:[[CPADDR]] +; CHECK: movk x[[ADDR_REG]], #:abs_g0_nc:[[CPADDR]] +; CHECK: ldr q0, [x[[ADDR_REG]]] +} diff --git a/test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll b/test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll new file mode 100644 index 000000000000..81cee38420aa --- /dev/null +++ b/test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll @@ -0,0 +1,37 @@ +; RUN: llc -mtriple=arm64-apple-ios -O3 -aarch64-collect-loh -aarch64-collect-loh-bb-only=true -aarch64-collect-loh-pre-collect-register=false < %s -o - | FileCheck %s +; Check that the LOH analysis does not crash when the analysed chained +; contains instructions that are filtered out. +; +; Before the fix for , these cases were removed +; from the main container. Now, the deterministic container does not allow +; to remove arbitrary values, so we have to live with garbage values. +; + +%"class.H4ISP::H4ISPDevice" = type { i32 (%"class.H4ISP::H4ISPDevice"*, i32, i8*, i8*)*, i8*, i32*, %"class.H4ISP::H4ISPCameraManager"* } + +%"class.H4ISP::H4ISPCameraManager" = type opaque + +declare i32 @_ZN5H4ISP11H4ISPDevice32ISP_SelectBestMIPIFrequencyIndexEjPj(%"class.H4ISP::H4ISPDevice"*) + +@pH4ISPDevice = hidden global %"class.H4ISP::H4ISPDevice"* null, align 8 + +; CHECK-LABEL: _foo: +; CHECK: ret +; CHECK-NOT: .loh AdrpLdrGotLdr +define void @foo() { +entry: + br label %if.then83 +if.then83: ; preds = %if.end81 + %tmp = load %"class.H4ISP::H4ISPDevice"** @pH4ISPDevice, align 8 + %call84 = call i32 @_ZN5H4ISP11H4ISPDevice32ISP_SelectBestMIPIFrequencyIndexEjPj(%"class.H4ISP::H4ISPDevice"* %tmp) #19 + tail call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27}"() + %tmp2 = load %"class.H4ISP::H4ISPDevice"** @pH4ISPDevice, align 8 + tail call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x28}"() + %pCameraManager.i268 = getelementptr inbounds %"class.H4ISP::H4ISPDevice"* %tmp2, i64 0, i32 3 + %tmp3 = load %"class.H4ISP::H4ISPCameraManager"** %pCameraManager.i268, align 8 + %tobool.i269 = icmp eq %"class.H4ISP::H4ISPCameraManager"* %tmp3, null + br i1 %tobool.i269, label %if.then83, label %end +end: + ret void +} + diff --git a/test/CodeGen/AArch64/arm64-collect-loh-str.ll b/test/CodeGen/AArch64/arm64-collect-loh-str.ll new file mode 100644 index 000000000000..d7bc00e318f7 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-collect-loh-str.ll @@ -0,0 +1,23 @@ +; RUN: llc -mtriple=arm64-apple-ios -O2 -aarch64-collect-loh -aarch64-collect-loh-bb-only=false < %s -o - | FileCheck %s +; Test case for . +; AdrpAddStr cannot be used when the store uses same +; register as address and value. Indeed, the related +; if applied, may completely remove the definition or +; at least provide a wrong one (with the offset folded +; into the definition). + +%struct.anon = type { i32*, i32** } + +@pptp_wan_head = internal global %struct.anon zeroinitializer, align 8 + +; CHECK-LABEL: _pptp_wan_init +; CHECK: ret +; CHECK-NOT: AdrpAddStr +define i32 @pptp_wan_init() { +entry: + store i32* null, i32** getelementptr inbounds (%struct.anon* @pptp_wan_head, i64 0, i32 0), align 8 + store i32** getelementptr inbounds (%struct.anon* @pptp_wan_head, i64 0, i32 0), i32*** getelementptr inbounds (%struct.anon* @pptp_wan_head, i64 0, i32 1), align 8 + ret i32 0 +} + + diff --git a/test/CodeGen/AArch64/arm64-collect-loh.ll b/test/CodeGen/AArch64/arm64-collect-loh.ll new file mode 100644 index 000000000000..6d73daac6209 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-collect-loh.ll @@ -0,0 +1,53 @@ +; RUN: llc -mtriple=arm64-apple-ios -O2 -aarch64-collect-loh -aarch64-collect-loh-bb-only=false < %s -o - | FileCheck %s +; RUN: llc -mtriple=arm64-linux-gnu -O2 -aarch64-collect-loh -aarch64-collect-loh-bb-only=false < %s -o - | FileCheck %s --check-prefix=CHECK-ELF + +; CHECK-ELF-NOT: .loh +; CHECK-ELF-NOT: AdrpAdrp +; CHECK-ELF-NOT: AdrpAdd +; CHECK-ELF-NOT: AdrpLdrGot + +@a = internal unnamed_addr global i32 0, align 4 +@b = external global i32 + +; Function Attrs: noinline nounwind ssp +define void @foo(i32 %t) { +entry: + %tmp = load i32* @a, align 4 + %add = add nsw i32 %tmp, %t + store i32 %add, i32* @a, align 4 + ret void +} + +; Function Attrs: nounwind ssp +; Testcase for , AdrpAdrp reuse is valid only when the first adrp +; dominates the second. +; The first adrp comes from the loading of 'a' and the second the loading of 'b'. +; 'a' is loaded in if.then, 'b' in if.end4, if.then does not dominates if.end4. +; CHECK-LABEL: _test +; CHECK: ret +; CHECK-NOT: .loh AdrpAdrp +define i32 @test(i32 %t) { +entry: + %cmp = icmp sgt i32 %t, 5 + br i1 %cmp, label %if.then, label %if.end4 + +if.then: ; preds = %entry + %tmp = load i32* @a, align 4 + %add = add nsw i32 %tmp, %t + %cmp1 = icmp sgt i32 %add, 12 + br i1 %cmp1, label %if.then2, label %if.end4 + +if.then2: ; preds = %if.then + tail call void @foo(i32 %add) + %tmp1 = load i32* @a, align 4 + br label %if.end4 + +if.end4: ; preds = %if.then2, %if.then, %entry + %t.addr.0 = phi i32 [ %tmp1, %if.then2 ], [ %t, %if.then ], [ %t, %entry ] + %tmp2 = load i32* @b, align 4 + %add5 = add nsw i32 %tmp2, %t.addr.0 + tail call void @foo(i32 %add5) + %tmp3 = load i32* @b, align 4 + %add6 = add nsw i32 %tmp3, %t.addr.0 + ret i32 %add6 +} diff --git a/test/CodeGen/AArch64/arm64-complex-copy-noneon.ll b/test/CodeGen/AArch64/arm64-complex-copy-noneon.ll new file mode 100644 index 000000000000..f65b11612828 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-complex-copy-noneon.ll @@ -0,0 +1,21 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -mattr=-neon < %s + +; The DAG combiner decided to use a vector load/store for this struct copy +; previously. This probably shouldn't happen without NEON, but the most +; important thing is that it compiles. + +define void @store_combine() nounwind { + %src = alloca { double, double }, align 8 + %dst = alloca { double, double }, align 8 + + %src.realp = getelementptr inbounds { double, double }* %src, i32 0, i32 0 + %src.real = load double* %src.realp + %src.imagp = getelementptr inbounds { double, double }* %src, i32 0, i32 1 + %src.imag = load double* %src.imagp + + %dst.realp = getelementptr inbounds { double, double }* %dst, i32 0, i32 0 + %dst.imagp = getelementptr inbounds { double, double }* %dst, i32 0, i32 1 + store double %src.real, double* %dst.realp + store double %src.imag, double* %dst.imagp + ret void +} diff --git a/test/CodeGen/AArch64/arm64-complex-ret.ll b/test/CodeGen/AArch64/arm64-complex-ret.ll new file mode 100644 index 000000000000..93d50a59861d --- /dev/null +++ b/test/CodeGen/AArch64/arm64-complex-ret.ll @@ -0,0 +1,7 @@ +; RUN: llc -march=arm64 -o - %s | FileCheck %s + +define { i192, i192, i21, i192 } @foo(i192) { +; CHECK-LABEL: foo: +; CHECK: stp xzr, xzr, [x8] + ret { i192, i192, i21, i192 } {i192 0, i192 1, i21 2, i192 3} +} diff --git a/test/CodeGen/AArch64/arm64-const-addr.ll b/test/CodeGen/AArch64/arm64-const-addr.ll new file mode 100644 index 000000000000..c55a9226cc7a --- /dev/null +++ b/test/CodeGen/AArch64/arm64-const-addr.ll @@ -0,0 +1,23 @@ +; RUN: llc -mtriple=arm64-darwin-unknown < %s | FileCheck %s + +%T = type { i32, i32, i32, i32 } + +; Test if the constant base address gets only materialized once. +define i32 @test1() nounwind { +; CHECK-LABEL: test1 +; CHECK: movz w8, #0x40f, lsl #16 +; CHECK-NEXT: movk w8, #0xc000 +; CHECK-NEXT: ldp w9, w10, [x8, #4] +; CHECK: ldr w8, [x8, #12] + %at = inttoptr i64 68141056 to %T* + %o1 = getelementptr %T* %at, i32 0, i32 1 + %t1 = load i32* %o1 + %o2 = getelementptr %T* %at, i32 0, i32 2 + %t2 = load i32* %o2 + %a1 = add i32 %t1, %t2 + %o3 = getelementptr %T* %at, i32 0, i32 3 + %t3 = load i32* %o3 + %a2 = add i32 %a1, %t3 + ret i32 %a2 +} + diff --git a/test/CodeGen/AArch64/arm64-convert-v4f64.ll b/test/CodeGen/AArch64/arm64-convert-v4f64.ll new file mode 100644 index 000000000000..7123e5e0b235 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-convert-v4f64.ll @@ -0,0 +1,33 @@ +; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -march=arm64 | FileCheck %s + + +define <4 x i16> @fptosi_v4f64_to_v4i16(<4 x double>* %ptr) { +; CHECK: fptosi_v4f64_to_v4i16 +; CHECK-DAG: fcvtzs v[[LHS:[0-9]+]].2d, v1.2d +; CHECK-DAG: fcvtzs v[[RHS:[0-9]+]].2d, v0.2d +; CHECK-DAG: xtn v[[LHS_NA:[0-9]+]].2s, v[[LHS]].2d +; CHECK-DAG: xtn v[[RHS_NA:[0-9]+]].2s, v[[RHS]].2d +; CHECK: uzp1 v0.4h, v[[RHS_NA]].4h, v[[LHS_NA]].4h + %tmp1 = load <4 x double>* %ptr + %tmp2 = fptosi <4 x double> %tmp1 to <4 x i16> + ret <4 x i16> %tmp2 +} + +define <8 x i8> @fptosi_v4f64_to_v4i8(<8 x double>* %ptr) { +; CHECK: fptosi_v4f64_to_v4i8 +; CHECK-DAG: fcvtzs v[[CONV3:[0-9]+]].2d, v3.2d +; CHECK-DAG: fcvtzs v[[CONV2:[0-9]+]].2d, v2.2d +; CHECK-DAG: fcvtzs v[[CONV1:[0-9]+]].2d, v1.2d +; CHECK-DAG: fcvtzs v[[CONV0:[0-9]+]].2d, v0.2d +; CHECK-DAG: xtn v[[NA3:[0-9]+]].2s, v[[CONV3]].2d +; CHECK-DAG: xtn v[[NA2:[0-9]+]].2s, v[[CONV2]].2d +; CHECK-DAG: xtn v[[NA1:[0-9]+]].2s, v[[CONV1]].2d +; CHECK-DAG: xtn v[[NA0:[0-9]+]].2s, v[[CONV0]].2d +; CHECK-DAG: uzp1 v[[TMP1:[0-9]+]].4h, v[[CONV2]].4h, v[[CONV3]].4h +; CHECK-DAG: uzp1 v[[TMP2:[0-9]+]].4h, v[[CONV0]].4h, v[[CONV1]].4h +; CHECK: uzp1 v0.8b, v[[TMP2]].8b, v[[TMP1]].8b + %tmp1 = load <8 x double>* %ptr + %tmp2 = fptosi <8 x double> %tmp1 to <8 x i8> + ret <8 x i8> %tmp2 +} + diff --git a/test/CodeGen/AArch64/arm64-copy-tuple.ll b/test/CodeGen/AArch64/arm64-copy-tuple.ll new file mode 100644 index 000000000000..1803787d729f --- /dev/null +++ b/test/CodeGen/AArch64/arm64-copy-tuple.ll @@ -0,0 +1,146 @@ +; RUN: llc -mtriple=arm64-apple-ios -o - %s | FileCheck %s + +; The main purpose of this test is to find out whether copyPhysReg can deal with +; the memmove-like situation arising in tuples, where an early copy can clobber +; the value needed by a later one if the tuples overlap. + +; We use dummy inline asm to force LLVM to generate a COPY between the registers +; we want by clobbering all the others. + +define void @test_D1D2_from_D0D1(i8* %addr) #0 { +; CHECK-LABEL: test_D1D2_from_D0D1: +; CHECK: mov.8b v2, v1 +; CHECK: mov.8b v1, v0 +entry: + %addr_v8i8 = bitcast i8* %addr to <8 x i8>* + %vec = tail call { <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld2.v8i8.p0v8i8(<8 x i8>* %addr_v8i8) + %vec0 = extractvalue { <8 x i8>, <8 x i8> } %vec, 0 + %vec1 = extractvalue { <8 x i8>, <8 x i8> } %vec, 1 + tail call void asm sideeffect "", "~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + + tail call void asm sideeffect "", "~{v0},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + ret void +} + +define void @test_D0D1_from_D1D2(i8* %addr) #0 { +; CHECK-LABEL: test_D0D1_from_D1D2: +; CHECK: mov.8b v0, v1 +; CHECK: mov.8b v1, v2 +entry: + %addr_v8i8 = bitcast i8* %addr to <8 x i8>* + %vec = tail call { <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld2.v8i8.p0v8i8(<8 x i8>* %addr_v8i8) + %vec0 = extractvalue { <8 x i8>, <8 x i8> } %vec, 0 + %vec1 = extractvalue { <8 x i8>, <8 x i8> } %vec, 1 + tail call void asm sideeffect "", "~{v0},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + + tail call void asm sideeffect "", "~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + ret void +} + +define void @test_D0D1_from_D31D0(i8* %addr) #0 { +; CHECK-LABEL: test_D0D1_from_D31D0: +; CHECK: mov.8b v1, v0 +; CHECK: mov.8b v0, v31 +entry: + %addr_v8i8 = bitcast i8* %addr to <8 x i8>* + %vec = tail call { <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld2.v8i8.p0v8i8(<8 x i8>* %addr_v8i8) + %vec0 = extractvalue { <8 x i8>, <8 x i8> } %vec, 0 + %vec1 = extractvalue { <8 x i8>, <8 x i8> } %vec, 1 + tail call void asm sideeffect "", "~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + + tail call void asm sideeffect "", "~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + ret void +} + +define void @test_D31D0_from_D0D1(i8* %addr) #0 { +; CHECK-LABEL: test_D31D0_from_D0D1: +; CHECK: mov.8b v31, v0 +; CHECK: mov.8b v0, v1 +entry: + %addr_v8i8 = bitcast i8* %addr to <8 x i8>* + %vec = tail call { <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld2.v8i8.p0v8i8(<8 x i8>* %addr_v8i8) + %vec0 = extractvalue { <8 x i8>, <8 x i8> } %vec, 0 + %vec1 = extractvalue { <8 x i8>, <8 x i8> } %vec, 1 + tail call void asm sideeffect "", "~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + + tail call void asm sideeffect "", "~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30}"() + tail call void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, i8* %addr) + ret void +} + +define void @test_D2D3D4_from_D0D1D2(i8* %addr) #0 { +; CHECK-LABEL: test_D2D3D4_from_D0D1D2: +; CHECK: mov.8b v4, v2 +; CHECK: mov.8b v3, v1 +; CHECK: mov.8b v2, v0 +entry: + %addr_v8i8 = bitcast i8* %addr to <8 x i8>* + %vec = tail call { <8 x i8>, <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld3.v8i8.p0v8i8(<8 x i8>* %addr_v8i8) + %vec0 = extractvalue { <8 x i8>, <8 x i8>, <8 x i8> } %vec, 0 + %vec1 = extractvalue { <8 x i8>, <8 x i8>, <8 x i8> } %vec, 1 + %vec2 = extractvalue { <8 x i8>, <8 x i8>, <8 x i8> } %vec, 2 + + tail call void asm sideeffect "", "~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st3.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, <8 x i8> %vec2, i8* %addr) + + tail call void asm sideeffect "", "~{v0},~{v1},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st3.v8i8.p0i8(<8 x i8> %vec0, <8 x i8> %vec1, <8 x i8> %vec2, i8* %addr) + ret void +} + +define void @test_Q0Q1Q2_from_Q1Q2Q3(i8* %addr) #0 { +; CHECK-LABEL: test_Q0Q1Q2_from_Q1Q2Q3: +; CHECK: mov.16b v0, v1 +; CHECK: mov.16b v1, v2 +; CHECK: mov.16b v2, v3 +entry: + %addr_v16i8 = bitcast i8* %addr to <16 x i8>* + %vec = tail call { <16 x i8>, <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld3.v16i8.p0v16i8(<16 x i8>* %addr_v16i8) + %vec0 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8> } %vec, 0 + %vec1 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8> } %vec, 1 + %vec2 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8> } %vec, 2 + tail call void asm sideeffect "", "~{v0},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st3.v16i8.p0i8(<16 x i8> %vec0, <16 x i8> %vec1, <16 x i8> %vec2, i8* %addr) + + tail call void asm sideeffect "", "~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st3.v16i8.p0i8(<16 x i8> %vec0, <16 x i8> %vec1, <16 x i8> %vec2, i8* %addr) + ret void +} + +define void @test_Q1Q2Q3Q4_from_Q30Q31Q0Q1(i8* %addr) #0 { +; CHECK-LABEL: test_Q1Q2Q3Q4_from_Q30Q31Q0Q1: +; CHECK: mov.16b v4, v1 +; CHECK: mov.16b v3, v0 +; CHECK: mov.16b v2, v31 +; CHECK: mov.16b v1, v30 + %addr_v16i8 = bitcast i8* %addr to <16 x i8>* + %vec = tail call { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld4.v16i8.p0v16i8(<16 x i8>* %addr_v16i8) + %vec0 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %vec, 0 + %vec1 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %vec, 1 + %vec2 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %vec, 2 + %vec3 = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %vec, 3 + + tail call void asm sideeffect "", "~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29}"() + tail call void @llvm.aarch64.neon.st4.v16i8.p0i8(<16 x i8> %vec0, <16 x i8> %vec1, <16 x i8> %vec2, <16 x i8> %vec3, i8* %addr) + + tail call void asm sideeffect "", "~{v0},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31}"() + tail call void @llvm.aarch64.neon.st4.v16i8.p0i8(<16 x i8> %vec0, <16 x i8> %vec1, <16 x i8> %vec2, <16 x i8> %vec3, i8* %addr) + ret void +} + +declare { <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld2.v8i8.p0v8i8(<8 x i8>*) +declare { <8 x i8>, <8 x i8>, <8 x i8> } @llvm.aarch64.neon.ld3.v8i8.p0v8i8(<8 x i8>*) +declare { <16 x i8>, <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld3.v16i8.p0v16i8(<16 x i8>*) +declare { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld4.v16i8.p0v16i8(<16 x i8>*) + +declare void @llvm.aarch64.neon.st2.v8i8.p0i8(<8 x i8>, <8 x i8>, i8*) +declare void @llvm.aarch64.neon.st3.v8i8.p0i8(<8 x i8>, <8 x i8>, <8 x i8>, i8*) +declare void @llvm.aarch64.neon.st3.v16i8.p0i8(<16 x i8>, <16 x i8>, <16 x i8>, i8*) +declare void @llvm.aarch64.neon.st4.v16i8.p0i8(<16 x i8>, <16 x i8>, <16 x i8>, <16 x i8>, i8*) diff --git a/test/CodeGen/AArch64/arm64-crc32.ll b/test/CodeGen/AArch64/arm64-crc32.ll new file mode 100644 index 000000000000..d3099e6bb132 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-crc32.ll @@ -0,0 +1,71 @@ +; RUN: llc -march=arm64 -mattr=+crc -o - %s | FileCheck %s + +define i32 @test_crc32b(i32 %cur, i8 %next) { +; CHECK-LABEL: test_crc32b: +; CHECK: crc32b w0, w0, w1 + %bits = zext i8 %next to i32 + %val = call i32 @llvm.aarch64.crc32b(i32 %cur, i32 %bits) + ret i32 %val +} + +define i32 @test_crc32h(i32 %cur, i16 %next) { +; CHECK-LABEL: test_crc32h: +; CHECK: crc32h w0, w0, w1 + %bits = zext i16 %next to i32 + %val = call i32 @llvm.aarch64.crc32h(i32 %cur, i32 %bits) + ret i32 %val +} + +define i32 @test_crc32w(i32 %cur, i32 %next) { +; CHECK-LABEL: test_crc32w: +; CHECK: crc32w w0, w0, w1 + %val = call i32 @llvm.aarch64.crc32w(i32 %cur, i32 %next) + ret i32 %val +} + +define i32 @test_crc32x(i32 %cur, i64 %next) { +; CHECK-LABEL: test_crc32x: +; CHECK: crc32x w0, w0, x1 + %val = call i32 @llvm.aarch64.crc32x(i32 %cur, i64 %next) + ret i32 %val +} + +define i32 @test_crc32cb(i32 %cur, i8 %next) { +; CHECK-LABEL: test_crc32cb: +; CHECK: crc32cb w0, w0, w1 + %bits = zext i8 %next to i32 + %val = call i32 @llvm.aarch64.crc32cb(i32 %cur, i32 %bits) + ret i32 %val +} + +define i32 @test_crc32ch(i32 %cur, i16 %next) { +; CHECK-LABEL: test_crc32ch: +; CHECK: crc32ch w0, w0, w1 + %bits = zext i16 %next to i32 + %val = call i32 @llvm.aarch64.crc32ch(i32 %cur, i32 %bits) + ret i32 %val +} + +define i32 @test_crc32cw(i32 %cur, i32 %next) { +; CHECK-LABEL: test_crc32cw: +; CHECK: crc32cw w0, w0, w1 + %val = call i32 @llvm.aarch64.crc32cw(i32 %cur, i32 %next) + ret i32 %val +} + +define i32 @test_crc32cx(i32 %cur, i64 %next) { +; CHECK-LABEL: test_crc32cx: +; CHECK: crc32cx w0, w0, x1 + %val = call i32 @llvm.aarch64.crc32cx(i32 %cur, i64 %next) + ret i32 %val +} + +declare i32 @llvm.aarch64.crc32b(i32, i32) +declare i32 @llvm.aarch64.crc32h(i32, i32) +declare i32 @llvm.aarch64.crc32w(i32, i32) +declare i32 @llvm.aarch64.crc32x(i32, i64) + +declare i32 @llvm.aarch64.crc32cb(i32, i32) +declare i32 @llvm.aarch64.crc32ch(i32, i32) +declare i32 @llvm.aarch64.crc32cw(i32, i32) +declare i32 @llvm.aarch64.crc32cx(i32, i64) diff --git a/test/CodeGen/AArch64/arm64-crypto.ll b/test/CodeGen/AArch64/arm64-crypto.ll new file mode 100644 index 000000000000..2908b336b1bd --- /dev/null +++ b/test/CodeGen/AArch64/arm64-crypto.ll @@ -0,0 +1,135 @@ +; RUN: llc -march=arm64 -mattr=crypto -aarch64-neon-syntax=apple -o - %s | FileCheck %s + +declare <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> %data, <16 x i8> %key) +declare <16 x i8> @llvm.aarch64.crypto.aesd(<16 x i8> %data, <16 x i8> %key) +declare <16 x i8> @llvm.aarch64.crypto.aesmc(<16 x i8> %data) +declare <16 x i8> @llvm.aarch64.crypto.aesimc(<16 x i8> %data) + +define <16 x i8> @test_aese(<16 x i8> %data, <16 x i8> %key) { +; CHECK-LABEL: test_aese: +; CHECK: aese.16b v0, v1 + %res = call <16 x i8> @llvm.aarch64.crypto.aese(<16 x i8> %data, <16 x i8> %key) + ret <16 x i8> %res +} + +define <16 x i8> @test_aesd(<16 x i8> %data, <16 x i8> %key) { +; CHECK-LABEL: test_aesd: +; CHECK: aesd.16b v0, v1 + %res = call <16 x i8> @llvm.aarch64.crypto.aesd(<16 x i8> %data, <16 x i8> %key) + ret <16 x i8> %res +} + +define <16 x i8> @test_aesmc(<16 x i8> %data) { +; CHECK-LABEL: test_aesmc: +; CHECK: aesmc.16b v0, v0 + %res = call <16 x i8> @llvm.aarch64.crypto.aesmc(<16 x i8> %data) + ret <16 x i8> %res +} + +define <16 x i8> @test_aesimc(<16 x i8> %data) { +; CHECK-LABEL: test_aesimc: +; CHECK: aesimc.16b v0, v0 + %res = call <16 x i8> @llvm.aarch64.crypto.aesimc(<16 x i8> %data) + ret <16 x i8> %res +} + +declare <4 x i32> @llvm.aarch64.crypto.sha1c(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) +declare <4 x i32> @llvm.aarch64.crypto.sha1p(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) +declare <4 x i32> @llvm.aarch64.crypto.sha1m(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) +declare i32 @llvm.aarch64.crypto.sha1h(i32 %hash_e) +declare <4 x i32> @llvm.aarch64.crypto.sha1su0(<4 x i32> %wk0_3, <4 x i32> %wk4_7, <4 x i32> %wk8_11) +declare <4 x i32> @llvm.aarch64.crypto.sha1su1(<4 x i32> %wk0_3, <4 x i32> %wk12_15) + +define <4 x i32> @test_sha1c(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) { +; CHECK-LABEL: test_sha1c: +; CHECK: fmov [[HASH_E:s[0-9]+]], w0 +; CHECK: sha1c.4s q0, [[HASH_E]], v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1c(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) + ret <4 x i32> %res +} + +; Incomplete removal of unnecessary FMOV instructions in intrinsic SHA1 +define <4 x i32> @test_sha1c_in_a_row(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) { +; CHECK-LABEL: test_sha1c_in_a_row: +; CHECK: fmov [[HASH_E:s[0-9]+]], w0 +; CHECK: sha1c.4s q[[SHA1RES:[0-9]+]], [[HASH_E]], v1 +; CHECK-NOT: fmov +; CHECK: sha1c.4s q0, s[[SHA1RES]], v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1c(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) + %extract = extractelement <4 x i32> %res, i32 0 + %res2 = call <4 x i32> @llvm.aarch64.crypto.sha1c(<4 x i32> %hash_abcd, i32 %extract, <4 x i32> %wk) + ret <4 x i32> %res2 +} + +define <4 x i32> @test_sha1p(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) { +; CHECK-LABEL: test_sha1p: +; CHECK: fmov [[HASH_E:s[0-9]+]], w0 +; CHECK: sha1p.4s q0, [[HASH_E]], v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1p(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) + ret <4 x i32> %res +} + +define <4 x i32> @test_sha1m(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) { +; CHECK-LABEL: test_sha1m: +; CHECK: fmov [[HASH_E:s[0-9]+]], w0 +; CHECK: sha1m.4s q0, [[HASH_E]], v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1m(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk) + ret <4 x i32> %res +} + +define i32 @test_sha1h(i32 %hash_e) { +; CHECK-LABEL: test_sha1h: +; CHECK: fmov [[HASH_E:s[0-9]+]], w0 +; CHECK: sha1h [[RES:s[0-9]+]], [[HASH_E]] +; CHECK: fmov w0, [[RES]] + %res = call i32 @llvm.aarch64.crypto.sha1h(i32 %hash_e) + ret i32 %res +} + +define <4 x i32> @test_sha1su0(<4 x i32> %wk0_3, <4 x i32> %wk4_7, <4 x i32> %wk8_11) { +; CHECK-LABEL: test_sha1su0: +; CHECK: sha1su0.4s v0, v1, v2 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1su0(<4 x i32> %wk0_3, <4 x i32> %wk4_7, <4 x i32> %wk8_11) + ret <4 x i32> %res +} + +define <4 x i32> @test_sha1su1(<4 x i32> %wk0_3, <4 x i32> %wk12_15) { +; CHECK-LABEL: test_sha1su1: +; CHECK: sha1su1.4s v0, v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha1su1(<4 x i32> %wk0_3, <4 x i32> %wk12_15) + ret <4 x i32> %res +} + +declare <4 x i32> @llvm.aarch64.crypto.sha256h(<4 x i32> %hash_abcd, <4 x i32> %hash_efgh, <4 x i32> %wk) +declare <4 x i32> @llvm.aarch64.crypto.sha256h2(<4 x i32> %hash_efgh, <4 x i32> %hash_abcd, <4 x i32> %wk) +declare <4 x i32> @llvm.aarch64.crypto.sha256su0(<4 x i32> %w0_3, <4 x i32> %w4_7) +declare <4 x i32> @llvm.aarch64.crypto.sha256su1(<4 x i32> %w0_3, <4 x i32> %w8_11, <4 x i32> %w12_15) + +define <4 x i32> @test_sha256h(<4 x i32> %hash_abcd, <4 x i32> %hash_efgh, <4 x i32> %wk) { +; CHECK-LABEL: test_sha256h: +; CHECK: sha256h.4s q0, q1, v2 + %res = call <4 x i32> @llvm.aarch64.crypto.sha256h(<4 x i32> %hash_abcd, <4 x i32> %hash_efgh, <4 x i32> %wk) + ret <4 x i32> %res +} + +define <4 x i32> @test_sha256h2(<4 x i32> %hash_efgh, <4 x i32> %hash_abcd, <4 x i32> %wk) { +; CHECK-LABEL: test_sha256h2: +; CHECK: sha256h2.4s q0, q1, v2 + + %res = call <4 x i32> @llvm.aarch64.crypto.sha256h2(<4 x i32> %hash_efgh, <4 x i32> %hash_abcd, <4 x i32> %wk) + ret <4 x i32> %res +} + +define <4 x i32> @test_sha256su0(<4 x i32> %w0_3, <4 x i32> %w4_7) { +; CHECK-LABEL: test_sha256su0: +; CHECK: sha256su0.4s v0, v1 + %res = call <4 x i32> @llvm.aarch64.crypto.sha256su0(<4 x i32> %w0_3, <4 x i32> %w4_7) + ret <4 x i32> %res +} + +define <4 x i32> @test_sha256su1(<4 x i32> %w0_3, <4 x i32> %w8_11, <4 x i32> %w12_15) { +; CHECK-LABEL: test_sha256su1: +; CHECK: sha256su1.4s v0, v1, v2 + %res = call <4 x i32> @llvm.aarch64.crypto.sha256su1(<4 x i32> %w0_3, <4 x i32> %w8_11, <4 x i32> %w12_15) + ret <4 x i32> %res +} diff --git a/test/CodeGen/AArch64/arm64-cse.ll b/test/CodeGen/AArch64/arm64-cse.ll new file mode 100644 index 000000000000..5d62cfe76a84 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-cse.ll @@ -0,0 +1,59 @@ +; RUN: llc -O3 < %s -aarch64-atomic-cfg-tidy=0 | FileCheck %s +target triple = "arm64-apple-ios" + +; rdar://12462006 +; CSE between "icmp reg reg" and "sub reg reg". +; Both can be in the same basic block or in different basic blocks. +define i8* @t1(i8* %base, i32* nocapture %offset, i32 %size) nounwind { +entry: +; CHECK-LABEL: t1: +; CHECK: subs +; CHECK-NOT: cmp +; CHECK-NOT: sub +; CHECK: b.ge +; CHECK: sub +; CHECK: sub +; CHECK-NOT: sub +; CHECK: ret + %0 = load i32* %offset, align 4 + %cmp = icmp slt i32 %0, %size + %s = sub nsw i32 %0, %size + br i1 %cmp, label %return, label %if.end + +if.end: + %sub = sub nsw i32 %0, %size + %s2 = sub nsw i32 %s, %size + %s3 = sub nsw i32 %sub, %s2 + store i32 %s3, i32* %offset, align 4 + %add.ptr = getelementptr inbounds i8* %base, i32 %sub + br label %return + +return: + %retval.0 = phi i8* [ %add.ptr, %if.end ], [ null, %entry ] + ret i8* %retval.0 +} + +; CSE between "icmp reg imm" and "sub reg imm". +define i8* @t2(i8* %base, i32* nocapture %offset) nounwind { +entry: +; CHECK-LABEL: t2: +; CHECK: subs +; CHECK-NOT: cmp +; CHECK-NOT: sub +; CHECK: b.lt +; CHECK-NOT: sub +; CHECK: ret + %0 = load i32* %offset, align 4 + %cmp = icmp slt i32 %0, 1 + br i1 %cmp, label %return, label %if.end + +if.end: + %sub = sub nsw i32 %0, 1 + store i32 %sub, i32* %offset, align 4 + %add.ptr = getelementptr inbounds i8* %base, i32 %sub + br label %return + +return: + %retval.0 = phi i8* [ %add.ptr, %if.end ], [ null, %entry ] + ret i8* %retval.0 +} diff --git a/test/CodeGen/AArch64/arm64-csel.ll b/test/CodeGen/AArch64/arm64-csel.ll new file mode 100644 index 000000000000..98eba30f119d --- /dev/null +++ b/test/CodeGen/AArch64/arm64-csel.ll @@ -0,0 +1,230 @@ +; RUN: llc -O3 < %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-n32:64" +target triple = "arm64-unknown-unknown" + +; CHECK-LABEL: foo1 +; CHECK: cinc w{{[0-9]+}}, w{{[0-9]+}}, ne +define i32 @foo1(i32 %b, i32 %c) nounwind readnone ssp { +entry: + %not.tobool = icmp ne i32 %c, 0 + %add = zext i1 %not.tobool to i32 + %b.add = add i32 %c, %b + %add1 = add i32 %b.add, %add + ret i32 %add1 +} + +; CHECK-LABEL: foo2 +; CHECK: cneg w{{[0-9]+}}, w{{[0-9]+}}, ne +define i32 @foo2(i32 %b, i32 %c) nounwind readnone ssp { +entry: + %mul = sub i32 0, %b + %tobool = icmp eq i32 %c, 0 + %b.mul = select i1 %tobool, i32 %b, i32 %mul + %add = add nsw i32 %b.mul, %c + ret i32 %add +} + +; CHECK-LABEL: foo3 +; CHECK: cinv w{{[0-9]+}}, w{{[0-9]+}}, ne +define i32 @foo3(i32 %b, i32 %c) nounwind readnone ssp { +entry: + %not.tobool = icmp ne i32 %c, 0 + %xor = sext i1 %not.tobool to i32 + %b.xor = xor i32 %xor, %b + %add = add nsw i32 %b.xor, %c + ret i32 %add +} + +; rdar://11632325 +define i32@foo4(i32 %a) nounwind ssp { +; CHECK-LABEL: foo4 +; CHECK: cneg +; CHECK-NEXT: ret + %cmp = icmp sgt i32 %a, -1 + %neg = sub nsw i32 0, %a + %cond = select i1 %cmp, i32 %a, i32 %neg + ret i32 %cond +} + +define i32@foo5(i32 %a, i32 %b) nounwind ssp { +entry: +; CHECK-LABEL: foo5 +; CHECK: subs +; CHECK-NEXT: cneg +; CHECK-NEXT: ret + %sub = sub nsw i32 %a, %b + %cmp = icmp sgt i32 %sub, -1 + %sub3 = sub nsw i32 0, %sub + %cond = select i1 %cmp, i32 %sub, i32 %sub3 + ret i32 %cond +} + +; make sure we can handle branch instruction in optimizeCompare. +define i32@foo6(i32 %a, i32 %b) nounwind ssp { +; CHECK-LABEL: foo6 +; CHECK: b + %sub = sub nsw i32 %a, %b + %cmp = icmp sgt i32 %sub, 0 + br i1 %cmp, label %l.if, label %l.else + +l.if: + ret i32 1 + +l.else: + ret i32 %sub +} + +; If CPSR is used multiple times and V flag is used, we don't remove cmp. +define i32 @foo7(i32 %a, i32 %b) nounwind { +entry: +; CHECK-LABEL: foo7: +; CHECK: sub +; CHECK-next: adds +; CHECK-next: csneg +; CHECK-next: b + %sub = sub nsw i32 %a, %b + %cmp = icmp sgt i32 %sub, -1 + %sub3 = sub nsw i32 0, %sub + %cond = select i1 %cmp, i32 %sub, i32 %sub3 + br i1 %cmp, label %if.then, label %if.else + +if.then: + %cmp2 = icmp slt i32 %sub, -1 + %sel = select i1 %cmp2, i32 %cond, i32 %a + ret i32 %sel + +if.else: + ret i32 %cond +} + +define i32 @foo8(i32 %v, i32 %a, i32 %b) nounwind readnone ssp { +entry: +; CHECK-LABEL: foo8: +; CHECK: cmp w0, #0 +; CHECK: csinv w0, w1, w2, ne + %tobool = icmp eq i32 %v, 0 + %neg = xor i32 -1, %b + %cond = select i1 %tobool, i32 %neg, i32 %a + ret i32 %cond +} + +define i32 @foo9(i32 %v) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo9: +; CHECK: cmp w0, #0 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x4 +; CHECK: cinv w0, w[[REG]], eq + %tobool = icmp ne i32 %v, 0 + %cond = select i1 %tobool, i32 4, i32 -5 + ret i32 %cond +} + +define i64 @foo10(i64 %v) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo10: +; CHECK: cmp x0, #0 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x4 +; CHECK: cinv x0, x[[REG]], eq + %tobool = icmp ne i64 %v, 0 + %cond = select i1 %tobool, i64 4, i64 -5 + ret i64 %cond +} + +define i32 @foo11(i32 %v) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo11: +; CHECK: cmp w0, #0 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x4 +; CHECK: cneg w0, w[[REG]], eq + %tobool = icmp ne i32 %v, 0 + %cond = select i1 %tobool, i32 4, i32 -4 + ret i32 %cond +} + +define i64 @foo12(i64 %v) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo12: +; CHECK: cmp x0, #0 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x4 +; CHECK: cneg x0, x[[REG]], eq + %tobool = icmp ne i64 %v, 0 + %cond = select i1 %tobool, i64 4, i64 -4 + ret i64 %cond +} + +define i32 @foo13(i32 %v, i32 %a, i32 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo13: +; CHECK: cmp w0, #0 +; CHECK: csneg w0, w1, w2, ne + %tobool = icmp eq i32 %v, 0 + %sub = sub i32 0, %b + %cond = select i1 %tobool, i32 %sub, i32 %a + ret i32 %cond +} + +define i64 @foo14(i64 %v, i64 %a, i64 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo14: +; CHECK: cmp x0, #0 +; CHECK: csneg x0, x1, x2, ne + %tobool = icmp eq i64 %v, 0 + %sub = sub i64 0, %b + %cond = select i1 %tobool, i64 %sub, i64 %a + ret i64 %cond +} + +define i32 @foo15(i32 %a, i32 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo15: +; CHECK: cmp w0, w1 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x1 +; CHECK: cinc w0, w[[REG]], gt + %cmp = icmp sgt i32 %a, %b + %. = select i1 %cmp, i32 2, i32 1 + ret i32 %. +} + +define i32 @foo16(i32 %a, i32 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo16: +; CHECK: cmp w0, w1 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x1 +; CHECK: cinc w0, w[[REG]], le + %cmp = icmp sgt i32 %a, %b + %. = select i1 %cmp, i32 1, i32 2 + ret i32 %. +} + +define i64 @foo17(i64 %a, i64 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo17: +; CHECK: cmp x0, x1 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x1 +; CHECK: cinc x0, x[[REG]], gt + %cmp = icmp sgt i64 %a, %b + %. = select i1 %cmp, i64 2, i64 1 + ret i64 %. +} + +define i64 @foo18(i64 %a, i64 %b) nounwind readnone optsize ssp { +entry: +; CHECK-LABEL: foo18: +; CHECK: cmp x0, x1 +; CHECK: orr w[[REG:[0-9]+]], wzr, #0x1 +; CHECK: cinc x0, x[[REG]], le + %cmp = icmp sgt i64 %a, %b + %. = select i1 %cmp, i64 1, i64 2 + ret i64 %. +} + +define i64 @foo19(i64 %a, i64 %b, i64 %c) { +entry: +; CHECK-LABEL: foo19: +; CHECK: cinc x0, x2 +; CHECK-NOT: add + %cmp = icmp ult i64 %a, %b + %inc = zext i1 %cmp to i64 + %inc.c = add i64 %inc, %c + ret i64 %inc.c +} diff --git a/test/CodeGen/AArch64/arm64-cvt.ll b/test/CodeGen/AArch64/arm64-cvt.ll new file mode 100644 index 000000000000..420a8bc04833 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-cvt.ll @@ -0,0 +1,401 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s + +; +; Floating-point scalar convert to signed integer (to nearest with ties to away) +; +define i32 @fcvtas_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtas_1w1s: +;CHECK: fcvtas w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtas.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtas_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtas_1x1s: +;CHECK: fcvtas x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtas.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtas_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtas_1w1d: +;CHECK: fcvtas w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtas.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtas_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtas_1x1d: +;CHECK: fcvtas x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtas.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtas.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtas.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtas.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtas.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to unsigned integer +; +define i32 @fcvtau_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtau_1w1s: +;CHECK: fcvtau w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtau.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtau_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtau_1x1s: +;CHECK: fcvtau x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtau.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtau_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtau_1w1d: +;CHECK: fcvtau w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtau.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtau_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtau_1x1d: +;CHECK: fcvtau x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtau.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtau.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtau.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtau.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtau.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to signed integer (toward -Inf) +; +define i32 @fcvtms_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtms_1w1s: +;CHECK: fcvtms w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtms.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtms_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtms_1x1s: +;CHECK: fcvtms x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtms.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtms_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtms_1w1d: +;CHECK: fcvtms w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtms.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtms_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtms_1x1d: +;CHECK: fcvtms x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtms.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtms.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtms.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtms.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtms.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to unsigned integer (toward -Inf) +; +define i32 @fcvtmu_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtmu_1w1s: +;CHECK: fcvtmu w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtmu.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtmu_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtmu_1x1s: +;CHECK: fcvtmu x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtmu.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtmu_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtmu_1w1d: +;CHECK: fcvtmu w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtmu.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtmu_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtmu_1x1d: +;CHECK: fcvtmu x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtmu.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtmu.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtmu.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtmu.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtmu.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to signed integer (to nearest with ties to even) +; +define i32 @fcvtns_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtns_1w1s: +;CHECK: fcvtns w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtns.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtns_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtns_1x1s: +;CHECK: fcvtns x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtns.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtns_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtns_1w1d: +;CHECK: fcvtns w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtns.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtns_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtns_1x1d: +;CHECK: fcvtns x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtns.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtns.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtns.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtns.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtns.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to unsigned integer (to nearest with ties to even) +; +define i32 @fcvtnu_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtnu_1w1s: +;CHECK: fcvtnu w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtnu.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtnu_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtnu_1x1s: +;CHECK: fcvtnu x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtnu.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtnu_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtnu_1w1d: +;CHECK: fcvtnu w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtnu.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtnu_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtnu_1x1d: +;CHECK: fcvtnu x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtnu.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtnu.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtnu.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtnu.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtnu.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to signed integer (toward +Inf) +; +define i32 @fcvtps_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtps_1w1s: +;CHECK: fcvtps w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtps.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtps_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtps_1x1s: +;CHECK: fcvtps x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtps.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtps_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtps_1w1d: +;CHECK: fcvtps w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtps.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtps_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtps_1x1d: +;CHECK: fcvtps x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtps.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtps.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtps.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtps.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtps.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to unsigned integer (toward +Inf) +; +define i32 @fcvtpu_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtpu_1w1s: +;CHECK: fcvtpu w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtpu.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtpu_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtpu_1x1s: +;CHECK: fcvtpu x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtpu.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtpu_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtpu_1w1d: +;CHECK: fcvtpu w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtpu.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtpu_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtpu_1x1d: +;CHECK: fcvtpu x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtpu.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtpu.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtpu.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtpu.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtpu.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to signed integer (toward zero) +; +define i32 @fcvtzs_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtzs_1w1s: +;CHECK: fcvtzs w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtzs.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtzs_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtzs_1x1s: +;CHECK: fcvtzs x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtzs.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtzs_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtzs_1w1d: +;CHECK: fcvtzs w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtzs.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtzs_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtzs_1x1d: +;CHECK: fcvtzs x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtzs.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtzs.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtzs.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtzs.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtzs.i64.f64(double) nounwind readnone + +; +; Floating-point scalar convert to unsigned integer (toward zero) +; +define i32 @fcvtzu_1w1s(float %A) nounwind { +;CHECK-LABEL: fcvtzu_1w1s: +;CHECK: fcvtzu w0, s0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtzu.i32.f32(float %A) + ret i32 %tmp3 +} + +define i64 @fcvtzu_1x1s(float %A) nounwind { +;CHECK-LABEL: fcvtzu_1x1s: +;CHECK: fcvtzu x0, s0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtzu.i64.f32(float %A) + ret i64 %tmp3 +} + +define i32 @fcvtzu_1w1d(double %A) nounwind { +;CHECK-LABEL: fcvtzu_1w1d: +;CHECK: fcvtzu w0, d0 +;CHECK-NEXT: ret + %tmp3 = call i32 @llvm.aarch64.neon.fcvtzu.i32.f64(double %A) + ret i32 %tmp3 +} + +define i64 @fcvtzu_1x1d(double %A) nounwind { +;CHECK-LABEL: fcvtzu_1x1d: +;CHECK: fcvtzu x0, d0 +;CHECK-NEXT: ret + %tmp3 = call i64 @llvm.aarch64.neon.fcvtzu.i64.f64(double %A) + ret i64 %tmp3 +} + +declare i32 @llvm.aarch64.neon.fcvtzu.i32.f32(float) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtzu.i64.f32(float) nounwind readnone +declare i32 @llvm.aarch64.neon.fcvtzu.i32.f64(double) nounwind readnone +declare i64 @llvm.aarch64.neon.fcvtzu.i64.f64(double) nounwind readnone diff --git a/test/CodeGen/AArch64/arm64-dagcombiner-convergence.ll b/test/CodeGen/AArch64/arm64-dagcombiner-convergence.ll new file mode 100644 index 000000000000..a45e31320de8 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dagcombiner-convergence.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -o /dev/null +; rdar://10795250 +; DAGCombiner should converge. + +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-n32:64" +target triple = "arm64-apple-macosx10.8.0" + +define i64 @foo(i128 %Params.coerce, i128 %SelLocs.coerce) { +entry: + %tmp = lshr i128 %Params.coerce, 61 + %.tr38.i = trunc i128 %tmp to i64 + %mul.i = and i64 %.tr38.i, 4294967288 + %tmp1 = lshr i128 %SelLocs.coerce, 62 + %.tr.i = trunc i128 %tmp1 to i64 + %mul7.i = and i64 %.tr.i, 4294967292 + %add.i = add i64 %mul7.i, %mul.i + %conv.i.i = and i64 %add.i, 4294967292 + ret i64 %conv.i.i +} diff --git a/test/CodeGen/AArch64/arm64-dagcombiner-dead-indexed-load.ll b/test/CodeGen/AArch64/arm64-dagcombiner-dead-indexed-load.ll new file mode 100644 index 000000000000..6eed48bf62e3 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dagcombiner-dead-indexed-load.ll @@ -0,0 +1,32 @@ +; RUN: llc -mcpu=cyclone < %s | FileCheck %s + +; r208640 broke ppc64/Linux self-hosting; xfailing while this is worked on. +; XFAIL: * + +target datalayout = "e-i64:64-n32:64-S128" +target triple = "arm64-apple-ios" + +%"struct.SU" = type { i32, %"struct.SU"*, i32*, i32, i32, %"struct.BO", i32, [5 x i8] } +%"struct.BO" = type { %"struct.RE" } + +%"struct.RE" = type { i32, i32, i32, i32 } + +; This is a read-modify-write of some bifields combined into an i48. It gets +; legalized into i32 and i16 accesses. Only a single store of zero to the low +; i32 part should be live. + +; CHECK-LABEL: test: +; CHECK-NOT: ldr +; CHECK: str wzr +; CHECK-NOT: str +define void @test(%"struct.SU"* nocapture %su) { +entry: + %r1 = getelementptr inbounds %"struct.SU"* %su, i64 1, i32 5 + %r2 = bitcast %"struct.BO"* %r1 to i48* + %r3 = load i48* %r2, align 8 + %r4 = and i48 %r3, -4294967296 + %r5 = or i48 0, %r4 + store i48 %r5, i48* %r2, align 8 + + ret void +} diff --git a/test/CodeGen/AArch64/arm64-dagcombiner-indexed-load.ll b/test/CodeGen/AArch64/arm64-dagcombiner-indexed-load.ll new file mode 100644 index 000000000000..ce132c6afa46 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dagcombiner-indexed-load.ll @@ -0,0 +1,46 @@ +; RUN: llc -O3 < %s | FileCheck %s +; RUN: llc -O3 -addr-sink-using-gep=1 < %s | FileCheck %s +; Test case for a DAG combiner bug where we combined an indexed load +; with an extension (sext, zext, or any) into a regular extended load, +; i.e., dropping the indexed value. +; + +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios" + +%class.A = type { i64, i64 } +%class.C = type { i64 } + +; CHECK-LABEL: XX: +; CHECK: ldr +define i32 @XX(%class.A* %K, i1 %tst, i32* %addr, %class.C** %ppC, %class.C* %pC) { +entry: + br i1 %tst, label %if.then, label %lor.rhs.i + +lor.rhs.i: ; preds = %entry + %tmp = load i32* %addr, align 4 + %y.i.i.i = getelementptr inbounds %class.A* %K, i64 0, i32 1 + %tmp1 = load i64* %y.i.i.i, align 8 + %U.sroa.3.8.extract.trunc.i = trunc i64 %tmp1 to i32 + %div11.i = sdiv i32 %U.sroa.3.8.extract.trunc.i, 17 + %add12.i = add nsw i32 0, %div11.i + %U.sroa.3.12.extract.shift.i = lshr i64 %tmp1, 32 + %U.sroa.3.12.extract.trunc.i = trunc i64 %U.sroa.3.12.extract.shift.i to i32 + %div15.i = sdiv i32 %U.sroa.3.12.extract.trunc.i, 13 + %add16.i = add nsw i32 %add12.i, %div15.i + %rem.i.i = srem i32 %add16.i, %tmp + %idxprom = sext i32 %rem.i.i to i64 + %arrayidx = getelementptr inbounds %class.C** %ppC, i64 %idxprom + %tobool533 = icmp eq %class.C* %pC, null + br i1 %tobool533, label %while.end, label %while.body + +if.then: ; preds = %entry + ret i32 42 + +while.body: ; preds = %lor.rhs.i + ret i32 5 + +while.end: ; preds = %lor.rhs.i + %tmp3 = load %class.C** %arrayidx, align 8 + ret i32 50 +} diff --git a/test/CodeGen/AArch64/arm64-dagcombiner-load-slicing.ll b/test/CodeGen/AArch64/arm64-dagcombiner-load-slicing.ll new file mode 100644 index 000000000000..0679014e59ae --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dagcombiner-load-slicing.ll @@ -0,0 +1,102 @@ +; RUN: llc -mtriple arm64-apple-ios -O3 -o - < %s | FileCheck %s +; + +%class.Complex = type { float, float } +%class.Complex_int = type { i32, i32 } +%class.Complex_long = type { i64, i64 } + +; CHECK-LABEL: @test +; CHECK: add [[BASE:x[0-9]+]], x0, x1, lsl #3 +; CHECK: ldp [[CPLX1_I:s[0-9]+]], [[CPLX1_R:s[0-9]+]], {{\[}}[[BASE]]] +; CHECK: ldp [[CPLX2_I:s[0-9]+]], [[CPLX2_R:s[0-9]+]], {{\[}}[[BASE]], #64] +; CHECK: fadd {{s[0-9]+}}, [[CPLX2_I]], [[CPLX1_I]] +; CHECK: fadd {{s[0-9]+}}, [[CPLX2_R]], [[CPLX1_R]] +; CHECK: ret +define void @test(%class.Complex* nocapture %out, i64 %out_start) { +entry: + %arrayidx = getelementptr inbounds %class.Complex* %out, i64 %out_start + %0 = bitcast %class.Complex* %arrayidx to i64* + %1 = load i64* %0, align 4 + %t0.sroa.0.0.extract.trunc = trunc i64 %1 to i32 + %2 = bitcast i32 %t0.sroa.0.0.extract.trunc to float + %t0.sroa.2.0.extract.shift = lshr i64 %1, 32 + %t0.sroa.2.0.extract.trunc = trunc i64 %t0.sroa.2.0.extract.shift to i32 + %3 = bitcast i32 %t0.sroa.2.0.extract.trunc to float + %add = add i64 %out_start, 8 + %arrayidx2 = getelementptr inbounds %class.Complex* %out, i64 %add + %i.i = getelementptr inbounds %class.Complex* %arrayidx2, i64 0, i32 0 + %4 = load float* %i.i, align 4 + %add.i = fadd float %4, %2 + %retval.sroa.0.0.vec.insert.i = insertelement <2 x float> undef, float %add.i, i32 0 + %r.i = getelementptr inbounds %class.Complex* %arrayidx2, i64 0, i32 1 + %5 = load float* %r.i, align 4 + %add5.i = fadd float %5, %3 + %retval.sroa.0.4.vec.insert.i = insertelement <2 x float> %retval.sroa.0.0.vec.insert.i, float %add5.i, i32 1 + %ref.tmp.sroa.0.0.cast = bitcast %class.Complex* %arrayidx to <2 x float>* + store <2 x float> %retval.sroa.0.4.vec.insert.i, <2 x float>* %ref.tmp.sroa.0.0.cast, align 4 + ret void +} + +; CHECK-LABEL: @test_int +; CHECK: add [[BASE:x[0-9]+]], x0, x1, lsl #3 +; CHECK: ldp [[CPLX1_I:w[0-9]+]], [[CPLX1_R:w[0-9]+]], {{\[}}[[BASE]]] +; CHECK: ldp [[CPLX2_I:w[0-9]+]], [[CPLX2_R:w[0-9]+]], {{\[}}[[BASE]], #64] +; CHECK: add {{w[0-9]+}}, [[CPLX2_I]], [[CPLX1_I]] +; CHECK: add {{w[0-9]+}}, [[CPLX2_R]], [[CPLX1_R]] +; CHECK: ret +define void @test_int(%class.Complex_int* nocapture %out, i64 %out_start) { +entry: + %arrayidx = getelementptr inbounds %class.Complex_int* %out, i64 %out_start + %0 = bitcast %class.Complex_int* %arrayidx to i64* + %1 = load i64* %0, align 4 + %t0.sroa.0.0.extract.trunc = trunc i64 %1 to i32 + %2 = bitcast i32 %t0.sroa.0.0.extract.trunc to i32 + %t0.sroa.2.0.extract.shift = lshr i64 %1, 32 + %t0.sroa.2.0.extract.trunc = trunc i64 %t0.sroa.2.0.extract.shift to i32 + %3 = bitcast i32 %t0.sroa.2.0.extract.trunc to i32 + %add = add i64 %out_start, 8 + %arrayidx2 = getelementptr inbounds %class.Complex_int* %out, i64 %add + %i.i = getelementptr inbounds %class.Complex_int* %arrayidx2, i64 0, i32 0 + %4 = load i32* %i.i, align 4 + %add.i = add i32 %4, %2 + %retval.sroa.0.0.vec.insert.i = insertelement <2 x i32> undef, i32 %add.i, i32 0 + %r.i = getelementptr inbounds %class.Complex_int* %arrayidx2, i64 0, i32 1 + %5 = load i32* %r.i, align 4 + %add5.i = add i32 %5, %3 + %retval.sroa.0.4.vec.insert.i = insertelement <2 x i32> %retval.sroa.0.0.vec.insert.i, i32 %add5.i, i32 1 + %ref.tmp.sroa.0.0.cast = bitcast %class.Complex_int* %arrayidx to <2 x i32>* + store <2 x i32> %retval.sroa.0.4.vec.insert.i, <2 x i32>* %ref.tmp.sroa.0.0.cast, align 4 + ret void +} + +; CHECK-LABEL: @test_long +; CHECK: add [[BASE:x[0-9]+]], x0, x1, lsl #4 +; CHECK: ldp [[CPLX1_I:x[0-9]+]], [[CPLX1_R:x[0-9]+]], {{\[}}[[BASE]]] +; CHECK: ldp [[CPLX2_I:x[0-9]+]], [[CPLX2_R:x[0-9]+]], {{\[}}[[BASE]], #128] +; CHECK: add {{x[0-9]+}}, [[CPLX2_I]], [[CPLX1_I]] +; CHECK: add {{x[0-9]+}}, [[CPLX2_R]], [[CPLX1_R]] +; CHECK: ret +define void @test_long(%class.Complex_long* nocapture %out, i64 %out_start) { +entry: + %arrayidx = getelementptr inbounds %class.Complex_long* %out, i64 %out_start + %0 = bitcast %class.Complex_long* %arrayidx to i128* + %1 = load i128* %0, align 4 + %t0.sroa.0.0.extract.trunc = trunc i128 %1 to i64 + %2 = bitcast i64 %t0.sroa.0.0.extract.trunc to i64 + %t0.sroa.2.0.extract.shift = lshr i128 %1, 64 + %t0.sroa.2.0.extract.trunc = trunc i128 %t0.sroa.2.0.extract.shift to i64 + %3 = bitcast i64 %t0.sroa.2.0.extract.trunc to i64 + %add = add i64 %out_start, 8 + %arrayidx2 = getelementptr inbounds %class.Complex_long* %out, i64 %add + %i.i = getelementptr inbounds %class.Complex_long* %arrayidx2, i32 0, i32 0 + %4 = load i64* %i.i, align 4 + %add.i = add i64 %4, %2 + %retval.sroa.0.0.vec.insert.i = insertelement <2 x i64> undef, i64 %add.i, i32 0 + %r.i = getelementptr inbounds %class.Complex_long* %arrayidx2, i32 0, i32 1 + %5 = load i64* %r.i, align 4 + %add5.i = add i64 %5, %3 + %retval.sroa.0.4.vec.insert.i = insertelement <2 x i64> %retval.sroa.0.0.vec.insert.i, i64 %add5.i, i32 1 + %ref.tmp.sroa.0.0.cast = bitcast %class.Complex_long* %arrayidx to <2 x i64>* + store <2 x i64> %retval.sroa.0.4.vec.insert.i, <2 x i64>* %ref.tmp.sroa.0.0.cast, align 4 + ret void +} diff --git a/test/CodeGen/AArch64/arm64-dead-def-frame-index.ll b/test/CodeGen/AArch64/arm64-dead-def-frame-index.ll new file mode 100644 index 000000000000..9bb4b7120763 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dead-def-frame-index.ll @@ -0,0 +1,18 @@ +; RUN: llc -march=arm64 < %s | FileCheck %s + +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios7.0.0" + +; Function Attrs: nounwind ssp uwtable +define i32 @test1() #0 { + %tmp1 = alloca i8 + %tmp2 = alloca i32, i32 4096 + %tmp3 = icmp eq i8* %tmp1, null + %tmp4 = zext i1 %tmp3 to i32 + + ret i32 %tmp4 + + ; CHECK-LABEL: test1 + ; CHECK: adds [[TEMP:[a-z0-9]+]], sp, #4, lsl #12 + ; CHECK: adds [[TEMP]], [[TEMP]], #15 +} diff --git a/test/CodeGen/AArch64/arm64-dead-register-def-bug.ll b/test/CodeGen/AArch64/arm64-dead-register-def-bug.ll new file mode 100644 index 000000000000..1bbcf50ba73c --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dead-register-def-bug.ll @@ -0,0 +1,32 @@ +; RUN: llc -mtriple="arm64-apple-ios" < %s | FileCheck %s +; +; Check that the dead register definition pass is considering implicit defs. +; When rematerializing through truncates, the coalescer may produce instructions +; with dead defs, but live implicit-defs of subregs: +; E.g. %X1 = MOVi64imm 2, %W1; %X1:GPR64, %W1:GPR32 +; These instructions are live, and their definitions should not be rewritten. +; +; + +define void @testcase() { +; CHECK: testcase: +; CHECK-NOT: orr xzr, xzr, #0x2 + +bb1: + %tmp1 = tail call float @ceilf(float 2.000000e+00) + %tmp2 = fptoui float %tmp1 to i64 + br i1 undef, label %bb2, label %bb3 + +bb2: + tail call void @foo() + br label %bb3 + +bb3: + %tmp3 = trunc i64 %tmp2 to i32 + tail call void @bar(i32 %tmp3) + ret void +} + +declare void @foo() +declare void @bar(i32) +declare float @ceilf(float) nounwind readnone diff --git a/test/CodeGen/AArch64/arm64-dup.ll b/test/CodeGen/AArch64/arm64-dup.ll new file mode 100644 index 000000000000..0c56b46c4176 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-dup.ll @@ -0,0 +1,323 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple -asm-verbose=false | FileCheck %s + +define <8 x i8> @v_dup8(i8 %A) nounwind { +;CHECK-LABEL: v_dup8: +;CHECK: dup.8b + %tmp1 = insertelement <8 x i8> zeroinitializer, i8 %A, i32 0 + %tmp2 = insertelement <8 x i8> %tmp1, i8 %A, i32 1 + %tmp3 = insertelement <8 x i8> %tmp2, i8 %A, i32 2 + %tmp4 = insertelement <8 x i8> %tmp3, i8 %A, i32 3 + %tmp5 = insertelement <8 x i8> %tmp4, i8 %A, i32 4 + %tmp6 = insertelement <8 x i8> %tmp5, i8 %A, i32 5 + %tmp7 = insertelement <8 x i8> %tmp6, i8 %A, i32 6 + %tmp8 = insertelement <8 x i8> %tmp7, i8 %A, i32 7 + ret <8 x i8> %tmp8 +} + +define <4 x i16> @v_dup16(i16 %A) nounwind { +;CHECK-LABEL: v_dup16: +;CHECK: dup.4h + %tmp1 = insertelement <4 x i16> zeroinitializer, i16 %A, i32 0 + %tmp2 = insertelement <4 x i16> %tmp1, i16 %A, i32 1 + %tmp3 = insertelement <4 x i16> %tmp2, i16 %A, i32 2 + %tmp4 = insertelement <4 x i16> %tmp3, i16 %A, i32 3 + ret <4 x i16> %tmp4 +} + +define <2 x i32> @v_dup32(i32 %A) nounwind { +;CHECK-LABEL: v_dup32: +;CHECK: dup.2s + %tmp1 = insertelement <2 x i32> zeroinitializer, i32 %A, i32 0 + %tmp2 = insertelement <2 x i32> %tmp1, i32 %A, i32 1 + ret <2 x i32> %tmp2 +} + +define <2 x float> @v_dupfloat(float %A) nounwind { +;CHECK-LABEL: v_dupfloat: +;CHECK: dup.2s + %tmp1 = insertelement <2 x float> zeroinitializer, float %A, i32 0 + %tmp2 = insertelement <2 x float> %tmp1, float %A, i32 1 + ret <2 x float> %tmp2 +} + +define <16 x i8> @v_dupQ8(i8 %A) nounwind { +;CHECK-LABEL: v_dupQ8: +;CHECK: dup.16b + %tmp1 = insertelement <16 x i8> zeroinitializer, i8 %A, i32 0 + %tmp2 = insertelement <16 x i8> %tmp1, i8 %A, i32 1 + %tmp3 = insertelement <16 x i8> %tmp2, i8 %A, i32 2 + %tmp4 = insertelement <16 x i8> %tmp3, i8 %A, i32 3 + %tmp5 = insertelement <16 x i8> %tmp4, i8 %A, i32 4 + %tmp6 = insertelement <16 x i8> %tmp5, i8 %A, i32 5 + %tmp7 = insertelement <16 x i8> %tmp6, i8 %A, i32 6 + %tmp8 = insertelement <16 x i8> %tmp7, i8 %A, i32 7 + %tmp9 = insertelement <16 x i8> %tmp8, i8 %A, i32 8 + %tmp10 = insertelement <16 x i8> %tmp9, i8 %A, i32 9 + %tmp11 = insertelement <16 x i8> %tmp10, i8 %A, i32 10 + %tmp12 = insertelement <16 x i8> %tmp11, i8 %A, i32 11 + %tmp13 = insertelement <16 x i8> %tmp12, i8 %A, i32 12 + %tmp14 = insertelement <16 x i8> %tmp13, i8 %A, i32 13 + %tmp15 = insertelement <16 x i8> %tmp14, i8 %A, i32 14 + %tmp16 = insertelement <16 x i8> %tmp15, i8 %A, i32 15 + ret <16 x i8> %tmp16 +} + +define <8 x i16> @v_dupQ16(i16 %A) nounwind { +;CHECK-LABEL: v_dupQ16: +;CHECK: dup.8h + %tmp1 = insertelement <8 x i16> zeroinitializer, i16 %A, i32 0 + %tmp2 = insertelement <8 x i16> %tmp1, i16 %A, i32 1 + %tmp3 = insertelement <8 x i16> %tmp2, i16 %A, i32 2 + %tmp4 = insertelement <8 x i16> %tmp3, i16 %A, i32 3 + %tmp5 = insertelement <8 x i16> %tmp4, i16 %A, i32 4 + %tmp6 = insertelement <8 x i16> %tmp5, i16 %A, i32 5 + %tmp7 = insertelement <8 x i16> %tmp6, i16 %A, i32 6 + %tmp8 = insertelement <8 x i16> %tmp7, i16 %A, i32 7 + ret <8 x i16> %tmp8 +} + +define <4 x i32> @v_dupQ32(i32 %A) nounwind { +;CHECK-LABEL: v_dupQ32: +;CHECK: dup.4s + %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %A, i32 0 + %tmp2 = insertelement <4 x i32> %tmp1, i32 %A, i32 1 + %tmp3 = insertelement <4 x i32> %tmp2, i32 %A, i32 2 + %tmp4 = insertelement <4 x i32> %tmp3, i32 %A, i32 3 + ret <4 x i32> %tmp4 +} + +define <4 x float> @v_dupQfloat(float %A) nounwind { +;CHECK-LABEL: v_dupQfloat: +;CHECK: dup.4s + %tmp1 = insertelement <4 x float> zeroinitializer, float %A, i32 0 + %tmp2 = insertelement <4 x float> %tmp1, float %A, i32 1 + %tmp3 = insertelement <4 x float> %tmp2, float %A, i32 2 + %tmp4 = insertelement <4 x float> %tmp3, float %A, i32 3 + ret <4 x float> %tmp4 +} + +; Check to make sure it works with shuffles, too. + +define <8 x i8> @v_shuffledup8(i8 %A) nounwind { +;CHECK-LABEL: v_shuffledup8: +;CHECK: dup.8b + %tmp1 = insertelement <8 x i8> undef, i8 %A, i32 0 + %tmp2 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <8 x i32> zeroinitializer + ret <8 x i8> %tmp2 +} + +define <4 x i16> @v_shuffledup16(i16 %A) nounwind { +;CHECK-LABEL: v_shuffledup16: +;CHECK: dup.4h + %tmp1 = insertelement <4 x i16> undef, i16 %A, i32 0 + %tmp2 = shufflevector <4 x i16> %tmp1, <4 x i16> undef, <4 x i32> zeroinitializer + ret <4 x i16> %tmp2 +} + +define <2 x i32> @v_shuffledup32(i32 %A) nounwind { +;CHECK-LABEL: v_shuffledup32: +;CHECK: dup.2s + %tmp1 = insertelement <2 x i32> undef, i32 %A, i32 0 + %tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> undef, <2 x i32> zeroinitializer + ret <2 x i32> %tmp2 +} + +define <2 x float> @v_shuffledupfloat(float %A) nounwind { +;CHECK-LABEL: v_shuffledupfloat: +;CHECK: dup.2s + %tmp1 = insertelement <2 x float> undef, float %A, i32 0 + %tmp2 = shufflevector <2 x float> %tmp1, <2 x float> undef, <2 x i32> zeroinitializer + ret <2 x float> %tmp2 +} + +define <16 x i8> @v_shuffledupQ8(i8 %A) nounwind { +;CHECK-LABEL: v_shuffledupQ8: +;CHECK: dup.16b + %tmp1 = insertelement <16 x i8> undef, i8 %A, i32 0 + %tmp2 = shufflevector <16 x i8> %tmp1, <16 x i8> undef, <16 x i32> zeroinitializer + ret <16 x i8> %tmp2 +} + +define <8 x i16> @v_shuffledupQ16(i16 %A) nounwind { +;CHECK-LABEL: v_shuffledupQ16: +;CHECK: dup.8h + %tmp1 = insertelement <8 x i16> undef, i16 %A, i32 0 + %tmp2 = shufflevector <8 x i16> %tmp1, <8 x i16> undef, <8 x i32> zeroinitializer + ret <8 x i16> %tmp2 +} + +define <4 x i32> @v_shuffledupQ32(i32 %A) nounwind { +;CHECK-LABEL: v_shuffledupQ32: +;CHECK: dup.4s + %tmp1 = insertelement <4 x i32> undef, i32 %A, i32 0 + %tmp2 = shufflevector <4 x i32> %tmp1, <4 x i32> undef, <4 x i32> zeroinitializer + ret <4 x i32> %tmp2 +} + +define <4 x float> @v_shuffledupQfloat(float %A) nounwind { +;CHECK-LABEL: v_shuffledupQfloat: +;CHECK: dup.4s + %tmp1 = insertelement <4 x float> undef, float %A, i32 0 + %tmp2 = shufflevector <4 x float> %tmp1, <4 x float> undef, <4 x i32> zeroinitializer + ret <4 x float> %tmp2 +} + +define <8 x i8> @vduplane8(<8 x i8>* %A) nounwind { +;CHECK-LABEL: vduplane8: +;CHECK: dup.8b + %tmp1 = load <8 x i8>* %A + %tmp2 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <8 x i32> < i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1 > + ret <8 x i8> %tmp2 +} + +define <4 x i16> @vduplane16(<4 x i16>* %A) nounwind { +;CHECK-LABEL: vduplane16: +;CHECK: dup.4h + %tmp1 = load <4 x i16>* %A + %tmp2 = shufflevector <4 x i16> %tmp1, <4 x i16> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > + ret <4 x i16> %tmp2 +} + +define <2 x i32> @vduplane32(<2 x i32>* %A) nounwind { +;CHECK-LABEL: vduplane32: +;CHECK: dup.2s + %tmp1 = load <2 x i32>* %A + %tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> undef, <2 x i32> < i32 1, i32 1 > + ret <2 x i32> %tmp2 +} + +define <2 x float> @vduplanefloat(<2 x float>* %A) nounwind { +;CHECK-LABEL: vduplanefloat: +;CHECK: dup.2s + %tmp1 = load <2 x float>* %A + %tmp2 = shufflevector <2 x float> %tmp1, <2 x float> undef, <2 x i32> < i32 1, i32 1 > + ret <2 x float> %tmp2 +} + +define <16 x i8> @vduplaneQ8(<8 x i8>* %A) nounwind { +;CHECK-LABEL: vduplaneQ8: +;CHECK: dup.16b + %tmp1 = load <8 x i8>* %A + %tmp2 = shufflevector <8 x i8> %tmp1, <8 x i8> undef, <16 x i32> < i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1 > + ret <16 x i8> %tmp2 +} + +define <8 x i16> @vduplaneQ16(<4 x i16>* %A) nounwind { +;CHECK-LABEL: vduplaneQ16: +;CHECK: dup.8h + %tmp1 = load <4 x i16>* %A + %tmp2 = shufflevector <4 x i16> %tmp1, <4 x i16> undef, <8 x i32> < i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1 > + ret <8 x i16> %tmp2 +} + +define <4 x i32> @vduplaneQ32(<2 x i32>* %A) nounwind { +;CHECK-LABEL: vduplaneQ32: +;CHECK: dup.4s + %tmp1 = load <2 x i32>* %A + %tmp2 = shufflevector <2 x i32> %tmp1, <2 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > + ret <4 x i32> %tmp2 +} + +define <4 x float> @vduplaneQfloat(<2 x float>* %A) nounwind { +;CHECK-LABEL: vduplaneQfloat: +;CHECK: dup.4s + %tmp1 = load <2 x float>* %A + %tmp2 = shufflevector <2 x float> %tmp1, <2 x float> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > + ret <4 x float> %tmp2 +} + +define <2 x i64> @foo(<2 x i64> %arg0_int64x1_t) nounwind readnone { +;CHECK-LABEL: foo: +;CHECK: dup.2d +entry: + %0 = shufflevector <2 x i64> %arg0_int64x1_t, <2 x i64> undef, <2 x i32> + ret <2 x i64> %0 +} + +define <2 x i64> @bar(<2 x i64> %arg0_int64x1_t) nounwind readnone { +;CHECK-LABEL: bar: +;CHECK: dup.2d +entry: + %0 = shufflevector <2 x i64> %arg0_int64x1_t, <2 x i64> undef, <2 x i32> + ret <2 x i64> %0 +} + +define <2 x double> @baz(<2 x double> %arg0_int64x1_t) nounwind readnone { +;CHECK-LABEL: baz: +;CHECK: dup.2d +entry: + %0 = shufflevector <2 x double> %arg0_int64x1_t, <2 x double> undef, <2 x i32> + ret <2 x double> %0 +} + +define <2 x double> @qux(<2 x double> %arg0_int64x1_t) nounwind readnone { +;CHECK-LABEL: qux: +;CHECK: dup.2d +entry: + %0 = shufflevector <2 x double> %arg0_int64x1_t, <2 x double> undef, <2 x i32> + ret <2 x double> %0 +} + +define <2 x i32> @f(i32 %a, i32 %b) nounwind readnone { +; CHECK-LABEL: f: +; CHECK-NEXT: fmov s0, w0 +; CHECK-NEXT: ins.s v0[1], w1 +; CHECK-NEXT: ret + %vecinit = insertelement <2 x i32> undef, i32 %a, i32 0 + %vecinit1 = insertelement <2 x i32> %vecinit, i32 %b, i32 1 + ret <2 x i32> %vecinit1 +} + +define <4 x i32> @g(i32 %a, i32 %b) nounwind readnone { +; CHECK-LABEL: g: +; CHECK-NEXT: fmov s0, w0 +; CHECK-NEXT: ins.s v0[1], w1 +; CHECK-NEXT: ins.s v0[2], w1 +; CHECK-NEXT: ins.s v0[3], w0 +; CHECK-NEXT: ret + %vecinit = insertelement <4 x i32> undef, i32 %a, i32 0 + %vecinit1 = insertelement <4 x i32> %vecinit, i32 %b, i32 1 + %vecinit2 = insertelement <4 x i32> %vecinit1, i32 %b, i32 2 + %vecinit3 = insertelement <4 x i32> %vecinit2, i32 %a, i32 3 + ret <4 x i32> %vecinit3 +} + +define <2 x i64> @h(i64 %a, i64 %b) nounwind readnone { +; CHECK-LABEL: h: +; CHECK-NEXT: fmov d0, x0 +; CHECK-NEXT: ins.d v0[1], x1 +; CHECK-NEXT: ret + %vecinit = insertelement <2 x i64> undef, i64 %a, i32 0 + %vecinit1 = insertelement <2 x i64> %vecinit, i64 %b, i32 1 + ret <2 x i64> %vecinit1 +} + +; We used to spot this as a BUILD_VECTOR implementable by dup, but assume that +; the single value needed was of the same type as the vector. This is false if +; the scalar corresponding to the vector type is illegal (e.g. a <4 x i16> +; BUILD_VECTOR will have an i32 as its source). In that case, the operation is +; not a simple "dup vD.4h, vN.h[idx]" after all, and we crashed. +; +; *However*, it is a dup vD.4h, vN.h[2*idx]. +define <4 x i16> @test_build_illegal(<4 x i32> %in) { +; CHECK-LABEL: test_build_illegal: +; CHECK: dup.4h v0, v0[6] + %val = extractelement <4 x i32> %in, i32 3 + %smallval = trunc i32 %val to i16 + %vec = insertelement <4x i16> undef, i16 %smallval, i32 3 + + ret <4 x i16> %vec +} + +; We used to inherit an already extract_subvectored v4i16 from +; SelectionDAGBuilder here. We then added a DUPLANE on top of that, preventing +; the formation of an indexed-by-7 MLS. +define <4 x i16> @test_high_splat(<4 x i16> %a, <4 x i16> %b, <8 x i16> %v) #0 { +; CHECK-LABEL: test_high_splat: +; CHECK: mls.4h v0, v1, v2[7] +entry: + %shuffle = shufflevector <8 x i16> %v, <8 x i16> undef, <4 x i32> + %mul = mul <4 x i16> %shuffle, %b + %sub = sub <4 x i16> %a, %mul + ret <4 x i16> %sub +} diff --git a/test/CodeGen/AArch64/arm64-early-ifcvt.ll b/test/CodeGen/AArch64/arm64-early-ifcvt.ll new file mode 100644 index 000000000000..44150c29aeb0 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-early-ifcvt.ll @@ -0,0 +1,423 @@ +; RUN: llc < %s -stress-early-ifcvt -aarch64-atomic-cfg-tidy=0 | FileCheck %s +target triple = "arm64-apple-macosx" + +; CHECK: mm2 +define i32 @mm2(i32* nocapture %p, i32 %n) nounwind uwtable readonly ssp { +entry: + br label %do.body + +; CHECK: do.body +; Loop body has no branches before the backedge. +; CHECK-NOT: LBB +do.body: + %max.0 = phi i32 [ 0, %entry ], [ %max.1, %do.cond ] + %min.0 = phi i32 [ 0, %entry ], [ %min.1, %do.cond ] + %n.addr.0 = phi i32 [ %n, %entry ], [ %dec, %do.cond ] + %p.addr.0 = phi i32* [ %p, %entry ], [ %incdec.ptr, %do.cond ] + %incdec.ptr = getelementptr inbounds i32* %p.addr.0, i64 1 + %0 = load i32* %p.addr.0, align 4 + %cmp = icmp sgt i32 %0, %max.0 + br i1 %cmp, label %do.cond, label %if.else + +if.else: + %cmp1 = icmp slt i32 %0, %min.0 + %.min.0 = select i1 %cmp1, i32 %0, i32 %min.0 + br label %do.cond + +do.cond: + %max.1 = phi i32 [ %0, %do.body ], [ %max.0, %if.else ] + %min.1 = phi i32 [ %min.0, %do.body ], [ %.min.0, %if.else ] +; CHECK: cbnz + %dec = add i32 %n.addr.0, -1 + %tobool = icmp eq i32 %dec, 0 + br i1 %tobool, label %do.end, label %do.body + +do.end: + %sub = sub nsw i32 %max.1, %min.1 + ret i32 %sub +} + +; CHECK-LABEL: fold_inc_true_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csinc w0, w1, w0, eq +; CHECK-NEXT: ret +define i32 @fold_inc_true_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %inc = add nsw i32 %x, 1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %y, %eq_bb ], [ %inc, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_inc_true_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csinc x0, x1, x0, eq +; CHECK-NEXT: ret +define i64 @fold_inc_true_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %inc = add nsw i64 %x, 1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %y, %eq_bb ], [ %inc, %entry ] + ret i64 %cond +} + +; CHECK-LABEL: fold_inc_false_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csinc w0, w1, w0, ne +; CHECK-NEXT: ret +define i32 @fold_inc_false_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %inc = add nsw i32 %x, 1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %inc, %eq_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_inc_false_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csinc x0, x1, x0, ne +; CHECK-NEXT: ret +define i64 @fold_inc_false_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %inc = add nsw i64 %x, 1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %inc, %eq_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK-LABEL: fold_inv_true_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csinv w0, w1, w0, eq +; CHECK-NEXT: ret +define i32 @fold_inv_true_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %inv = xor i32 %x, -1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %y, %eq_bb ], [ %inv, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_inv_true_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csinv x0, x1, x0, eq +; CHECK-NEXT: ret +define i64 @fold_inv_true_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %inv = xor i64 %x, -1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %y, %eq_bb ], [ %inv, %entry ] + ret i64 %cond +} + +; CHECK-LABEL: fold_inv_false_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csinv w0, w1, w0, ne +; CHECK-NEXT: ret +define i32 @fold_inv_false_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %inv = xor i32 %x, -1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %inv, %eq_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_inv_false_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csinv x0, x1, x0, ne +; CHECK-NEXT: ret +define i64 @fold_inv_false_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %inv = xor i64 %x, -1 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %inv, %eq_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK-LABEL: fold_neg_true_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csneg w0, w1, w0, eq +; CHECK-NEXT: ret +define i32 @fold_neg_true_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %neg = sub nsw i32 0, %x + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %y, %eq_bb ], [ %neg, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_neg_true_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csneg x0, x1, x0, eq +; CHECK-NEXT: ret +define i64 @fold_neg_true_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %neg = sub nsw i64 0, %x + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %y, %eq_bb ], [ %neg, %entry ] + ret i64 %cond +} + +; CHECK-LABEL: fold_neg_false_32: +; CHECK: {{subs.*wzr,|cmp}} w2, #1 +; CHECK-NEXT: csneg w0, w1, w0, ne +; CHECK-NEXT: ret +define i32 @fold_neg_false_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 1 + %neg = sub nsw i32 0, %x + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %neg, %eq_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK-LABEL: fold_neg_false_64: +; CHECK: {{subs.*xzr,|cmp}} x2, #1 +; CHECK-NEXT: csneg x0, x1, x0, ne +; CHECK-NEXT: ret +define i64 @fold_neg_false_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 1 + %neg = sub nsw i64 0, %x + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %neg, %eq_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK: cbnz_32 +; CHECK: {{subs.*wzr,|cmp}} w2, #0 +; CHECK-NEXT: csel w0, w1, w0, ne +; CHECK-NEXT: ret +define i32 @cbnz_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp eq i32 %c, 0 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %x, %eq_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK: cbnz_64 +; CHECK: {{subs.*xzr,|cmp}} x2, #0 +; CHECK-NEXT: csel x0, x1, x0, ne +; CHECK-NEXT: ret +define i64 @cbnz_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp eq i64 %c, 0 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %x, %eq_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK: cbz_32 +; CHECK: {{subs.*wzr,|cmp}} w2, #0 +; CHECK-NEXT: csel w0, w1, w0, eq +; CHECK-NEXT: ret +define i32 @cbz_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %tobool = icmp ne i32 %c, 0 + br i1 %tobool, label %ne_bb, label %done + +ne_bb: + br label %done + +done: + %cond = phi i32 [ %x, %ne_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK: cbz_64 +; CHECK: {{subs.*xzr,|cmp}} x2, #0 +; CHECK-NEXT: csel x0, x1, x0, eq +; CHECK-NEXT: ret +define i64 @cbz_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %tobool = icmp ne i64 %c, 0 + br i1 %tobool, label %ne_bb, label %done + +ne_bb: + br label %done + +done: + %cond = phi i64 [ %x, %ne_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK: tbnz_32 +; CHECK: {{ands.*xzr,|tst}} w2, #0x80 +; CHECK-NEXT: csel w0, w1, w0, ne +; CHECK-NEXT: ret +define i32 @tbnz_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %mask = and i32 %c, 128 + %tobool = icmp eq i32 %mask, 0 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i32 [ %x, %eq_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK: tbnz_64 +; CHECK: {{ands.*xzr,|tst}} x2, #0x8000000000000000 +; CHECK-NEXT: csel x0, x1, x0, ne +; CHECK-NEXT: ret +define i64 @tbnz_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %mask = and i64 %c, 9223372036854775808 + %tobool = icmp eq i64 %mask, 0 + br i1 %tobool, label %eq_bb, label %done + +eq_bb: + br label %done + +done: + %cond = phi i64 [ %x, %eq_bb ], [ %y, %entry ] + ret i64 %cond +} + +; CHECK: tbz_32 +; CHECK: {{ands.*xzr,|tst}} w2, #0x80 +; CHECK-NEXT: csel w0, w1, w0, eq +; CHECK-NEXT: ret +define i32 @tbz_32(i32 %x, i32 %y, i32 %c) nounwind ssp { +entry: + %mask = and i32 %c, 128 + %tobool = icmp ne i32 %mask, 0 + br i1 %tobool, label %ne_bb, label %done + +ne_bb: + br label %done + +done: + %cond = phi i32 [ %x, %ne_bb ], [ %y, %entry ] + ret i32 %cond +} + +; CHECK: tbz_64 +; CHECK: {{ands.*xzr,|tst}} x2, #0x8000000000000000 +; CHECK-NEXT: csel x0, x1, x0, eq +; CHECK-NEXT: ret +define i64 @tbz_64(i64 %x, i64 %y, i64 %c) nounwind ssp { +entry: + %mask = and i64 %c, 9223372036854775808 + %tobool = icmp ne i64 %mask, 0 + br i1 %tobool, label %ne_bb, label %done + +ne_bb: + br label %done + +done: + %cond = phi i64 [ %x, %ne_bb ], [ %y, %entry ] + ret i64 %cond +} + +; This function from 175.vpr folds an ADDWri into a CSINC. +; Remember to clear the kill flag on the ADDWri. +define i32 @get_ytrack_to_xtracks() nounwind ssp { +entry: + br label %for.body + +for.body: + %x0 = load i32* undef, align 4 + br i1 undef, label %if.then.i146, label %is_sbox.exit155 + +if.then.i146: + %add8.i143 = add nsw i32 0, %x0 + %rem.i144 = srem i32 %add8.i143, %x0 + %add9.i145 = add i32 %rem.i144, 1 + br label %is_sbox.exit155 + +is_sbox.exit155: ; preds = %if.then.i146, %for.body + %seg_offset.0.i151 = phi i32 [ %add9.i145, %if.then.i146 ], [ undef, %for.body ] + %idxprom15.i152 = sext i32 %seg_offset.0.i151 to i64 + %arrayidx18.i154 = getelementptr inbounds i32* null, i64 %idxprom15.i152 + %x1 = load i32* %arrayidx18.i154, align 4 + br i1 undef, label %for.body51, label %for.body + +for.body51: ; preds = %is_sbox.exit155 + call fastcc void @get_switch_type(i32 %x1, i32 undef, i16 signext undef, i16 signext undef, i16* undef) + unreachable +} +declare fastcc void @get_switch_type(i32, i32, i16 signext, i16 signext, i16* nocapture) nounwind ssp diff --git a/test/CodeGen/AArch64/arm64-elf-calls.ll b/test/CodeGen/AArch64/arm64-elf-calls.ll new file mode 100644 index 000000000000..8c4020327b91 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-elf-calls.ll @@ -0,0 +1,20 @@ +; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s +; RUN: llc -mtriple=arm64-linux-gnu -filetype=obj -o - %s | llvm-objdump -triple=arm64-linux-gnu - -r | FileCheck %s --check-prefix=CHECK-OBJ + +declare void @callee() + +define void @caller() { + call void @callee() + ret void +; CHECK-LABEL: caller: +; CHECK: bl callee +; CHECK-OBJ: R_AARCH64_CALL26 callee +} + +define void @tail_caller() { + tail call void @callee() + ret void +; CHECK-LABEL: tail_caller: +; CHECK: b callee +; CHECK-OBJ: R_AARCH64_JUMP26 callee +} diff --git a/test/CodeGen/AArch64/arm64-elf-constpool.ll b/test/CodeGen/AArch64/arm64-elf-constpool.ll new file mode 100644 index 000000000000..95d334376b76 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-elf-constpool.ll @@ -0,0 +1,13 @@ +; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s +; RUN: llc -mtriple=arm64-linux-gnu -O0 -o - %s | FileCheck %s + +; O0 checked for fastisel purposes. It has a separate path which +; creates a constpool entry for floating values. + +define double @needs_const() { + ret double 3.14159 +; CHECK: .LCPI0_0: + +; CHECK: adrp {{x[0-9]+}}, .LCPI0_0 +; CHECK: ldr d0, [{{x[0-9]+}}, :lo12:.LCPI0_0] +} diff --git a/test/CodeGen/AArch64/arm64-elf-globals.ll b/test/CodeGen/AArch64/arm64-elf-globals.ll new file mode 100644 index 000000000000..4ed44e7c17af --- /dev/null +++ b/test/CodeGen/AArch64/arm64-elf-globals.ll @@ -0,0 +1,115 @@ +; RUN: llc -mtriple=arm64-linux-gnu -o - %s -mcpu=cyclone | FileCheck %s +; RUN: llc -mtriple=arm64-linux-gnu -o - %s -O0 -mcpu=cyclone | FileCheck %s --check-prefix=CHECK-FAST +; RUN: llc -mtriple=arm64-linux-gnu -relocation-model=pic -o - %s -mcpu=cyclone | FileCheck %s --check-prefix=CHECK-PIC +; RUN: llc -mtriple=arm64-linux-gnu -O0 -relocation-model=pic -o - %s -mcpu=cyclone | FileCheck %s --check-prefix=CHECK-FAST-PIC + +@var8 = external global i8, align 1 +@var16 = external global i16, align 2 +@var32 = external global i32, align 4 +@var64 = external global i64, align 8 + +define i8 @test_i8(i8 %new) { + %val = load i8* @var8, align 1 + store i8 %new, i8* @var8 + ret i8 %val +; CHECK-LABEL: test_i8: +; CHECK: adrp x[[HIREG:[0-9]+]], var8 +; CHECK: ldrb {{w[0-9]+}}, [x[[HIREG]], :lo12:var8] +; CHECK: strb {{w[0-9]+}}, [x[[HIREG]], :lo12:var8] + +; CHECK-PIC-LABEL: test_i8: +; CHECK-PIC: adrp x[[HIREG:[0-9]+]], :got:var8 +; CHECK-PIC: ldr x[[VAR_ADDR:[0-9]+]], [x[[HIREG]], :got_lo12:var8] +; CHECK-PIC: ldrb {{w[0-9]+}}, [x[[VAR_ADDR]]] + +; CHECK-FAST: adrp x[[HIREG:[0-9]+]], var8 +; CHECK-FAST: ldrb {{w[0-9]+}}, [x[[HIREG]], :lo12:var8] + +; CHECK-FAST-PIC: adrp x[[HIREG:[0-9]+]], :got:var8 +; CHECK-FAST-PIC: ldr x[[VARADDR:[0-9]+]], [x[[HIREG]], :got_lo12:var8] +; CHECK-FAST-PIC: ldr {{w[0-9]+}}, [x[[VARADDR]]] +} + +define i16 @test_i16(i16 %new) { + %val = load i16* @var16, align 2 + store i16 %new, i16* @var16 + ret i16 %val +; CHECK-LABEL: test_i16: +; CHECK: adrp x[[HIREG:[0-9]+]], var16 +; CHECK: ldrh {{w[0-9]+}}, [x[[HIREG]], :lo12:var16] +; CHECK: strh {{w[0-9]+}}, [x[[HIREG]], :lo12:var16] + +; CHECK-FAST: adrp x[[HIREG:[0-9]+]], var16 +; CHECK-FAST: ldrh {{w[0-9]+}}, [x[[HIREG]], :lo12:var16] +} + +define i32 @test_i32(i32 %new) { + %val = load i32* @var32, align 4 + store i32 %new, i32* @var32 + ret i32 %val +; CHECK-LABEL: test_i32: +; CHECK: adrp x[[HIREG:[0-9]+]], var32 +; CHECK: ldr {{w[0-9]+}}, [x[[HIREG]], :lo12:var32] +; CHECK: str {{w[0-9]+}}, [x[[HIREG]], :lo12:var32] + +; CHECK-FAST: adrp x[[HIREG:[0-9]+]], var32 +; CHECK-FAST: add {{x[0-9]+}}, x[[HIREG]], :lo12:var32 +} + +define i64 @test_i64(i64 %new) { + %val = load i64* @var64, align 8 + store i64 %new, i64* @var64 + ret i64 %val +; CHECK-LABEL: test_i64: +; CHECK: adrp x[[HIREG:[0-9]+]], var64 +; CHECK: ldr {{x[0-9]+}}, [x[[HIREG]], :lo12:var64] +; CHECK: str {{x[0-9]+}}, [x[[HIREG]], :lo12:var64] + +; CHECK-FAST: adrp x[[HIREG:[0-9]+]], var64 +; CHECK-FAST: add {{x[0-9]+}}, x[[HIREG]], :lo12:var64 +} + +define i64* @test_addr() { + ret i64* @var64 +; CHECK-LABEL: test_addr: +; CHECK: adrp [[HIREG:x[0-9]+]], var64 +; CHECK: add x0, [[HIREG]], :lo12:var64 + +; CHECK-FAST: adrp [[HIREG:x[0-9]+]], var64 +; CHECK-FAST: add x0, [[HIREG]], :lo12:var64 +} + +@hiddenvar = hidden global i32 0, align 4 +@protectedvar = protected global i32 0, align 4 + +define i32 @test_vis() { + %lhs = load i32* @hiddenvar, align 4 + %rhs = load i32* @protectedvar, align 4 + %ret = add i32 %lhs, %rhs + ret i32 %ret +; CHECK-PIC: adrp {{x[0-9]+}}, hiddenvar +; CHECK-PIC: ldr {{w[0-9]+}}, [{{x[0-9]+}}, :lo12:hiddenvar] +; CHECK-PIC: adrp {{x[0-9]+}}, protectedvar +; CHECK-PIC: ldr {{w[0-9]+}}, [{{x[0-9]+}}, :lo12:protectedvar] +} + +@var_default = external global [2 x i32] + +define i32 @test_default_align() { + %addr = getelementptr [2 x i32]* @var_default, i32 0, i32 0 + %val = load i32* %addr + ret i32 %val +; CHECK-LABEL: test_default_align: +; CHECK: adrp x[[HIREG:[0-9]+]], var_default +; CHECK: ldr w0, [x[[HIREG]], :lo12:var_default] +} + +define i64 @test_default_unaligned() { + %addr = bitcast [2 x i32]* @var_default to i64* + %val = load i64* %addr + ret i64 %val +; CHECK-LABEL: test_default_unaligned: +; CHECK: adrp [[HIREG:x[0-9]+]], var_default +; CHECK: add x[[ADDR:[0-9]+]], [[HIREG]], :lo12:var_default +; CHECK: ldr x0, [x[[ADDR]]] +} diff --git a/test/CodeGen/AArch64/arm64-ext.ll b/test/CodeGen/AArch64/arm64-ext.ll new file mode 100644 index 000000000000..67860de51b0f --- /dev/null +++ b/test/CodeGen/AArch64/arm64-ext.ll @@ -0,0 +1,118 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s + +define <8 x i8> @test_vextd(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextd: +;CHECK: {{ext.8b.*#3}} + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + ret <8 x i8> %tmp3 +} + +define <8 x i8> @test_vextRd(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextRd: +;CHECK: {{ext.8b.*#5}} + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + ret <8 x i8> %tmp3 +} + +define <16 x i8> @test_vextq(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextq: +;CHECK: {{ext.16b.*3}} + %tmp1 = load <16 x i8>* %A + %tmp2 = load <16 x i8>* %B + %tmp3 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + ret <16 x i8> %tmp3 +} + +define <16 x i8> @test_vextRq(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextRq: +;CHECK: {{ext.16b.*7}} + %tmp1 = load <16 x i8>* %A + %tmp2 = load <16 x i8>* %B + %tmp3 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + ret <16 x i8> %tmp3 +} + +define <4 x i16> @test_vextd16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK-LABEL: test_vextd16: +;CHECK: {{ext.8b.*#6}} + %tmp1 = load <4 x i16>* %A + %tmp2 = load <4 x i16>* %B + %tmp3 = shufflevector <4 x i16> %tmp1, <4 x i16> %tmp2, <4 x i32> + ret <4 x i16> %tmp3 +} + +define <4 x i32> @test_vextq32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK-LABEL: test_vextq32: +;CHECK: {{ext.16b.*12}} + %tmp1 = load <4 x i32>* %A + %tmp2 = load <4 x i32>* %B + %tmp3 = shufflevector <4 x i32> %tmp1, <4 x i32> %tmp2, <4 x i32> + ret <4 x i32> %tmp3 +} + +; Undef shuffle indices should not prevent matching to VEXT: + +define <8 x i8> @test_vextd_undef(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextd_undef: +;CHECK: {{ext.8b.*}} + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + ret <8 x i8> %tmp3 +} + +define <8 x i8> @test_vextd_undef2(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextd_undef2: +;CHECK: {{ext.8b.*#6}} + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = shufflevector <8 x i8> %tmp1, <8 x i8> %tmp2, <8 x i32> + ret <8 x i8> %tmp3 +} + +define <16 x i8> @test_vextRq_undef(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK-LABEL: test_vextRq_undef: +;CHECK: {{ext.16b.*#7}} + %tmp1 = load <16 x i8>* %A + %tmp2 = load <16 x i8>* %B + %tmp3 = shufflevector <16 x i8> %tmp1, <16 x i8> %tmp2, <16 x i32> + ret <16 x i8> %tmp3 +} + +define <8 x i16> @test_vextRq_undef2(<8 x i16>* %A) nounwind { +;CHECK-LABEL: test_vextRq_undef2: +;CHECK: {{ext.16b.*#10}} + %tmp1 = load <8 x i16>* %A + %vext = shufflevector <8 x i16> %tmp1, <8 x i16> undef, <8 x i32> + ret <8 x i16> %vext; +} + +; Tests for ReconstructShuffle function. Indices have to be carefully +; chosen to reach lowering phase as a BUILD_VECTOR. + +; One vector needs vext, the other can be handled by extract_subvector +; Also checks interleaving of sources is handled correctly. +; Essence: a vext is used on %A and something saner than stack load/store for final result. +define <4 x i16> @test_interleaved(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK-LABEL: test_interleaved: +;CHECK: ext.8b +;CHECK: zip1.4h + %tmp1 = load <8 x i16>* %A + %tmp2 = load <8 x i16>* %B + %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <4 x i32> + ret <4 x i16> %tmp3 +} + +; An undef in the shuffle list should still be optimizable +define <4 x i16> @test_undef(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK-LABEL: test_undef: +;CHECK: zip1.4h + %tmp1 = load <8 x i16>* %A + %tmp2 = load <8 x i16>* %B + %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <4 x i32> + ret <4 x i16> %tmp3 +} diff --git a/test/CodeGen/AArch64/arm64-extend-int-to-fp.ll b/test/CodeGen/AArch64/arm64-extend-int-to-fp.ll new file mode 100644 index 000000000000..048fdb083a41 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extend-int-to-fp.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -march=arm64 -aarch64-neon-syntax=apple | FileCheck %s + +define <4 x float> @foo(<4 x i16> %a) nounwind { +; CHECK-LABEL: foo: +; CHECK: ushll.4s v0, v0, #0 +; CHECK-NEXT: ucvtf.4s v0, v0 +; CHECK-NEXT: ret + %vcvt.i = uitofp <4 x i16> %a to <4 x float> + ret <4 x float> %vcvt.i +} + +define <4 x float> @bar(<4 x i16> %a) nounwind { +; CHECK-LABEL: bar: +; CHECK: sshll.4s v0, v0, #0 +; CHECK-NEXT: scvtf.4s v0, v0 +; CHECK-NEXT: ret + %vcvt.i = sitofp <4 x i16> %a to <4 x float> + ret <4 x float> %vcvt.i +} diff --git a/test/CodeGen/AArch64/arm64-extend.ll b/test/CodeGen/AArch64/arm64-extend.ll new file mode 100644 index 000000000000..afcaca2c4920 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extend.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s +@array = external global [0 x i32] + +define i64 @foo(i32 %i) { +; CHECK: foo +; CHECK: adrp x[[REG:[0-9]+]], _array@GOTPAGE +; CHECK: ldr x[[REG1:[0-9]+]], [x[[REG]], _array@GOTPAGEOFF] +; CHECK: ldrsw x0, [x[[REG1]], w0, sxtw #2] +; CHECK: ret + %idxprom = sext i32 %i to i64 + %arrayidx = getelementptr inbounds [0 x i32]* @array, i64 0, i64 %idxprom + %tmp1 = load i32* %arrayidx, align 4 + %conv = sext i32 %tmp1 to i64 + ret i64 %conv +} diff --git a/test/CodeGen/AArch64/arm64-extern-weak.ll b/test/CodeGen/AArch64/arm64-extern-weak.ll new file mode 100644 index 000000000000..a239403befa5 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extern-weak.ll @@ -0,0 +1,51 @@ +; RUN: llc -mtriple=arm64-none-linux-gnu -o - < %s | FileCheck %s +; RUN: llc -mtriple=arm64-none-linux-gnu -code-model=large -o - < %s | FileCheck --check-prefix=CHECK-LARGE %s + +declare extern_weak i32 @var() + +define i32()* @foo() { +; The usual ADRP/ADD pair can't be used for a weak reference because it must +; evaluate to 0 if the symbol is undefined. We use a litpool entry. + ret i32()* @var + +; CHECK: adrp x[[VAR:[0-9]+]], :got:var +; CHECK: ldr x0, [x[[VAR]], :got_lo12:var] + + ; In the large model, the usual relocations are absolute and can + ; materialise 0. +; CHECK-LARGE: movz x0, #:abs_g3:var +; CHECK-LARGE: movk x0, #:abs_g2_nc:var +; CHECK-LARGE: movk x0, #:abs_g1_nc:var +; CHECK-LARGE: movk x0, #:abs_g0_nc:var +} + + +@arr_var = extern_weak global [10 x i32] + +define i32* @bar() { + %addr = getelementptr [10 x i32]* @arr_var, i32 0, i32 5 +; CHECK: adrp x[[ARR_VAR_HI:[0-9]+]], :got:arr_var +; CHECK: ldr [[ARR_VAR:x[0-9]+]], [x[[ARR_VAR_HI]], :got_lo12:arr_var] +; CHECK: add x0, [[ARR_VAR]], #20 + ret i32* %addr + + ; In the large model, the usual relocations are absolute and can + ; materialise 0. +; CHECK-LARGE: movz [[ARR_VAR:x[0-9]+]], #:abs_g3:arr_var +; CHECK-LARGE: movk [[ARR_VAR]], #:abs_g2_nc:arr_var +; CHECK-LARGE: movk [[ARR_VAR]], #:abs_g1_nc:arr_var +; CHECK-LARGE: movk [[ARR_VAR]], #:abs_g0_nc:arr_var +} + +@defined_weak_var = internal unnamed_addr global i32 0 + +define i32* @wibble() { + ret i32* @defined_weak_var +; CHECK: adrp [[BASE:x[0-9]+]], defined_weak_var +; CHECK: add x0, [[BASE]], :lo12:defined_weak_var + +; CHECK-LARGE: movz x0, #:abs_g3:defined_weak_var +; CHECK-LARGE: movk x0, #:abs_g2_nc:defined_weak_var +; CHECK-LARGE: movk x0, #:abs_g1_nc:defined_weak_var +; CHECK-LARGE: movk x0, #:abs_g0_nc:defined_weak_var +} diff --git a/test/CodeGen/AArch64/arm64-extload-knownzero.ll b/test/CodeGen/AArch64/arm64-extload-knownzero.ll new file mode 100644 index 000000000000..14e5fd310d7b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extload-knownzero.ll @@ -0,0 +1,28 @@ +; RUN: llc < %s -march=arm64 | FileCheck %s +; rdar://12771555 + +define void @foo(i16* %ptr, i32 %a) nounwind { +entry: +; CHECK-LABEL: foo: + %tmp1 = icmp ult i32 %a, 100 + br i1 %tmp1, label %bb1, label %bb2 +bb1: +; CHECK: %bb1 +; CHECK: ldrh [[REG:w[0-9]+]] + %tmp2 = load i16* %ptr, align 2 + br label %bb2 +bb2: +; CHECK: %bb2 +; CHECK-NOT: and {{w[0-9]+}}, [[REG]], #0xffff +; CHECK: cmp [[REG]], #23 + %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ] + %cmp = icmp ult i16 %tmp3, 24 + br i1 %cmp, label %bb3, label %exit +bb3: + call void @bar() nounwind + br label %exit +exit: + ret void +} + +declare void @bar () diff --git a/test/CodeGen/AArch64/arm64-extract.ll b/test/CodeGen/AArch64/arm64-extract.ll new file mode 100644 index 000000000000..01984662d23a --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extract.ll @@ -0,0 +1,58 @@ +; RUN: llc -aarch64-extr-generation=true -verify-machineinstrs < %s \ +; RUN: -march=arm64 | FileCheck %s + +define i64 @ror_i64(i64 %in) { +; CHECK-LABEL: ror_i64: + %left = shl i64 %in, 19 + %right = lshr i64 %in, 45 + %val5 = or i64 %left, %right +; CHECK: ror {{x[0-9]+}}, x0, #45 + ret i64 %val5 +} + +define i32 @ror_i32(i32 %in) { +; CHECK-LABEL: ror_i32: + %left = shl i32 %in, 9 + %right = lshr i32 %in, 23 + %val5 = or i32 %left, %right +; CHECK: ror {{w[0-9]+}}, w0, #23 + ret i32 %val5 +} + +define i32 @extr_i32(i32 %lhs, i32 %rhs) { +; CHECK-LABEL: extr_i32: + %left = shl i32 %lhs, 6 + %right = lshr i32 %rhs, 26 + %val = or i32 %left, %right + ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use + ; something other than w0 and w1. +; CHECK: extr {{w[0-9]+}}, w0, w1, #26 + + ret i32 %val +} + +define i64 @extr_i64(i64 %lhs, i64 %rhs) { +; CHECK-LABEL: extr_i64: + %right = lshr i64 %rhs, 40 + %left = shl i64 %lhs, 24 + %val = or i64 %right, %left + ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use + ; something other than w0 and w1. +; CHECK: extr {{x[0-9]+}}, x0, x1, #40 + + ret i64 %val +} + +; Regression test: a bad experimental pattern crept into git which optimised +; this pattern to a single EXTR. +define i32 @extr_regress(i32 %a, i32 %b) { +; CHECK-LABEL: extr_regress: + + %sh1 = shl i32 %a, 14 + %sh2 = lshr i32 %b, 14 + %val = or i32 %sh2, %sh1 +; CHECK-NOT: extr {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, #{{[0-9]+}} + + ret i32 %val +; CHECK: ret +} diff --git a/test/CodeGen/AArch64/arm64-extract_subvector.ll b/test/CodeGen/AArch64/arm64-extract_subvector.ll new file mode 100644 index 000000000000..8b15a6453b2b --- /dev/null +++ b/test/CodeGen/AArch64/arm64-extract_subvector.ll @@ -0,0 +1,51 @@ +; RUN: llc -march=arm64 -aarch64-neon-syntax=apple < %s | FileCheck %s + +; Extract of an upper half of a vector is an "ext.16b v0, v0, v0, #8" insn. + +define <8 x i8> @v8i8(<16 x i8> %a) nounwind { +; CHECK: v8i8 +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> + ret <8 x i8> %ret +} + +define <4 x i16> @v4i16(<8 x i16> %a) nounwind { +; CHECK-LABEL: v4i16: +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> + ret <4 x i16> %ret +} + +define <2 x i32> @v2i32(<4 x i32> %a) nounwind { +; CHECK-LABEL: v2i32: +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> + ret <2 x i32> %ret +} + +define <1 x i64> @v1i64(<2 x i64> %a) nounwind { +; CHECK-LABEL: v1i64: +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> + ret <1 x i64> %ret +} + +define <2 x float> @v2f32(<4 x float> %a) nounwind { +; CHECK-LABEL: v2f32: +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <4 x float> %a, <4 x float> %a, <2 x i32> + ret <2 x float> %ret +} + +define <1 x double> @v1f64(<2 x double> %a) nounwind { +; CHECK-LABEL: v1f64: +; CHECK: ext.16b v0, v0, v0, #8 +; CHECK: ret + %ret = shufflevector <2 x double> %a, <2 x double> %a, <1 x i32> + ret <1 x double> %ret +} diff --git a/test/CodeGen/AArch64/arm64-fast-isel-addr-offset.ll b/test/CodeGen/AArch64/arm64-fast-isel-addr-offset.ll new file mode 100644 index 000000000000..ebd847e0f728 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-fast-isel-addr-offset.ll @@ -0,0 +1,47 @@ +; RUN: llc < %s -O0 -fast-isel-abort -mtriple=arm64-apple-darwin | FileCheck %s + +@sortlist = common global [5001 x i32] zeroinitializer, align 16 +@sortlist2 = common global [5001 x i64] zeroinitializer, align 16 + +; Load an address with an offset larget then LDR imm can handle +define i32 @foo() nounwind { +entry: +; CHECK: @foo +; CHECK: adrp x[[REG:[0-9]+]], _sortlist@GOTPAGE +; CHECK: ldr x[[REG1:[0-9]+]], [x[[REG]], _sortlist@GOTPAGEOFF] +; CHECK: movz x[[REG2:[0-9]+]], #0x4e20 +; CHECK: add x[[REG3:[0-9]+]], x[[REG1]], x[[REG2]] +; CHECK: ldr w0, [x[[REG3]]] +; CHECK: ret + %0 = load i32* getelementptr inbounds ([5001 x i32]* @sortlist, i32 0, i64 5000), align 4 + ret i32 %0 +} + +define i64 @foo2() nounwind { +entry: +; CHECK: @foo2 +; CHECK: adrp x[[REG:[0-9]+]], _sortlist2@GOTPAGE +; CHECK: ldr x[[REG1:[0-9]+]], [x[[REG]], _sortlist2@GOTPAGEOFF] +; CHECK: movz x[[REG2:[0-9]+]], #0x9c40 +; CHECK: add x[[REG3:[0-9]+]], x[[REG1]], x[[REG2]] +; CHECK: ldr x0, [x[[REG3]]] +; CHECK: ret + %0 = load i64* getelementptr inbounds ([5001 x i64]* @sortlist2, i32 0, i64 5000), align 4 + ret i64 %0 +} + +; Load an address with a ridiculously large offset. +; rdar://12505553 +@pd2 = common global i8* null, align 8 + +define signext i8 @foo3() nounwind ssp { +entry: +; CHECK: @foo3 +; CHECK: movz x[[REG:[0-9]+]], #0xb3a, lsl #32 +; CHECK: movk x[[REG]], #0x73ce, lsl #16 +; CHECK: movk x[[REG]], #0x2ff2 + %0 = load i8** @pd2, align 8 + %arrayidx = getelementptr inbounds i8* %0, i64 12345678901234 + %1 = load i8* %arrayidx, align 1 + ret i8 %1 +} diff --git a/test/CodeGen/AArch64/arm64-fast-isel-alloca.ll b/test/CodeGen/AArch64/arm64-fast-isel-alloca.ll new file mode 100644 index 000000000000..1706e9eba2bd --- /dev/null +++ b/test/CodeGen/AArch64/arm64-fast-isel-alloca.ll @@ -0,0 +1,25 @@ +; This test should cause the TargetMaterializeAlloca to be invoked +; RUN: llc < %s -O0 -fast-isel-abort -mtriple=arm64-apple-darwin | FileCheck %s + +%struct.S1Ty = type { i64 } +%struct.S2Ty = type { %struct.S1Ty, %struct.S1Ty } + +define void @takeS1(%struct.S1Ty* %V) nounwind { +entry: + %V.addr = alloca %struct.S1Ty*, align 8 + store %struct.S1Ty* %V, %struct.S1Ty** %V.addr, align 8 + ret void +} + +define void @main() nounwind { +entry: +; CHECK: main +; CHECK: mov x29, sp +; CHECK: mov x[[REG:[0-9]+]], sp +; CHECK-NEXT: orr x[[REG1:[0-9]+]], xzr, #0x8 +; CHECK-NEXT: add x0, x[[REG]], x[[REG1]] + %E = alloca %struct.S2Ty, align 4 + %B = getelementptr inbounds %struct.S2Ty* %E, i32 0, i32 1 + call void @takeS1(%struct.S1Ty* %B) + ret void +} diff --git a/test/CodeGen/AArch64/arm64-fast-isel-br.ll b/test/CodeGen/AArch64/arm64-fast-isel-br.ll new file mode 100644 index 000000000000..37a8295c8931 --- /dev/null +++ b/test/CodeGen/AArch64/arm64-fast-isel-br.ll @@ -0,0 +1,155 @@ +; RUN: llc < %s -O0 -fast-isel-abort -mtriple=arm64-apple-darwin -mcpu=cyclone | FileCheck %s + +define void @branch1() nounwind uwtable ssp { + %x = alloca i32, align 4 + store i32 0, i32* %x, align 4 + %1 = load i32* %x, align 4 + %2 = icmp ne i32 %1, 0 + br i1 %2, label %3, label %4 + +;