summaryrefslogtreecommitdiffstats
path: root/llvm/test
Commit message (Collapse)AuthorAgeFilesLines
* Testcase for PR17964Bill Wendling2013-11-171-0/+10
| | | | llvm-svn: 194961
* DAGCombiner: Partially revert r192795, getNOT was fixed not to create ↵Benjamin Kramer2013-11-171-0/+2
| | | | | | illegal constants. llvm-svn: 194959
* Add the cold attribute to error-reporting call sitesHal Finkel2013-11-171-0/+77
| | | | | | | | | | | Generally speaking, control flow paths with error reporting calls are cold. So far, error reporting calls are calls to perror and calls to fprintf, fwrite, etc. with stderr as the stream. This can be extended in the future. The primary motivation is to improve block placement (the cold attribute affects the static branch prediction heuristics). llvm-svn: 194943
* Added a size field to the stack map record to handle subregister spills.Andrew Trick2013-11-172-60/+132
| | | | | | | | Implementing this on bigendian platforms could get strange. I added a target hook, getStackSlotRange, per Jakob's recommendation to make this as explicit as possible. llvm-svn: 194942
* Use right address space pointer sizeMatt Arsenault2013-11-171-0/+11
| | | | llvm-svn: 194940
* Add a loop rerolling passHal Finkel2013-11-162-0/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a loop rerolling pass: the opposite of (partial) loop unrolling. The transformation aims to take loops like this: for (int i = 0; i < 3200; i += 5) { a[i] += alpha * b[i]; a[i + 1] += alpha * b[i + 1]; a[i + 2] += alpha * b[i + 2]; a[i + 3] += alpha * b[i + 3]; a[i + 4] += alpha * b[i + 4]; } and turn them into this: for (int i = 0; i < 3200; ++i) { a[i] += alpha * b[i]; } and loops like this: for (int i = 0; i < 500; ++i) { x[3*i] = foo(0); x[3*i+1] = foo(0); x[3*i+2] = foo(0); } and turn them into this: for (int i = 0; i < 1500; ++i) { x[i] = foo(0); } There are two motivations for this transformation: 1. Code-size reduction (especially relevant, obviously, when compiling for code size). 2. Providing greater choice to the loop vectorizer (and generic unroller) to choose the unrolling factor (and a better ability to vectorize). The loop vectorizer can take vector lengths and register pressure into account when choosing an unrolling factor, for example, and a pre-unrolled loop limits that choice. This is especially problematic if the manual unrolling was optimized for a machine different from the current target. The current implementation is limited to single basic-block loops only. The rerolling recognition should work regardless of how the loop iterations are intermixed within the loop body (subject to dependency and side-effect constraints), but the significant restriction is that the order of the instructions in each iteration must be identical. This seems sufficient to capture all current use cases. This pass is not currently enabled by default at any optimization level. llvm-svn: 194939
* Apply the InstCombine fptrunc sqrt optimization to llvm.sqrtHal Finkel2013-11-161-0/+13
| | | | | | | | | | | | | | | | | | | InstCombine, in visitFPTrunc, applies the following optimization to sqrt calls: (fptrunc (sqrt (fpext x))) -> (sqrtf x) but does not apply the same optimization to llvm.sqrt. This is a problem because, to enable vectorization, Clang generates llvm.sqrt instead of sqrt in fast-math mode, and because this optimization is being applied to sqrt and not applied to llvm.sqrt, sometimes the fast-math code is slower. This change makes InstCombine apply this optimization to llvm.sqrt as well. This fixes the specific problem in PR17758, although the same underlying issue (optimizations applied to libcalls are not applied to intrinsics) exists for other optimizations in SimplifyLibCalls. llvm-svn: 194935
* Fix assert on unaligned access to global with different address space size.Matt Arsenault2013-11-161-1/+23
| | | | llvm-svn: 194934
* Fix codegen for null different sized pointer.Matt Arsenault2013-11-161-0/+11
| | | | llvm-svn: 194932
* R600: Make dot_4 instructions predicableVincent Lejeune2013-11-161-0/+27
| | | | llvm-svn: 194927
* InstCombine: fold (A >> C) == (B >> C) --> (A^B) < (1 << C) for constant Cs.Benjamin Kramer2013-11-162-8/+28
| | | | | | This is common in bitfield code. llvm-svn: 194925
* Use correct size for address space in BasicAA.Matt Arsenault2013-11-162-2/+41
| | | | | | | | | | | | The tests just hit this with a different sized address space since I haven't figured out how to use this to break it. I thought I committed this a long time ago, and I'm not sure why missing this hasn't caused any problems. llvm-svn: 194903
* For dwarf4 use the correct form for referencing debug_loc locations,Eric Christopher2013-11-162-2/+2
| | | | | | | | | and update test cases accordingly. This doesn't affect the output dumped using llvm-dwarfdump, but readelf does now dump the debug_loc section. llvm-svn: 194898
* Implemented aarch64 Neon scalar vmulx_lane intrinsicsAna Pazos2013-11-153-12/+238
| | | | | | | | | | | | | | Implemented aarch64 Neon scalar vfma_lane intrinsics Implemented aarch64 Neon scalar vfms_lane intrinsics Implemented legacy vmul_n_f64, vmul_lane_f64, vmul_laneq_f64 intrinsics (v1f64 parameter type) using Neon scalar instructions. Implemented legacy vfma_lane_f64, vfms_lane_f64, vfma_laneq_f64, vfms_laneq_f64 intrinsics (v1f64 parameter type) using Neon scalar instructions. llvm-svn: 194888
* LoopVectorizer: Use abi alignment for accesses with no alignmentArnold Schwaighofer2013-11-151-0/+33
| | | | | | | | | | | When we vectorize a scalar access with no alignment specified, we have to set the target's abi alignment of the scalar access on the vectorized access. Using the same alignment of zero would be wrong because most targets will have a bigger abi alignment for vector types. This probably fixes PR17878. llvm-svn: 194876
* [AArch64] Fix the scalar NEON ACLE functions so that they return float/doubleChad Rosier2013-11-151-24/+16
| | | | | | rather than the vector equivalent. llvm-svn: 194853
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-152-0/+17
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
* ArgumentPromotion: correctly transfer TBAA tags and alignments.Manman Ren2013-11-151-0/+52
| | | | | | | | | | | | | | We used to use std::map<IndicesVector, LoadInst*> for OriginalLoads, and when we try to promote two arguments, they will both write to OriginalLoads causing created loads for the two arguments to have the same original load. And the same tbaa tag and alignment will be put to the created loads for the two arguments. The fix is to use std::map<std::pair<Argument*, IndicesVector>, LoadInst*> for OriginalLoads, so each Argument will write to different parts of the map. PR17906 llvm-svn: 194846
* Avoid illegal integer promotion in fastiselBob Wilson2013-11-153-0/+72
| | | | | | | | | | | | | | | | | Stop folding constant adds into GEP when the type size doesn't match. Otherwise, the adds' operands are effectively being promoted, changing the conditions of an overflow. Results are different when: sext(a) + sext(b) != sext(a + b) Problem originally found on x86-64, but also fixed issues with ARM and PPC, which used similar code. <rdar://problem/15292280> Patch by Duncan Exon Smith! llvm-svn: 194840
* R600/SI: Add VReg_96 register class to SIRegisterInfo::hasVGPRs()Tom Stellard2013-11-151-0/+46
| | | | | | This fixes a crash with GNOME settings manager. llvm-svn: 194836
* [mips][msa] Merge basic_operations_little.ll into basic_operations.ll.Daniel Sanders2013-11-152-639/+184
| | | | | | | | Now that FileCheck supports multiple check prefixes, we don't need to keep the little and big endian versions of this test separate anymore. Merge them back together. llvm-svn: 194826
* Add AVX512 unmasked FMA intrinsics and support.Cameron McInally2013-11-151-0/+97
| | | | llvm-svn: 194824
* Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 typeDaniel Sanders2013-11-159-26/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When getConstant() is called for an expanded vector type, it is split into multiple scalar constants which are then combined using appropriate build_vector and bitcast operations. In addition to the usual big/little endian differences, the case where the element-order of the vector does not have the same endianness as the elements themselves is also accounted for. For example, for v4i32 on big-endian MIPS, the byte-order of the vector is <3210,7654,BA98,FEDC>. For little-endian, it is <0123,4567,89AB,CDEF>. Handling this case turns out to be a nop since getConstant() returns a splatted vector (so reversing the element order doesn't change the value) This fixes a number of cases in MIPS MSA where calling getConstant() during operation legalization introduces illegal types (e.g. to legalize v2i64 UNDEF into a v2i64 BUILD_VECTOR of illegal i64 zeros). It should also handle bigger differences between illegal and legal types such as legalizing v2i64 into v8i16. lowerMSASplatImm() in the MIPS backend no longer needs to avoid calling getConstant() so this function has been updated in the same patch. For the sake of transparency, the steps I've taken since the review are: * Added 'virtual' to isVectorEltOrderLittleEndian() as requested. This revealed that the MIPS tests were falsely passing because a polymorphic function was not actually polymorphic in the reviewed patch. * Fixed the tests that were now failing. This involved deleting the code to handle the MIPS MSA element-order (which was previously doing an byte-order swap instead of an element-order swap). This left isVectorEltOrderLittleEndian() unused and it was deleted. * Fixed build failures caused by rebasing beyond r194467-r194472. These build failures involved the bset, bneg, and bclr instructions added in these commits using lowerMSASplatImm() in a way that was no longer valid after this patch. Some of these were fixed by calling SelectionDAG::getConstant() instead, others were fixed by a new function getBuildVectorSplat() that provided the removed functionality of lowerMSASplatImm() in a more sensible way. Reviewers: bkramer Reviewed By: bkramer CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1973 llvm-svn: 194811
* [NVPTX] Fix handling of indirect callsJustin Holewinski2013-11-151-0/+10
| | | | | | Using a special machine node is cleaner than an InlineAsm node, and fixes an assertion failure in InstrEmitter llvm-svn: 194810
* [mips][msa] Build all the tests in little and big endian modes and correct ↵Daniel Sanders2013-11-1559-3/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an incorrect test. Summary: This patch (correctly) breaks some MSA tests by exposing the cases when SelectionDAG::getConstant() produces illegal types. These have been temporarily marked XFAIL and the XFAIL flag will be removed when SelectionDAG::getConstant() is fixed. There are three categories of failure: * Immediate instructions are not selected in one endian mode. * Immediates used in ldi.[bhwd] must be different according to endianness. (this only affects cases where the 'wrong' ldi is used to load the correct bitpattern. E.g. (bitcast:v2i64 (build_vector:v4i32 ...))) * Non-immediate instructions that rely on immediates affected by the previous two categories as part of their match pattern. For example, the bset match pattern is the vector equivalent of 'ws | (1 << wt)'. One test needed correcting to expect different output depending on whether big or little endian was in use. This test was test/CodeGen/Mips/msa/basic_operations.ll and experiences the second category of failure shown above. The little endian version of this test is named basic_operations_little.ll and will be merged back into basic_operations.ll in a follow up commit now that FileCheck supports multiple check prefixes. Reviewers: bkramer, jacksprat, dsanders Reviewed By: dsanders CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1972 llvm-svn: 194806
* Redirect unused test case output to /dev/nullAlexey Samsonov2013-11-151-1/+1
| | | | llvm-svn: 194798
* Use instr mapping for microMIPS in llvm-mc.Zoran Jovanovic2013-11-151-12/+12
| | | | llvm-svn: 194792
* Reapply "[asan] Poor man's coverage that works with ASan"Bob Wilson2013-11-151-0/+13
| | | | | | | | I was able to successfully run a bootstrapped LTO build of clang with r194701, so this change does not seem to be the cause of our failing buildbots. llvm-svn: 194789
* Platform proof a test case.Andrew Trick2013-11-151-3/+3
| | | | llvm-svn: 194788
* Add instcombine visitor for addrspacecastMatt Arsenault2013-11-151-0/+31
| | | | llvm-svn: 194786
* Add target hook to prevent folding some bitcasted loads.Matt Arsenault2013-11-151-0/+42
| | | | | | | | | | | | | This is to avoid this transformation in some cases: fold (conv (load x)) -> (load (conv*)x) On architectures that don't natively support some vector loads efficiently casting the load to a smaller vector of larger types and loading is more efficient. Patch by Micah Villmow. llvm-svn: 194783
* [OCaml] Add REQUIRES: native, object-emission to the Target testPeter Zotov2013-11-151-0/+1
| | | | | | | | While the test would work with any compiled in target with object emission support, it's nontrivial to formulate this condition in lit, so a conservative restriction is used instead. llvm-svn: 194781
* Revert "[asan] Poor man's coverage that works with ASan"Bob Wilson2013-11-151-13/+0
| | | | | | | | | This reverts commit 194701. Apple's bootstrapped LTO builds have been failing, and this change (along with compiler-rt 194702-194704) is the only thing on the blamelist. I will either reappy these changes or help debug the problem, depending on whether this fixes the buildbots. llvm-svn: 194780
* [OCaml] Use native target in testsuite instead of hardcoding X86Peter Zotov2013-11-152-16/+11
| | | | llvm-svn: 194778
* [OCaml] Add Target and TargetMachine bindings to Llvm_targetPeter Zotov2013-11-151-2/+52
| | | | llvm-svn: 194774
* [OCaml] Refactor Llvm_target interfacePeter Zotov2013-11-155-27/+22
| | | | | | | | This commit brings the module structure, argument order and primitive names in Llvm_target in order with the rest of the bindings, in preparation for adding TargetMachine API. llvm-svn: 194773
* Make all the conditional Mips 16 branches get initially set for theReed Kotler2013-11-154-0/+86
| | | | | | | | | | short form. Constant islands will expand them if they are out of range. Since there is not direct object emitter at this time, it does not have any material affect because the assembler sorts this out. But we need to know for the actual constant island work. We track the difference by putting # 16 inst in the comments. llvm-svn: 194766
* Add addrspacecast instruction.Matt Arsenault2013-11-1512-15/+23
| | | | | | Patch by Michele Scandale! llvm-svn: 194760
* R600: Fix scheduling of instructions that use the LDS output queueTom Stellard2013-11-152-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | The LDS output queue is accessed via the OQAP register. The OQAP register cannot be live across clauses, so if value is written to the output queue, it must be retrieved before the end of the clause. With the machine scheduler, we cannot statisfy this constraint, because it lacks proper alias analysis and it will mark some LDS accesses as having a chain dependency on vertex fetches. Since vertex fetches require a new clauses, the dependency may end up spiltting OQAP uses and defs so the end up in different clauses. See the lds-output-queue.ll test for a more detailed explanation. To work around this issue, we now combine the LDS read and the OQAP copy into one instruction and expand it after register allocation. This patch also adds some checks to the EmitClauseMarker pass, so that it doesn't end a clause with a value still in the output queue and removes AR.X and OQAP handling from the scheduler (AR.X uses and defs were already being expanded post-RA, so the scheduler will never see them). Reviewed-by: Vincent Lejeune <vljn at ovi.com> llvm-svn: 194755
* Simplify testcase.Eric Christopher2013-11-141-1/+1
| | | | llvm-svn: 194748
* Recognize 0x0000 as a COFF file magic.Rui Ueyama2013-11-142-0/+16
| | | | | | | | | | | | | | | Summary: Some machine-type-neutral object files containing only undefined symbols actually do exist in the Windows standard library. Need to recognize them as COFF files. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2164 llvm-svn: 194734
* ARM: produce friendly error for invalid inline asmTim Northover2013-11-141-0/+16
| | | | | | | | | We used to perform an invalid operation on an MVT and crash, which wasn't much fun. Patch by Oliver Stannard. llvm-svn: 194714
* Add a triple and switch test to FileCheck.Rafael Espindola2013-11-141-1/+8
| | | | | | | On windows we don't print .weak for function definitions, so count was only finding 1 'weak'. llvm-svn: 194713
* llvm-cov.test: Remove XFAIL:arm. Seems this is passing since my tweaks.NAKAMURA Takumi2013-11-141-1/+1
| | | | llvm-svn: 194712
* Error if we see an alias to a declaration.Rafael Espindola2013-11-149-26/+70
| | | | | | | | | | | | | | | In ELF and COFF an alias is just another offset in a section. There is no way to represent an alias to something in another file. In MachO, the spec has the N_INDR type which should allow for exactly that, but is not currently implemented. Given that it is specified but not implemented, we error in codegen to avoid miscompiling but don't reject aliases to declarations in the verifier to leave the option open of implementing it. In the past we have used alias to declarations as a way of implementing weakref, which is why it exists in some old tests which this patch updates. llvm-svn: 194705
* [asan] Poor man's coverage that works with ASanKostya Serebryany2013-11-141-0/+13
| | | | llvm-svn: 194701
* [msan] Use CHECK-DAG instead of CHECK where order of instructions does not ↵Evgeniy Stepanov2013-11-141-2/+2
| | | | | | | | matter. This may fix hexagon-elf bots. llvm-svn: 194700
* [msan] Fast path optimization for wrap-indirect-calls feature of ↵Evgeniy Stepanov2013-11-141-2/+15
| | | | | | | | | | | | | | | | | | | MemorySanitizer. Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool for MSan) to catch all cases where execution leaves a compiler-instrumented module by allowing the tool to rewrite targets of indirect calls. This change is an optimization that skips wrapping for calls when target is inside the current module. This relies on the linker providing symbols at the begin and end of the module code (or code + data, does not really matter). Gold linker provides such symbols by default. GNU (BFD) linker needs a link flag: -Wl,--defsym=__executable_start=0. More info: https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec llvm-svn: 194697
* llvm-cov.test: Tweak win32 hosts not confused by \r\n in llvm-cov's stdout.NAKAMURA Takumi2013-11-141-1/+1
| | | | | | "diff -b" -- Ignore space changes. llvm-svn: 194694
* AVX-512: Handled extractelement from mask vector;Elena Demikhovsky2013-11-142-0/+33
| | | | | | Added VMOSHDUP/VMOVSLDUP shuffle instructions. llvm-svn: 194691
OpenPOWER on IntegriCloud