summaryrefslogtreecommitdiffstats
path: root/llvm/test
Commit message (Collapse)AuthorAgeFilesLines
* InstCombine: Don't assume that m_ZExt matches an InstructionDavid Majnemer2014-11-011-0/+13
| | | | | | | | | | | | m_ZExt might bind against a ConstantExpr instead of an Instruction. Assuming this, using cast<Instruction>, results in InstCombine crashing. Instead, introduce ZExtOperator to bridge both Instruction and ConstantExpr ZExts. This fixes PR21445. llvm-svn: 221069
* Remove test coverage added in 221067 due to it being non-portable.David Blaikie2014-11-011-1/+1
| | | | | | | Will try to find a portable way to test this (or a fixed-target test I can add such coverage to) shortly. llvm-svn: 221068
* Remove DwarfUnit::LabelEnd in favor of computing the length of the section ↵David Blaikie2014-11-012-3/+3
| | | | | | | | | | directly This was a compile-unit specific label (unused in type units) and seems unnecessary anyway when we can more easily directly compute the size of the compile unit. llvm-svn: 221067
* InstCombine: Combine (X+cst) < 0 --> X < -cstDavid Majnemer2014-11-011-0/+32
| | | | | | | | | | | | | This can happen pretty often in code that looks like: int foo = bar - 1; if (foo < 0) do stuff In this case, bar < 1 is an equivalent condition. This transform requires that the add instruction be annotated with nsw. llvm-svn: 221045
* Revert "Temporarily revert r220777 to sort out build bot breakage."Adrian Prantl2014-11-012-2/+46
| | | | | | | This reverts commit r221028. Later commits depend on this and reverting just this one causes even more bots to fail. llvm-svn: 221041
* Add show and merge tools for sample PGO profiles.Diego Novillo2014-11-012-0/+42
| | | | | | | | | | | | | | | | | | | | | Summary: This patch extends the 'show' and 'merge' commands in llvm-profdata to handle sample PGO formats. Using the 'merge' command it is now possible to convert one sample PGO format to another. The only format that is currently not working is 'gcc'. I still need to implement support for it in lib/ProfileData. The changes in the sample profile support classes are needed for the merge operation. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6065 llvm-svn: 221032
* Temporarily revert r220777 to sort out build bot breakage.Adrian Prantl2014-11-012-46/+2
| | | | | | "[x86] Simplify vector selection if condition value type matches vselect value type and true value is all ones or false value is all zeros." llvm-svn: 221028
* Revert "R600: Make sure to inline all internal functions"Reid Kleckner2014-10-312-25/+1
| | | | | | | | | This reverts commit r220996. It introduced layering violations causing link errors in many configurations. llvm-svn: 221020
* Refactor duplicated code in liking GlobalValues.Rafael Espindola2014-10-312-3/+11
| | | | | | | | | There is quiet a bit of logic that is common to any GlobalValue but was duplicated for Functions, GlobalVariables and GlobalAliases. While at it, merge visibility even when comdats are used, fixing pr21415. llvm-svn: 221014
* Correctly update dom-tree after loop vectorizer.Michael Zolotukhin2014-10-311-0/+142
| | | | llvm-svn: 221009
* R600: Don't promote allocas when one of the users is a ptrtoint instructionTom Stellard2014-10-311-0/+19
| | | | | | | | We need to figure out how to track ptrtoint values all the way until result is converted back to a pointer in order to correctly rewrite the pointer type. llvm-svn: 220997
* R600: Make sure to inline all internal functionsTom Stellard2014-10-312-1/+25
| | | | | | Function calls aren't supported yet. llvm-svn: 220996
* [PowerPC] Initial VSX intrinsic support, with min/max for vector doubleBill Schmidt2014-10-311-0/+98
| | | | | | | | | | | | | Now that we have initial support for VSX, we can begin adding intrinsics for programmer access to VSX instructions. This patch adds basic support for VSX intrinsics in general, and tests it by implementing intrinsics for minimum and maximum for the vector double data type. The LLVM portion of this is quite straightforward. There is a companion patch for Clang. llvm-svn: 220988
* [asan] do not treat inline asm calls as indirect callsKostya Serebryany2014-10-311-0/+1
| | | | llvm-svn: 220985
* [CodeGenPrepare] Move extractelement close to store if they can be combined.Quentin Colombet2014-10-311-0/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an optimization in CodeGenPrepare to move an extractelement right before a store when the target can combine them. The optimization may promote any scalar operations to vector operations in the way to make that possible. ** Context ** Some targets use different register files for both vector and scalar operations. This means that transitioning from one domain to another may incur copy from one register file to another. These copies are not coalescable and may be expensive. For example, according to the scheduling model, on cortex-A8 a vector to GPR move is 20 cycles. ** Motivating Example ** Let us consider an example: define void @foo(<2 x i32>* %addr1, i32* %dest) { %in1 = load <2 x i32>* %addr1, align 8 %extract = extractelement <2 x i32> %in1, i32 1 %out = or i32 %extract, 1 store i32 %out, i32* %dest, align 4 ret void } As it is, this IR generates the following assembly on armv7: vldr d16, [r0] @vector load vmov.32 r0, d16[1] @ cross-register-file copy: 20 cycles orr r0, r0, #1 @ scalar bitwise or str r0, [r1] @ scalar store bx lr Whereas we could generate much faster code: vldr d16, [r0] @ vector load vorr.i32 d16, #0x1 @ vector bitwise or vst1.32 {d16[1]}, [r1:32] @ vector extract + store bx lr Half of the computation made in the vector is useless, but this allows to get rid of the expensive cross-register-file copy. ** Proposed Solution ** To avoid this cross-register-copy penalty, we promote the scalar operations to vector operations. The penalty will be removed if we manage to promote the whole chain of computation in the vector domain. Currently, we do that only when the chain of computation ends by a store and the target is able to combine an extract with a store. Stores are the most likely candidates, because other instructions produce values that would need to be promoted and so, extracted as some point[1]. Moreover, this is customary that targets feature stores that perform a vector extract (see AArch64 and X86 for instance). The proposed implementation relies on the TargetTransformInfo to decide whether or not it is beneficial to promote a chain of computation in the vector domain. Unfortunately, this interface is rather inaccurate for this level of details and although this optimization may be beneficial for X86 and AArch64, the inaccuracy will lead to the optimization being too aggressive. Basically in TargetTransformInfo, everything that is legal has a cost of 1, whereas, even if a vector type is legal, usually a vector operation is slightly more expensive than its scalar counterpart. That will lead to too many promotions that may not be counter balanced by the saving of the cross-register-file copy. For instance, on AArch64 this penalty is just 4 cycles. For now, the optimization is just enabled for ARM prior than v8, since those processors have a larger penalty on cross-register-file copies, and the scope is limited to basic blocks. Because of these two factors, we limit the effects of the inaccuracy. Indeed, I did not want to build up a fancy cost model with block frequency and everything on top of that. [1] We can imagine targets that can combine an extractelement with other instructions than just stores. If we want to go into that direction, the current interfaces must be augmented and, moreover, I think this becomes a global isel problem. Differential Revision: http://reviews.llvm.org/D5921 <rdar://problem/14170854> llvm-svn: 220978
* [asan] fix caller-calee instrumentation to emit new cache for every call siteKostya Serebryany2014-10-311-1/+5
| | | | llvm-svn: 220973
* Unify and update link-messages.ll and redefinition.ll. NFC.Rafael Espindola2014-10-313-17/+5
| | | | llvm-svn: 220968
* [AArch64] CondOpt pass is missing FCMP instructions when searching backward forChad Rosier2014-10-311-0/+64
| | | | | | | | | a CMP which defines the flags used by B.CC. http://reviews.llvm.org/D6047 Patch by Zhaoshi Zheng <zhaoshiz@codeaurora.org>! llvm-svn: 220961
* [SCEV] Improve Scalar Evolution's use of no {un,}signed wrap flagsBradley Smith2014-10-312-2/+53
| | | | | | | | | | | | | | | In a case where we have a no {un,}signed wrap flag on the increment, if RHS - Start is constant then we can avoid inserting a max operation bewteen the two, since we can statically determine which is greater. This allows us to unroll loops such as: void testcase3(int v) { for (int i=v; i<=v+1; ++i) f(i); } llvm-svn: 220960
* [PowerPC] Load BlockAddress values from the TOC in 64-bit SVR4 codeUlrich Weigand2014-10-311-0/+26
| | | | | | | | | | | | | | Since block address values can be larger than 2GB in 64-bit code, they cannot be loaded simply using an @l / @ha pair, but instead must be loaded from the TOC, just like GlobalAddress, ConstantPool, and JumpTable values are. The commit also fixes a bug in PPCLinuxAsmPrinter::doFinalization where temporary labels could not be used as TOC values, since code would attempt (and fail) to use GetOrCreateSymbol to create a symbol of the same name as the temporary label. llvm-svn: 220959
* [OCaml] Ensure consistent naming.Peter Zotov2014-10-3114-0/+0
| | | | | | | | | Specifically: * Directories match module names. * Test names match module names. * The language is called "OCaml", not "Ocaml". llvm-svn: 220958
* [OCaml] Rework Llvm_executionengine using ctypes.Peter Zotov2014-10-311-75/+45
| | | | | | | | | | | | | | | | | | | | | | | | Since JIT->MCJIT migration, most of the ExecutionEngine interface became deprecated and/or broken. This especially affected the OCaml bindings, as runFunction is no longer available, and unlike in C, it is not possible to coerce a pointer to a function and call it in OCaml. In practice, LLVM 3.5 shipped completely unusable Llvm_executionengine. The GenericValue interface and runFunction were essentially a poor man's FFI. As such, this interface was removed and instead a dependency on ctypes >=0.3 added, which handled platform-specific aspects of accessing data and calling functions. The new interface does not expose JIT (which is a shim around MCJIT), as well as the interpreter (which can't handle a lot of valid IR). Llvm_executionengine.add_global_mapping is currently unusable due to PR20656. llvm-svn: 220957
* Move an input file to Inputs instead of using RUN: true.Rafael Espindola2014-10-312-7/+3
| | | | llvm-svn: 220953
* Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer2014-10-314-7/+7
| | | | | | | Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things. llvm-svn: 220952
* merge tests for constant linking.Rafael Espindola2014-10-316-27/+10
| | | | llvm-svn: 220951
* PR20557: Fix the bug that bogus cpu parameter crashes llc on AArch64 backend.Hao Liu2014-10-311-0/+8
| | | | | | Initial patch by Oleg Ranevskyy. llvm-svn: 220945
* [SelectionDAG] When scalarizing trunc, don't assert for legal operands.Ahmed Bougacha2014-10-301-1/+20
| | | | | | | | | | | | | | | | | | | | | r212242 introduced a legalizer hook, originally to let AArch64 widen v1i{32,16,8} rather than scalarize, because the legalizer expected, when scalarizing the result of a conversion operation, to already have scalarized the operands. On AArch64, v1i64 is legal, so that commit ensured operations such as v1i32 = trunc v1i64 wouldn't assert. It did that by choosing to widen v1 types whenever possible. However, v1i1 types, for which there's no legal widened type, would still trigger the assert. This commit fixes that, by only scalarizing a trunc's result when the operand has already been scalarized, and introducing an extract_elt otherwise. This is similar to r205625. Fixes PR20777. llvm-svn: 220937
* llvm/test/Transforms/SampleProfile/syntax.ll: Relax MISSING-FILE not toNAKAMURA Takumi2014-10-301-1/+1
| | | | | | check locale-aware message catalog. llvm-svn: 220934
* Fix incorrect invariant check in DAG CombineLouis Gerbarg2014-10-301-0/+36
| | | | | | | | | | | | | Earlier this summer I fixed an issue where we were incorrectly combining multiple loads that had different constraints such alignment, invariance, temporality, etc. Apparently in one case I made copt paste error and swapped alignment and invariance. Tests included. rdar://18816719 llvm-svn: 220933
* Fix the merging of the constantness of declarations.Rafael Espindola2014-10-301-1/+1
| | | | | | | | | | | | | | | | | The langref says: LLVM explicitly allows declarations of global variables to be marked constant, even if the final definition of the global is not. This capability can be used to enable slightly better optimization of the program, but requires the language definition to guarantee that optimizations based on the ‘constantness’ are valid for the translation units that do not include the definition. Given that definition, when merging two declarations, we have to drop constantness if of of them is not marked contant, since the Module without the constant marker might not have the necessary guarantees. llvm-svn: 220927
* Add handling for range metadata in ValueTracking isKnownNonZeroPhilip Reames2014-10-301-0/+61
| | | | | | | | | | | If we load from a location with range metadata, we can use information about the ranges of the loaded value for optimization purposes. This helps to remove redundant checks and canonicalize checks for other optimization passes. This particular patch checks whether a value is known to be non-zero from the range metadata. Currently, these tests are against InstCombine. In theory, all of these should be InstSimplify since we're not inserting any new instructions. Moving the code may follow in a separate change. Reviewed by: Hal Differential Revision: http://reviews.llvm.org/D5947 llvm-svn: 220925
* Update test to pass .ll to llvm-link and use Inputs.Rafael Espindola2014-10-302-7/+5
| | | | llvm-svn: 220924
* PR21408: Workaround the appearance of duplicate variables due to problems ↵David Blaikie2014-10-301-0/+117
| | | | | | when inlining two calls to the same function from the same call site. llvm-svn: 220923
* lit: PR21417: don't try to update OCAMLPATH if LibDir is empty.Peter Zotov2014-10-301-6/+8
| | | | llvm-svn: 220919
* Add profile writing capabilities for sampling profiles.Diego Novillo2014-10-304-1/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch finishes up support for handling sampling profiles in both text and binary formats. The new binary format uses uleb128 encoding to represent numeric values. This makes profiles files about 25% smaller. The profile writer class can write profiles in the existing text and the new binary format. In subsequent patches, I will add the capability to read (and perhaps write) profiles in the gcov format used by GCC. Additionally, I will be adding support in llvm-profdata to manipulate sampling profiles. There was a bit of refactoring needed to separate some code that was in the reader files, but is actually common to both the reader and writer. The new test checks that reading the same profile encoded as text or raw, produces the same results. Reviewers: bogner, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6000 llvm-svn: 220915
* ARM: test default values for TAG_CPU_unaligned_access attribute.Tim Northover2014-10-301-0/+9
| | | | | | | | | It should be on for every target that supports unaligned accesses (e.g. not v6m). Patch by Charlie Turner. llvm-svn: 220912
* [AVX512] Added VBROADCAST{SS/SD} encoding for VL subset.Robert Khasanov2014-10-302-0/+220
| | | | | | | Refactored through AVX512_maskable llvm-svn: 220908
* [dfsan] New calling convention for custom functions with variadic arguments.Peter Collingbourne2014-10-301-21/+30
| | | | | | | | | | | | | | | | | | | Summary: The previous calling convention prevented custom functions from being able to access argument labels unless it knew how many variadic arguments there were, and of which type. This restriction made it impossible to correctly model functions in the printf family, as it is legal to pass more arguments than required to those functions. We now pass arguments in the following order: non-vararg arguments labels for non-vararg arguments [if vararg function, pointer to array of labels for vararg arguments] [if non-void function, pointer to label for return value] vararg arguments Differential Revision: http://reviews.llvm.org/D6028 llvm-svn: 220906
* [OCaml] Expose LLVM{Get,Set}DLLStorageClass.Peter Zotov2014-10-301-1/+8
| | | | llvm-svn: 220902
* [OCaml] Test code emission in Llvm_target.Peter Zotov2014-10-301-4/+3
| | | | | | | | | Prior to this commit, the Llvm_target tests (ab)used the Llvm_executionengine as a mechanism to initialize at least some target. This needlessly restricted tests to builds which can emit code for their host architecture. llvm-svn: 220901
* [OCaml] Enable backtraces in tests.Peter Zotov2014-10-3014-13/+16
| | | | llvm-svn: 220900
* [OCaml] [autoconf] Migrate to ocamlfind.Peter Zotov2014-10-3017-64/+54
| | | | | | | | | | | | | | | | | | | | | | This commit updates the OCaml bindings and tests to use ocamlfind. The bindings are migrated in order to use ctypes, which are now required for MCJIT-backed Llvm_executionengine. The tests are migrated in order to use OUnit and to verify that the distributed META.llvm allows to build working executables. Every OCaml toolchain invocation is now chained through ocamlfind, which (in theory) allows to cross-compile the OCaml bindings. The configure script now checks for ctypes (>= 0.2.3) and OUnit (>= 2). The code depending on these libraries will be added later. The configure script does not check the package versions in order to keep changes less invasive. Additionally, OCaml bindings will now be automatically enabled if ocamlfind is detected on the system, rather than ocamlc, as it was before. llvm-svn: 220899
* Enable the slp vectorizer in the gold plugin.Rafael Espindola2014-10-301-0/+30
| | | | llvm-svn: 220887
* Enable the loop vectorizer in the gold plugin.Rafael Espindola2014-10-301-0/+30
| | | | llvm-svn: 220886
* Replace also-emit-llvm with save-temps.Rafael Espindola2014-10-291-7/+9
| | | | | | | | The also-emit-llvm option only supported getting the IR before optimizations. This patch replaces it with a more generic save-temps option that saves the IR both before and after optimizations. llvm-svn: 220885
* llvm/test/Transforms/LoopRotate/nosimplifylatch.ll: Fix possibly ↵NAKAMURA Takumi2014-10-291-36/+0
| | | | | | mis-repeatedly-pasted test. llvm-svn: 220880
* Test Case for r220872:Do not simplifyLatch for loops where hoisting ↵Yi Jiang2014-10-291-0/+70
| | | | | | increments couldresult in extra live range interferance llvm-svn: 220873
* Do not simplifyLatch for loops where hoisting increments couldresult in ↵Yi Jiang2014-10-292-4/+4
| | | | | | extra live range interferance llvm-svn: 220872
* Fix getRelocationValueString to return the symbol name for EM_386.Jan Wen Voung2014-10-292-6/+6
| | | | | | | | | | | | | | Summary: This helps llvm-objdump -r to print out the symbol name along with the relocation type on x86. Adjust existing tests from checking for "Unknown" to check for the symbol now. Test Plan: Adjusted test/Object tests. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5987 llvm-svn: 220866
* [AVX512] Implemented AVX512VL FP bnary packed instructions (VADDP*, VSUBP*, ↵Robert Khasanov2014-10-291-0/+1344
| | | | | | | | | VMULP*, VDIVP*, VMAXP*, VMINP*) Refactored through AVX512_maskable Added encoding tests for them. llvm-svn: 220858
OpenPOWER on IntegriCloud