summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* LowerSwitch: replace unreachable default with popular case destinationHans Wennborg2015-01-231-63/+135
| | | | | | | | | | | | SimplifyCFG currently does this transformation, but I'm planning to remove that to allow other passes, such as this one, to exploit the unreachable default. This patch takes care to keep track of what case values are unreachable even after the transformation, allowing for more efficient lowering. Differential Revision: http://reviews.llvm.org/D6697 llvm-svn: 226934
* Classify functions by EH personality type rather than using the tripleReid Kleckner2015-01-238-17/+32
| | | | | | | | | | | | | | | This mostly reverts commit r222062 and replaces it with a new enum. At some point this enum will grow at least for other MSVC EH personalities. Also beefs up the way we were sniffing the personality function. Previously we would emit the Itanium LSDA despite using __C_specific_handler. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D6987 llvm-svn: 226920
* Debug Info / PR22309: Allow union types to be emitted as unsigned constants.Adrian Prantl2015-01-231-1/+2
| | | | llvm-svn: 226919
* Remove some local variables in place of just querying for themEric Christopher2015-01-231-6/+4
| | | | | | in the couple of asserts. llvm-svn: 226917
* [mips] Add new error message and improve testing for parsing the .module ↵Toma Tabacu2015-01-231-26/+27
| | | | | | | | | | | | | | | | | | | | | | | directive. Summary: We used to silently ignore any empty .module's and we used to give an error saying that we found an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number). We now give an error saying that we "expected .module option identifier" in both of those cases. I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7095 llvm-svn: 226905
* This patch fixes issue with lowering below mentioned pattern :-Jyoti Allur2015-01-231-7/+10
| | | | | | | | | | | | | | | | | | _foo: smull r0, r1, r1, r0 smull r2, r3, r3, r2 adds r0, r2, r0 adc r1, r3, r1 bx lr to _foo: smull r0, r1, r1, r0 smlal r0, r1, r3, r2 bx lr llvm-svn: 226904
* [x86] Change u8imm operands to always print as unsigned. This makes shuffle ↵Craig Topper2015-01-235-0/+15
| | | | | | masks and the like make way more sense. llvm-svn: 226902
* DAGCombine: always constant fold FMA when target disable FP exceptionsMehdi Amini2015-01-231-1/+1
| | | | | | | | | | | | | | | | | Summary: When trying to constant fold an FMA in the DAG, getNode() fails to fold the FMA if an operand is not finite. In this case this patch allows the constant folding if !TLI->hasFloatingPointExceptions() Reviewers: resistor Reviewed By: resistor Subscribers: hfinkel, llvm-commits Differential Revision: http://reviews.llvm.org/D6912 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 226901
* [X86] Add IntrNoMem to the AVX512 conflict intrinsics.Craig Topper2015-01-231-1/+9
| | | | llvm-svn: 226897
* Add STB_GNU_UNIQUE to the ELF writer.Rafael Espindola2015-01-232-3/+9
| | | | | | This lets llvm-mc assemble files produced by gcc. llvm-svn: 226895
* Reformat.NAKAMURA Takumi2015-01-231-3/+2
| | | | llvm-svn: 226888
* MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]NAKAMURA Takumi2015-01-231-3/+2
| | | | llvm-svn: 226887
* R600: Try to use lower types for 64bit division if possibleJan Vesely2015-01-222-13/+39
| | | | | | | | v2: add and enable tests for SI Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226881
* SelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENTJan Vesely2015-01-221-0/+30
| | | | | | | | | | | | v2: use getZExtValue add missing break codestyle v3: add few more comments Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226880
* R600: Simplify LowerUDIVREMJan Vesely2015-01-221-19/+11
| | | | | | | | | | | optimizations can handle removing the Hi part operations. The generated code is identical for R600, ~10% icount reduction for SI v2: rebase Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 226879
* IR: Change GenericDwarfNode::getHeader() to StringRefDuncan P. N. Exon Smith2015-01-222-8/+6
| | | | | | | Simplify the API to use a `StringRef` directly rather than exposing the `MDString` bits underneath. llvm-svn: 226876
* IR: DwarfNode => DebugNode, NFCDuncan P. N. Exon Smith2015-01-224-24/+24
| | | | | | | | | These things are potentially used for non-DWARF data (see the discussion in PR22235), so take the `Dwarf` out of the name. Since the new name gives fewer clues, update the doxygen to properly describe what they are. llvm-svn: 226874
* [X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.Simon Pilgrim2015-01-221-2/+5
| | | | | | | | Minor tweak now that D7042 is complete, we can enable stack folding for (V)MOVDDUP and do proper testing. Added missing AVX ymm folding patterns and fixed alignment for AVX VMOVSLDUP / VMOVSHDUP. llvm-svn: 226873
* [PM] Actually add the new pass manager support for the assumption cache.Chandler Carruth2015-01-221-0/+15
| | | | | | | | | | | | | | | I had already factored this analysis specifically to enable doing this, but hadn't actually committed the necessary wiring to get at this from the new pass manager. This also nicely shows how the separate cache object can be directly managed by the new pass manager. This analysis didn't have any direct tests and so I've added a printer pass and a boring test case. I chose to print the i1 value which is being assumed rather than the call to llvm.assume as that seems much more useful for testing... but suggestions on an even better printing strategy welcome. My main goal was to make sure things actually work. =] llvm-svn: 226868
* Remove dead leak detector parts that fell out of use in r224703.Benjamin Kramer2015-01-223-109/+1
| | | | llvm-svn: 226867
* IR: Update references to temporaries before deletingDuncan P. N. Exon Smith2015-01-221-0/+1
| | | | | | | | | | | | | | | | During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)` to update all tracking references to `nullptr`. This fixes PR22280, where inverted destruction order between tracking references and the temporaries themselves caused a use-after-free in `LLParser`. An alternative fix would be to add an assertion that there are no users, and continue to fix inverted destruction order in clients (like `LLParser`), but instead I decided to make getting-teardown-right easy. (If someone disagrees let me know.) llvm-svn: 226866
* Refactoring cl::parser construction and initialization.Chris Bieneman2015-01-221-2/+2
| | | | | | | | | | | | | | | Summary: Some parsers need references back to the option they are members of. This is used for handling the argument string as well as by the various pass name parsers for making pass names into flags. Making parsers that need to refer back to the option have a reference to the option eliminates some of the members of various parsers, and enables further code cleanup. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7131 llvm-svn: 226864
* Intrinsics: introduce llvm_any_ty aka ValueType AnyRamkumar Ramachandra2015-01-225-13/+9
| | | | | | | | | | | | | | | Specifically, gc.result benefits from this greatly. Instead of: gc.result.int.* gc.result.float.* gc.result.ptr.* ... We now have a gc.result.* that can specialize to literally any type. Differential Revision: http://reviews.llvm.org/D7020 llvm-svn: 226857
* Revert "Don't remove a landing pad if the invoke requires a table entry."Reid Kleckner2015-01-221-17/+3
| | | | | | | | | | | | This reverts commit r176827. Björn Steinbrink pointed out that this didn't actually fix the bug (PR15555) it was attempting to fix. With this reverted, we can now remove landingpad cleanups that immediately resume unwinding, converting the invoke to a call. llvm-svn: 226850
* merge consecutive stores of extracted vector elements (PR21711)Sanjay Patel2015-01-221-92/+162
| | | | | | | | | | | | | | | | | | This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698. That patch was checked in at r224611, but reverted at r225031 because it caused a failure outside of the regression tests. The cause of the crash was not recognizing consecutive stores that have mixed source values (loads and vector element extracts), so this patch adds a check to bail out if any store value is not coming from a vector element extract. This patch also refactors the shared logic of the constant source and vector extracted elements source cases into a helper function. Differential Revision: http://reviews.llvm.org/D6850 llvm-svn: 226845
* Revert "PR21408: Workaround the appearance of duplicate variables due to ↵David Blaikie2015-01-221-6/+1
| | | | | | | | | | | problems when inlining two calls to the same function from the same call site." The underlying bug has been fixed in r226736 so there's no need to workaround this anymore. This reverts commit r220923. llvm-svn: 226842
* AArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.Tim Northover2015-01-221-42/+35
| | | | | | | | | | | | Currently, we're adding a uint64_t describing the current subtarget so that matching can check whether the specified register is valid. However, we want to move to a bitset for those bits (x86 has more than 64 of them). This can't live in a union so it's probably better to do the checks early (especially as there are only 3 of them). llvm-svn: 226841
* Rewrite DIExpression::printInternal() to use the iterator interface.Adrian Prantl2015-01-221-9/+5
| | | | | | NFC. llvm-svn: 226836
* Rename DIExpressionIterator to DIExpression::iterator.Adrian Prantl2015-01-223-7/+7
| | | | | | Addresses review feedback from Duncan. llvm-svn: 226835
* [pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.Rafael Espindola2015-01-221-9/+36
| | | | | | | | | | | | The ELF format is used on Windows by the MCJIT engine. Thus, on Windows, the ELFObjectWriter can encounter symbols mangled using the MS Visual Studio C++ name mangling. Symbols mangled using the MSVC C++ name mangling can legally have "@@@" as a substring. The EFLObjectWriter should not interpret the "@@@" substring as specifying GNU-style symbol versioning. The ELFObjectWriter therefore check for the MSVC C++ name mangling prefix which is either "?", "@?", "imp_?" or "imp_?@". llvm-svn: 226830
* Silencing a -Wsign-compare warning (all uses of this constant are within ↵Aaron Ballman2015-01-221-1/+1
| | | | | | unsigned expressions anyway); NFC. llvm-svn: 226826
* [DAGCombine] Produce better code for constant splatsMichael Kuperstein2015-01-222-2/+41
| | | | | | | | | | | This solves PR22276. Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead. Differential Revision: http://reviews.llvm.org/D7093 Fixed recommit of r226811. llvm-svn: 226816
* Mark |TLI| variables used to suppress -Wunused-variable warnings.Alexander Potapenko2015-01-221-0/+2
| | | | | | (These vars are only used in assertions) llvm-svn: 226815
* Revert r226811, MSVC accepts code sane compilers don't.Michael Kuperstein2015-01-222-41/+2
| | | | llvm-svn: 226814
* [DAGCombine] Produce better code for constant splatsMichael Kuperstein2015-01-222-2/+41
| | | | | | | | | This solves PR22276. Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead. Differential Revision: http://reviews.llvm.org/D7093 llvm-svn: 226811
* [ASan/Win] Move the shadow to 0x30000000Timur Iskhodzhanov2015-01-221-1/+1
| | | | llvm-svn: 226809
* Fixed a bug in type legalizer for masked load/store intrinsics.Elena Demikhovsky2015-01-227-38/+249
| | | | | | | | | | | | The problem occurs when after vectorization we have type <2 x i32>. This type is promoted to <2 x i64> and then requires additional efforts for expanding loads and truncating stores. I added EXPAND / TRUNCATE attributes to the masked load/store SDNodes. The code now contains additional shuffles. I've prepared changes in the cost estimation for masked memory operations, it will be submitted separately. llvm-svn: 226808
* Fixed a commentElena Demikhovsky2015-01-221-1/+1
| | | | llvm-svn: 226806
* Fixed a bug in narrowing store operation.Elena Demikhovsky2015-01-221-2/+5
| | | | | | | | | Type MVT::i1 became legal in KNL, but store operation can't be narrowed to this type, since the size of VT (1 bit) is not equal to its actual store size(8 bits). Added a test provided by David (dag@cray.com) llvm-svn: 226805
* [NFC] Introduce a 'struct Range' for IRCESanjoy Das2015-01-221-17/+27
| | | | | | | | | Use the struct instead of a std::pair<Value *, Value *>. This makes a Range an obviously immutable object, and we can now assert that a range is well-typed (Begin->getType() == End->getType()) on its construction. llvm-svn: 226804
* Revert r226798. Guess I missed the patterns.Craig Topper2015-01-221-2/+2
| | | | llvm-svn: 226802
* Use u8imm instead of i32i8imm on a couple instructions that have no patterns ↵Craig Topper2015-01-221-2/+2
| | | | | | and thus no reason to use a larger operand size. llvm-svn: 226798
* [X86] Remove some unused multiclasses from AVX512 instruction file.Craig Topper2015-01-221-101/+0
| | | | llvm-svn: 226797
* Fix crashes in IRCE caused by mismatched typesSanjoy Das2015-01-221-7/+35
| | | | | | | | | | | | | | | There are places where the inductive range check elimination pass depends on two llvm::Values or llvm::SCEVs to be of the same llvm::Type when they do not need to be. This patch relaxes those restrictions (by bailing out of the optimization if the types mismatch), and adds test cases to trigger those paths. These issues were found by bootstrapping clang with IRCE running in the -O3 pass ordering. Differential Revision: http://reviews.llvm.org/D7082 llvm-svn: 226793
* SLPVectorizer: add a second limit for the number of alias checks.Erik Eckstein2015-01-221-21/+49
| | | | | | | | Even with the current limit on the number of alias checks, the containing loop has quadratic complexity. This begins to hurt for blocks containing > 1K load/store instructions. This commit introduces a limit for the loop count. It reduces the runtime for such very large blocks. llvm-svn: 226792
* Fixed a bug in masked load/store in reversed loop.Elena Demikhovsky2015-01-221-0/+2
| | | | | | | | | Added a test. The bug was submitted to bugzilla: http://llvm.org/bugs/show_bug.cgi?id=22225 llvm-svn: 226791
* [PM] Rename InstCombine.h to InstCombineInternal.h in preparation forChandler Carruth2015-01-2214-16/+21
| | | | | | | | | | | | | | | | creating a non-internal header file for the InstCombine pass. I thought about calling this InstCombiner.h or in some way more clearly associating it with the InstCombiner clas that it is primarily defining, but there are several other utility interfaces defined within this for InstCombine. If, in the course of refactoring, those end up moving elsewhere or going away, it might make more sense to make this the combiner's header alone. Naturally, this is a bikeshed to a certain degree, so feel free to lobby for a different shade of paint if this name just doesn't suit you. llvm-svn: 226783
* [canonicalize] Teach InstCombine to canonicalize loads which are onlyChandler Carruth2015-01-221-0/+29
| | | | | | | | | | | | | | | | | | | | | | | ever stored to always use a legal integer type if one is available. Regardless of whether this particular type is good or bad, it ensures we don't get weird differences in generated code (and resulting performance) from "equivalent" patterns that happen to end up using a slightly different type. After some discussion on llvmdev it seems everyone generally likes this canonicalization. However, there may be some parts of LLVM that handle it poorly and need to be fixed. I have at least verified that this doesn't impede GVN and instcombine's store-to-load forwarding powers in any obvious cases. Subtle cases are exactly what we need te flush out if they remain. Also note that this IR pattern should already be hitting LLVM from Clang at least because it is exactly the IR which would be produced if you used memcpy to copy a pointer or floating point between memory instead of a variable. llvm-svn: 226781
* ARM: fail less catastrophically on invalid Windows inputSaleem Abdulrasool2015-01-223-7/+18
| | | | | | | | | | | | Windows supports a restricted set of relocations (compared to ARM ELF). In some cases, we may end up generating an unsupported relocation. This can occur with bad input to the assembler in particular (the frontend should never generate code that cannot be compiled). Generate an error rather than just aborting. The change in the API is driven by the desire to provide a slightly more helpful message for debugging purposes. llvm-svn: 226779
* [canonicalize] Move a helper function further up the file so it can beChandler Carruth2015-01-221-47/+47
| | | | | | used earlier. NFC. llvm-svn: 226777
OpenPOWER on IntegriCloud