summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add new target hooks for LoadStoreVectorizerVolkan Keles2016-10-036-59/+187
| | | | | | | | | | | | Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains. Reviewers: tstellarAMD, arsenm Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D24727 llvm-svn: 283099
* [ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of aSjoerd Meijer2016-10-032-1/+91
| | | | | | | | | | | | | | | library call to __aeabi_uidivmod. This is an improved implementation of r280808, see also D24133, that got reverted because isel was stuck in a loop. That was caused by the optimisation incorrectly triggering on i64 ints, which shouldn't happen because there is no 64bit hwdiv support; that put isel's type legalization and this optimisation in a loop. A native ARM compiler and testing now shows that this is fixed. Patch mostly by Pablo Barrio. Differential Revision: https://reviews.llvm.org/D25077 llvm-svn: 283098
* [ELF] - Do not crash on invalid section alignment.George Rimar2016-10-032-0/+21
| | | | | | | | | | | | | | Case was revealed by id_000010,sig_08,src_000000,op_havoc,rep_4 from PR30540. Out implementation uses uint32 for storing section alignment value, what seems reasonable, though if value exceeds 32 bits bounds we have truncation and final value of 0. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D25082 llvm-svn: 283097
* [StaticAnalyser] Add test case to ensure that unreachable code is found.Daniel Marjamaki2016-10-031-1/+12
| | | | | | https://reviews.llvm.org/D24905 llvm-svn: 283096
* [StaticAnalyzer] Fix UnreachableCode false positives.Daniel Marjamaki2016-10-032-11/+20
| | | | | | | | When there is 'do { } while (0);' in the code the ExplodedGraph and UnoptimizedCFG did not match. Differential Revision: https://reviews.llvm.org/D24759 llvm-svn: 283095
* [analyzer] Improve CloneChecker diagnosticsArtem Dergachev2016-10-0314-92/+291
| | | | | | | | | | | | | | | | | | Highlight code clones referenced by the warning message with the help of the extra notes feature recently introduced in r283092. Change warning text to more clang-ish. Remove suggestions from the copy-paste error checker diagnostics, because currently our suggestions are strictly 50% wrong (we do not know which of the two code clones contains the error), and for that reason we should not sound as if we're actually suggesting this. Hopefully a better solution would bring them back. Make sure the suspicious clone pair structure always mentions the correct variable for the second clone. Differential Revision: https://reviews.llvm.org/D24916 llvm-svn: 283094
* [analyzer] Add extra notes to ObjCDeallocCheckerArtem Dergachev2016-10-034-12/+116
| | | | | | | | | | The report is now highlighting instance variables and properties referenced by the warning message with the help of the extra notes feature recently introduced in r283092. Differential Revision: https://reviews.llvm.org/D24915 llvm-svn: 283093
* [analyzer] Extend bug reports with extra notesArtem Dergachev2016-10-0310-58/+232
| | | | | | | | | | | | | | | | | | | | These diagnostics are separate from the path-sensitive engine's path notes, and can be added manually on top of path-sensitive or path-insensitive reports. The new note diagnostics would appear as note:-diagnostic on console and as blue bubbles in scan-build. In plist files they currently do not appear, because format needs to be discussed with plist file users. The analyzer option "-analyzer-config notes-as-events=true" would convert notes to normal path notes, and put them at the beginning of the path. This is a temporary hack to show the new notes in plist files. A few checkers would be updated in subsequent commits, including tests for this new feature. Differential Revision: https://reviews.llvm.org/D24278 llvm-svn: 283092
* [CodeGen] Adding a test showing the current state of poor code gen ofAlexey Bataev2016-10-031-0/+67
| | | | | | | | | | | | search loop, by Andrey Tischenko PR27136 shows failure to hoist constant out of loop. This test is used as start point to fix the failure: it shows the current state of codegen and discovers what should be fixed Differential Revision: https://reviews.llvm.org/D25097 llvm-svn: 283091
* [lit] Throw in unimplemented method (NFC)Chris Bieneman2016-10-031-1/+1
| | | | | | | | | | | | | | | | | | Summary: lit's `OneCommandFileTest` class implements an abstract method that raises if called. However, it raises by referencing an undefined symbol. Instead, raise explicitly by throwing a `NotImplementedError`. This is clearer, and appeases Python linters. Patch By Brian Gesiak! Reviewers: ddunbar, echristo, beanz Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25170 llvm-svn: 283090
* [lit] Remove unused imports (NFC)Chris Bieneman2016-10-034-5/+6
| | | | | | | | | | | | Reviewers: ddunbar, echristo, beanz Patch by Brian Gesiak! Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25169 llvm-svn: 283089
* [lit] Compare to None using identity, not equalityChris Bieneman2016-10-032-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In Python, `None` is a singleton, so checking whether a variable is `None` may be done with `is` or `is not`. This has a slight advantage over equiality comparisons `== None` and `!= None`, since `__eq__` may be overridden in Python to produce sometimes unexpected results. Using `is None` and `is not None` is also recommended practice in https://www.python.org/dev/peps/pep-0008: > Comparisons to singletons like `None` should always be done with `is` or > `is not`, never the equality operators. Patch by Brian Gesiak! Reviewers: ddunbar, echristo, beanz Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25168 llvm-svn: 283088
* [AMDGPU] Remove unused variables from SIOptimizeExecMaskingKonstantin Zhuravlyov2016-10-031-3/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D25110 llvm-svn: 283087
* [PowerPC] Account for the ELFv2 function prologue during branch selectionHal Finkel2016-10-032-2/+18
| | | | | | | | | | | | | | | | The PPC branch-selection pass, which performs branch relaxation, needs to account for the padding that might be introduced to satisfy block alignment requirements. We were assuming that the first block was at offset zero (i.e. had the alignment of the function itself), but under the ELFv2 ABI, a global entry function prologue is added to the first block, and it is a two-instruction sequence (i.e. eight-bytes long). If the function has 16-byte alignment, the fact that the first block is eight bytes offset from the start of the function is relevant to calculating where padding will be added in between later blocks. Unfortunately, I don't have a small test case. llvm-svn: 283086
* Keep the test only for Itanium abiAditya Kumar2016-10-031-1/+1
| | | | llvm-svn: 283085
* [AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.Craig Topper2016-10-031-1/+1
| | | | | | This was accidentally copy and pasted from other Pseudos in the file. llvm-svn: 283084
* [X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.Craig Topper2016-10-033-24/+23
| | | | | | I don't know for sure that we truly needs this, but its the only vector load that isn't rematerializable. Making it consistent allows it to not be a special case in the td files. llvm-svn: 283083
* Fix regex in lldb lit test TestCallStopAndContinueTim Hammerquist2016-10-031-1/+1
| | | | | | https://reviews.llvm.org/D25167 llvm-svn: 283082
* [CMake] Fixing a few missing dependencies on intrinsics_genChris Bieneman2016-10-032-0/+8
| | | | | | These are missing dependencies that have been exposed in builds as a result of my change to make lldb libraries depend on CLANG_TABLEGEN_TARGETS instead of libclang. llvm-svn: 283081
* [X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPSSimon Pilgrim2016-10-022-24/+32
| | | | llvm-svn: 283080
* [SCEV] Rely on ConstantRange instead of custom logic; NFCISanjoy Das2016-10-021-124/+52
| | | | | | | This was first landed in rL283058 and subsequenlty reverted since a change this depends on (rL283057) was buggy and had to be reverted. llvm-svn: 283079
* [ConstantRange] Make getEquivalentICmp smarterSanjoy Das2016-10-023-0/+61
| | | | | | | | | | | This change teaches getEquivalentICmp to be smarter about generating ICMP_NE and ICMP_EQ predicates. An earlier version of this change was landed as rL283057 which had a use-after-free bug. This new version has a fix for that bug, and a (C++ unittests/) test case that would have triggered it rL283057. llvm-svn: 283078
* [X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPSSimon Pilgrim2016-10-021-0/+48
| | | | llvm-svn: 283077
* [X86][AVX2] Fix typo in test namesSimon Pilgrim2016-10-021-6/+6
| | | | | | We are testing vpermps not vpermd llvm-svn: 283076
* [cmake] Install 'clang-cpp' symlinkMichal Gorny2016-10-021-1/+1
| | | | | | | | | | | | | | | Install the 'clang-cpp' symlink used to spawn the preprocessor. The code handling this suffix is already included in Driver. FreeBSD is already creating such a symlink in ports, and a similar one was requested by Gentoo/FreeBSD team. The goal is to handle software that takes a C preprocessor via a variable but does not handle passing options correctly (i.e. 'clang -E' does not work). Bug: https://bugs.gentoo.org/478810 Differential Revision: https://reviews.llvm.org/D25161 llvm-svn: 283075
* Rangify for loops.Yaron Keren2016-10-021-17/+10
| | | | llvm-svn: 283074
* [AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics ↵Craig Topper2016-10-022-102/+80
| | | | | | when rounding mode isn't used. llvm-svn: 283073
* [x86] remove 'nan' strings from copysign assertions; NFCSanjay Patel2016-10-021-8/+8
| | | | | | | | | | | | Preemptively scrubbing these to avoid a bot fail as in PR30443: https://llvm.org/bugs/show_bug.cgi?id=30443 I'm nearly done with a patch to fix these cases, so not trying very hard to do better for the temporary win. I plan to use better checks than what the script produces for the vectorized cases. llvm-svn: 283072
* [x86] add test to show unnecessary scalarization of copysign intrinsics ↵Sanjay Patel2016-10-021-0/+294
| | | | | | (PR30433) llvm-svn: 283071
* [X86][AVX] Ensure broadcast loads respect dependenciesSimon Pilgrim2016-10-022-9/+22
| | | | | | | | | | | | To allow broadcast loads of a non-zero'th vector element, lowerVectorShuffleAsBroadcast can replace a load with a new load with an adjusted address, but unfortunately we weren't ensuring that the new load respected the same dependencies. This patch adds a TokenFactor and updates all dependencies of the old load to reference the new load instead. Bug found during internal testing. Differential Revision: https://reviews.llvm.org/D25039 llvm-svn: 283070
* Revert "XFAIL TestSBData for gcc-4.9 i386"Pavel Labath2016-10-021-1/+0
| | | | | | Test fixed. llvm-svn: 283069
* [CUDA] Allow extern __shared__ on empty-length arrays.Justin Lebar2016-10-022-2/+13
| | | | | | "extern __shared__ int x[]" is OK. llvm-svn: 283068
* [clang-rename] Overhaul clang-rename.el.Kirill Bobyrev2016-10-021-22/+52
| | | | | | | | | | | | | | | | | | | | | | | * Use lexical binding, as recommended for new libraries. * Fix customization variable (set correct group and type). * Create a new customization group for the library. * Autoload the main clang-rename command so that users don't have to explicitly load the library. * Correctly translate between file and buffer positions using bufferpos-to-filepos (if available) or a fallback. * Don't invoke the shell, it's not necessary and adds complexity. * Save clang-rename output in a buffer and display that on failure. * Save all buffers before calling clang-rename. This is required anyway and prevents data loss when the buffer is later reverted. * In revert-buffer, use keywords instead of t for Boolean arguments to improve readability. * Don't reset buffer modes when reverting. * Emacs treats the character after a symbol as part of the symbol, while clang-rename doesn't; resolve this inconsistency. * Formatting. Patch by Philipp Stephani! Reviewers: omtcyfz Differential Revision: https://reviews.llvm.org/D25156 llvm-svn: 283067
* [X86] Don't set i64 ADDC/ADDE/SUBC/SUBE as Custom if the target isn't ↵Craig Topper2016-10-021-7/+4
| | | | | | 64-bit. This way we don't have to catch them and do nothing with them in ReplaceNodeResults. llvm-svn: 283066
* [X86] Fix indentation. NFCCraig Topper2016-10-021-1/+1
| | | | llvm-svn: 283065
* [coroutines] Rename driver flag -fcoroutines to -fcoroutines-tsGor Nishanov2016-10-0215-14/+38
| | | | | | | | | | | | | | | Summary: Also makes -fcoroutines_ts to be both a Driver and CC1 flag. Patch mostly by EricWF. Reviewers: rnk, cfe-commits, rsmith, EricWF Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D25130 llvm-svn: 283064
* Alias must point to a definitionAditya Kumar2016-10-022-8/+26
| | | | | | | | | | | | | | | Reapplying the patch after modifying the test case. Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend. https://llvm.org/bugs/show_bug.cgi?id=30341 This patch disables alias to available_externally definitions. Reviewers: eugenis, rsmith Differential Revision: https://reviews.llvm.org/D24682 llvm-svn: 283063
* Revert r283057 and r283058Sanjoy Das2016-10-023-91/+124
| | | | | | | | | | | They've broken the sanitizer-bootstrap bots. Reverting while I investigate. Original commit messages: r283057: "[ConstantRange] Make getEquivalentICmp smarter" r283058: "[SCEV] Rely on ConstantRange instead of custom logic; NFCI" llvm-svn: 283062
* [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-floatHal Finkel2016-10-024-26/+202
| | | | | | | | | | Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. llvm-svn: 283061
* [PowerPC] Refactor soft-float support, and enable PPC64 soft floatHal Finkel2016-10-026-26/+45
| | | | | | | | | | | | | | | | | | | | | | | This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. llvm-svn: 283060
* Remove duplicated code; NFCSanjoy Das2016-10-026-73/+7
| | | | | | | ICmpInst::makeConstantRange does exactly the same thing as ConstantRange::makeExactICmpRegion. llvm-svn: 283059
* [SCEV] Rely on ConstantRange instead of custom logic; NFCISanjoy Das2016-10-021-124/+52
| | | | llvm-svn: 283058
* [ConstantRange] Make getEquivalentICmp smarterSanjoy Das2016-10-022-0/+39
| | | | | | | This change teaches getEquivalentICmp to be smarter about generating ICMP_NE and ICMP_EQ predicates. llvm-svn: 283057
* [SCEV] Remove commented out code; NFCSanjoy Das2016-10-021-3/+1
| | | | llvm-svn: 283056
* COFF: Fix short import lib import name type bitshiftMartell Malone2016-10-013-1/+5
| | | | | | | | | | | | | | As per the PE COFF spec (section 8.3, Import Name Type) Offset: 18 Size 2 bits Name: Type Offset: 20 Size 3 bits Name: Name Type Offset: 20 added based on 18+2 Partially commited as rL279069 Differential Revision: https://reviews.llvm.org/D23540 llvm-svn: 283055
* [AVX-512] Check rounding mode for builtins that take one. Rounding mode ↵Craig Topper2016-10-011-0/+93
| | | | | | should be either _MM_FROUND_CUR_DIRECTION or a 2-bit rounding mode ORed with _MM_FROUND_NO_EXC. llvm-svn: 283054
* [AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode ↵Craig Topper2016-10-012-120/+120
| | | | | | intrinsics. This is preparation for a follow up commit that will check validity of rounding mode argument. llvm-svn: 283053
* Remove some additional unnecessary std:: in cmathHal Finkel2016-10-011-9/+9
| | | | | | | Unlike in math.h, as Eric pointed out in the review of D18639, we don't need the std:: in cmath. llvm-svn: 283052
* Use __builtin_isnan/isinf/isfinite in complexHal Finkel2016-10-012-80/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libc-provided isnan/isinf/isfinite macro implementations are specifically designed to function correctly, even in the presence of -ffast-math (or, more specifically, -ffinite-math-only). As such, on most implementation, these either always turn into external function calls (e.g. glibc) or are specifically function calls when FINITE_MATH_ONLY is defined (e.g. Darwin). Our implementation of complex arithmetic makes heavy use of isnan/isinf/isfinite to deal with corner cases involving non-finite quantities. This was problematic in two respects: 1. On systems where these are always function calls (e.g. Linux/glibc), there was a performance penalty 2. When compiling with -ffast-math, there was a significant performance penalty (in fact, on Darwin and systems with similar implementations, the code may in fact be slower than not using -ffast-math, because the inline definitions provided by libc become unavailable to prevent the checks from being optimized out). Eliding these inf/nan checks in -ffast-math mode is consistent with what happens with libstdc++, and in my experience, what users expect. This is critical to getting high-performance code when using complex<T>. This change replaces uses of those functions on basic floating-point types with calls to __builtin_isnan/isinf/isfinite, which Clang will always expand inline. When using -ffast-math (or -ffinite-math-only), the optimizer will remove the checks as expected. Differential Revision: https://reviews.llvm.org/D18639 llvm-svn: 283051
* [X86][SSE] Cleaned up shuffle decode assertion messagesSimon Pilgrim2016-10-011-7/+11
| | | | llvm-svn: 283050
OpenPOWER on IntegriCloud