summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [WASM] Fix overflow when reading custom sectionJonas Devlieghere2018-08-083-3/+13
| | | | | | | | | | | | | When reading a custom WASM section, it was possible that its name extended beyond the size of the section. This resulted in a bogus value for the section size due to the size overflowing. Fixes heap buffer overflow detected by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8190 Differential revision: https://reviews.llvm.org/D50387 llvm-svn: 339269
* [DebugInfo] Fine tune emitting flags as part of the producerJonas Devlieghere2018-08-082-4/+8
| | | | | | | | | When using APPLE extensions, don't duplicate the compiler invocation's flags both in AT_producer and AT_APPLE_flags. Differential revision: https://reviews.llvm.org/D50453 llvm-svn: 339268
* [InstCombine] fold fadd+fsub with common operandSanjay Patel2018-08-082-10/+13
| | | | | | | This is a sibling to the simplify from: https://reviews.llvm.org/rL339174 llvm-svn: 339267
* [InstCombine] fold fsub+fsub with common operandSanjay Patel2018-08-082-4/+11
| | | | | | | This is a sibling to the simplify from: rL339171 llvm-svn: 339266
* [DebugInfo][OpenCL] Address post-commit review for r338299Scott Linder2018-08-083-63/+107
| | | | | | | | NFC refactor of code to generate debug info for OpenCL 2.X blocks. Differential Revision: https://reviews.llvm.org/D50099 llvm-svn: 339265
* [CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual ↵Simon Pilgrim2018-08-081-8/+8
| | | | | | | | | | warning (PR38210) As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector Differential Revision: https://reviews.llvm.org/D50448 llvm-svn: 339264
* [InstCombine] add tests for fsub folds; NFCSanjay Patel2018-08-081-68/+137
| | | | | | | | | | | | | | The scalar cases are handled in instcombine's internal reassociation pass for FP ops, but it misses the vector types. These patterns are similar to what was handled in InstSimplify in: https://reviews.llvm.org/rL339171 https://reviews.llvm.org/rL339174 https://reviews.llvm.org/rL339176 ...but we can't use instsimplify on these because we require negation of the original operand. llvm-svn: 339263
* [DAG] DAGCombiner::visitSDIVLike - remove unnecessary isConstOrConstSplat ↵Simon Pilgrim2018-08-081-4/+1
| | | | | | | | call. NFCI. The isConstOrConstSplat result is only used in a ISD::matchUnaryPredicate call which can perform the equivalent iteration just as quickly. llvm-svn: 339262
* Fix -Wdocumentation warnings. NFCI.Simon Pilgrim2018-08-081-22/+22
| | | | llvm-svn: 339261
* [PowerPC] Improve codegen for vector loads using scalar_to_vectorZaara Syeda2018-08-0814-239/+1527
| | | | | | | | | | | | | | | | This patch aims to improve the codegen for vector loads involving the scalar_to_vector (load X) sequence. Initially, ld->mv instructions were used for scalar_to_vector (load X), so this patch allows scalar_to_vector (load X) to utilize: LXSD and LXSDX for i64 and f64 LXSIWAX for i32 (sign extension to i64) LXSIWZX for i32 and f64 Committing on behalf of Amy Kwan. Differential Revision: https://reviews.llvm.org/D48950 llvm-svn: 339260
* Remove unneeded preprocessor condition.Charles Davis2018-08-081-9/+0
| | | | llvm-svn: 339259
* [libunwind][include] Add SEH declarations to <unwind.h>.Charles Davis2018-08-081-2/+28
| | | | | | | | | | | | | | | | Summary: Make the `_Unwind_Exception` struct correct under SEH. Add a declaration of `_GCC_specific_handler()`, which is used by SEH versions of Itanium personality handlers to do common setup. Roughly corresponds to Clang's D50380. Reviewers: mstorsjo, rnk, compnerd, smeenai Subscribers: christof, chrib, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50414 llvm-svn: 339258
* [CodeGen] emit inline asm clobber list warnings for reservedTies Stuij2018-08-085-32/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, in line with GCC, when specifying reserved registers like sp or pc on an inline asm() clobber list, we don't always preserve the original value across the statement. And in general, overwriting reserved registers can have surprising results. For example: ``` extern int bar(int[]); int foo(int i) { int a[i]; // VLA asm volatile( "mov r7, #1" : : : "r7" ); return 1 + bar(a); } ``` Compiled for thumb, this gives: ``` $ clang --target=arm-arm-none-eabi -march=armv7a -c test.c -o - -S -O1 -mthumb ... foo: .fnstart @ %bb.0: @ %entry .save {r4, r5, r6, r7, lr} push {r4, r5, r6, r7, lr} .setfp r7, sp, #12 add r7, sp, #12 .pad #4 sub sp, #4 movs r1, #7 add.w r0, r1, r0, lsl #2 bic r0, r0, #7 sub.w r0, sp, r0 mov sp, r0 @APP mov.w r7, #1 @NO_APP bl bar adds r0, #1 sub.w r4, r7, #12 mov sp, r4 pop {r4, r5, r6, r7, pc} ... ``` r7 is used as the frame pointer for thumb targets, and this function needs to restore the SP from the FP because of the variable-length stack allocation a. r7 is clobbered by the inline assembly (and r7 is included in the clobber list), but LLVM does not preserve the value of the frame pointer across the assembly block. This type of behavior is similar to GCC's and has been discussed on the bugtracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11807 . No consensus seemed to have been reached on the way forward. Clang behavior has briefly been discussed on the CFE mailing (starting here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058392.html). I've opted for following Eli Friedman's advice to print warnings when there are reserved registers on the clobber list so as not to diverge from GCC behavior for now. The patch uses MachineRegisterInfo's target-specific knowledge of reserved registers, just before we convert the inline asm string in the AsmPrinter. If we find a reserved register, we print a warning: ``` repro.c:6:7: warning: inline asm clobber list contains reserved registers: R7 [-Winline-asm] "mov r7, #1" ^ ``` Reviewers: eli.friedman, olista01, javed.absar, efriedma Reviewed By: efriedma Subscribers: efriedma, eraman, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D49727 llvm-svn: 339257
* [AST] Check described template at structural equivalence check.Balazs Keri2018-08-083-125/+178
| | | | | | | | | | | | | | | | | | | | Summary: When checking a class or function the described class or function template is checked too. Split StructuralEquivalenceContext::Finish into multiple functions. Improved test with symmetric check, added new tests. Reviewers: martong, a.sidorin, a_sidorin, bruno Reviewed By: martong, a.sidorin Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D49223 llvm-svn: 339256
* [RISCV] Add mnemonic alias: move, sbreak and scall.Alex Bradbury2018-08-082-0/+19
| | | | | | | | | Further improve compatibility with the GNU assembler. Differential Revision: https://reviews.llvm.org/D50217 Patch by Kito Cheng. llvm-svn: 339255
* [TargetLowering] BuildUDIV - Add support for divide by one (PR38477)Simon Pilgrim2018-08-082-92/+27
| | | | | | | | Provide a pass-through of the numerator for divide by one cases - this is the same approach we take in DAGCombiner::visitSDIVLike. I investigated whether we could achieve this by magic MULHU/SRL values but nothing appeared to work as we don't have a way for MULHU(x,c) -> x llvm-svn: 339254
* Add missing REQUIRES x86 to tests.Peter Smith2018-08-086-0/+6
| | | | | | | | Add REQUIRES to tests that fail when an x86 backend is not present. Differential Revision: https://reviews.llvm.org/D50440 llvm-svn: 339253
* [RISCV] Add InstAlias definitions for add[w], and, xor, or, sll[w], srl[w], ↵Alex Bradbury2018-08-086-1/+112
| | | | | | | | | | | | sra[w], slt and sltu with immediate Match the GNU assembler in supporting immediate operands for these instructions even when the reg-reg mnemonic is used. Differential Revision: https://reviews.llvm.org/D50046 Patch by Kito Cheng. llvm-svn: 339252
* [ARM][NFC] Replaced tab-characters in test file vtrn.llSjoerd Meijer2018-08-081-100/+100
| | | | llvm-svn: 339251
* Add a CommandGuide for llvm-objdumpMichael Trent2018-08-083-0/+119
| | | | | | | | | | | | | | | | Summary: Add a CommandGuide for llvm-objdump summarizing its usage along with some general context. Reviewers: beanz Reviewed By: beanz Subscribers: Eugene.Zelenko, llvm-commits Differential Revision: https://reviews.llvm.org/D50034 llvm-svn: 339250
* [libFuzzer] Optimize handle unstable checks by reducing iterationsMax Moroz2018-08-083-16/+21
| | | | | | | | | | | | | | | | | | Summary: We only run the 3rd check if 2nd check finds unstable edges. 3rd UpdateUnstableCounters is now merged with ApplyUnstableCounters to only run 1 iteration. Patch by Kyungtak Woo (@kevinwkt). Reviewers: Dor1s, metzman, morehouse Reviewed By: Dor1s, morehouse Subscribers: delcypher, #sanitizers, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D50411 llvm-svn: 339249
* [InstCombine] fold fneg into constant operand of fmul/fdivSanjay Patel2018-08-083-25/+29
| | | | | | | | | | | | This accounts for the missing IR fold noted in D50195. We don't need any fast-math to enable the negation transform. FP negation can always be folded into an fmul/fdiv constant to eliminate the fneg. I've limited this to one-use to ensure that we are eliminating an instruction rather than replacing fneg by a potentially expensive fdiv or fmul. Differential Revision: https://reviews.llvm.org/D50417 llvm-svn: 339248
* [X86][SSE] PR38477 test is more cleanly tested with udiv instead of uremSimon Pilgrim2018-08-081-110/+78
| | | | | | Making the test use urem relies on it calling udiv-like combines, but the real issue is with the udiv so we're better off using that directly. llvm-svn: 339247
* [TargetLowering] Remove APInt divisor argument from BuildExactSDIV (NFCI).Simon Pilgrim2018-08-081-14/+22
| | | | | | | | As requested in D50392, this is a minor refactor to BuildExactSDIV to stop taking the uniform constant APInt divisor and instead extract it locally. I also cleanup the operands and valuetypes to better match BuildUDiv (and BuildSDIV in the near future). llvm-svn: 339246
* test commit accessTies Stuij2018-08-081-4/+4
| | | | | | | | | | Summary: changing a few typos Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50445 llvm-svn: 339245
* [analyzer] Fix a typo in `RegionStore.txt`.Henry Wong2018-08-081-2/+2
| | | | | | | | | | | | | | Summary: The typo of the description for default bindings can be confusing. Reviewers: NoQ, george.karpenkov Reviewed By: NoQ, george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D50382 llvm-svn: 339244
* [InstCombine] De Morgan: sink 'not' into 'xor' (PR38446)Roman Lebedev2018-08-082-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | Summary: https://rise4fun.com/Alive/IT3 Comes up in the [most ugliest] `signed int` -> `signed char` case of `-fsanitize=implicit-conversion` (https://reviews.llvm.org/D50250) Previously, we were stuck with `not`: {F6867736} But now we are able to completely get rid of it: {F6867737} (FIXME: why are we loosing the metadata? that seems wrong/strange.) Here, we only want to do that it we will be able to completely get rid of that 'not'. Reviewers: spatel, craig.topper Reviewed By: spatel Subscribers: vsk, erichkeane, llvm-commits Differential Revision: https://reviews.llvm.org/D50301 llvm-svn: 339243
* [ARM] FP16: codegen support for VEXTSjoerd Meijer2018-08-082-18/+26
| | | | | | Differential Revision: https://reviews.llvm.org/D50427 llvm-svn: 339241
* [analyzer][UninitializedObjectChecker] Pointer/reference objects are ↵Kristof Umann2018-08-083-36/+149
| | | | | | | | | | | | | | | | dereferenced according to dynamic type This patch fixed an issue where the dynamic type of pointer/reference object was known by the analyzer, but wasn't obtained in the checker, which resulted in false negatives. This should also increase reliability of the checker, as derefencing is always done now according to the dynamic type (even if that happens to be the same as the static type). Special thanks to Artem Degrachev for setting me on the right track. Differential Revision: https://reviews.llvm.org/D49199 llvm-svn: 339240
* [ARM] FP16: vector vmov and vdup supportSjoerd Meijer2018-08-082-52/+85
| | | | | | | | This adds codegen support for the vmov_n_f16 and vdup_n_f16 variants. Differential Revision: https://reviews.llvm.org/D50329 llvm-svn: 339238
* [analyzer][UninitializedObjectChecker] Fixed a false negative by no longer ↵Kristof Umann2018-08-082-19/+36
| | | | | | | | | | | | | | | | | filtering out certain constructor calls As of now, all constructor calls are ignored that are being called by a constructor. The point of this was not to analyze the fields of an object, so an uninitialized field wouldn't be reported multiple times. This however introduced false negatives when the two constructors were in no relation to one another -- see the test file for a neat example for this with singletons. This patch aims so fix this issue. Differential Revision: https://reviews.llvm.org/D48436 llvm-svn: 339237
* [ARM] FP16: vector VMUL variantsSjoerd Meijer2018-08-082-36/+58
| | | | | | | | This adds codegen support for the vmul_lane_f16 and vmul_n_f16 variants. Differential Revision: https://reviews.llvm.org/D50326 llvm-svn: 339232
* [X86][SSE] Add divide-by-one exact sdiv vector testSimon Pilgrim2018-08-081-0/+34
| | | | | | Based on PR38477, we need to ensure we're testing for divide-by-one in non-uniform vectors llvm-svn: 339231
* [Wasm] Don't iterate over MachineBasicBlock::successors while erasing from itBenjamin Kramer2018-08-081-8/+10
| | | | | | This will read out of bounds. Found by asan. llvm-svn: 339230
* [TargetLowering] BuildUDIV - Early out for divide by one (PR38477)Simon Pilgrim2018-08-082-0/+132
| | | | | | We're not handling the UDIV by one special case properly - for now just early out. llvm-svn: 339229
* [ARM] FP16: support vector INT_TO_FP and FP_TO_INTSjoerd Meijer2018-08-082-50/+100
| | | | | | | | This adds codegen support for the different vcvt_f16 variants. Differential Revision: https://reviews.llvm.org/D50393 llvm-svn: 339227
* [ASTImporter] Load external Decls when getting field index.Balazs Keri2018-08-085-19/+75
| | | | | | | | | | | | | | | | | Summary: At equality check of fields without name the index of fields is compared. At determining the index of a field all fields of the parent context should be loaded from external source to find the field at all. Reviewers: a.sidorin, a_sidorin, r.stahl Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49796 llvm-svn: 339226
* Support inline asm with multiple 64bit output in 32bit GPRThomas Preud'homme2018-08-083-138/+344
| | | | | | | | | | | | | | Summary: Extend fix for PR34170 to support inline assembly with multiple output operands that do not naturally go in the register class it is constrained to (eg. double in a 32-bit GPR as in the PR). Reviewers: bogner, t.p.northover, lattner, javed.absar, efriedma Reviewed By: efriedma Subscribers: efriedma, tra, eraman, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D45437 llvm-svn: 339225
* Added functionality to suggest FixIts for conversion of '->' to '.' and vice ↵Kadir Cetinkaya2018-08-0810-12/+167
| | | | | | | | | | | | | | | | versa. Summary: Added functionality to suggest FixIts for conversion of '->' to '.' and vice versa. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: yvvan, ioeric, jkorous, arphaman, cfe-commits, kadircet Differential Revision: https://reviews.llvm.org/D50193 llvm-svn: 339224
* [NFC][InstCombine] Cleanup demorgan-sink-not-into-xor.ll testRoman Lebedev2018-08-081-62/+33
| | | | | | We are only going to do it if it is free to do. llvm-svn: 339223
* [ARM] FP16: support the vector vmin and vmax variantsSjoerd Meijer2018-08-083-32/+362
| | | | | | Differential Revision: https://reviews.llvm.org/D50238 llvm-svn: 339221
* [NFC] Add some tests on mustexecMax Kazantsev2018-08-081-0/+149
| | | | llvm-svn: 339219
* [libcxx] [test] Avoid -Wunused-local-typedef in node_handle.pass.cpp.Billy Robert O'Neal III2018-08-081-1/+3
| | | | llvm-svn: 339218
* [libunwind] Fix pointer-to-integer cast warnings on LLP64.Charles Davis2018-08-082-8/+8
| | | | | | | | | | | | | | Summary: `long` is too short on LLP64. We have to use `intptr_t` to avoid truncating pointers. Reviewers: mstorsjo, rnk, compnerd, smeenai Subscribers: christof, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50412 llvm-svn: 339217
* Fixed a breaking test caseBalaji V. Iyer2018-08-081-1/+1
| | | | llvm-svn: 339216
* [NFC][VFS] Fix typos in comments.Volodymyr Sapsai2018-08-081-2/+2
| | | | llvm-svn: 339215
* [libcxx] [test] Allow a standard library that implements LWG 1203 in ↵Billy Robert O'Neal III2018-08-081-1/+1
| | | | | | | | istream.rvalue/rvalue.pass.cpp (Still pending review at https://reviews.llvm.org/D47400 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339214
* [libcxx] [test] Remove nonportable locale assumption in ↵Billy Robert O'Neal III2018-08-081-3/+3
| | | | | | | | | | basic.ios.members/narrow.pass.cpp I'm not sure if libcxx is asserting UTF-8 here; but on Windows the full char value is always passed through in its entirety, since the default codepage is something like Windows-1252. The replacement character is only used for non-chars there; and that should be a more portable test everywhere. (Still pending review at https://reviews.llvm.org/D47395 which has been open since may; will ask for forgiveness rather than permission :) ) llvm-svn: 339213
* [libcxx] [test] Remove asserts that <cstddef> and <stdexcept> are included ↵Billy Robert O'Neal III2018-08-081-10/+1
| | | | | | | | by <bitset> Reviewed as https://reviews.llvm.org/D50421 llvm-svn: 339212
* [MS Demangler] Properly handle backreferencing of special names.Zachary Turner2018-08-082-22/+37
| | | | | | | | | | | | | | | | | | | | | Function template names are not stored in the backref table, but non-template function names are. The general pattern seems to be that when you are demangling a symbol name, if the name starts with '?' it does not go into the backreference table, otherwise it does. Note that this even handles the general case of operator names (template or otherwise) not going into the back-reference table, anonymous namespaces not going into the backreference table, etc. It's important that we apply this check *only* for the unqualified portion of a name, and only for symbol names. For example, this does not apply to type names (such as class templates) and we need to make sure that these still do go into the backref table. Differential Revision: https://reviews.llvm.org/D50394 llvm-svn: 339211
OpenPOWER on IntegriCloud