summaryrefslogtreecommitdiffstats
path: root/llvm/test
Commit message (Collapse)AuthorAgeFilesLines
...
* lld test for configure & makeIain Sandoe2014-06-061-0/+9
| | | | | | | | r210177 added lld Makefiles, r210245 added automatic build when the source is present. This revision completes the set by adding the lld test and unittests to the check-all target. llvm-svn: 210318
* Revert r210298 'Correctly set the comdat symbol on COFF' as it asserts on ↵Timur Iskhodzhanov2014-06-062-53/+20
| | | | | | Windows llvm-svn: 210317
* [yaml2obj][obj2yaml] Support ELF symbol's visibility flags ↵Simon Atanasyan2014-06-061-0/+126
| | | | | | (default/hidden/protected). llvm-svn: 210316
* Added select flavour for ABS and NEG(ABS)Dinesh Dwivedi2014-06-061-0/+481
| | | | | | | | | | | | | | | | This patch can identify ABS(X) ==> (X >s 0) ? X : -X and (X >s -1) ? X : -X ABS(X) ==> (X <s 0) ? -X : X and (X <s 1) ? -X : X NABS(X) ==> (X >s 0) ? -X : X and (X >s -1) ? -X : X NABS(X) ==> (X <s 0) ? X : -X and (X <s 1) ? X : -X and can transform ABS(ABS(X)) -> ABS(X) NABS(NABS(X)) -> NABS(X) Differential Revision: http://reviews.llvm.org/D3658 llvm-svn: 210312
* Fix PR19657 (scalar loads not combined into vector load)Karthik Bhat2014-06-061-0/+73
| | | | | | | | If we have common uses on separate paths in the tree; process the one with greater common depth first. This makes sure that we do not assume we need to extract a load when it is actually going to be part of a vectorized tree. Review: http://reviews.llvm.org/D3800 llvm-svn: 210310
* Allow aliases to be unnamed_addr.Rafael Espindola2014-06-0611-11/+29
| | | | | | | | | | | | | | | | | | Alias with unnamed_addr were in a strange state. It is stored in GlobalValue, the language reference talks about "unnamed_addr aliases" but the verifier was rejecting them. It seems natural to allow unnamed_addr in aliases: * It is a property of how it is accessed, not of the data itself. * It is perfectly possible to write code that depends on the address of an alias. This patch then makes unname_addr legal for aliases. One side effect is that the syntax changes for a corner case: In globals, unnamed_addr is now printed before the address space. llvm-svn: 210302
* Correctly set the comdat symbol on COFF.Rafael Espindola2014-06-052-20/+53
| | | | | | | | | | | | | | | | | | | | | We extended the .section syntax to allow multiple sections with the same name but different comdats, but currently we don't make sure that the output section has that comdat symbol. That happens to work with the code llc produces currently because it looks like .section secName, "dr", one_only, "COMDATSym" .globl COMDATSym COMDATSym: .... but that is not very friendly to anyone coding in assembly or even to llc once we get comdat support in the IR. This patch changes the coff object writer to make sure the comdat symbol is output just after the section symbol, as required by the coff spec. llvm-svn: 210298
* [PPC64LE] Add test case for r210282 commitBill Schmidt2014-06-051-0/+17
| | | | | | | | Chandler correctly pointed out that I need an LLVM IR test for r210282, which modified the vperm -> shuffle transform for little endian PowerPC. This patch provides that test. llvm-svn: 210297
* Fixed several correctness issues in SeparateConstOffsetFromGEPJingyue Wu2014-06-052-55/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most issues are on mishandling s/zext. Fixes: 1. When rebuilding new indices, s/zext should be distributed to sub-expressions. e.g., sext(a +nsw (b +nsw 5)) = sext(a) + sext(b) + 5 but not sext(a + b) + 5. This also affects the logic of recursively looking for a constant offset, we need to include s/zext into the context of the searching. 2. Function find should return the bitwidth of the constant offset instead of always sign-extending it to i64. 3. Stop shortcutting zext'ed GEP indices. LLVM conceptually sign-extends GEP indices to pointer-size before computing the address. Therefore, gep base, zext(a + b) != gep base, a + b Improvements: 1. Add an optimization for splitting sext(a + b): if a + b is proven non-negative (e.g., used as an index of an inbound GEP) and one of a, b is non-negative, sext(a + b) = sext(a) + sext(b) 2. Function Distributable checks whether both sext and zext can be distributed to operands of a binary operator. This helps us split zext(sext(a + b)) to zext(sext(a) + zext(sext(b)) when a + b does not signed or unsigned overflow. Refactoring: Merge some common logic of handling add/sub/or in find. Testing: Add many tests in split-gep.ll and split-gep-and-gvn.ll to verify the changes we made. llvm-svn: 210291
* Adding explicit triples to the ARM jumptable testsTom Roeder2014-06-051-2/+2
| | | | llvm-svn: 210288
* Add a testcase where there is an overflow when combining two constants.Rafael Espindola2014-06-051-0/+10
| | | | | | I noticed that a proposed optimization would have prevented this. llvm-svn: 210287
* Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.Kevin Enderby2014-06-054-0/+53
| | | | | | | | | | | | | | | This is a first step in seeing if it is possible to make llvm-nm produce the same output as darwin's nm(1). Darwin's default format is bsd but its -m output prints the longer Mach-O specific details. For now I added the "-format darwin" to do this (whos name may need to change in the future). As there are other Mach-O specific flags to nm(1) which I'm hoping to add some how in the future. But I wanted to see if I could get the correct output for -m flag using llvm-nm and the libObject interfaces. I got this working but would love to hear what others think about this approach to getting object/format specific details printed with llvm-nm. llvm-svn: 210285
* Add a new attribute called 'jumptable' that creates jump-instruction tables ↵Tom Roeder2014-06-057-4/+402
| | | | | | | | | | | | for functions marked with this attribute. It includes a pass that rewrites all indirect calls to jumptable functions to pass through these tables. This also adds backend support for generating the jump-instruction tables on ARM and X86. Note that since the jumptable attribute creates a second function pointer for a function, any function marked with jumptable must also be marked with unnamed_addr. llvm-svn: 210280
* [asancov] Fix coverage line info some more.Evgeniy Stepanov2014-06-051-17/+51
| | | | | | | Now it should always point to the opening brace of the function (in -asan-coverage=1 mode). llvm-svn: 210266
* XFAIL: test/DebugInfo/missing-abstract-variable.ll on s390x as wellUlrich Weigand2014-06-051-1/+1
| | | | llvm-svn: 210264
* [mips] Modify long branch for NaCl:Sasa Stankovic2014-06-051-0/+34
| | | | | | | | | * Move the instruction that changes sp outside of the branch delay slot. * Bundle-align the target of indirect branch. Differential Revision: http://llvm-reviews.chandlerc.com/D3928 llvm-svn: 210262
* Prevent hoisting the instruction whose def might be clobbered by the terminator.Sasa Stankovic2014-06-051-0/+144
| | | | llvm-svn: 210261
* [mips] Fix triple.Matheus Almeida2014-06-052-2/+2
| | | | | | Mips2 is a 32-bit architecture. llvm-svn: 210254
* R600: Fix test. Using wrong check prefix.Matt Arsenault2014-06-051-21/+21
| | | | llvm-svn: 210244
* Fix coverage for files with global constructors again. Adds a testcase to ↵Nick Lewycky2014-06-051-0/+58
| | | | | | the commit from r206671, as requested by David Blaikie. llvm-svn: 210239
* PR19388: DebugInfo: Emit dead arguments in their originally declared order.David Blaikie2014-06-051-0/+80
| | | | | | | | | | | | | | | | | | | | | | | Unused arguments were not being added to the argument list, but instead treated as arbitrary scope variables. This meant they weren't carefully added in the original argument order. In this particular example, though, it turns out the argument is only /mostly/ unused (well, actually it's entirely used, but in a specific way). It's a struct that, due to ABI reasons, is decomposed into chunks (exactly one chunk, since it has one member) and then passed. Since only one of those chunks is used (SROA, etc, kill the original reconstitution code) we don't have a location to describe the whole variable. In this particular case, since the struct consists of just the one int, once we have partial location information, this should have a location that describes the entire variable (since the piece is the entirety of the object). And at some point we'll need to describe the location of even /entirely/ unused arguments so that they can at least be printed on function entry. llvm-svn: 210231
* Use AArch64 instead of now removed ARM64 in test configsAlexey Samsonov2014-06-053-3/+3
| | | | llvm-svn: 210229
* R600/SI: Match rsq instructionsMatt Arsenault2014-06-051-0/+26
| | | | llvm-svn: 210226
* DebugInfo: Reapply r209984 (reverted in r210143), asserting that abstract ↵David Blaikie2014-06-041-9/+14
| | | | | | | | | | | | | | | | | DbgVariables have DIEs. Abstract variables within abstract scopes that are entirely optimized away in their first inlining are omitted because their scope is not present so the variable is never created. Instead, we should ensure the scope is created so the variable can be added, even if it's been optimized away in its first inlining. This fixes the incorrect debug info in missing-abstract-variable.ll (added in r210143) and passes an asserts self-hosting build, so hopefully there's not more of these issues left behind... *fingers crossed*. llvm-svn: 210221
* Don't emit structors for available_externally globals (PR19933)Hans Wennborg2014-06-041-2/+12
| | | | | | | | | | | | We would previously assert here when trying to figure out the section for the global. This makes us handle the situation more gracefully since the IR isn't malformed. Differential Revision: http://reviews.llvm.org/D4022 llvm-svn: 210215
* XFAIL: test/DebugInfo/missing-abstract-variable.ll on mips and ppc64 due to ↵David Blaikie2014-06-041-0/+5
| | | | | | an inlined parameter that goes missing. llvm-svn: 210200
* InstCombine: Improvement to check if signed addition overflows.Rafael Espindola2014-06-041-0/+58
| | | | | | | | | | | | | | | | | | This patch implements two things: 1. If we know one number is positive and another is negative, we return true as signed addition of two opposite signed numbers will never overflow. 2. Implemented TODO : If one of the operands only has one non-zero bit, and if the other operand has a known-zero bit in a more significant place than it (not including the sign bit) the ripple may go up to and fill the zero, but won't change the sign. e.x - (x & ~4) + 1 We make sure that we are ignoring 0 at MSB. Patch by Suyog Sarda. llvm-svn: 210186
* DebugInfo: Partial revert r209984 due to more cases where abstract ↵David Blaikie2014-06-041-0/+181
| | | | | | | | | | | | | | | DbgVariables do not have associated DIEs. Along with a test case to demonstrate that due to inlining order there are cases where abstract variable DIEs are not constructed since the abstract subprogram was built due to a previous inlining that optimized away those variables. This produces incorrect debug info (the 'missing' abstract variable causes the inlined instance of that variable to be emitted with a full description (name, line, file) rather than referencing the abstract origin), but this commit at least ensures that it doesn't crash... llvm-svn: 210143
* Revert r209381 as it isn't a local variable. Add a testcase so thatEric Christopher2014-06-031-0/+23
| | | | | | we know next time this happens. llvm-svn: 210127
* Fix a small bug in the parsing of anonymous globals.Rafael Espindola2014-06-031-0/+2
| | | | | | | | | | | | It was able to parse hidden dllexport global i32 42 but not dllexport global i32 42 llvm-svn: 210121
* [AArch64] Add regression tests for the load/store optimizer which cover ↵Tilmann Scheller2014-06-031-0/+130
| | | | | | | | | | | | | | | | post-index update folding with sub rather than add. The tests check that the following transform happens: (ldr|str) X, [x20] ... sub x20, x20, #16 -> (ldr|str) X, [x20], #-16 with X being either w0, x0, s0, d0 or q0. llvm-svn: 210113
* [asan] Fix coverage instrumentation with -asan-globals=0.Evgeniy Stepanov2014-06-031-0/+12
| | | | llvm-svn: 210103
* AArch64: mark small types (i1, i8, i16) as promotedTim Northover2014-06-031-13/+14
| | | | | | | | | This means the output of LowerFormalArguments returns a lowered SDValue with the correct type (expected in SelectionDAGBuilder). Without this, an assertion under a DEBUG macro triggers when those types are passed on the stack. llvm-svn: 210102
* Ignore line numbers on debug intrinsics. Add an assert to ensure that we ↵Nick Lewycky2014-06-031-0/+143
| | | | | | aren't emitting line number zero, the .gcno format uses this to indicate that the next field is a filename. llvm-svn: 210068
* [AArch64] Correctly deal with VPR stack parameter passing.Jiangning Liu2014-06-031-0/+8
| | | | llvm-svn: 210067
* Allow alias to point to an arbitrary ConstantExpr.Rafael Espindola2014-06-0322-75/+88
| | | | | | | | | | | | | | | | | | | | | This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is valid or not. This reduces our ability to diagnose invalid uses and how early we can spot them, but it also lets us do things like @test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32), i32 ptrtoint (i32* @bar to i32)) to i32*) An important implication of this patch is that the notion of aliased global doesn't exist any more. The alias has to encode the information needed to access it in its metadata (linkage, visibility, type, etc). Another consequence to notice is that getSection has to return a "const char *". It could return a NullTerminatedStringRef if there was such a thing, but when that was proposed the decision was to just uses "const char*" for that. llvm-svn: 210062
* Add back commit r210029.Rafael Espindola2014-06-026-12/+12
| | | | | | | | The code was actually correct. Sorry for the confusion. I have expanded the comment saying why the analysis is valid to avoid me misunderstaning it again in the future. llvm-svn: 210052
* Convert test to FileCheck.Rafael Espindola2014-06-021-4/+6
| | | | llvm-svn: 210049
* Revert "Add the nsw flag when we detect that an add will not signed overflow."Rafael Espindola2014-06-026-12/+12
| | | | | | | | | This reverts commit r210029. It was not correctly handling cases where LHS and RHS had multiple but different sign bits. llvm-svn: 210048
* Added support to optimize comparisons with "lshr exact" of a constant.Rafael Espindola2014-06-021-0/+8
| | | | | | Patch by Rahul Jain. llvm-svn: 210040
* [X86] Fix checked arithmetic for i8 on X86.Andrea Di Biagio2014-06-021-0/+24
| | | | | | | | | | | When lowering a ISD::BRCOND into a test+branch, make sure that we always use the correct condition code to emit the test operation. This fixes PR19858: "i8 checked mul is wrong on x86". Patch by Keno Fisher! llvm-svn: 210032
* Add the nsw flag when we detect that an add will not signed overflow.Rafael Espindola2014-06-026-12/+12
| | | | | | | We already had a function for checking this, we were just using it only in specialized cases. llvm-svn: 210029
* [AArch64] Add some more regression tests for store pre-index update folding ↵Tilmann Scheller2014-06-021-0/+105
| | | | | | | | | | | | | | | | in the load/store optimizer. Add tests for the following transform: add x8, x8, #16 ... str X, [x8] -> str X, [x8, #16]! with X being either w0, x0, s0, d0 or q0. llvm-svn: 210021
* [msan] Handle x86 vector pack intrinsics.Evgeniy Stepanov2014-06-021-0/+38
| | | | llvm-svn: 210020
* [AArch64] Add some more regression tests for load pre-index update folding ↵Tilmann Scheller2014-06-021-0/+106
| | | | | | | | | | | | | | | | in the load/store optimizer. Add tests for the following transform: add x8, x8, #16 ... ldr X, [x8] -> ldr X, [x8, #16]! with X being either w0, x0, s0, d0 or q0. llvm-svn: 210018
* Added inst combine tarnsform for (1 << X) & C pattrens where C is (some ↵Dinesh Dwivedi2014-06-021-0/+17
| | | | | | | | | | | | PowerOf2 - 1) This patch can handles following cases from http://nondot.org/sabre/LLVMNotes/InstCombine.txt "((1 << X) & 7) == 0" ==> "X > 2" "((1 << X) & 7) != 0" ==> "X < 3". Differential Revision: http://reviews.llvm.org/D3678 llvm-svn: 210007
* Added inst combine transforms for single bit tests from Chris's noteDinesh Dwivedi2014-06-021-0/+105
| | | | | | | | | | | | if ((x & C) == 0) x |= C becomes x |= C if ((x & C) != 0) x ^= C becomes x &= ~C if ((x & C) == 0) x ^= C becomes x |= C if ((x & C) != 0) x &= ~C becomes x &= ~C if ((x & C) == 0) x &= ~C becomes nothing Differential Revision: http://reviews.llvm.org/D3777 llvm-svn: 210006
* ARMEB: Fix function return type f64Christian Pirker2014-06-011-0/+12
| | | | | | Reviewed at http://reviews.llvm.org/D3968 llvm-svn: 209990
* DebugInfo: Assert that DbgVariables have associated DIEsDavid Blaikie2014-06-011-0/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously committed in r209680 and reverted in r209683 after it caused sanitizer builds to crash. The issue seems to be that the DebugLoc associated with dbg.value IR intrinsics isn't necessarily accurate. Instead, we duplicate the DIVariables and add an InlinedAt field to them to record their location. We were using this InlinedAt field to compute the LexicalScope for the variable, but not using it in the abstract DbgVariable construction and mapping. This resulted in a formal parameter to the current concrete function, correctly having no InlinedAt information, but incorrectly having a DebugLoc that described an inlined location within the function... thus an abstract DbgVariable was created for the variable, but its DIE was never constructed (since the LexicalScope had no such variable). This DbgVariable was silently ignored (by testing for a non-null DIE on the abstract DbgVariable). So, fix this by using the right scoping information when constructing abstract DbgVariables. In the long run, I suspect we want to undo the work that added this second kind of location tracking and fix the places where the DebugLoc propagation on the dbg.value intrinsic fails. This will shrink debug info (by not duplicating DIVariables), make it more efficient (by not having to construct new DIVariable metadata nodes to try to map back to a single variable), and benefit all instructions. But perhaps there are insurmountable issues with DebugLoc quality that I'm unaware of... I just don't know how we can't /just keep the DebugLoc from the dbg.declare to the dbg.values and never get this wrong/. Some history context: http://llvm.org/viewvc/llvm-project?view=revision&revision=135629 http://llvm.org/viewvc/llvm-project?view=revision&revision=137253 llvm-svn: 209984
* Fix typosAlp Toker2014-05-311-1/+1
| | | | llvm-svn: 209982
OpenPOWER on IntegriCloud