summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Make sure all temporary files get created under %T."Frederic Riss2015-08-051-3/+1
| | | | | | | | | This reverts commit r244163. The workaround shouldn't be necessary after r244172, and moreover the commit was slightly buggy as it dis a simple mkdir without removing the directory first, which could cause 'File exists' errors. llvm-svn: 244182
* ValueMapper: Rotate distinct node remapping algorithmDuncan P. N. Exon Smith2015-08-051-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rotate the algorithm for remapping distinct nodes in order to simplify how uniquing cycles get resolved. This removes some of the recursion, and, most importantly, exposes all uniquing cycles at the top-level. Besides being a little more efficient -- temporary MDNodes won't live as long -- the clearer logic should help protect against bugs like those fixed in r243961 and r243976. What are uniquing cycles? Why do they present challenges when remapping metadata? !0 = !{!1} !1 = !{!0} !0 and !1 form a simple uniquing cycle. When remapping from one metadata graph to another, every uniquing cycle gets "duplicated" through a dance: !0-temp = !{!1?} ; map(!0): clone !0, VM[!0] = !0-temp !1-temp = !{!0?} ; ..map(!1): clone !1, VM[!1] = !1-temp !1-temp = !{!0-temp} ; ..map(!1): remap !1's operands !2 = !{!0-temp} ; ..map(!1): uniquify: !1-temp => !2 !0-temp = !{!2} ; map(!0): remap !0's operands !3 = !{!2} ; map(!0): uniquify: !0-temp => !3 ; Result !2 = !{!3} !3 = !{!2} (In the two "uniquify" steps above, the operands of !X-temp are compared to the operands of !X. If they're the same, then !X-temp gets RAUW'ed to !X; if they're different, then !X-temp is promoted to a new unique node. The latter case always hits in for uniquing cycles, so we duplicate all the nodes involved.) Why is this a problem? Uniquable Metadata nodes that have temporary node as transitive operands keep RAUW support until the temporary nodes get finalized. With non-cycles, this happens automatically: when a uniquable node's count of unresolved operands drops to zero, it immediately sheds its own RAUW support (possibly triggering the same in any node that references it). However, uniquing cycles create a reference cycle, and uniqued nodes that transitively reference a uniquing cycle are "stuck" in an unresolved state until someone calls `MDNode::resolveCycles()` on a node in the unresolved subgraph. Distinct nodes should help here (and mostly do): since they aren't uniqued anywhere, they are guaranteed not to be RAUW'ed. They effectively form a barrier between uniqued nodes, breaking some uniquing cycles, and shielding uniqued nodes from uniquing cycles. Unfortunately, with this barrier in place, the unresolved subgraph(s) can be disjoint from the top-level node. The mapping algorithm needs to find at least one representative from each disjoint subgraph. But which nodes are *stuck*, and which will get resolved automatically? And which nodes are in the unresolved subgraph? The old logic was conservative. This commit rotates the logic for distinct nodes, so that we have access to unresolved nodes at the top-level call to `llvm::MapMetadata()`. Each time we return to the top-level, we know that all temporaries have been RAUW'ed away. Here, it's safe (and necessary) to call `resolveCycles()` immediately on unresolved operands. This should also perform better than the old algorithm. The recursion stack is shorter, temporary nodes don't live as long, and there are fewer tracking references to unresolved nodes. As the debug info graph introduces more 'distinct' nodes, remapping should incrementally get cheaper and cheaper. Aside from possible performance improvements (and reduced cruft in the `LLVMContext`), there should be no functionality change here. llvm-svn: 244181
* COFF, ELF2: Pass output file path implicitly using Config global variable.Rui Ueyama2015-08-056-23/+18
| | | | | | | | | | | Various parameters are passed implicitly using Config global variable already. Output file path is no different from others, so there was no special reason to handle that differnetly. This patch changes the signature of writeResult(SymbolTable *, StringRef) to writeResult(SymbolTable *). llvm-svn: 244180
* Driver: Strip -header-include-file and -diagnostic-log-file from crash repro ↵Justin Bogner2015-08-052-2/+7
| | | | | | | | | scripts These two arguments tend to refer to a local path that won't exist when we try to reproduce a bug. Strip them. llvm-svn: 244179
* Rename DescriptionString -> DataLayoutString as it matches the actualEric Christopher2015-08-057-98/+96
| | | | | | use of the string. llvm-svn: 244178
* [libFuzzer] avoid build warnings in non-assert build (useful warning in this ↵Kostya Serebryany2015-08-051-1/+4
| | | | | | case) llvm-svn: 244177
* [test] Fix tests in non-darwin bots.Argyrios Kyrtzidis2015-08-053-5/+5
| | | | llvm-svn: 244176
* COFF: Simplify Writer interface by hiding Writer class.Rui Ueyama2015-08-053-157/+170
| | | | llvm-svn: 244175
* Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.Wei Mi2015-08-051-0/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D9689 llvm-svn: 244174
* Add a big endian testcase.Rafael Espindola2015-08-052-0/+118
| | | | llvm-svn: 244173
* [dsymutil] Do not create temporary files in -no-output mode.Frederic Riss2015-08-051-5/+19
| | | | | | | | | The files were never written to and then deleted, but they were created nonetheless. To prevent that, create a wrapper around the 2 variants of createUniqueFile and use the one that only does an access(Exists) call to check for name unicity in -no-output mode. llvm-svn: 244172
* [dsymutil] Update source used to generate test binary.Frederic Riss2015-08-051-2/+13
| | | | | | Forgot to include that in the last commit. llvm-svn: 244171
* Add -fno-coverage-mapping flag.Diego Novillo2015-08-054-3/+15
| | | | | | | This new flag allows the user to disable a previous instance of -fcoverage-mapping, if needed. llvm-svn: 244170
* ELF2: Simplify Writer interface.Rui Ueyama2015-08-053-91/+88
| | | | | | | | We are using Writer more like a function instead of a class. This patch makes it a function to simplify the interface. All details of Writer class is now hidden from other parts of the linker. llvm-svn: 244169
* ValueMapper: Simplify remap() helper function, NFCDuncan P. N. Exon Smith2015-08-051-33/+22
| | | | | | | | | | Rename `remap()` to `remapOperands()`, and restrict its contract to remapping operands. Previously, it also called `mapToMetadata()`, but this logic is hard to reason about externally. In particular, this refactors `mapUniquedNode()` to avoid redundant mapping calls, taking advantage of the RAUWs that are already in place. llvm-svn: 244168
* x86: NFC remove needless InstrCompiler castJF Bastien2015-08-051-15/+15
| | | | | | | | | | Summary: The casts from String to PatFrag weren't needed if we instead provided an SDNode. This fix was suggested by @pete in D11382. Subscribers: pete, llvm-commits Differential Revision: http://reviews.llvm.org/D11788 llvm-svn: 244167
* [NVPTX] Use LDG for pointer induction variables.Bjarke Hammersholt Roune2015-08-052-11/+84
| | | | | | | | More specifically, make NVPTXISelDAGToDAG able to emit cached loads (LDG) for pointer induction variables. Also fix latent bug where LDG was not restricted to kernel functions. I believe that this could not be triggered so far since we do not currently infer that a pointer is global outside a kernel function, and only loads of global pointers are considered for cached loads. llvm-svn: 244166
* [libFuzzer] in dfsan mode, set labels every time we start recording traces ↵Kostya Serebryany2015-08-051-1/+3
| | | | | | as opposed to doing it at process startup. This ensures that the labels are fresh. llvm-svn: 244165
* Add a TrailingObjects template class.James Y Knight2015-08-056-26/+412
| | | | | | | | | | This is intended to help support the idiom of a class that has some other objects (or multiple arrays of different types of objects) appended on the end, which is used quite heavily in clang. Differential Revision: http://reviews.llvm.org/D11272 llvm-svn: 244164
* Make sure all temporary files get created under %T.Artem Belevich2015-08-051-1/+3
| | | | llvm-svn: 244163
* Add flag to request codeview debug info on WindowsReid Kleckner2015-08-051-0/+2
| | | | | | Needed after fixing PR22032. llvm-svn: 244162
* function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith2015-08-0510-139/+76
| | | | | | | | useless return value. Switch to using it directly when completing the redeclaration chain for an anonymous declaration, and reduce the set of declarations that we load in the process to just those of the right kind. llvm-svn: 244161
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-056-13/+89
| | | | | | | | This option allows to select a subset of the architectures when performing a universal binary link. The filter is done completely in the mach-o specific part of the code. llvm-svn: 244160
* Fix Windows test failure with triple instead of using the native OSReid Kleckner2015-08-051-3/+3
| | | | llvm-svn: 244159
* If the "CodeView" module flag is set, emit codeview instead of DWARFReid Kleckner2015-08-0514-35/+30
| | | | | | | | | | | | | | Summary: Emit both DWARF and CodeView if "CodeView" and "Dwarf Version" module flags are set. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11756 llvm-svn: 244158
* MIR Serialization: Serialize the machine operand's offset.Alex Lorenz2015-08-0511-9/+242
| | | | | | | This commit serializes the offset for the following operands: target index, global address, external symbol, constant pool index, and block address. llvm-svn: 244157
* Add <numeric> header for use of std::accumulate().Cong Hou2015-08-051-0/+1
| | | | llvm-svn: 244156
* Divide the primitive size in bits by eight so the initial load's alignment is inRichard Diamond2015-08-052-1/+9
| | | | | | bytes as expected. Tested with the included unit test. llvm-svn: 244155
* Record whether the weights on out-edges from a MBB are normalized.Cong Hou2015-08-056-40/+104
| | | | | | | | | | | | 1. Create a utility function normalizeEdgeWeights() in MachineBranchProbabilityInfo that normalizes a list of edge weights so that the sum of then can fit in uint32_t. 2. Provide an interface in MachineBasicBlock to normalize its successors' weights. 3. Add a flag in MachineBasicBlock that tracks whether its successors' weights are normalized. 4. Provide an overload of getSumForBlock that accepts a non-const pointer to a MBB so that it can force normalizing this MBB's successors' weights. 5. Update several uses of getSumForBlock() by eliminating the once needed weight scale. Differential Revision: http://reviews.llvm.org/D11442 llvm-svn: 244154
* Add flags to disable profile generation.Diego Novillo2015-08-054-28/+72
| | | | | | | | | | | | This patch adds flags -fno-profile-instr-generate and -fno-profile-instr-use, and the GCC aliases -fno-profile-generate and -fno-profile-use. These flags are used in situations where users need to disable profile generation or use for specific files in a build, without affecting other files. llvm-svn: 244153
* [libFuzzer] add option -report_slow_units=Nsec to control when slow units ↵Kostya Serebryany2015-08-054-3/+8
| | | | | | are printed llvm-svn: 244152
* [libFuzzer] add a missing test fileKostya Serebryany2015-08-051-0/+28
| | | | llvm-svn: 244151
* Reword a comment about IncludeDirGroup. NFCDouglas Katzman2015-08-051-4/+5
| | | | | | | Referring to the groups by mixing the enumerated name with the command-line flag was not as clear as could be. llvm-svn: 244150
* [sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE ↵Kostya Serebryany2015-08-0512-15/+62
| | | | | | crashes same as SIGSEV crashes, patch by Karl Skomski llvm-svn: 244136
* Drop the defaulted CallGraph move ctor, since it's unused and MSVC doesn't ↵David Blaikie2015-08-051-4/+0
| | | | | | support defaulted move ops llvm-svn: 244135
* Replace &vector[0] with vector.data() to avoid invalid dereference caught by ↵Nick Lewycky2015-08-051-4/+5
| | | | | | debug STL. Also move a '*' for consistency and fix an 80-col violation. llvm-svn: 244134
* -Wdeprecated: Remove some dead code that was relying on a questionable ↵David Blaikie2015-08-052-49/+0
| | | | | | (rule-of-3-violating) copy ctor in MCInstPrinter llvm-svn: 244133
* [LoopUnswitch] Preserve make.implicit metadata for unswitched conditionsChen Li2015-08-052-0/+24
| | | | | | | | | | | | Summary: This patch adds support to preserve make.implicit metadata for unswitched conditions in loop pre-header. Reviewers: sanjoy, weimingz Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D11769 llvm-svn: 244132
* Remove unused header includes.Eric Christopher2015-08-052-2/+0
| | | | llvm-svn: 244131
* [Hexagon] Edit a comment. NFCKrzysztof Parzyszek2015-08-051-7/+1
| | | | llvm-svn: 244130
* -Wdeprecated clean by making LogBuilder move constructible so it can be ↵David Blaikie2015-08-052-4/+9
| | | | | | returned by value (in DifferenceEngine::logf) llvm-svn: 244129
* x86 atomic: optimize a.store(reg op a.load(acquire), release)JF Bastien2015-08-055-119/+562
| | | | | | | | | | | | Summary: PR24191 finds that the expected memory-register operations aren't generated when relaxed { load ; modify ; store } is used. This is similar to PR17281 which was addressed in D4796, but only for memory-immediate operations (and for memory orderings up to acquire and release). This patch also handles some floating-point operations. Reviewers: reames, kcc, dvyukov, nadav, morisset, chandlerc, t.p.northover, pete Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11382 llvm-svn: 244128
* [PM] Remove a failed attempt to port the CallGraph analysis to the newChandler Carruth2015-08-052-27/+0
| | | | | | | | | | | | | pass manager. This never worked, and won't ever work. It was actually why I ended up building the LazyCallGraph set of code which is more more effectively wired up to the new pass manager. This accidentally got committed when I was trying to land a cleanup of the code organization in the other parts of this file. =[ My bad, but fortunately Dave was keen eyed enough to spot that this code couldn't possibly work. =] llvm-svn: 244127
* Rename builtin_lang -> Langs to match the rest of the code a bit better.Eric Christopher2015-08-052-10/+11
| | | | llvm-svn: 244126
* Remove unused function GetBuiltinNames.Eric Christopher2015-08-052-16/+0
| | | | llvm-svn: 244125
* Documentation: fix another typo, "arrays types" -> "array types".James Dennett2015-08-051-1/+1
| | | | | | Thanks to Kim Gräsman <kim.grasman@gmail.com> for pointing this out. llvm-svn: 244124
* Update GettingStarted docs list of LLVM_TARGETS_TO_BUILD to match cmake.Pete Cooper2015-08-051-3/+3
| | | | | | | | | | Since the docs were written, we've added the BPF backend to the list. Updating the docs to take this in to account. Also sorted them to match cmake while I was changing these lines. Reviewed by Chris B. llvm-svn: 244123
* -Wdeprecated cleanup: Make CallGraph movable by default by using unique_ptr ↵David Blaikie2015-08-053-26/+36
| | | | | | | | | | members rather than raw pointers. The only place that tries to return a CallGraph by value (CallGraphAnalysis::run) doesn't seem to be used right now, but it's a reasonable bit of cleanup anyway. llvm-svn: 244122
* Revert "Fix MO's analyzePhysReg, it was confusing sub- and super-registers. ↵JF Bastien2015-08-053-145/+55
| | | | | | | | Problem pointed out by Michael Hordijk." I mistakenly committed the patch for D6629, and was trying to commit another. Reverting until it gets proper signoff. llvm-svn: 244121
* Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem ↵JF Bastien2015-08-053-55/+145
| | | | | | pointed out by Michael Hordijk. llvm-svn: 244120
OpenPOWER on IntegriCloud