summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Recognize n/1 in the SCEV divide functionBrendon Cahoon2015-04-202-0/+77
| | | | | | | | | | | | n/1 generates a quotient equal to n and a remainder of 0. If this case is not recognized, then the SCEV divide() function can return a remainder that is greater than or equal to the denominator, which means the delinearized subscripts for the test case will be incorrect. Differential Revision: http://reviews.llvm.org/D9003 llvm-svn: 235311
* [PowerPC] Flow oversized lines for r235309Bill Schmidt2015-04-201-11/+25
| | | | llvm-svn: 235310
* [PowerPC] Add future work for vector insert/extract to README_ALTIVEC.txtBill Schmidt2015-04-201-0/+14
| | | | llvm-svn: 235309
* [mips][microMIPSr6] Implement disassembler supportJozef Kolek2015-04-203-4/+20
| | | | | | | | Implement disassembler support for microMIPS32r6. Differential Revision: http://reviews.llvm.org/D8490 llvm-svn: 235307
* Don't allow pwrite to resize a stream.Rafael Espindola2015-04-203-15/+26
| | | | | | | | | | | | | | | | | | | | | The current implementations could exhibit some behavior differences: raw_fd_ostream: Whatever the underlying fd does with seek+write. In a normal file, the write position would be back to the old offset. raw_svector_ostream: The write position is always the end of the stream, so after pwrite the write position would be the new end. This matches what OS_X (all BSD?) do with a pwrite in a O_APPEND fd. Given that we don't need that feature and don't use O_APPEND a lot in LLVM, just disallow it. I am open to suggestions on renaming pwrite to something else, but this fixes the issue for now. Thanks to Yaron Keren for reporting it. llvm-svn: 235303
* [mips][microMIPSr6] Implement BALC and BC instructionsJozef Kolek2015-04-204-3/+63
| | | | | | | | This patch implements BALC and BC instructions using mapping. Differential Revision: http://reviews.llvm.org/D8388 llvm-svn: 235302
* Look past locals in comdats.Rafael Espindola2015-04-202-9/+10
| | | | | | | | | | | We have to avoid converting a reference to a global into a reference to a local, but it is fine to look past a local. Patch by Vasileios Kalintiris. I just moved the comment and added thet test. llvm-svn: 235300
* [mips][microMIPSr6] Implement initial mapping supportJozef Kolek2015-04-203-2/+40
| | | | | | Differential Revision: http://reviews.llvm.org/D8387 llvm-svn: 235298
* [mips][microMIPSr6] Implement initial subtarget supportJozef Kolek2015-04-204-0/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D8386 llvm-svn: 235296
* [X86][FastIsel] Fix assertion failure when selecting int-to-double ↵Andrea Di Biagio2015-04-202-5/+23
| | | | | | | | | | | | | | | | | | | | | | conversion (PR23273). This fixes a regression introduced at revision 231243. The target-independent selection algorithm in FastISel knows how to select a SINT_TO_FP if the target is SSE but not AVX. That is because on X86, the tablegen'd 'fastEmit' functions know how to select CVTSI2SSrr and CVTSI2SDrr. Method X86FastISel::X86SelectSIToFP was therefore working under the wrong assumption that the target was AVX. That assumption was incorrect since we can have a target that is neither AVX nor SSE. So, rather than asserting for the presence of AVX, we should have had an early exit from 'X86SelectSIToFP' if the target was not AVX. This patch fixes the issue replacing the invalid assertion with an early exit. Thanks to Dimitry Andric for reporting this problem and for providing a small reproducible testcase. Added test pr23273.ll. llvm-svn: 235295
* Fix buildbot failure on darwin from r235284.Karthik Bhat2015-04-201-0/+2
| | | | llvm-svn: 235287
* [Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobjSimon Atanasyan2015-04-203-0/+24
| | | | llvm-svn: 235285
* [NFC] Refactor identification of reductions as common utility function.Karthik Bhat2015-04-204-519/+611
| | | | | | | | | This patch refactors reduction identification code out of LoopVectorizer and exposes them as common utilities. No functional change. Review: http://reviews.llvm.org/D9046 llvm-svn: 235284
* [InlineAsm] Remove EarlyClobber on registers that are also inputsHal Finkel2015-04-202-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an inline asm call has an output register marked as early-clobber, but that same register is also an input operand, what should we do? GCC accepts this, and is documented to accept this for read/write operands saying, "Furthermore, if the earlyclobber operand is also a read/write operand, then that operand is written only after it's used." For write-only operands, the situation seems less clear, but I have at least one existing codebase that assumes this will work, in part because it has syscall macros like this: ({ \ register uint64_t r0 __asm__ ("r0") = (__NR_ ## name); \ register uint64_t r3 __asm__ ("r3") = ((uint64_t) (arg0)); \ register uint64_t r4 __asm__ ("r4") = ((uint64_t) (arg1)); \ register uint64_t r5 __asm__ ("r5") = ((uint64_t) (arg2)); \ __asm__ __volatile__ \ ("sc" \ : "=&r"(r0),"=&r"(r3),"=&r"(r4),"=&r"(r5) \ : "0"(r0), "1"(r3), "2"(r4), "3"(r5) \ : "r6","r7","r8","r9","r10","r11","r12","cr0","memory"); \ r3; \ }) Furthermore, with register aliases and subregister relationships that only the backend knows about, rejecting this in the frontend seems like a difficult proposition (if we wanted to do so). However, keeping the early-clobber flag on the INLINEASM MI does not work for us, because it will cause the register's live interval to end to soon (so it will not appear defined to be used as an input). Fortunately, fixing this does not seem hard: When forming the INLINEASM MI, check to see if any of the early-clobber outputs are also inputs, and if so, remove the early-clobber flag. llvm-svn: 235283
* [X86][SSE] Fix for getScalarValueForVectorElement to detect scalar sources ↵Simon Pilgrim2015-04-192-2/+23
| | | | | | | | | | requiring truncation. The fix ensures that scalar sources inserted into a vector are the correct bit size. Integer scalar sources from BUILD_VECTOR and SCALAR_TO_VECTOR nodes may require truncation that this function doesn't currently support. llvm-svn: 235281
* [X86][SSE] Extended copysign tests to include llvm intrinsic implementation ↵Simon Pilgrim2015-04-191-7/+125
| | | | | | and constant folding. llvm-svn: 235279
* [mips] Update MIPS relocations listSimon Atanasyan2015-04-191-0/+4
| | | | | | No functional changes. llvm-svn: 235278
* Remove the FCFI option from TargetOptions as it is currently unused.Eric Christopher2015-04-192-12/+1
| | | | llvm-svn: 235269
* Remove CFIFuncName from TargetOptions as it is currently unused.Eric Christopher2015-04-193-30/+1
| | | | llvm-svn: 235268
* Remove the CFIEnforcing flag from TargetOptions as it is unused.Eric Christopher2015-04-193-15/+2
| | | | llvm-svn: 235267
* Remove the CFIType TargetOption as it is unused.Eric Christopher2015-04-192-28/+1
| | | | llvm-svn: 235266
* Remove the JITEmitDebugInfo TargetOptions as they're only set andEric Christopher2015-04-192-36/+2
| | | | | | not used anywhere in llvm. llvm-svn: 235265
* Remove unnecessary include and probably a layering violation.Craig Topper2015-04-191-1/+0
| | | | llvm-svn: 235262
* [MemCpyOpt] Don't force i64 when promoting memset/memcpy sizes.Ahmed Bougacha2015-04-182-3/+38
| | | | | | | | | | Harden r235258 to support any integer bitwidth. The quick glance at the reference made me think only i32 and i64 were valid types, but they're not special, so any overload is legal. Thanks to David Majnemer for noticing! llvm-svn: 235261
* [X86][AVX2] Force execution domain on broadcast folding tests.Simon Pilgrim2015-04-181-3/+9
| | | | llvm-svn: 235260
* [X86][SSE] Force execution domain on float/double unpack shuffle tests.Simon Pilgrim2015-04-182-12/+36
| | | | llvm-svn: 235259
* [MemCpyOpt] Promote both memset/memcpy sizes if differently typed.Ahmed Bougacha2015-04-182-3/+41
| | | | | | | | | | | | | Followup to r235232, which caused PR23278. We can't assume the memset and memcpy sizes have the same type, as nothing in the language reference prevents that. Instead, zext both to i64 if they disagree. While there, robustify tests by using i8 %c rather than i8 0 for the memset character. llvm-svn: 235258
* [InstCombine] Create zero constants on demand.Benjamin Kramer2015-04-181-4/+2
| | | | | | No functional change intended. llvm-svn: 235257
* [InstCombine] (mul nsw 1, INT_MIN) != (shl nsw 1, 31)David Majnemer2015-04-182-2/+22
| | | | | | | Multiplying INT_MIN by 1 doesn't trigger nsw. However, shifting 1 into the sign bit *does* trigger nsw. llvm-svn: 235250
* [GlobalMerge] Look at uses to create smaller global sets.Ahmed Bougacha2015-04-189-20/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of merging everything together, look at the users of GlobalVariables, and try to group them by function, to create sets of globals used "together". Using that information, a less-aggressive alternative is to keep merging everything together *except* globals that are only ever used alone, that is, those for which it's clearly non-profitable to merge with others. In my testing, grouping by Function is too aggressive, but grouping by BasicBlock is too conservative. Anything in-between isn't trivially available, so stick with Function grouping for now. cl::opts are added for testing; both enabled by default. A few of the testcases aren't testing the merging proper, but just various edge cases when merging does occur. Update them to use the previous grouping behavior. Also, one of the tests is unrelated to GlobalMerge; change it accordingly. While there, switch to r234666' flags rather than the brutal -O3. Differential Revision: http://reviews.llvm.org/D8070 llvm-svn: 235249
* DebugInfo: Delete DIDescriptor (but not its subclasses)Duncan P. N. Exon Smith2015-04-185-50/+18
| | | | | | | Delete `DIDescriptor` and update the remaining users. I'll follow-up by deleting subclasses in manageable groups (top-down). llvm-svn: 235248
* docs: Update Kaleidoscope for recent DI changesDuncan P. N. Exon Smith2015-04-181-26/+26
| | | | | | | | This has been bit-rotting, so fix it up. I'll have to edit this again once the MD* classes have been renamed to DI* -- I'll try to remember to do that with the commit that renames them. llvm-svn: 235244
* [AArch64] Don't force MVT::Untyped when selecting LD1LANEpost.Ahmed Bougacha2015-04-172-1/+23
| | | | | | | | | | | | | | | | | | | The result is either an Untyped reg sequence, on ldN with N > 1, or just the type of the input vector, on ld1. Don't force Untyped. Instead, just use the type of the reg sequence. This mirrors the behavior of createTuple, which feeds the LD1*_POST. The narrow code path wasn't actually covered by tests, because V64 insert_vector_elt are widened to V128 before the LD1LANEpost combine has the chance to run, usually. The only case where it does run on V64 vectors is if the vector ops legalizer ran. So, tickle the code with a ctpop. Fixes PR23265. llvm-svn: 235243
* Fix another typo in r235224 testcase. NFC.Ahmed Bougacha2015-04-171-9/+9
| | | | | | Third time's the charm! llvm-svn: 235242
* Fix build wanrings and line endingsAndrew Kaylor2015-04-171-1/+0
| | | | llvm-svn: 235241
* DebugInfo: Remove DIDescriptor from the DebugInfo APIDuncan P. N. Exon Smith2015-04-177-60/+62
| | | | | | | Stop using `DIDescriptor` and its subclasses in the `DebugInfoFinder` API, as well as the rest of the API hanging around in `DebugInfo.h`. llvm-svn: 235240
* [WinEH] Fixes for a few cppeh failures.Andrew Kaylor2015-04-173-13/+619
| | | | | | Differential Review: http://reviews.llvm.org/D9065 llvm-svn: 235239
* [LoopAccesses] Improve debug outputAdam Nemet2015-04-171-4/+8
| | | | llvm-svn: 235238
* [PDB] Support executables and source/line info.Zachary Turner2015-04-178-6/+106
| | | | | | | | | | | | Previously DebugInfoPDB could only load data for a PDB given a path to the PDB. It could not open an EXE and find the matching PDB and verify it matched, etc. This patch adds support for that so that we can simply load debug information for a PDB directly. Additionally, this patch extends DebugInfoPDB to support getting source and line information for symbols. llvm-svn: 235237
* [opaque pointer type] Access the pointee of the result type from the GEP ↵David Blaikie2015-04-172-3/+4
| | | | | | | | | | rather than pulling it out of the pointer result type The implementation of this GEP::getResultElementType will be refactored to either rely on a member variable, or recompute the value from the indicies (any preferences?). llvm-svn: 235236
* [opaque pointer type] Query the GEP for its source element type directly ↵David Blaikie2015-04-171-2/+1
| | | | | | rather than finding it through the pointer type of the first operand in the Verifier llvm-svn: 235235
* [opaque pointer type] Avoid creating (and then unwrapping) a pointer type to ↵David Blaikie2015-04-171-7/+11
| | | | | | compute the result type of a GEP llvm-svn: 235234
* [opaque pointer type] Use the parsed explicit pointee type when ↵David Blaikie2015-04-171-5/+2
| | | | | | error-checking geps during LL parsing llvm-svn: 235233
* [MemCpyOpt] Optimize double-storing by memset+memcpy.Ahmed Bougacha2015-04-172-3/+113
| | | | | | | | | | | | | | | | | | A common idiom in some code is to do the following: memset(dst, 0, dst_size); memcpy(dst, src, src_size); Some of the memset is redundant; instead, we can do: memcpy(dst, src, src_size); memset(dst + src_size, 0, dst_size <= src_size ? 0 : dst_size - src_size); Original patch by: Joel Jones Differential Revision: http://reviews.llvm.org/D498 llvm-svn: 235232
* [LangRef] Remove redundant and inconsistent condition.Sean Silva2015-04-171-1/+1
| | | | | | | | Just above, 'op2' is stated to be unsigned, so 'negative' doesn't make sense (and is handled by "larger than" anyway). The descriptions for lshr and ashr don't say 'negative or' either. llvm-svn: 235230
* AsmPrinter: Create a unified .debug_loc streamDuncan P. N. Exon Smith2015-04-178-86/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes `DebugLocList` and replaces it with `DebugLocStream`. - `DebugLocEntry` no longer contains its byte/comment streams. - The `DebugLocEntry` list for a variable/inlined-at pair is allocated on the stack, and released right after `DebugLocEntry::finalize()` (possible because of the refactoring in r231023). Now, only one list is in memory at a time now. - There's a single unified stream for the `.debug_loc` section that persists, stored in the new `DebugLocStream` data structure. The last point is important: this collapses the nested `SmallVector<>`s from `DebugLocList` into unified streams. We previously had something like the following: vec<tuple<Label, CU, vec<tuple<BeginSym, EndSym, vec<Value>, vec<char>, vec<string>>>>> A `SmallVector` can avoid allocations, but is statically fairly large for a vector: three pointers plus the size of the small storage, which is the number of elements in small mode times the element size). Nesting these is expensive, since an inner vector's size contributes to the element size of an outer one. (Nesting any vector is expensive...) In the old data structure, the outer vector's *element* size was 632B, excluding allocation costs for when the middle and inner vectors exceeded their small sizes. 312B of this was for the "three" pointers in the vector-tree beneath it. If you assume 1M functions with an average of 10 variable/inlined-at pairs each (in an LTO scenario), that's almost 6GB (besides inner allocations), with almost 3GB for the "three" pointers. This came up in a heap profile a little while ago of a `clang -flto -g` bootstrap, with `DwarfDebug::collectVariableInfo()` using something like 10-15% of the total memory. With this commit, we have: tuple<vec<tuple<Label, CU, Offset>>, vec<tuple<BeginSym, EndSym, Offset, Offset>>, vec<char>, vec<string>> The offsets are used to create `ArrayRef` slices of adjacent `SmallVector`s. This reduces the number of vectors to four (unrelated to the number of variable/inlined-at pairs), and caps the number of allocations at the same number. Besides saving memory and limiting allocations, this is NFC. I don't know my way around this code very well yet, but I wonder if we could go further: why stream to a side-table, instead of directly to the output stream? llvm-svn: 235229
* AArch64: Add test for returning [2 x i64] in registers. NFC.Pete Cooper2015-04-171-0/+11
| | | | llvm-svn: 235228
* Compute A-B when A or B is weak.Rafael Espindola2015-04-179-40/+36
| | | | | | | | | | | | | | | | | | | | Similar to r235222, but for the weak symbol case. In an "ideal" assembler/object format an expression would always refer to the final value and A-B would only be computed from a section in the same comdat as A and B with A and B strong. Unfortunately that is not the case with debug info on ELF, so we need an heuristic. Since we need an heuristic, we may as well use the same one as gas: * call weak_sym : produces a relocation, even if in the same section. * A - weak_sym and weak_sym -A: don't produce a relocation if we can compute it. This fixes pr23272 and changes the fix of pr22815 to match what gas does. llvm-svn: 235227
* Fix typo in r235224 testcase. NFC.Ahmed Bougacha2015-04-171-1/+1
| | | | llvm-svn: 235226
* Remove dead code, NFCDuncan P. N. Exon Smith2015-04-171-8/+0
| | | | llvm-svn: 235225
OpenPOWER on IntegriCloud