summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* transform obscured FP sign bit ops into a fabs/fneg using TLI hookSanjay Patel2016-06-021-0/+46
| | | | | | | | | | | | | | | | | | | This is effectively a revert of: http://reviews.llvm.org/rL249702 - [InstCombine] transform masking off of an FP sign bit into a fabs() intrinsic call (PR24886) and: http://reviews.llvm.org/rL249701 - [ValueTracking] teach computeKnownBits that a fabs() clears sign bits and a reimplementation as a DAG combine for targets that have IEEE754-compliant fabs/fneg instructions. This is intended to resolve the objections raised on the dev list: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098154.html and: https://llvm.org/bugs/show_bug.cgi?id=24886#c4 In the interest of patch minimalism, I've only partly enabled AArch64. PowerPC, MIPS, x86 and others can enable later. Differential Revision: http://reviews.llvm.org/D19391 llvm-svn: 271573
* [CodeView] Use None instead of Void if there is no subprogramDavid Majnemer2016-06-021-1/+1
| | | | llvm-svn: 271566
* Use false for bool instead of 0Matt Arsenault2016-06-021-1/+1
| | | | llvm-svn: 271562
* [codeview] Fix crash when handling qualified void typesReid Kleckner2016-06-021-2/+1
| | | | | | | | | | The DIType* for void is the null pointer. A null DIType can never be a qualified type, so we can just exit the loop at this point and go to getTypeIndex(BaseTy). Fixes PR27984 llvm-svn: 271550
* [CodeView] Implement function-type indicesDavid Majnemer2016-06-022-23/+47
| | | | | | | | | We still need to do something about member functions and calling conventions. Differential Revision: http://reviews.llvm.org/D20900 llvm-svn: 271541
* [PEI, AArch64] Use empty spaces in stack area for local stack slot allocation.Geoff Berry2016-06-021-5/+122
| | | | | | | | | | | | | | | | | Summary: If the target requests it, use emptry spaces in the fixed and callee-save stack area to allocate local stack objects. AArch64: Change last callee-save reg stack object alignment instead of size to leave a gap to take advantage of above change. Reviewers: t.p.northover, qcolombet, MatzeB Subscribers: rengolin, mcrosier, llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D20220 llvm-svn: 271527
* [DAG] use getBitcast() to reduce codeSanjay Patel2016-06-021-33/+25
| | | | | | | | | | Although this was intended to be NFC, the test case wiggle shows a change in code scheduling/RA caused by a difference in the SDLoc() generation. Depending on how you look at it, this is the (dis)advantage of exact checking in regression tests. llvm-svn: 271526
* [CodeView] Use the right type index for long longDavid Majnemer2016-06-021-12/+17
| | | | | | We used T_INT8 instead of T_QUAD. llvm-svn: 271497
* [CodeView] Remove superfluous bitmathDavid Majnemer2016-06-021-1/+1
| | | | llvm-svn: 271495
* [codeview] Return type indices for typedefsDavid Majnemer2016-06-022-0/+13
| | | | | | | Use the type index of the underlying type unless we have a typedef from long to HRESULT; HRESULT typedefs are translated to T_HRESULT. llvm-svn: 271494
* Make MachineCopyPropagation preserve CFGMatt Arsenault2016-06-021-0/+5
| | | | | | This doesn't touch it as far as I can tell. llvm-svn: 271445
* SDAG: Drop a redundant replace and move the dead node removal closer. NFCJustin Bogner2016-06-011-6/+4
| | | | llvm-svn: 271429
* [DAG] Improve legalization of INSERT_SUBVECTORMichael Kuperstein2016-06-011-3/+22
| | | | | | | | | When the index is known to be constant 0, insert directly into the the low half, instead of spilling, performing the insert in-memory, and reloading. Differential Revision: http://reviews.llvm.org/D20763 llvm-svn: 271428
* Better fix for PR27903.Than McIntosh2016-06-011-13/+26
| | | | | | | | | | | | | | | | | Summary: Re-enable lifetime-start-on-first-use for stack coloring, but explicitly disable it for slots with more than one start or end lifetime marker. Bug: 27903 Reviewers: wmi, tejohnson, qcolombet, gbiv Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20739 llvm-svn: 271412
* Fix the NDEBUG buildReid Kleckner2016-06-011-0/+1
| | | | llvm-svn: 271411
* [codeview] Translate basic DITypes to CV type recordsReid Kleckner2016-06-012-3/+224
| | | | | | | | | | | | | | | Summary: This is meant to be the tiniest step towards DIType to CV type index translation that I could come up with. Whenever translation fails, we use type index zero, which is the unknown type. Reviewers: aaboud, zturner Subscribers: llvm-commits, amccarth Differential Revision: http://reviews.llvm.org/D20840 llvm-svn: 271408
* DwarfDebug: Simplify. NFC.Peter Collingbourne2016-06-011-6/+2
| | | | llvm-svn: 271360
* [MC] Rename EmitFill to emitFillPetr Hosek2016-06-012-3/+3
| | | | | | | | This is to match the overloaded variants as well as the new style. Differential Revision: http://reviews.llvm.org/D20690 llvm-svn: 271359
* DAGCombiner: Fix broken size check in isAliasMatt Arsenault2016-06-011-1/+1
| | | | | | | | | | | | | | | This should have been converting the size to bytes, but wasn't really. These should probably all be using getStoreSize instead. I haven't been able to come up with a meaningful testcase for this. I can trigger it using combinations of struct loads and stores, but can't observe a difference in non-broken testcases. isAlias is only really used during store merging, so I'm not sure how to get into the vector splitting situation the comment describes since store merging is only done before type legalization. llvm-svn: 271356
* CodeGen: Refactor renameDisconnectedComponents() as a passMatthias Braun2016-05-318-292/+460
| | | | | | | | | | | | | | | | | | Refactor LiveIntervals::renameDisconnectedComponents() to be a pass. Also change the name to "RenameIndependentSubregs": - renameDisconnectedComponents() worked on a MachineFunction at a time so it is a natural candidate for a machine function pass. - The algorithm is testable with a .mir test now. - This also fixes a problem where the lazy renaming as part of the MachineScheduler introduced IMPLICIT_DEF instructions after the number of a nodes in a region were counted leading to a mismatch. Differential Revision: http://reviews.llvm.org/D20507 llvm-svn: 271345
* [CodeGen] Promote FMINNAN/FMAXNAN like other binops.Ahmed Bougacha2016-05-311-0/+2
| | | | | | | | We think it's OK to generate half fminnan because it's legal for the transform-to type (f32; r245196). However, PromoteFloatRes was missing the case; simply promote like the other binops, including minnum. llvm-svn: 271317
* [CodeGen] Don't mark FMINNUM/FMAXNUM Expand twice. NFC.Ahmed Bougacha2016-05-311-2/+0
| | | | | | They're already in the all_valuetypes() loop above. llvm-svn: 271316
* [codeview] Improve readability of type record assemblyReid Kleckner2016-05-311-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the method MCStreamer::EmitBinaryData, which is usually an alias for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex dump output like this: .byte 0x0e, 0x00, 0x08, 0x10 .byte 0x03, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x10, 0x00, 0x00 Also, when verbose asm comments are enabled, this patch prints the dump output for each comment before its record, like this: # ArgList (0x1000) { # TypeLeafKind: LF_ARGLIST (0x1201) # NumArgs: 0 # Arguments [ # ] # } .byte 0x06, 0x00, 0x01, 0x12 .byte 0x00, 0x00, 0x00, 0x00 This should make debugging easier and testing more convenient. Reviewers: aaboud Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits Differential Revision: http://reviews.llvm.org/D20711 llvm-svn: 271313
* X86: permit using SjLj EH on x86 targets as an optionSaleem Abdulrasool2016-05-311-0/+3
| | | | | | | | | | | This adds support to the backed to actually support SjLj EH as an exception model. This is *NOT* the default model, and requires explicitly opting into it from the frontend. GCC supports this model and for MinGW can still be enabled via the `--using-sjlj-exceptions` options. Addresses PR27749! llvm-svn: 271244
* Add RelaxELFRelocations to TargetOptions.h.Rafael Espindola2016-05-291-0/+2
| | | | | | It will be used in clang. llvm-svn: 271161
* Update the stack coloring pass to remove lifetime intrinsics in the ↵Andrew Kaylor2016-05-271-4/+2
| | | | | | | | optnone/opt-bisect skip case. Differential Revision: http://reviews.llvm.org/D20453 llvm-svn: 271068
* MachineScheduler: Introduce ONLY1 reason to improve debug outputMatthias Braun2016-05-271-6/+13
| | | | llvm-svn: 271058
* [X86] Detect SAD patterns and emit psadbw instructions.Michael Kuperstein2016-05-271-7/+11
| | | | | | | | This recommits r267649 with a fix for PR27539. Differential Revision: http://reviews.llvm.org/D20598 llvm-svn: 271033
* Disable lifetime-start-on-first-use analysis.Than McIntosh2016-05-271-2/+2
| | | | | | | | | | | | | | | | Summary: Turn off lifetime-start-on-first-use enhancement for the moment pending a fix for bug 27903. Bug: 27903 Reviewers: tejohnson, wmi, qcolombet, gbiv Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20731 llvm-svn: 271003
* Apply clang-tidy's misc-move-constructor-init throughout LLVM.Benjamin Kramer2016-05-275-16/+25
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270997
* Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled ↵George Rimar2016-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | compression sections. Fix: updated clang code which was not updated by mistake. Original commit message: [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections. This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270987
* Apply clang-tidy's misc-static-assert where it makes sense.Benjamin Kramer2016-05-271-4/+6
| | | | | | | Also fold conditions into assert(0) where it makes sense. No functional change intended. llvm-svn: 270982
* Revert r270977 ([llvm-mc] - Teach llvm-mc to generate zlib styled ↵George Rimar2016-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compression sections.) It broke buildbot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/13585/steps/build/logs/stdio Initial commit message: [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections. This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270978
* [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.George Rimar2016-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | This patch is strongly based on previously reverted D20331. (because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style) Difference that this patch supports both zlib and zlib-gnu styles. -compress-debug-sections option now supports next values: -compress-debug-sections=zlib-gnu -compress-debug-sections=zlib -compress-debug-sections=none Previously specifying -compress-debug-sections enabled zlib-gnu compression, so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior that was before this patch for case when compression was enabled. Differential revision: http://reviews.llvm.org/D20676 llvm-svn: 270977
* [CodeGen] Fix problem with X86 byte registers in CriticalAntiDepBreakerMitch Bodart2016-05-261-4/+6
| | | | | | | | | | | | CriticalAntiDepBreaker was not correctly tracking defs of the high X86 byte registers, leading to incorrect use of a busy register to break an antidependence. Fixes pr27681, and its duplicates pr27580, pr27804. Differential Revision: http://reviews.llvm.org/D20456 llvm-svn: 270935
* SDAG: Use an Optional<> instead of a sigil value. NFCJustin Bogner2016-05-261-6/+6
| | | | | | | This just makes it a bit more clear that we don't intend to use a deleted node for anything here. llvm-svn: 270931
* PR26055: Speed up LiveDebugValues::transferDebugValue()Adrian Prantl2016-05-261-43/+85
| | | | | | | | | | | | | | | | | | | | | | | | | This patch builds upon r270776 and speeds up LiveDebugValues::transferDebugValue() by adding an index that maps each DebugVariable to its open VarLoc. The transferDebugValue() function needs to close all open ranges for a given DebugVariable. Iterating over the set bits of OpenRanges is prohibitively slow in practice. I experimented with using the sorted map of VarLocs in the UniqueVector to iterate only over the range of VarLocs with a given DebugVariable, but the binary search turned out to be even more expensive than just iterating over the set bits in OpenRanges. Instead, this patch exploits the fact that there can only be one open location for each DebugVariable and redundantly stores this location in a DenseMap. This patch brings the time spent in the LiveDebugValues pass down to an almost neglectiable amount. http://llvm.org/bugs/show_bug.cgi?id=26055 http://reviews.llvm.org/D20636 rdar://problem/24091200 llvm-svn: 270923
* Do not rename registers that do not start an independent live rangeKrzysztof Parzyszek2016-05-261-0/+25
| | | | llvm-svn: 270885
* Undo a suboptimal clang-format decision. NFCAdrian Prantl2016-05-261-4/+2
| | | | llvm-svn: 270861
* Use shouldAssumeDSOLocal on AArch64.Rafael Espindola2016-05-261-0/+43
| | | | | | This reduces code duplication and now AArch64 also handles PIE. llvm-svn: 270844
* [codeview] Use comdats for debug info describing comdat functionsReid Kleckner2016-05-252-12/+57
| | | | | | | | | | | | | | | | | | Summary: This allows the linker to discard unused symbol information for comdat functions that were discarded during the link. Before this change, searching for the name of an inline function in the debugger would return multiple results, one per symbol subsection in the object file. After this change, there is only one result, the result for the function chosen by the linker. Reviewers: zturner, majnemer Subscribers: aaboud, amccarth, llvm-commits Differential Revision: http://reviews.llvm.org/D20642 llvm-svn: 270792
* Work around an MSVC compiler issue in r270776.Adrian Prantl2016-05-251-3/+3
| | | | llvm-svn: 270783
* PR26055: Speed up LiveDebugValues by replacing lists with bitvectors.Adrian Prantl2016-05-251-143/+183
| | | | | | | | | | | | | | | | | | | | | This patch modifies the LiveDebugValues pass to use more efficient set data structures as outlined in PR26055. Both VarLocSet and VarLocList are now SparseBitVectors which allows us to perform much faster bitvector arithmetic on them. The speedup can be in the order of minutes especially on ASANified code. The change is not NFC in the assembler output because the inserted DBG_VALUEs are now sorted by variable and location. Many thanks to Daniel Berlin for helping design the improved algorithm and reviewing the patch. https://llvm.org/bugs/show_bug.cgi?id=26055 http://reviews.llvm.org/D20178 rdar://problem/24091200 llvm-svn: 270776
* [MBB] Early exit to reduce indentation, per coding guidelines. NFC.Chad Rosier2016-05-251-59/+62
| | | | llvm-svn: 270773
* Simplify std::all_of predicate (to one line) by using llvm::all_of. NFCI.Simon Pilgrim2016-05-251-2/+1
| | | | llvm-svn: 270749
* Simplify std::all_of predicate (to one line) by using llvm::all_of. NFCI.Simon Pilgrim2016-05-251-3/+1
| | | | llvm-svn: 270747
* [SelectionDAG] Add smarts for BSWAP in computeKnownBits.Chad Rosier2016-05-251-0/+6
| | | | llvm-svn: 270738
* [SDAG] Add a fallback multiplication expansionHal Finkel2016-05-251-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | LegalizeIntegerTypes does not have a way to expand multiplications for large integer types (i.e. larger than twice the native bit width). There's no standard runtime call to use in that case, and so we'd just assert. Unfortunately, as it turns out, it is possible to hit this case from standard-ish C code in rare cases. A particular case a user ran into yesterday involved an __int128 induction variable and a loop with a quadratic (not linear) recurrence which triggered some backend logic using SCEVExpander. In this case, the BinomialCoefficient code in SCEV generates some i129 variables, which get widened to i256. At a high level, this is not actually good (i.e. the underlying optimization, PPCLoopPreIncPrep, should not be transforming the loop in question for performance reasons), but regardless, the backend shouldn't crash because of cost-modeling issues in the optimizer. This is a straightforward implementation of the multiplication expansion, based on the algorithm in Hacker's Delight. I validated it against the code for the mul256b function from http://locklessinc.com/articles/256bit_arithmetic/ using random inputs. There should be no functional change for previously-working code (the new expansion code only replaces an assert). Fixes PR19797. llvm-svn: 270720
* Clarify that we match BSwap in InstCombine and BitReverse in CGP. NFC.Chad Rosier2016-05-251-1/+1
| | | | | | | | Also, rename recognizeBitReverseOrBSwapIdiom to recognizeBSwapOrBitReverseIdiom, so the ordering of the MatchBSwaps and MatchBitReversals arguments are consistent with the function name. llvm-svn: 270715
* ScheduleDAGInstrs: Fix memory corruptionMatthias Braun2016-05-251-2/+2
| | | | | | | | We have to modify V2SU before inserting new elements into the CurrentVRegDefs set because that may move V2SU in memory invalidating the reference. llvm-svn: 270644
OpenPOWER on IntegriCloud