summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Don't use nopl in cpus that don't support it.Rafael Espindola2013-11-251-1/+5
| | | | | | | | | | | | | | | Patch by Mikulas Patocka. I added the test. I checked that for cpu names that gas knows about, it also doesn't generate nopl. The modified cpus: i686 - there are i686-class CPUs that don't have nopl: Via c3, Transmeta Crusoe, Microsoft VirtualBox - see https://bbs.archlinux.org/viewtopic.php?pid=775414 k6, k6-2, k6-3, winchip-c6, winchip2 - these are 586-class CPUs via c3 c3-2 - see https://bugs.archlinux.org/task/19733 as a proof that Via c3 and c3-Nehemiah don't have nopl llvm-svn: 195679
* ARM integrated assembler generates incorrect nop opcodeDavid Peixotto2013-11-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a bug in the assembler that was causing bad code to be emitted. When switching modes in an assembly file (e.g. arm to thumb mode) we would always emit the opcode from the original mode. Consider this small example: $ cat align.s .code 16 foo: add r0, r0 .align 3 add r0, r0 $ llvm-mc -triple armv7-none-linux align.s -filetype=obj -o t.o $ llvm-objdump -triple thumbv7 -d t.o Disassembly of section .text: foo: 0: 00 44 add r0, r0 2: 00 f0 20 e3 blx #4195904 6: 00 00 movs r0, r0 8: 00 44 add r0, r0 This shows that we have actually emitted an arm nop (e320f000) instead of a thumb nop. Unfortunately, this encodes to a thumb branch which causes bad things to happen when compiling assembly code with align directives. The fix is to notify the ARMAsmBackend when we switch mode. The MCMachOStreamer was already doing this correctly. This patch makes the same change for the MCElfStreamer. There is still a bug in the way nops are emitted for alignment because the MCAlignment fragment does not store the correct mode. The ARMAsmBackend will emit nops for the last mode it knew about. In the example above, we still generate an arm nop if we add a `.code 32` to the end of the file. PR18019 llvm-svn: 195677
* Unrevert r195599 with testcase fix.Bill Wendling2013-11-251-0/+5
| | | | | | | I'm not sure how it was checking for the wrong values... PR18023. llvm-svn: 195670
* Fix indentation typoTim Northover2013-11-251-1/+1
| | | | llvm-svn: 195660
* ARM: remove special cases for Darwin dynamic-no-pic mode.Tim Northover2013-11-2511-104/+73
| | | | | | | | | These are handled almost identically to static mode (and ELF's global address materialisation), except that a symbol may have "$non_lazy_ptr" appended. This can be handled by passing appropriate flags along with the instruction instead of using entirely separate pseudo-instructions. llvm-svn: 195655
* Fix .comm and .lcomm on COFF.Rafael Espindola2013-11-251-18/+2
| | | | | | | | | | | | | | | | These should not use COMDATs. GNU as uses .bss for .lcomm and section 0 for .comm. Given static int a; int b; MSVC puts both in .bss. This patch then puts both .comm and .lcomm on .bss. With this change we agree with gas on .lcomm, are much closer on .comm and clang-cl matches msvc on the above example. llvm-svn: 195654
* Refactor to make the .bss, .data and .text sections available for other uses.Rafael Espindola2013-11-251-19/+22
| | | | | | No functionality change. llvm-svn: 195653
* Make helper function static.Benjamin Kramer2013-11-251-2/+3
| | | | llvm-svn: 195650
* ARM: remove unused patterns.Tim Northover2013-11-253-6/+1
| | | | | | | | There is no sane way for an LEApcrel (= single ADR) instruction to generate a global address on any ARM target I know of. Fortunately, no-one was trying to any more, but there were vestigial patterns. llvm-svn: 195644
* [ARM] Enable FeatureMP for Cortex-A5 by default.Amara Emerson2013-11-251-1/+1
| | | | | | Patch by Oliver Stannard. llvm-svn: 195640
* Revert r195599 as it broke the builds.Amara Emerson2013-11-251-5/+0
| | | | llvm-svn: 195636
* Fixed tryFoldToZero() for vector types that need expansion.Daniel Sanders2013-11-252-15/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: Moved the requirement for SelectionDAG::getConstant() to return legally typed nodes slightly earlier. There were two optional DAGCombine passes that were missed out and were required to produce type-legal DAGs. Simplified a code-path in tryFoldToZero() to use SelectionDAG::getConstant(). This provides support for both promoted and expanded vector types whereas the previous code only supported promoted vector types. Fixes a "Type for zero vector elements is not legal" assertion detected by an llvm-stress generated test. Reviewers: resistor CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2251 llvm-svn: 195635
* X86: enable AVX2 under Haswell native compilationTim Northover2013-11-252-7/+96
| | | | | | Patch by Adam Strzelecki llvm-svn: 195632
* Don't look past volatile loads.Bill Wendling2013-11-251-0/+5
| | | | | | | A volatile load should block us from trying to coalesce stores. PR18023 llvm-svn: 195599
* Fixed a bug about disassembling AArch64 post-index load/store single element ↵Hao Liu2013-11-251-9/+14
| | | | | | | | | | instructions. ie. echo "0x00 0x04 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble echo "0x00 0x00 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble will be disassembled into the same instruction st1 {v0b}[0], [x0], x0. llvm-svn: 195591
* SparcFrameLowering.cpp: Prune 'DL' [-Wunused-variable]NAKAMURA Takumi2013-11-251-1/+0
| | | | llvm-svn: 195590
* Output a bit more information in the debug printing for MBP. This wasChandler Carruth2013-11-251-3/+4
| | | | | | useful when analyzing parts of zlib's behavior here. llvm-svn: 195588
* [Sparc] Emit large negative adjustments to SP/FP with sethi+xor instead of ↵Venkatraman Govindaraju2013-11-244-40/+108
| | | | | | sethi+or. This generates correct code for both sparc32 and sparc64. llvm-svn: 195576
* [Sparc]: Implement LEA pattern for sparcv9.Venkatraman Govindaraju2013-11-242-4/+11
| | | | llvm-svn: 195575
* [SparcV9]: Do not emit .register directives for global registers that are ↵Venkatraman Govindaraju2013-11-241-1/+1
| | | | | | clobbered by calls but not used in the function itself. llvm-svn: 195574
* [SparcV9] Enable custom lowering of DYNAMIC_STACKALLOC in sparc64.Venkatraman Govindaraju2013-11-241-6/+11
| | | | llvm-svn: 195573
* Make sure that for C++ emitting LwConstant32 pseudos, that it correspondsReed Kotler2013-11-242-3/+3
| | | | | | | | | | to what is needed for constant islands. The prescan method for Mips16 constant islands will eventually go away. It is only temporary and should be done earlier when the instructions are first created or from the DAG. If we keep it here we need to handle better the situation where constant islands is called multiple times since don't want to prescan more than once. llvm-svn: 195569
* Fix a funny bug I introduced during conversion of ARM constant islands to Mips.Reed Kotler2013-11-241-3/+5
| | | | | | | | | | | | I had to move some code and I moved a declaration forward past it's first use in the function but by nutty coincidence there was another variable of the same name and type and with completely unrelated function that was declared globally in the class so no compilation error ensued. It required some unusual conditions for it to even matter. Caused test case casts.c in test-suite to fail during compilation with a duplicate symbol error. I would have noticed it during final code review for this port. llvm-svn: 195565
* [PM] Complete the cross-layer interfaces with a Module-to-FunctionChandler Carruth2013-11-231-0/+2
| | | | | | | | | | | | | proxy. This lets a function pass query a module analysis manager. However, the interface is const to indicate that only cached results can be safely queried. With this, I think the new pass manager is largely functionally complete for modules and analyses. Still lots to test, and need to generalize to SCCs and Loops, and need to build an adaptor layer to support the use of existing Pass objects in the new managers. llvm-svn: 195538
* DwarfDebug: Move ownership of CompileUnits into DwarfUnitsDavid Blaikie2013-11-232-13/+8
| | | | | | | | | | This avoids the need for an extra list of SkeletonCUs and associated cleanup while staging things to be cleaner for further type unit improvements. Also hopefully fixes a memory leak introduced in r195166. llvm-svn: 195536
* Migrate metadata information from scalar to vector instructions duringChandler Carruth2013-11-231-2/+37
| | | | | | | | | | | SLP vectorization. Based on the code in BBVectorizer. Fixes PR17741. Patch by Raul Silvera, reviewed by Hal and Nadav. Reformatted by my driving of clang-format. =] llvm-svn: 195528
* [PM] Add support to the analysis managers to query explicitly for cachedChandler Carruth2013-11-231-0/+13
| | | | | | | | | | | results. This is the last piece of infrastructure needed to effectively support querying *up* the analysis layers. The next step will be to introduce a proxy which provides access to those layers with appropriate use of const to direct queries to the safe interface. llvm-svn: 195525
* Refactor DW_AT_ranges handling to use labels for ranges rather thanEric Christopher2013-11-231-23/+24
| | | | | | | | | a non-relocatable number offset. One fixme to make the ranges as discrete data structures and have range lists explicitly represented rather than as a list of symbols. llvm-svn: 195523
* Reformat const for readability.Eric Christopher2013-11-231-6/+4
| | | | llvm-svn: 195522
* [PM] Switch the downward invalidation to be incremental where only theChandler Carruth2013-11-221-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one function's analyses are invalidated at a time. Also switch the preservation of the proxy to *fully* preserve the lower (function) analyses. Combined, this gets both upward and downward analysis invalidation to a point I'm happy with: - A function pass invalidates its function analyses, and its parent's module analyses. - A module pass invalidates all of its functions' analyses including the set of which functions are in the module. - A function pass can preserve a module analysis pass. - If all function passes preserve a module analysis pass, that preservation persists. If any doesn't the module analysis is invalidated. - A module pass can opt into managing *all* function analysis invalidation itself or *none*. - The conservative default is none, and the proxy takes the maximally conservative approach that works even if the set of functions has changed. - If a module pass opts into managing function analysis invalidation it has to propagate the invalidation itself, the proxy just does nothing. The only thing really missing is a way to query for a cached analysis or nothing at all. With this, function passes can more safely request a cached module analysis pass without fear of it accidentally running part way through. llvm-svn: 195519
* R600/SI: Fixing handling of condition codesTom Stellard2013-11-224-76/+98
| | | | | | | | We were ignoring the ordered/onordered bits and also the signed/unsigned bits of condition codes when lowering the DAG to MachineInstrs. NOTE: This is a candidate for the 3.4 branch. llvm-svn: 195514
* llvm-cov: Split entry blocks in GCNOProfiling.cpp.Yuchen Wu2013-11-221-0/+3
| | | | | | | | | | | | | gcov expects every function to contain an entry block that unconditionally branches into the next block. clang does not implement basic blocks in this manner, so gcov did not output correct branch info if the entry block branched to multiple blocks. This change splits every function's entry block into an empty block and a block with the rest of the instructions. The instrumentation code will take care of the rest. llvm-svn: 195513
* Debug Info: move StripDebugInfo from StripSymbols.cpp to DebugInfo.cpp.Manman Ren2013-11-222-51/+52
| | | | | | | | | | We can share the implementation between StripSymbols and dropping debug info for metadata versions that do not match. Also update the comments to match the implementation. A follow-on patch will drop the "Debug Info Version" module flag in StripDebugInfo. llvm-svn: 195505
* X86: Perform integer comparisons at i32 or larger.Jim Grosbach2013-11-221-0/+29
| | | | | | | | | | | | | | | Utilizing the 8 and 16 bit comparison instructions, even when an input can be folded into the comparison instruction itself, is typically not worth it. There are too many partial register stalls as a result, leading to significant slowdowns. By always performing comparisons on at least 32-bit registers, performance of the calculation chain leading to the comparison improves. Continue to use the smaller comparisons when minimizing size, as that allows better folding of loads into the comparison instructions. rdar://15386341 llvm-svn: 195496
* StructurizeCFG: Fix verification failure with some loops.Matt Arsenault2013-11-221-0/+14
| | | | | | | | | If the beginning of the loop was also the entry block of the function, branches were inserted to the entry block which isn't allowed. If this occurs, create a new dummy function entry block that branches to the start of the loop. llvm-svn: 195493
* StructurizeCFG: Fix inverting a branch on an argumentMatt Arsenault2013-11-221-11/+22
| | | | llvm-svn: 195492
* Teach ISel not to optimize 'optnone' functions (revised).Paul Robinson2013-11-222-0/+49
| | | | | | | | | | | | | Improvements over r195317: - Set/restore EnableFastISel flag instead of just running FastISel within SelectAllBasicBlocks; the flag is checked in various places, and FastISel won't run properly if those places don't do the right thing. - Test looks for normal ISel versus FastISel behavior, and not something more subtle that doesn't work everywhere. Based on work by Andrea Di Biagio. llvm-svn: 195491
* DEBUG shouldEvict decisionsAndrew Trick2013-11-222-3/+7
| | | | llvm-svn: 195490
* Minor cleanup. EvictionCost ctor was confusing relative to the other costs ↵Andrew Trick2013-11-221-3/+9
| | | | | | floating around in the code. llvm-svn: 195489
* patchpoint: factor SD builder code for live vars. Plain stackmap also ↵Andrew Trick2013-11-221-13/+19
| | | | | | optimizes Constant values now. llvm-svn: 195488
* patchpoint: eliminate hard coded operand indices.Andrew Trick2013-11-221-13/+19
| | | | llvm-svn: 195487
* Add a fixed version of r195470 back.Rafael Espindola2013-11-221-17/+37
| | | | | | | | | | | | | | | | The fix is simply to use CurI instead of I when handling aliases to avoid accessing a invalid iterator. original message: Convert linkonce* to weak* instead of strong. Also refactor the logic into a helper function. This is an important improve on mingw where the linker complains about mixed weak and strong symbols. Converting to weak ensures that the symbol is not dropped, but keeps in a comdat, making the linker happy. llvm-svn: 195477
* Fix PR18014Michael Liao2013-11-221-0/+9
| | | | | | | - When simplifying the mask generation for BLEND, check whether that mask is also consumed by other non-BLEND insns. If true, skip that simplification. llvm-svn: 195476
* [SystemZ] Fix TMHH and TMHL usage for z10 with -O0Richard Sandiford2013-11-224-20/+34
| | | | | | | | | | | | I've no idea why I decided to handle TMxx differently from all the other high/low logic operations, but it was a stupid thing to do. The high registers aren't available as separate 32-bit registers on z10, so subreg_h32 can't be used on a GR64 there. I've normally been testing with z196 and with -O3 and so hadn't noticed this until now. llvm-svn: 195473
* Revert "Convert linkonce* to weak* instead of strong."Rafael Espindola2013-11-221-37/+17
| | | | | | | This reverts commit r195470. Debugging failure in some bots. llvm-svn: 195472
* Add a Scalarizer pass.Richard Sandiford2013-11-223-0/+643
| | | | llvm-svn: 195471
* Convert linkonce* to weak* instead of strong.Rafael Espindola2013-11-221-17/+37
| | | | | | | | | Also refactor the logic into a helper function. This is an important improvement on mingw where the linker complains about mixed weak and strong symbols. Converting to weak ensures that the symbol is not dropped, but keeps in a comdat, making the linker happy. llvm-svn: 195470
* SLPVectorizer: Fix whitespace errors.Arnold Schwaighofer2013-11-221-5/+4
| | | | llvm-svn: 195468
* Don't produce tail calls when the caller is x86_thiscallcc.Rafael Espindola2013-11-221-3/+7
| | | | | | The callee will not pop the stack for us. llvm-svn: 195467
* Fix typo in a comment added in r195455.Daniel Sanders2013-11-221-1/+1
| | | | | | Credit to Matheus Almeida for spotting it. llvm-svn: 195456
OpenPOWER on IntegriCloud