summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [EarlyCSE] Teach about CSE'ing over invariant.start intrinsicsAnna Thomas2016-08-091-0/+13
| | | | | | | | | | | | | | Summary: Teach EarlyCSE about invariant.start intrinsic. Specifically, we can perform store-load, load-load forwarding over this call. Reviewers: majnemer, reames, dberlin, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23268 llvm-svn: 278153
* Re-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.Lang Hames2016-08-093-2/+23
| | | | llvm-svn: 278149
* [X86] Don't model UD2/UD2B as a terminatorDavid Majnemer2016-08-091-1/+1
| | | | | | | | | | | | | | A UD2 might make its way into the program via a call to @llvm.trap. Obviously, calls are not terminators. However, we modeled the X86 instruction, UD2, as a terminator. Later on, this confuses the epilogue insertion machinery which results in the epilogue getting inserted before the UD2. For some platforms, like x64, the result is a violation of the ABI. Instead, model UD2/UD2B as a side effecting instruction which may observe memory. llvm-svn: 278144
* [DAGCombiner] Better support for shifting large value type by constantsSimon Pilgrim2016-08-091-17/+42
| | | | | | | | | | As detailed on D22726, much of the shift combining code assume constant values will fit into a uint64_t value and calls ConstantSDNode::getZExtValue where it probably shouldn't (leading to asserts). Using APInt directly avoids this problem but we encounter other assertions if we attempt to compare/operate on 2 APInt of different bitwidths. This patch adds a helper function to ensure that 2 APInt values are zero extended as required so that they can be safely used together. I've only added an initial example use for this to the '(SHIFT (SHIFT x, c1), c2) --> (SHIFT x, (ADD c1, c2))' combines. Further cases can easily be added as required. Differential Revision: https://reviews.llvm.org/D23007 llvm-svn: 278141
* [AliasAnalysis] Treat invariant.start as read-memoryAnna Thomas2016-08-091-0/+26
| | | | | | | | | | | | | | | | | Summary: We teach alias analysis that invariant.start is readonly. This helps with GVN and memcopy optimizations that currently treat. invariant.start as a clobber. We need to treat this as readonly, so that DSE does not incorrectly remove stores prior to the invariant.start Reviewers: sanjoy, reames, majnemer, dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23214 llvm-svn: 278138
* [Profile] turn off verbose warnings by defaultXinliang David Li2016-08-091-1/+1
| | | | | | | | | no prof data for func warning is turned off by default due to its high verbosity and minimal usefulness. Differential Revision: http://reviews.llvm.org/D23295 llvm-svn: 278127
* [LVI] Make LVI smarter about comparisons with non-constantsArtur Pilipenko2016-08-091-19/+36
| | | | | | | | | | Make LVI smarter about comparisons with a non-constant. For example, a s< b constraints a to be in [INT_MIN, INT_MAX) range. This is a part of https://llvm.org/bugs/show_bug.cgi?id=28620 fix. Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D23205 llvm-svn: 278122
* [X86][XOP] Add support for combining target shuffles to VPERMIL2PD/VPERMIL2PSSimon Pilgrim2016-08-091-0/+44
| | | | llvm-svn: 278120
* [X86][XOP] Add support for combining target shuffles to VPPERMSimon Pilgrim2016-08-091-0/+39
| | | | llvm-svn: 278114
* [XRay] Test for xray_instr_map in object file. (NFC)Dean Michael Berris2016-08-091-1/+0
| | | | | | | | This makes a trivial change in the emission of the per-function XRay tables, and makes sure that the xray_instr_map section does show up in the object file. llvm-svn: 278113
* Revert 278107 which causes buildbot failures and in addition has wrong ↵Artur Pilipenko2016-08-091-33/+19
| | | | | | commit message llvm-svn: 278109
* Teach CorrelatedValuePropagation to mark adds as no wrapArtur Pilipenko2016-08-091-19/+33
| | | | | | | | | | Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem. Reviewed By: sanjoy Differential Revision: http://reviews.llvm.org/D23059 llvm-svn: 278107
* [X86][SSE] Fix memory folding of (v)roundsd / (v)roundssSimon Pilgrim2016-08-092-2/+34
| | | | | | | | | | We only had partial memory folding support for the intrinsic definitions, and (as noted on PR27481) was causing FR32/FR64/VR128 mismatch errors with the machine verifier. This patch adds missing memory folding support for both intrinsics and the ffloor/fnearbyint/fceil/frint/ftrunc patterns and in doing so fixes the failing machine verifier stack folding tests from PR27481. Differential Revision: https://reviews.llvm.org/D23276 llvm-svn: 278106
* [LVI] NFC. Fix a typo Bofore -> BeforeArtur Pilipenko2016-08-091-1/+1
| | | | llvm-svn: 278105
* [X86] Reduce duplicated code in the execution domain lookup functions by ↵Craig Topper2016-08-091-37/+17
| | | | | | passing tables as an argument. llvm-svn: 278098
* [AVX-512] Add support for execution domain switching masked logical ops ↵Craig Topper2016-08-091-11/+137
| | | | | | | | between floating point and integer domain. This switches PS<->D and PD<->Q. llvm-svn: 278097
* [X86] Remove the Fv packed logical operation alias instructions. Replace ↵Craig Topper2016-08-092-69/+114
| | | | | | | | them with patterns to the regular instructions. This enables execution domain fixing which is why the tests changed. llvm-svn: 278090
* [X86] Cleanup patterns for AVX/SSE for PS operations. Always try to look for ↵Craig Topper2016-08-091-9/+18
| | | | | | | | bitcasts from floating point types. If only AVX1 is supported we also need to handle integer types with floating point ops without looking for bitcasts. Previously SSE1 had a pattern that looked for integer types without bitcasts, but the type wasn't legal with only SSE1 and SSE2 add an identical pattern for the integer instructions. llvm-svn: 278089
* [X86] Remove unnecessary bitcast from the front of AVX1Only 256-bit logical ↵Craig Topper2016-08-091-4/+4
| | | | | | operation patterns. llvm-svn: 278088
* X86InstrInfo: Update liveness in classifyLea()Matthias Braun2016-08-092-9/+14
| | | | | | | | | We need to update liveness information when we create COPYs in classifyLea(). This fixes http://llvm.org/28301 llvm-svn: 278086
* [WebAssembly] Fix bugs in WebAssemblyLowerEmscriptenExceptions passDerek Schuff2016-08-092-34/+93
| | | | | | | | | | | | | | | | | | * Delete extra '_' prefixes from JS library function names. fixImports() function in JS glue code deals with this for wasm. * Change command-line option names in order to be consistent with asm.js. * Add missing lowering code for llvm.eh.typeid.for intrinsics * Delete commas in mangled function names * Fix a function argument attributes bug. Because we add the pointer to the original callee as the first argument of invoke wrapper, all argument attribute indices have to be incremented by one. Patch by Heejin Ahn Differential Revision: https://reviews.llvm.org/D23258 llvm-svn: 278081
* Consistently use CGSCCAnalysisManagerSean Silva2016-08-091-2/+2
| | | | | | | | | | | Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278080
* Consistently use LoopAnalysisManagerSean Silva2016-08-0913-16/+16
| | | | | | | | | | | | | | | | | One exception here is LoopInfo which must forward-declare it (because the typedef is in LoopPassManager.h which depends on LoopInfo). Also, some includes for LoopPassManager.h were needed since that file provides the typedef. Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278079
* Consistently use ModuleAnalysisManagerSean Silva2016-08-0918-20/+20
| | | | | | | | | | | Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278078
* Consistently use FunctionAnalysisManagerSean Silva2016-08-0941-49/+49
| | | | | | | | | | | Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278077
* CodeView: extract the OMF Directory HeaderSaleem Abdulrasool2016-08-092-11/+13
| | | | | | | | | | | | The DebugDirectory contains a pointer to the CodeView info structure which is a derivative of the OMF debug directory. The structure has evolved a bit over time, and PDB 2.0 used a slightly different definition from PDB 7.0. Both of these are specific to CodeView and not COFF. Reflect this by moving the structure definitions into the DebugInfo/CodeView headers. Define a generic DebugInfo union type that can be used to pass around a reference to the DebugInfo irrespective of the versioning. NFC. llvm-svn: 278075
* [x86] split combineVSelectWithAllOnesOrZeros into a helper function; NFCISanjay Patel2016-08-091-47/+61
| | | | llvm-svn: 278074
* [WebAssembly] Fix CFI index to account for padding nullptr functionDerek Schuff2016-08-081-1/+2
| | | | | | | | | | | | | The WebAssembly linker now creates a dummy function at index 0 to prevent miscomparisons with the NULL pointer, see https://github.com/WebAssembly/binaryen/pull/658. Thanks to pcc for pointing out this problem! Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D23137 llvm-svn: 278073
* Revert "Do not ignore SizeOfOptionalHeader in COFF header even if PE header ↵Rui Ueyama2016-08-081-2/+1
| | | | | | | | is not present." This reverts commit r278066 to unbreak buildbots. llvm-svn: 278070
* Revert r278065 while I investigate some build-bot breakage.Lang Hames2016-08-082-22/+2
| | | | llvm-svn: 278069
* Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not ↵Rui Ueyama2016-08-081-1/+2
| | | | | | | | | | | | | | | | | | | present. Attribute SizeOfOptionalHeader is ignored if no PE header is present in the file. This attribute should be ignored according to standard, however there are uses of this field even though it should not be used. This change does not conform to PE/COFF standard, but there are several COFF files without PE header, where you had to add up SizeOfOptionalHeader in order to get proper section headers. Other tools and their own parsers do take this into account. Patch by Marek Milkovič! https://reviews.llvm.org/D22750 llvm-svn: 278066
* [RuntimeDyld][Orc][MCJIT] Add partial weak-symbol support to RuntimeDyld.Lang Hames2016-08-082-2/+22
| | | | | | | | | | | | | | | This patch causes RuntimeDyld to check for existing definitions when it encounters weak symbols. If a definition already exists then the new weak definition is discarded. All symbol lookups within a "logical dylib" should now agree on the address of any given weak symbol. This allows the JIT to better match the behavior of the static linker for C++ code. This support is only partial, as it does not allow strong definitions that occur after the first weak definition (in JIT symbol lookup order) to override the previous weak definitions. Support for this will be added in a future patch. llvm-svn: 278065
* Revert "[X86] Support the "ms-hotpatch" attribute."Charles Davis2016-08-088-83/+21
| | | | | | | | This reverts commit r278048. Something changed between the last time I built this--it takes awhile on my ridiculously slow and ancient computer--and now that broke this. llvm-svn: 278053
* InstCombine: Remove a redundant #ifdef NDEBUG. NFCJustin Bogner2016-08-081-2/+0
| | | | | | The DEBUG() macro already does this. llvm-svn: 278049
* [X86] Support the "ms-hotpatch" attribute.Charles Davis2016-08-088-21/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on two patches by Michael Mueller. This is a target attribute that causes a function marked with it to be emitted as "hotpatchable". This particular mechanism was originally devised by Microsoft for patching their binaries (which they are constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but is now commonly abused by Windows programs to hook API functions. This mechanism is target-specific. For x86, a two-byte no-op instruction is emitted at the function's entry point; the entry point must be immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding. This padding is where the patch code is written. The two byte no-op is then overwritten with a short jump into this code. The no-op is usually a `movl %edi, %edi` instruction; this is used as a magic value indicating that this is a hotpatchable function. Reviewers: majnemer, sanjoy, rnk Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D19908 llvm-svn: 278048
* [Hexagon] Add pattern for 64-bit mulhsKrzysztof Parzyszek2016-08-082-11/+33
| | | | llvm-svn: 278040
* [LoopUnroll] Simplify loops created by unrolling.Michael Zolotukhin2016-08-081-0/+19
| | | | | | | | | | | | | | Summary: Currently loop-unrolling doesn't preserve loop-simplified form. This patch fixes it by resimplifying affected loops. Reviewers: chandlerc, sanjoy, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23148 llvm-svn: 278038
* RefreshCallGraph does not modify the SCC, adding "const" to make it clear (NFC)Mehdi Amini2016-08-081-3/+3
| | | | llvm-svn: 278037
* [MemorySSA] Fix windows build breakage caused by r278028Geoff Berry2016-08-081-4/+4
| | | | | r278028: [MemorySSA] Ensure address stability of MemorySSA object. llvm-svn: 278035
* [X86] Improve code size on X86 segment movesNirav Dave2016-08-081-0/+24
| | | | | | | | | | | | | | Moves of a value to a segment register from a 16-bit register is equivalent to one from it's corresponding 32-bit register. Match gas's behavior and rewrite instructions to the shorter of equivalent forms. Reviewers: rnk, ab Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23166 llvm-svn: 278031
* [MemorySSA] Ensure address stability of MemorySSA object.Geoff Berry2016-08-081-17/+13
| | | | | | | | | | | | | | | | | Summary: Ensure that the MemorySSA object never changes address when using the new pass manager since the walkers contained by MemorySSA cache pointers to it at construction time. This is achieved by wrapping the MemorySSAAnalysis result in a unique_ptr. Also add some asserts that check for this bug. Reviewers: george.burgess.iv, dberlin Subscribers: mcrosier, hfinkel, chandlerc, silvas, llvm-commits Differential Revision: https://reviews.llvm.org/D23171 llvm-svn: 278028
* [ARM] Add support for embedded position-independent codeOliver Stannard2016-08-0811-20/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for some new relocation models to the ARM backend: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. This does not affect read-write data. * Read-write position independence (RWPI): Read-write data is accessed relative to the static base register (r9). The offsets between all writeable data sections are known at static link time. This does not affect read-only data. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. They are otherwise the same as the "static" relocation model, and are not compatible with SysV-style PIC using a global offset table. These modes are normally used by bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting r9 to an appropriate value for RWPI code. I have only added support to SelectionDAG, not FastISel, because FastISel is currently disabled for bare-metal targets where these modes would be used. Differential Revision: https://reviews.llvm.org/D23195 llvm-svn: 278015
* [SystemZ] Add support for the .insn directiveZhan Jun Liau2016-08-087-0/+555
| | | | | | | | | | | | | | | | | Summary: Add support for the .insn directive. .insn is an s390 specific directive that allows encoding of an instruction instead of using a mnemonic. The motivating case is some code in node.js that requires support for the .insn directive. Reviewers: koriakin, uweigand Subscribers: koriakin, llvm-commits Differential Revision: https://reviews.llvm.org/D21809 llvm-svn: 278012
* GVN-hoist: enable by defaultSebastian Pop2016-08-081-2/+2
| | | | llvm-svn: 278010
* [LVI] NFC. On the fast dest path use inverse predicate instead of inverse ↵Artur Pilipenko2016-08-081-4/+5
| | | | | | | | | | range result Gathering constantins from a condition on the false path ask makeAllowedICmpRegion about inverse predicate instead of inversing the resulting range. This change was separated from the review "[LVI] Make LVI smarter about comparisons with non-constants" (https://reviews.llvm.org/D23205#inline-198361) llvm-svn: 278009
* [LVI] NFC. Rename confusing local NegOffset to OffsetArtur Pilipenko2016-08-081-6/+6
| | | | | | NegOffset is not necessarily negative llvm-svn: 278008
* [LVI] NFC. Extract LHS, RHS, Predicate locals in getValueFromConditionArtur Pilipenko2016-08-081-11/+14
| | | | llvm-svn: 278007
* [AArch64] PR28877: Don't assume we're running after legalization when ↵Silviu Baranga2016-08-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | creating vcvtfp2fxs Summary: The DAG combine transformation that was generating the aarch64_neon_vcvtfp2fxs node was assuming that all inputs where legal and wasn't accounting that the input could be a v4f64 if we're trying to do the transformation before legalization. We now bail out in this case. All illegal types besides v4f64 were already rejected. Fixes https://llvm.org/bugs/show_bug.cgi?id=28877. Reviewers: jmolloy Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D23261 llvm-svn: 278002
* Re-commit r277988: [mips][ias] Fix all the hacks related to MIPS-specific ↵Daniel Sanders2016-08-088-167/+171
| | | | | | | | | unary operators (%hi/%lo/%gp_rel/etc.). Hopefully with the MSVC builds fixed. I've added a missing '#include <tuple>' that gcc and clang don't seem to need. llvm-svn: 277995
* [X86][SSE] Assert if the shuffle mask indices are not -1 or within a valid ↵Simon Pilgrim2016-08-081-8/+5
| | | | | | | | input range As discussed in post-review rL277959 llvm-svn: 277993
OpenPOWER on IntegriCloud