summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* Revert 209903 and 210040.Rafael Espindola2014-06-07
| | | | | | | | | | | | The messages were "PR19753: Optimize comparisons with "ashr exact" of a constanst." "Added support to optimize comparisons with "lshr exact" of a constant." They were not correctly handling signed/unsigned operation differences, causing pr19958. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210393 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the MachineScheduler's logic for updating ready times for in-order.Andrew Trick2014-06-07
| | | | | | | | | | | | | | | | | Now the scheduler updates a node's ready time as soon as it is scheduled, before releasing dependent nodes. There was a reason I didn't do this initially but it no longer applies. A53 is in-order and was running into an issue where nodes where added to the readyQ too early. That's now fixed. This also makes it easier for custom scheduling strategies to build heuristics based on the actual cycles that the node was scheduled at. The only impact on OOO (sandybridge/cyclone) is that ready times will be slightly more accurate. I didn't measure any significant regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210390 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the use of TargetMachine with a tiny bool variable.Eric Christopher2014-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210386 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all local variables from X86SelectionDAGInfo, the DAG hasEric Christopher2014-06-06
| | | | | | all of the ones we were stashing away on startup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210385 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Use the scope of the function declaration, if any, to name a ↵David Blaikie2014-06-06
| | | | | | | | | | function in DWARF pubnames This ensures that member functions, for example, are entered into pubnames with their fully qualified name, rather than inside the global namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210379 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: pubnames: include file-local (static or anonymous namespace) ↵David Blaikie2014-06-06
| | | | | | | | | variables and anonymous namespaces themselves. Still some issues with name qualification, FIXMEs added to test cases and fixes will come next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210378 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: Canonicalize addrspacecast between different element typesJingyue Wu2014-06-06
| | | | | | | | | | | | | | | | | addrspacecast X addrspace(M)* to Y addrspace(N)* --> bitcast X addrspace(M)* to Y addrspace(M)* addrspacecast Y addrspace(M)* to Y addrspace(N)* Updat all affected tests and add several new tests in addrspacecast.ll. This patch is based on http://reviews.llvm.org/D2186 (authored by Matt Arsenault) with fixes and more tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210375 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: prevent early DCE of empty sectionsSaleem Abdulrasool2014-06-06
| | | | | | | | | | | | | | | | Prevent the early elimination of sections in the object writer. There may be references to the section itself by other symbols, which may potentially not be possible to resolve. ML (Visual Studio's Macro Assembler) also seems to retain empty sections. The elimination of symbols and sections which are unused should really occur at the link phase. This will not cause any change in the resulting binary, simply in the generated object files. The adjustments to the other unit tests account for the fluctuating section index caused by the appearance of sections which were previously discarded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210373 91177308-0d34-0410-b5e6-96231b3b80d8
* X86: Don't turn shifts into ands if there's another use that may not check ↵Benjamin Kramer2014-06-06
| | | | | | | | for equality. Fixes PR19964. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210371 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few issues with comdat handling on COFF.Rafael Espindola2014-06-06
| | | | | | | | | | | | | | | | | | | | | * Section association cannot use just the section name as many sections can have the same name. With this patch, the comdat symbol in an assoc section is interpreted to mean a symbol in the associated section and the mapping is discovered from it. * Comdat symbols were not being set correctly. Instead we were getting whatever was output first for that section. A consequence is that associative sections now must use .section to set the association. Using .linkonce would not work since it is not possible to change a sections comdat symbol (it is used to decide if we should create a new section or reuse an existing one). This includes r210298, which was reverted because it was asserting on an associated section having the same comdat as the associated section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210367 91177308-0d34-0410-b5e6-96231b3b80d8
* Have TargetSelectionDAGInfo take a DataLayout initializer rather thanEric Christopher2014-06-06
| | | | | | a TargetMachine since the only thing it wants is DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210366 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bug in lowering shuffle_vectors to insertpsFilipe Cabecinhas2014-06-06
| | | | | | | | | | | | | | Summary: We were being too strict and not accounting for undefs. Added a test case and fixed another one where we improved codegen. Reviewers: grosbach, nadav, delena Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4039 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210361 91177308-0d34-0410-b5e6-96231b3b80d8
* [SLP] Enable vectorization of GEP expressions.Michael Zolotukhin2014-06-06
| | | | | | | | The use cases look like the following: x->a = y->a + 10 x->b = y->b + 12 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210342 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Fix lowering of BUILD_VECTOR and SHUFFLE_VECTOR for little endianBill Schmidt2014-06-06
| | | | | | | | | | | | | | | | This patch fixes a couple of lowering issues for little endian PowerPC. The code for lowering BUILD_VECTOR contains a number of optimizations that are only valid for big endian. For now, we disable those optimizations for correctness. In the future, we will add analogous optimizations that are correct for little endian. When lowering a SHUFFLE_VECTOR to a VPERM operation, we again need to make the now-familiar transformation of swapping the input operands and complementing the permute control vector. Correctness of this transformation is tested by the accompanying test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210336 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r210298 'Correctly set the comdat symbol on COFF' as it asserts on ↵Timur Iskhodzhanov2014-06-06
| | | | | | Windows git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210317 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][obj2yaml] Support ELF symbol's visibility flags ↵Simon Atanasyan2014-06-06
| | | | | | (default/hidden/protected). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210316 91177308-0d34-0410-b5e6-96231b3b80d8
* Added select flavour for ABS and NEG(ABS)Dinesh Dwivedi2014-06-06
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210312 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR19657 (scalar loads not combined into vector load)Karthik Bhat2014-06-06
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210310 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow aliases to be unnamed_addr.Rafael Espindola2014-06-06
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210302 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix null dereference with -debug-only=dwarfdebugAlexey Samsonov2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210299 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly set the comdat symbol on COFF.Rafael Espindola2014-06-05
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210298 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove X86Subtarget from the X86FrameLowering constructor sinceEric Christopher2014-06-05
| | | | | | | we can just pass in the values we already know and we're not caching the subtarget anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210292 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed several correctness issues in SeparateConstOffsetFromGEPJingyue Wu2014-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210291 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove caching of the subtarget for X86FrameLowering.Eric Christopher2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210290 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicate copy of InstrItineraryData from the TargetMachine,Eric Christopher2014-06-05
| | | | | | it's already on the subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210289 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.Kevin Enderby2014-06-05
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210285 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Correct vperm -> shuffle transform for little endianBill Schmidt2014-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in cfe commit r210279, the correct little-endian semantics for the vec_perm Altivec interfaces are implemented by reversing the order of the input vectors and complementing the permute control vector. This converts the desired permute from little endian element order into the big endian element order that the underlying PowerPC vperm instruction uses. This is represented with a ppc_altivec_vperm intrinsic function. The instruction combining pass contains code to convert a ppc_altivec_vperm intrinsic into a vector shuffle operation when the intrinsic has a permute control vector (mask) that is a constant. However, the vector shuffle operation assumes that vector elements are in natural order for their endianness, so for little endian code we will get the wrong result with the existing transformation. This patch reverses the semantic change to vec_perm that was performed in altivec.h by once again swapping the input operands and complementing the permute control vector, returning the element ordering to little endian. The correctness of this code is tested by the new perm.c test added in a previous patch, and by other tests in the test suite that fail without this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210282 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing spurious dependency of IPO on JumpInstrTablesTom Roeder2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210281 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new attribute called 'jumptable' that creates jump-instruction tables ↵Tom Roeder2014-06-05
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210280 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Temporarily disable VSX support in little-endian modeBill Schmidt2014-06-05
| | | | | | | | | | | | This is a preliminary patch for the PowerPC64LE support. In stage 1 of the vector support, we will support the VMX (Altivec) instruction set, but will not yet support the VSX instructions. This is merely a staging issue to provide functional vector support as soon as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210271 91177308-0d34-0410-b5e6-96231b3b80d8
* [asancov] Fix coverage line info some more.Evgeniy Stepanov2014-06-05
| | | | | | | | Now it should always point to the opening brace of the function (in -asan-coverage=1 mode). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210266 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing const specifier to a const method.Evgeniy Stepanov2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210265 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Do not install IfConverter pass at -O0Ulrich Weigand2014-06-05
| | | | | | | | | | When not optimizing, do not run the IfConverter pass, this makes debugging more difficult (and causes a testsuite failure in DebugInfo/unconditional-branch.ll). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210263 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Modify long branch for NaCl:Sasa Stankovic2014-06-05
| | | | | | | | | | * 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210262 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent hoisting the instruction whose def might be clobbered by the terminator.Sasa Stankovic2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210261 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix coverage for files with global constructors again. Adds a testcase to ↵Nick Lewycky2014-06-05
| | | | | | the commit from r206671, as requested by David Blaikie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210239 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r210221 again, due to a crash Richard Smith has provided involving ↵David Blaikie2014-06-05
| | | | | | | | self-hosting LLVM with libc++. Test case coming, once I reduce it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210236 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, ↵David Blaikie2014-06-05
| | | | | | | | | rather than looking it up through the DebugLoc. No functional change intended, just streamlines the abstract variable lookup/construction to use a common entry point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210234 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Roll argument insertion into variable insertion to ensure ↵David Blaikie2014-06-05
| | | | | | | | arguments are correctly handled in all cases. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210233 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19388: DebugInfo: Emit dead arguments in their originally declared order.David Blaikie2014-06-05
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210231 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Add comments/assert description to r209674 based on Eric ↵David Blaikie2014-06-05
| | | | | | Christopher's post-commit review feedback. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210228 91177308-0d34-0410-b5e6-96231b3b80d8
* We've got a getSlotSize call already that we use everywhere else,Eric Christopher2014-06-05
| | | | | | use it here too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210227 91177308-0d34-0410-b5e6-96231b3b80d8
* R600/SI: Match rsq instructionsMatt Arsenault2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210226 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-columns.Eric Christopher2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210224 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of the TargetMachine from X86FrameLowering.Eric Christopher2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210223 91177308-0d34-0410-b5e6-96231b3b80d8
* Use nullptrMatt Arsenault2014-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210222 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Reapply r209984 (reverted in r210143), asserting that abstract ↵David Blaikie2014-06-04
| | | | | | | | | | | | | | | | | 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*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210221 91177308-0d34-0410-b5e6-96231b3b80d8
* Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno ↵Nick Lewycky2014-06-04
| | | | | | file emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210218 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit structors for available_externally globals (PR19933)Hans Wennborg2014-06-04
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210215 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Constant version of stripPointerCasts.Rafael Espindola2014-06-04
| | | | | | Thanks to rnk for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210205 91177308-0d34-0410-b5e6-96231b3b80d8