summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* PHIs don't need to be postprocessedDavid Majnemer2015-08-061-31/+6
| | | | llvm-svn: 244275
* Handle PHI nodes prefacing EH pads tooDavid Majnemer2015-08-062-14/+88
| | | | llvm-svn: 244274
* handle phi nodesDavid Majnemer2015-08-061-4/+27
| | | | llvm-svn: 244273
* [WinEHPrepare] Add rudimentary support for the new EH instructionsDavid Majnemer2015-08-061-8/+301
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds somewhat basic preparation functionality including: - Formation of funclets via coloring basic blocks. - Cloning of polychromatic blocks to ensure that funclets have unique program counters. - Demotion of values used between different funclets. - Some amount of cleanup once we have removed predecessors from basic blocks. - Verification that we are left with a CFG that makes some amount of sense. N.B. Arguments and numbering still need to be done. Reviewers: rnk, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11750 llvm-svn: 244272
* Thread premissions through sys::fs::create_director{y|ies}Frederic Riss2015-08-063-7/+10
| | | | llvm-svn: 244268
* [IndVars] Fix PR24356.Sanjoy Das2015-08-061-36/+30
| | | | | | | Unsigned predicates increase or decrease agnostic of the signs of their increments. llvm-svn: 244265
* [IndVars] Improved logging under DEBUG(); NFC.Sanjoy Das2015-08-061-6/+3
| | | | | | | Before this, we'd print the modified comparision in the "Simplified comparison" case. That looked misleading. llvm-svn: 244264
* Convert a bunch of loops to foreach. NFC.Pete Cooper2015-08-0612-31/+22
| | | | | | | | After r244074, we now have a successors() method to iterate over all the successors of a TerminatorInst. This commit changes a bunch of eligible loops to use it. llvm-svn: 244260
* AMDGPU/SI: Add Fiji supportTom Stellard2015-08-061-0/+4
| | | | | | Patch by: Alex Deucher llvm-svn: 244255
* AMDGPU/SI: Add support for 32-bit immediate SMRD offsets on CITom Stellard2015-08-065-20/+115
| | | | | | | | | | Reviewers: arsenm Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11604 llvm-svn: 244254
* AMDGPU/SI: Use ComplexPatterns for SMRD addressing modesTom Stellard2015-08-064-54/+127
| | | | | | | | | | | | Summary: This allows us to consolidate several of the TableGen patterns. Reviewers: arsenm Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11602 llvm-svn: 244253
* Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.Nico Weber2015-08-061-6/+14
| | | | | | | | | | | | | | | | | | libclang uses a CrashRecoveryContext, and building a module does too. If a module gets built through libclang, nested CrashRecoveryContexts are used. They work fine with threads as things are stored in ThreadLocal variables, but in LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the same globals. To fix, keep active CrashRecoveryContextImpls in a list and have the global point to the innermost one, and do something similar for tlIsRecoveringFromCrash. Necessary (but not sufficient) for PR11974 and PR20325 http://reviews.llvm.org/D11770 llvm-svn: 244251
* [libFuzzer] move the mutators to public interface so that custom mutators ↵Kostya Serebryany2015-08-064-38/+33
| | | | | | may reuse these functions directly llvm-svn: 244250
* Rename inst_range() to instructions() for consistency. NFCNico Rieck2015-08-0612-18/+18
| | | | llvm-svn: 244248
* Fix possible infinite loop in shrink wrapping when searching for save/restoreKit Barton2015-08-061-6/+24
| | | | | | | | | | | | | | | | | | | | points. There is an infinite loop that can occur in Shrink Wrapping while searching for the Save/Restore points. Part of this search checks whether the save/restore points are located in different loop nests and if so, uses the (post) dominator trees to find the immediate (post) dominator blocks. However, if the current block does not have any immediate (post) dominators then this search will result in an infinite loop. This can occur in code containing an infinite loop. The modification checks whether the immediate (post) dominator is different from the current save/restore block. If it is not, then the search terminates and the current location is not considered as a valid save/restore point for shrink wrapping. Phabricator: http://reviews.llvm.org/D11607 llvm-svn: 244247
* LibDriver: Replace references to lld-link2 with lld-link.Peter Collingbourne2015-08-061-1/+1
| | | | llvm-svn: 244246
* [Reassociation] Fix miscompile for va_arg arguments.Quentin Colombet2015-08-062-22/+6
| | | | | | | | | | | | | | | | iisUnmovableInstruction() had a list of instructions hardcoded which are considered unmovable. The list lacked (at least) an entry for the va_arg and cmpxchg instructions. Fix this by introducing a new Instruction::mayBeMemoryDependent() instead of maintaining another instruction list. Patch by Matthias Braun <matze@braunis.de>. Differential Revision: http://reviews.llvm.org/D11577 rdar://problem/22118647 llvm-svn: 244244
* MIR Parser: Report an error when parsing duplicate memory operand flags.Alex Lorenz2015-08-061-1/+5
| | | | llvm-svn: 244240
* Revert r244154 which causes some build failure. See ↵Cong Hou2015-08-064-61/+40
| | | | | | https://llvm.org/bugs/show_bug.cgi?id=24377. llvm-svn: 244239
* This patch changes the interface to enable the shrink wrapping optimization. Kit Barton2015-08-062-22/+50
| | | | | | | | | | | | | | | It adds a new constructor, which takes a std::function predicate function that is run at the beginning of shrink wrapping to determine whether the optimization should run on the given machine function. The std::function can be overridden by each target, allowing target-specific decisions to be made on each machine function. This is necessary for PowerPC, as the decision to run shrink wrapping is partially based on the ABI. Futhermore, this operates nicely with the GCC iFunc capability, which allows option overrides on a per-function basis. Phabricator: http://reviews.llvm.org/D11421 llvm-svn: 244235
* [AArch64] Use a static function and other minor cleanup for readability. NFC.Chad Rosier2015-08-061-11/+12
| | | | llvm-svn: 244233
* MIR Serialization: Serialize the 'invariant' machine memory operand flag.Alex Lorenz2015-08-064-3/+11
| | | | llvm-svn: 244230
* Fix an alignment error in `llvm::expandAtomicRMWToCmpXchg` without breaking ↵Richard Diamond2015-08-061-1/+1
| | | | | | | | | | | | | | the build where X86 isn't enabled. Summary: Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test. Reviewers: rengolin, jfb Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11804 llvm-svn: 244229
* MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.Alex Lorenz2015-08-064-1/+10
| | | | llvm-svn: 244228
* [AArch64] Improve the readability of the ld/st optimization pass. NFC.Chad Rosier2015-08-061-37/+48
| | | | llvm-svn: 244222
* [SPARC] Don't compare arch name as a string, use the enum instead.Douglas Katzman2015-08-061-1/+1
| | | | | | Fixes PR22695 llvm-svn: 244221
* Revert "Divide the primitive size in bits by eight so the initial load's ↵Renato Golin2015-08-061-1/+1
| | | | | | | | | alignment is in bytes as expected. Tested with the included unit test." This reverts commit r244155, as it was breaking the buildbots for too long. Should be reapplied with proper fix. llvm-svn: 244205
* llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, ↵NAKAMURA Takumi2015-08-061-2/+2
| | | | | | introduced in r244164. [-Wdocumentation] llvm-svn: 244204
* Removing tailing whitespacesMichael Liao2015-08-061-62/+62
| | | | llvm-svn: 244203
* [X86] Improve EmitLoweredSelect for contiguous CMOV pseudo instructions.Michael Kuperstein2015-08-061-33/+159
| | | | | | | | | | | | This change improves EmitLoweredSelect() so that multiple contiguous CMOV pseudo instructions with the same (or exactly opposite) conditions get lowered using a single new basic-block. This eliminates unnecessary extra basic-blocks (and CFG merge points) when contiguous CMOVs are being lowered. Patch by: kevin.b.smith@intel.com Differential Revision: http://reviews.llvm.org/D11428 llvm-svn: 244202
* [PM/AA] Clean up and homogenize comments throughout basic-aa.Chandler Carruth2015-08-061-52/+59
| | | | llvm-svn: 244200
* [PM/AA] Run clang-format over all of basic-aa before making moreChandler Carruth2015-08-061-59/+60
| | | | | | substantive edits. llvm-svn: 244198
* [PM/AA] Hoist the interface for BasicAA into a header file.Chandler Carruth2015-08-064-192/+13
| | | | | | | | | | | | | This is the first mechanical step in preparation for making this and all the other alias analysis passes available to the new pass manager. I'm factoring out all the totally boring changes I can so I'm moving code around here with no other changes. I've even minimized the formatting churn. I'll reformat and freshen comments on the interface now that its located in the right place so that the substantive changes don't triger this. llvm-svn: 244197
* COFF: Assign the correct symbol type to internal functions.Peter Collingbourne2015-08-061-2/+2
| | | | | | | | | | | The COFFSymbolRef::isFunctionDefinition() function tests for several conditions that are not related to whether a symbol is a function, but rather whether the symbol meets the requirements for a function definition auxiliary record, which excludes certain symbols such as internal functions and undefined references. The test we need to determine the symbol type is much simpler: we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION. llvm-svn: 244195
* [PM/AA] Simplify the AliasAnalysis interface by removing a wrapperChandler Carruth2015-08-067-72/+71
| | | | | | | | | | | | | | | | around a DataLayout interface in favor of directly querying DataLayout. This wrapper specifically helped handle the case where this no DataLayout, but LLVM now requires it simplifynig all of this. I've updated callers to directly query DataLayout. This in turn exposed a bunch of places where we should have DataLayout readily available but don't which I've fixed. This then in turn exposed that we were passing DataLayout around in a bunch of arguments rather than making it readily available so I've also fixed that. No functionality changed. llvm-svn: 244189
* [libFuzzer] add one more mutation strategy: byte shufflingKostya Serebryany2015-08-064-2/+41
| | | | llvm-svn: 244188
* MIR Serialization: Initial serialization of the machine operand target flags.Alex Lorenz2015-08-066-13/+132
| | | | | | | | | | | | This commit implements the initial serialization of the machine operand target flags. It extends the 'TargetInstrInfo' class to add two new methods that help to provide text based serialization for the target flags. This commit can serialize only the X86 target flags, and the target flags for the other targets will be serialized in the follow-up commits. Reviewers: Duncan P. N. Exon Smith llvm-svn: 244185
* 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
* [libFuzzer] avoid build warnings in non-assert build (useful warning in this ↵Kostya Serebryany2015-08-051-1/+4
| | | | | | case) llvm-svn: 244177
* 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
* 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-051-10/+29
| | | | | | | | 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-052-26/+24
| | | | | | | | | | 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
* If the "CodeView" module flag is set, emit codeview instead of DWARFReid Kleckner2015-08-053-13/+13
| | | | | | | | | | | | | | 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-054-9/+60
| | | | | | | This commit serializes the offset for the following operands: target index, global address, external symbol, constant pool index, and block address. llvm-svn: 244157
* Divide the primitive size in bits by eight so the initial load's alignment is inRichard Diamond2015-08-051-1/+1
| | | | | | 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-054-40/+61
| | | | | | | | | | | | 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
* [libFuzzer] add option -report_slow_units=Nsec to control when slow units ↵Kostya Serebryany2015-08-054-3/+8
| | | | | | are printed llvm-svn: 244152
OpenPOWER on IntegriCloud