summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* WinCOFF: Add support for -ffunction-sectionsDavid Majnemer2014-03-231-4/+9
| | | | | | | | This is a pretty straight forward translation for COFF, we just need to stick the function in a COMDAT section marked as IMAGE_COMDAT_SELECT_NODUPLICATES. llvm-svn: 204565
* remove a bunch of unused private methodsNuno Lopes2014-03-233-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. include/llvm/CodeGen/MachineSSAUpdater.h | 1 include/llvm/IR/DebugInfo.h | 3 lib/CodeGen/MachineSSAUpdater.cpp | 10 -- lib/CodeGen/PostRASchedulerList.cpp | 1 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 -- lib/IR/DebugInfo.cpp | 12 -- lib/MC/MCAsmStreamer.cpp | 2 lib/Support/YAMLParser.cpp | 39 --------- lib/TableGen/TGParser.cpp | 16 --- lib/TableGen/TGParser.h | 1 lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 9 -- lib/Target/ARM/ARMCodeEmitter.cpp | 12 -- lib/Target/ARM/ARMFastISel.cpp | 84 -------------------- lib/Target/Mips/MipsCodeEmitter.cpp | 11 -- lib/Target/Mips/MipsConstantIslandPass.cpp | 12 -- lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 21 ----- lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 lib/Target/PowerPC/PPCFastISel.cpp | 1 lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 lib/Transforms/Instrumentation/BoundsChecking.cpp | 2 lib/Transforms/Instrumentation/MemorySanitizer.cpp | 1 lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 - lib/Transforms/Scalar/SCCP.cpp | 1 utils/TableGen/CodeEmitterGen.cpp | 2 24 files changed, 2 insertions(+), 261 deletions(-) llvm-svn: 204560
* [DAG] Fix an assertion failure caused by an invalid cast in method ↵Andrea Di Biagio2014-03-222-8/+7
| | | | | | | | | | | | 'BuildVectorSDNode::isConstantSplat' This patch renames method 'isConstantSplat' as 'getConstantSplatValue' (mainly for consistency reasons), and rewrites its logic to ensure that we always perform a legal 'cast<ConstantSDNode>'. Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts. llvm-svn: 204536
* Delete stale comment. Thanks, Eric!Adrian Prantl2014-03-211-1/+0
| | | | llvm-svn: 204530
* Dwarf Debug: Remove some cargo-cult type uniquing. Scopes do not haveAdrian Prantl2014-03-211-1/+1
| | | | | | | an ID, so this is a noop. Thanks Manman for catching this! llvm-svn: 204528
* Remove some dead assignements found by scan-buildArnaud A. de Grandmaison2014-03-211-1/+1
| | | | llvm-svn: 204526
* Register allocator: add condition to hoist a spill to outer loop.Manman Ren2014-03-211-0/+14
| | | | | | | | | | | We make sure a spill is not hoisted to a hotter outer loop by adding a condition. Hoist a spill to outer loop if there are multiple dependents (it can be beneficial if more than one dependents are hoisted) or if DepSV (the hoisting source) is hotter than SV (the hoisting destination). rdar://16268194 llvm-svn: 204522
* DebugInfo: Omit DW_AT_addr_base from skeletal type units.David Blaikie2014-03-211-7/+7
| | | | | | | | | | | | | Type units have no addresses, so there's no need for DW_AT_addr_base. This removes another relocation from every skeletal type unit and brings LLVM's skeletal type units in line with GCC's (containing only GNU_dwo_name (strp), comp_dir (strp), and GNU_pubnames (flag_present)). Cary's got some ideas about using str_index in the .o file to reduce those last two relocations (well, replace two relocations with one relocation (pointing to the string index) and two indicies) llvm-svn: 204506
* Fix an assertion caused by using inline asm with indirect register inputs.Kevin Qin2014-03-211-1/+1
| | | | llvm-svn: 204425
* Remove LowerInvoke's obsolete "-enable-correct-eh-support" optionMark Seaborn2014-03-201-1/+1
| | | | | | | | | | | | | | | This option caused LowerInvoke to generate code using SJLJ-based exception handling, but there is no code left that interprets the jmp_buf stack that the resulting code maintained (llvm.sjljeh.jblist). This option has been obsolete for a while, and replaced by SjLjEHPrepare. This leaves the default behaviour of LowerInvoke, which is to convert invokes to calls. Differential Revision: http://llvm-reviews.chandlerc.com/D3136 llvm-svn: 204388
* Typo.Eric Christopher2014-03-201-1/+1
| | | | llvm-svn: 204378
* Reapply DW_AT_low/high_pc patch:Eric Christopher2014-03-204-81/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc. This commit moves us from a single range per subprogram to extending ranges if we are: a) In the same section, and b) In the same enclosing CU. This means we have more fine grained ranges for compile units, and fewer ranges overall when we have multiple functions in the same CU adjacent to each other in the object file. Also remove all of the earlier hacks around this functionality for function sections etc. Also update all of the testcases to take into account the merging functionality. with a fix for location entries in the debug_loc section: Make sure that debug loc entries are relative to the low_pc of the compile unit. This means that when we only have a single range that the offset should be just relative to the low_pc of the unit, for multiple ranges for a CU this means that we'll be relative to 0 which we emit along with DW_AT_ranges. This mostly shows up with linked binaries, so add a testcase with multiple CUs so that our location is going to be offset of a CU with a non-zero low_pc. llvm-svn: 204377
* Add comments from Eric's review of r204094.David Blaikie2014-03-201-0/+5
| | | | llvm-svn: 204358
* Revert "Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc."Eric Christopher2014-03-204-101/+61
| | | | | | | | This appears to trigger failures with optimization and function arguments somehow. This reverts commit r204277. llvm-svn: 204286
* Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.Eric Christopher2014-03-194-61/+101
| | | | | | | | | | | | | | | | | | This commit moves us from a single range per subprogram to extending ranges if we are: a) In the same section, and b) In the same enclosing CU. This means we have more fine grained ranges for compile units, and fewer ranges overall when we have multiple functions in the same CU adjacent to each other in the object file. Also remove all of the earlier hacks around this functionality for function sections etc. Also update all of the testcases to take into account the merging functionality. llvm-svn: 204277
* DebugInfo: Use the comp_dir of the referencing type units when building ↵David Blaikie2014-03-192-15/+27
| | | | | | | | | | | | debug_line.dwo This isn't a complete fix - it falls back to non-comp_dir when multiple compile units are in play. Adding a map of comp_dir to table is part of the more general solution, but I gave up (in the short term) when I realized I'd also have to calculate the size of each type unit so as to produce correct DW_AT_stmt_list attributes. llvm-svn: 204202
* MachO: Emit a version-min load command when possible.Jim Grosbach2014-03-181-0/+19
| | | | | | | | | When deployment target version information is available, emit it to the target streamer for inclusion in the object file. rdar://11337778 llvm-svn: 204191
* More header and forward declaration cleanup.Eric Christopher2014-03-182-5/+1
| | | | llvm-svn: 204183
* Add back the headers we're getting via (likely) transitive includes.Eric Christopher2014-03-181-0/+4
| | | | | | We really do use these things in the header. llvm-svn: 204180
* Fix for coding style.Eric Christopher2014-03-181-1/+1
| | | | llvm-svn: 204177
* Remove a bunch of unnecessary includes and forward declarations.Eric Christopher2014-03-181-17/+4
| | | | llvm-svn: 204176
* Add support for scalarizing/splitting vector bswap.Raul E. Silvera2014-03-181-0/+2
| | | | | | | | | | | | | | Summary: SLP Vectorization of intrinsics (r203707) has exposed cases where the expansion of vector bswap is failing (PR19151). Reviewers: hfinkel CC: chandlerc Differential Revision: http://llvm-reviews.chandlerc.com/D3104 llvm-svn: 204163
* Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.Adrian Prantl2014-03-184-51/+5
| | | | | | Follow-up to r203982. llvm-svn: 204162
* [DAGCombiner] teach how to simplify xor/and/or nodes according to the ↵Andrea Di Biagio2014-03-181-21/+52
| | | | | | | | | | | | | | following rules: 1) (AND (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (AND (A, B), C, Mask) 2) (OR (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (OR (A, B), C, Mask) 3) (XOR (shuf (A, C, Mask), shuf (B, C, Mask)) -> shuf (XOR (A, B), V_0, Mask) 4) (AND (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (C, AND (A, B), Mask) 5) (OR (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (C, OR (A, B), Mask) 6) (XOR (shuf (C, A, Mask), shuf (C, B, Mask)) -> shuf (V_0, XOR (A, B), Mask) llvm-svn: 204160
* DwarfDebug: Only unique retained types instead of all types.Adrian Prantl2014-03-182-5/+9
| | | | | | | This is a follow-up to r203983 based on feedback from dblaikie and mren (Thanks!) No functionality change. llvm-svn: 204107
* Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.Adrian Prantl2014-03-183-8/+16
| | | | | | | | | This allows us to catch more opportunities for ODR-based type uniquing during LTO. Paired commit with CFE which updates some testcases to verify the new DIBuilder behavior. llvm-svn: 204106
* Replace unnecessary #include directive with forward declarations.Adrian Prantl2014-03-182-1/+3
| | | | llvm-svn: 204104
* Add explanatory comment.Eric Christopher2014-03-181-0/+2
| | | | llvm-svn: 204103
* Shorten DotDebugLocEntry to just DebugLocEntry and reformat.Eric Christopher2014-03-183-33/+27
| | | | | | No functional change. llvm-svn: 204102
* DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers ↵David Blaikie2014-03-184-5/+5
| | | | | | | | | where opcodes are never used anyway Introduce a slightly tighter wrapper around the header structure that handles this use case. (MCDwarfDwoLineTable) llvm-svn: 204101
* DebugInfo: Implement debug_line.dwo for file names used in type units during ↵David Blaikie2014-03-184-10/+44
| | | | | | | | | | | | | | | | | | | | -gsplit-dwarf This removes an attribute (and more importantly, a relocation) from skeleton type units and removes some unnecessary file names from the debug_line section that remains in the .o (and linked executable) file. There's still a few places we could shave off some more space here: * use compilation dir of the underlying compilation unit (since all the type units share that compilation dir - though this would be more complicated in LTO cases where they don't (keep a map of compilation dir->line table header?)) * Remove some of the unnecessary header fields from the line table since they're not needed in this situation (about 12 bytes per table). llvm-svn: 204099
* DebugInfo: Do not rely on the compilation dir (index 0) for files in line ↵David Blaikie2014-03-182-6/+13
| | | | | | | | | | | | | | | | | | | | | | tables shared between compilation units When emitting assembly there's no support for emitting separate line tables for each compilation unit - so LLVM emits .loc directives producing a single line table. Line tables have an implicit directory (index 0) equal to the compilation directory (DW_AT_comp_dir) of the compilation unit that references them. If multiple compilation units (with possibly disparate compilation directories) reference the same line table, we must avoid relying on this ambiguous directory. Achieve this my simply not setting the compilation directory on the line table when we're in this situation (multiple units while emitting assembly). llvm-svn: 204094
* DebugInfo: Move getOrCreateSourceID from DwarfDebug to DwarfCompileUnitDavid Blaikie2014-03-174-31/+22
| | | | | | | | | | | We still do a few lookups into the line table mapping in MCContext that could be factored out into a single lookup (rather than looking it up once for the table label, once to set the compilation unit, once for each time we need a file ID, etc... ) but assembly output complicates that somewhat as we still need a virtual dispatch back to the MCAsmStreamer in that case. llvm-svn: 204092
* DebugInfo: Move line table zero-directory-index (compilation dir) handling ↵David Blaikie2014-03-171-4/+2
| | | | | | | | | | | | into MCDwarf Our handling of compilation directory in DwarfDebug was broken (incorrectly using the 'last' compilation directory (that of the last CU in the metadata list) for all function emission in any CU). By moving this handling down into MCDwarf the issue is fixed as the compilation dir is tracked correctly per line table. llvm-svn: 204089
* Switch a number of loops in lib/CodeGen over to range-based for-loops, now thatOwen Anderson2014-03-1717-143/+88
| | | | | | the MachineRegisterInfo iterators are compatible with it. llvm-svn: 204075
* Make DAGCombiner work on vector bitshifts with constant splat vectors.Matt Arsenault2014-03-172-137/+178
| | | | llvm-svn: 204071
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-172-35/+2
| | | | | | | | | | | | | See r204027 for the precursor to this that applied to asm debug info. This required some non-obvious API changes to handle the case of asm output (we never go asm->asm so this didn't come up in r204027): the modification of the file/directory name by MCDwarfLineTableHeader needed to be reflected in the MCAsmStreamer caller so it could print the appropriate .file directive, so those StringRef parameters are now non-const ref (in/out) parameters rather than just const. llvm-svn: 204069
* [VectorLegalizer/X86] Don't unvectorize fp_to_uint for v8f32->v8i16Adam Nemet2014-03-171-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than LegalizeAction::Expand, this needs LegalizeAction::Promote to get promoted to fp_to_sint v8f32->v8i32. This is a legal operation on AVX. For that to work properly, we also need to teach the legalizer about the specific promotion required here. The default vector promotion uses bitcasting to a vector type of the same total size. We want to promote the vector element type, effectively widening the operation and then truncating the result. This is analogous to the current logic of how int_to_fp is promoted. The change also factors out some code from the int_to_fp promotion code to ValueType::widenIntegerVectorElementType. This is now shared between int_to_fp and fp_to_int. There is no longer need for the custom lowering of fp_to_sint f32->v8i16 in X86. It can now go through the new target-independent fp_to_*int promotion logic. I also checked that no other target uses Promote for these ops yet, so there shouldn't be any unexpected change in behavior. Fixes <rdar://problem/16202247> llvm-svn: 204058
* [X86] New and improved VZeroUpperInserter optimization.Lang Hames2014-03-171-1/+1
| | | | | | | | | | | | | | | | | - Adds support for inserting vzerouppers before tail-calls. This is enabled implicitly by having MachineInstr::copyImplicitOps preserve regmask operands, which allows VZeroUpperInserter to see where tail-calls use vector registers. - Fixes a bug that caused the previous version of this optimization to miss some vzeroupper insertion points in loops. (Loops-with-vector-code that followed loops-without-vector-code were mistakenly overlooked by the previous version). - New algorithm never revisits instructions. Fixes <rdar://problem/16228798> llvm-svn: 204021
* Remove some dead assignements found by scan-buildArnaud A. de Grandmaison2014-03-152-3/+1
| | | | llvm-svn: 204013
* Debug info: Unique types before emitting them to DWARF, where applicable.Adrian Prantl2014-03-141-0/+3
| | | | llvm-svn: 203983
* Debug Info: Fix LTO type uniquing for C++ member declarationsAdrian Prantl2014-03-144-1/+53
| | | | | | | | | | | | | | | | based on the ODR. This adds an OdrMemberMap to DwarfDebug which is used to unique C++ member function declarations based on the unique identifier of their containing class and their mangled name. We can't use the usual DIRef mechanism here because DIScopes are indexed using their entire MDNode, including decl_file and decl_line, which need not be unique (see testcase). Prior to this change multiple redundant member function declarations would end up in the same uniqued DW_TAG_class_type. llvm-svn: 203982
* typoAdrian Prantl2014-03-141-1/+1
| | | | llvm-svn: 203980
* Remove command line option for CU hashing. This is on by default now.Eric Christopher2014-03-141-10/+2
| | | | | | Fix up testcases and use of flag. llvm-svn: 203973
* If we see that we're emitting code for a function that doesn't haveEric Christopher2014-03-141-1/+3
| | | | | | | | any lexical scopes then go ahead and turn on DW_AT_ranges for the compile unit since we would be claiming to describe in the CU a range for which we don't have information in the CU otherwise. llvm-svn: 203969
* Remove the -generate-dwarf-cu-ranges flag.Eric Christopher2014-03-141-12/+6
| | | | | | | Rewrite a couple of testcases to cover areas that would be normally by turning it on into testcases that will follow the logic. llvm-svn: 203968
* DwarfDebug: Remove some needless recursion.David Blaikie2014-03-141-2/+4
| | | | llvm-svn: 203946
* Revert r203883 (which was more of a bandaid) and fix the real underlyingOwen Anderson2014-03-141-1/+1
| | | | | | | | issue in that the new MachineRegisterInfo bundle iterators didn't dereference to the START of the bundle, while the old skipBundle() method did. llvm-svn: 203890
* Fix issue with r203865. The old behaviour would get a MachineOperand then ↵Pete Cooper2014-03-141-1/+1
| | | | | | find the MI for the bundle the MI was in. The new behaviour was failing to get the parent bundle and instead just used the MI from the MachineOperand llvm-svn: 203883
* Use DW_AT_linkage_name when we're emitting DWARF4 or above.Eric Christopher2014-03-131-1/+2
| | | | llvm-svn: 203867
OpenPOWER on IntegriCloud