summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] don't use DeMorgan's Law on integer constants (2nd try)Sanjay Patel2017-05-023-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was originally checked in here: https://reviews.llvm.org/rL301923 And reverted here: https://reviews.llvm.org/rL301924 Because there's a clang test that would fail after this. I fixed/removed the offending CHECK lines in: https://reviews.llvm.org/rL301928 So let's try this again. Original commit message: This is the fold that causes the infinite loop in BoringSSL (https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c) when we fix instcombine demanded bits to prefer 'not' ops as in https://reviews.llvm.org/D32255. There are 2 or 3 problems with dyn_castNotVal, and I don't think we can reinstate https://reviews.llvm.org/D32255 until dyn_castNotVal is completely eliminated. 1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot. 2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors. 3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y) That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y) Differential Revision: https://reviews.llvm.org/D32665 llvm-svn: 301929
* [CodeGen] remove/fix checks that will fail when r301923 is recommittedSanjay Patel2017-05-021-2/+6
| | | | | | Don't test the optimizer as part of front-end verification. llvm-svn: 301928
* tsan: allow fast large MemoryRangeSet on non-Windows GoDmitry Vyukov2017-05-021-3/+2
| | | | | | | | | | | | The fast reset for large memory regions is not working only on windows. So enable it for Go/linux/darwin/freebsd. See https://github.com/golang/go/issues/20139 for background and motivation. Based on idea by Josh Bleecher Snyder. llvm-svn: 301927
* [compiler-rt] move tsan's Android __get_tls() to sanitizer_commonKostya Kortchinsky2017-05-022-19/+45
| | | | | | | | | | | | | | | | | | | | | | Summary: TSan's Android `__get_tls()` and `TLS_SLOT_TSAN` can be used by other sanitizers as well (see D32649), this change moves them to sanitizer_common. I picked sanitizer_linux.h as their new home. In the process, add the 32-bit versions for ARM, i386 & MIPS. Can the address of `__get_tls()[TLS_SLOT_TSAN]` change in between the calls? I am not sure if there is a need to repeat the construct as opposed to using a variable. So I left things as they were. Testing on my side was restricted to a successful cross-compilation. Reviewers: dvyukov, kubamracek Reviewed By: dvyukov Subscribers: aemerson, rengolin, srhines, dberris, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D32705 llvm-svn: 301926
* [NFC] [IslAST] fix typo: "int the" -> "in the"Siddharth Bhat2017-05-021-1/+1
| | | | llvm-svn: 301925
* revert r301923 : [InstCombine] don't use DeMorgan's Law on integer constantsSanjay Patel2017-05-023-31/+28
| | | | | | There's a clang test that is wrongly using -O1 and failing after this commit. llvm-svn: 301924
* [InstCombine] don't use DeMorgan's Law on integer constantsSanjay Patel2017-05-023-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the fold that causes the infinite loop in BoringSSL (https://github.com/google/boringssl/blob/master/crypto/cipher/e_rc2.c) when we fix instcombine demanded bits to prefer 'not' ops as in D32255. There are 2 or 3 problems with dyn_castNotVal, and I don't think we can reinstate D32255 until dyn_castNotVal is completely eliminated. 1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot. 2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors. 3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y) That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y) Differential Revision: https://reviews.llvm.org/D32665 llvm-svn: 301923
* [DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)Amaury Sechet2017-05-025-1209/+1206
| | | | | | | | | | | | Summary: This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo . Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32687 llvm-svn: 301922
* Add llvm::object::getELFSectionTypeName().Rafael Espindola2017-05-024-58/+69
| | | | | | | | | | | This is motivated by https://reviews.llvm.org/D32488 where I am trying to add printing of the section type for incompatible sections to LLD error messages. This patch allows us to use the same code in llvm-readobj and LLD instead of duplicating the function inside LLD. Patch by Alexander Richardson! llvm-svn: 301921
* Improvements to TableGen/LangIntro.rstAlex Bradbury2017-05-021-2/+7
| | | | | | | | | | | Document the 'code' data type, and that value{15-17} is different to value{17-15}. Patch by @chenwj (Wei-Ren Chen). Differential Revision: https://reviews.llvm.org/D32117 llvm-svn: 301920
* [DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)Amaury Sechet2017-05-022-11/+14
| | | | | | | | | | Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used. Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer Differential Revision: https://reviews.llvm.org/D32738 llvm-svn: 301919
* Android.rules: set "ar" path correctlyPavel Labath2017-05-021-0/+1
| | | | llvm-svn: 301918
* ObjectFileELF: Fix symbol lookup in bss sectionPavel Labath2017-05-024-1/+166
| | | | | | | | | | | | | | | | | | | | | | | | Summary: If we have symbol information in a separate file, we need to be very careful about presenting a unified section view of module to the rest of the debugger. ObjectFileELF had code to handle that, but it was being overly cautious -- the section->GetFileSize()!=0 meant that the unification would fail for sections which do not occupy any space in the object file (e.g., .bss). In my case, that manifested itself as not being able to display the values of .bss variables properly as the section associated with the variable did not have it's load address set (because it was not present in the unified section list). I test this by making sure the unified section list and the variables refer to the same section. Reviewers: eugene, zturner Subscribers: tberghammer, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D32434 llvm-svn: 301917
* Revert r301735 (and subsequent r301786).Daniel Jasper2017-05-022-330/+244
| | | | | | | | | | | | | | | It leads to clang crashing, e.g. on this short code fragment (added to test/SemaCXX/warn-thread-safety-parsing.cpp): class SomeClass { public: void foo() { auto l = [this] { auto l = [] EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; }; } Mutex mu_; }; llvm-svn: 301916
* [X86][SSE] Add test for PR30264 (combining multiple constants inputs in a ↵Simon Pilgrim2017-05-021-0/+34
| | | | | | shuffle) llvm-svn: 301915
* [clang-move] Find template class forward declarations more precisely.Haojian Wu2017-05-022-11/+24
| | | | | | | | | | | | Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32741 llvm-svn: 301914
* [analyzer] Detect bad free of function pointersDaniel Marjamaki2017-05-022-1/+54
| | | | | | Differential Revision: https://reviews.llvm.org/D31650 llvm-svn: 301913
* [X86] Tidyup subvector insert/extract helpers. NFCI.Simon Pilgrim2017-05-021-24/+9
| | | | | | Use getConstantOperandVal where possible. llvm-svn: 301912
* Fix typo in comment. NFCI.Simon Pilgrim2017-05-021-2/+2
| | | | llvm-svn: 301911
* [SelectionDAG] Improve support for promotion of <1 x fX> floating point ↵Simon Pilgrim2017-05-026-13/+96
| | | | | | | | | | | | argument types (PR31088) PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats. This patch adds support for extension/truncation for both integer and float types. Differential Revision: https://reviews.llvm.org/D32391 llvm-svn: 301910
* Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau2017-05-0210-156/+31
| | | | llvm-svn: 301909
* Change UniqueCStringMap to use ConstString as the keyPavel Labath2017-05-0213-159/+135
| | | | | | | | | | | | | | | | Summary: UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons. Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate. Reviewers: #lldb, clayborg Reviewed By: clayborg Subscribers: labath, jasonmolenda, lldb-commits Differential Revision: https://reviews.llvm.org/D32316 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301908
* [DAGCombiner] Improve MatchBswapHword logic (PR31357)Simon Pilgrim2017-05-022-54/+26
| | | | | | | | | | | | The existing code only looks at half of the tree when matching bswap + rol patterns ending in an OR tree (as opposed to a cascade). Patch originally introduced by Jim Lewis. Submitted on the behalf of Dinar Temirbulatov. Differential Revision: https://reviews.llvm.org/D32039 llvm-svn: 301907
* Remove leftover test expectation from rL301902.Emilio Cobos Alvarez2017-05-021-1/+0
| | | | llvm-svn: 301906
* [ARM] GlobalISel: Use TableGen instruction selectorDiana Picus2017-05-026-25/+66
| | | | | | | | | | | Emit and use the TableGen instruction selector for ARM. At the moment, this allows us to remove the hand-written code for selecting G_SDIV and G_UDIV. Future commits will focus on increasing the code coverage for it and removing more dead code from the current instruction selector. llvm-svn: 301905
* [asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau2017-05-0210-31/+156
| | | | | | Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 301904
* Remove unused code related to CPlusPlusLanguage::FindEquivalentNamesPavel Labath2017-05-022-150/+0
| | | | | | | | | | | | | | | Summary: It is simply unused, and the header for it is private, so there should be no external dependencies. Reviewers: #lldb, zturner Reviewed By: zturner Subscribers: zturner, tberghammer, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D32503 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301903
* [libclang] Revert rL301328 and add tests for the regressions introduced.Emilio Cobos Alvarez2017-05-022-8/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D32566 llvm-svn: 301902
* [APInt] Move APInt::getSplat out of line.Craig Topper2017-05-022-9/+12
| | | | | | I think this method is probably too complex to be inlined. llvm-svn: 301901
* [APInt] Move the setBit and clearBit methods inline.Craig Topper2017-05-022-18/+16
| | | | | | This makes setBit/clearBit more consistent with setBits which is already inlined. llvm-svn: 301900
* Refactor callsite cost computation into a helper function /NFCXinliang David Li2017-05-022-29/+39
| | | | | | | Makes code more readable. The function will also be used by the partial inlining's cost analysis. llvm-svn: 301899
* clang/test/Modules/diag-flags.cpp: Appease targeting *-win32 with explicit ↵NAKAMURA Takumi2017-05-021-6/+6
| | | | | | | | | triple. Fixes r301846. MicrosoftRecordLayoutBuilder doesn't have ability of -Wpadded. FIXME: Would other diag be available here? llvm-svn: 301898
* ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO.Peter Collingbourne2017-05-021-0/+5
| | | | | | | | | | | | | | | | If there is a bug in the LTO implementation that causes it to fail to provide an expected symbol definition, the linker should report an undefined symbol error. Unfortunately, we were failing to do so if the symbol definition was weak, as the undefine() function was turning the definition into a weak undefined symbol, which resolves to zero if the symbol remains undefined. This patch causes us to set the binding to STB_GLOBAL when we undefine a symbol. I can't see a good way to test this. The behaviour should only be observable if there is a bug in the LTO implementation. Differential Revision: https://reviews.llvm.org/D32731 llvm-svn: 301897
* Update commetns.Rui Ueyama2017-05-021-3/+5
| | | | llvm-svn: 301896
* Make getArchiveMembers function a non-member function.Rui Ueyama2017-05-022-2/+1
| | | | | | | It didn't have to be a member function of Driver. This patch makes that function a file-scoped non-member function. llvm-svn: 301895
* [PartialInlining] Hook up inline cost analysisXinliang David Li2017-05-023-14/+141
| | | | | | Differential Revision: http://reviews.llvm.org/D32666 llvm-svn: 301894
* [AVR] Save/restore the frame pointer for all functionsDylan McKay2017-05-024-30/+29
| | | | | | | A recent commit I made made it so that we only did this for signal or interrupt handlers. This broke normal functions. llvm-svn: 301893
* [PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LENemanja Ivanovic2017-05-028-86/+112
| | | | | | | | | | | | | Fixes PR30730. This is a re-commit of a pulled commit. The commit was pulled because some software projects contained uses of Altivec vectors that violated alignment requirements. Known issues have now been fixed. Committing on behalf of Lei Huang. Differential Revision: https://reviews.llvm.org/D26861 llvm-svn: 301892
* Revert r301785 (and r301787) because they caused PR32864.Nick Lewycky2017-05-023-15/+5
| | | | | | The fix is that ExprEvaluatorBase::VisitInitListExpr should handle transparent exprs instead of exprs with one element. Fixing that uncovers one testcase failure because the AST for "constexpr _Complex float test2 = {1};" is wrong (the _Complex prvalue should not be const-qualified), and a number of test failures in test/OpenMP where the captured stmt contains an InitListExpr that is in syntactic form. llvm-svn: 301891
* [AArch64] armv8-A doesn't have LSE.Ahmed Bougacha2017-05-022-1/+9
| | | | | | | | | | | r288279 mistakenly added it to all arches, but it's only available from v8.1 onwards. The testcase is awkward, because (I suspect) of PR32873. Spotted by inspection. llvm-svn: 301890
* [sanitizer-coverage] add a deprecation note for the old sanitizer-coverage; ↵Kostya Serebryany2017-05-023-10/+7
| | | | | | remove a TODO printf llvm-svn: 301889
* [sanitizer-coverage] update the SanitizerCoverage docs to reflect the ↵Kostya Serebryany2017-05-021-233/+167
| | | | | | current state llvm-svn: 301888
* [AVR] Fix a bug where the frame pointer is clobberedDylan McKay2017-05-021-7/+17
| | | | | | | | | | | | | | | Because it was a callee-saved register, we automatically generated code to spill and unspill its original value so that it is restored after the function returns. The problem is that this code was being generated before the epilogue. The epilogue itself uses the Y register, which could be prematurely restored by the CSR restoration process. This removes R29R28 from the CSR list and changes the prologue/epilogue code to handle it explicitly. llvm-svn: 301887
* Revert r301880George Burgess IV2017-05-012-32/+0
| | | | | | | | | This change caused buildbot failures, apparently because we're not passing around types that InstSimplify is used to seeing. I'm not overly familiar with InstSimplify, so I'm reverting this until I can figure out what exactly is wrong. llvm-svn: 301885
* Stylistic makeover of DWARFDebugLine before working on it. NFCPaul Robinson2017-05-012-274/+264
| | | | | | | Rename parameters and locals to CamelCase, doxygenize the header, and run clang-format on the whole thing. llvm-svn: 301883
* [CodeView] Write CodeView line information.Zachary Turner2017-05-0124-14/+526
| | | | | | Differential Revision: https://reviews.llvm.org/D32716 llvm-svn: 301882
* [AVR] Enable the frame pointer for all functionsDylan McKay2017-05-011-2/+3
| | | | | | | This is a temporary measure while we figure out a way to get the frame pointer working correctly. llvm-svn: 301881
* [InstSimplify] Handle selects of GEPs with 0 offsetGeorge Burgess IV2017-05-012-0/+32
| | | | | | | | | In particular (since it wouldn't fit nicely in the summary): (select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V) Differential Revision: https://reviews.llvm.org/D31435 llvm-svn: 301880
* [X86] Reduce code for setting operations actions by merging into loops ↵Simon Pilgrim2017-05-011-129/+68
| | | | | | across multiple types/ops. NFCI. llvm-svn: 301879
* Empty Space. NFCXin Tong2017-05-011-1/+1
| | | | llvm-svn: 301878
OpenPOWER on IntegriCloud