summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix template argument deduction when a parameter pack has a valueRichard Smith2018-07-198-134/+385
| | | | | | | | | | | | | | provided by an outer template. We made the incorrect assumption in various places that the only way we can have any arguments already provided for a pack during template argument deduction was from a partially-specified pack. That's not true; we can also have arguments from an enclosing already-instantiated template, and that can even result in the function template's own pack parameters having a fixed length and not being packs for the purposes of template argument deduction. llvm-svn: 337481
* fix typo in commentNico Weber2018-07-191-1/+1
| | | | llvm-svn: 337480
* [OpenEmbedded] Add a unittest for aarch64-oe-linuxMandeep Singh Grang2018-07-191-0/+6
| | | | | | | | | | | | | | Summary: Added a unittest for aarch64-oe-linux which was missed in D48861. Reviewers: compnerd, rengolin, javed.absar Reviewed By: compnerd Subscribers: kristof.beyls, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49314 llvm-svn: 337479
* [APInt] Keep the original bit width in quotient and remainderKrzysztof Parzyszek2018-07-192-16/+49
| | | | | | | | | | | Some trivial cases in udivrem were handled by directly assigning 0 or 1 to APInt objects. This would set the bit width to 1, instead of the bit width of the inputs. A potentially undesirable side effect of that is that with the bit width of 1, 1 equals -1. Differential Revision: https://reviews.llvm.org/D49554 llvm-svn: 337478
* [libc++] Allow running ABI list tests with different ABI versionsLouis Dionne2018-07-194-17/+2425
| | | | | | | | | | | | | | | Summary: Currently, the ABI list test only works for ABI version 1. This commit allows running the ABI list test with ABI version 2. It also adds an ABI list file for ABI v2 on Mac OS X. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, llvm-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D49509 llvm-svn: 337477
* [libFuzzer] Update documentation regarding MSan.Matt Morehouse2018-07-191-5/+3
| | | | | | | | | | | | | | Summary: -fsanitize=fuzzer,memory now works out-of-the-box. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49441 llvm-svn: 337476
* Added unit tests for FlagsRaphael Isemann2018-07-192-0/+200
| | | | | | | | | | | | Reviewers: labath Reviewed By: labath Subscribers: labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D49435 llvm-svn: 337475
* [analyzer] Fix memory sanitizer error in MallocChecker.Reka Kovacs2018-07-191-3/+3
| | | | | | | | StringRef's data() returns a string that may be non-null-terminated. Switch to using StringRefs from const char pointers in visitor notes to avoid problems. llvm-svn: 337474
* Fix unused variable warning.Erich Keane2018-07-191-1/+1
| | | | llvm-svn: 337473
* [analyzer] Memoize complexity of SymExprMikhail R. Gadelha2018-07-194-9/+32
| | | | | | | | | | | | | | | | | Summary: This patch introduces a new member to SymExpr, which stores the symbol complexity, avoiding recalculating it every time computeComplexity() is called. Also, increase the complexity of conjured Symbols by one, so it's clear that it has a greater complexity than its underlying symbols. Reviewers: NoQ, george.karpenkov Reviewed By: NoQ, george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D49232 llvm-svn: 337472
* [LoadStoreVectorizer] Use getMinusScev() to compute the distance between two ↵Farhana Aleen2018-07-192-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | pointers. Summary: Currently, isConsecutiveAccess() detects two pointers(PtrA and PtrB) as consecutive by comparing PtrB with BaseDelta+PtrA. This works when both pointers are factorized or both of them are not factorized. But isConsecutiveAccess() fails if one of the pointers is factorized but the other one is not. Here is an example: PtrA = 4 * (A + B) PtrB = 4 + 4A + 4B This patch uses getMinusSCEV() to compute the distance between two pointers. getMinusSCEV() allows combining the expressions and computing the simplified distance. Author: FarhanaAleen Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D49516 llvm-svn: 337471
* [Sema] Add a new warning, -Wmemset-transposed-argsErik Pilkington2018-07-194-12/+176
| | | | | | | | | | | | | | | This diagnoses calls to memset that have the second and third arguments transposed, for example: memset(buf, sizeof(buf), 0); This is done by checking if the third argument is a literal 0, or if the second is a sizeof expression (and the third isn't). The first check is also done for calls to bzero. Differential revision: https://reviews.llvm.org/D49112 llvm-svn: 337470
* [X86][BtVer2] correctly model the latency/throughput of LEA instructions.Andrea Di Biagio2018-07-1913-292/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the latency/throughput of LEA instructions in the BtVer2 scheduling model. On Jaguar, A 3-operands LEA has a latency of 2cy, and a reciprocal throughput of 1. That is because it uses one cycle of SAGU followed by 1cy of ALU1. An LEA with a "Scale" operand is also slow, and it has the same latency profile as the 3-operands LEA. An LEA16r has a latency of 3cy, and a throughput of 0.5 (i.e. RThrouhgput of 2.0). This patch adds a new TIIPredicate named IsThreeOperandsLEAFn to X86Schedule.td. The tablegen backend (for instruction-info) expands that definition into this (file X86GenInstrInfo.inc): ``` static bool isThreeOperandsLEA(const MachineInstr &MI) { return ( ( MI.getOpcode() == X86::LEA32r || MI.getOpcode() == X86::LEA64r || MI.getOpcode() == X86::LEA64_32r || MI.getOpcode() == X86::LEA16r ) && MI.getOperand(1).isReg() && MI.getOperand(1).getReg() != 0 && MI.getOperand(3).isReg() && MI.getOperand(3).getReg() != 0 && ( ( MI.getOperand(4).isImm() && MI.getOperand(4).getImm() != 0 ) || (MI.getOperand(4).isGlobal()) ) ); } ``` A similar method is generated in the X86_MC namespace, and included into X86MCTargetDesc.cpp (the declaration lives in X86MCTargetDesc.h). Back to the BtVer2 scheduling model: A new scheduling predicate named JSlowLEAPredicate now checks if either the instruction is a three-operands LEA, or it is an LEA with a Scale value different than 1. A variant scheduling class uses that new predicate to correctly select the appropriate latency profile. Differential Revision: https://reviews.llvm.org/D49436 llvm-svn: 337469
* The patch adds support for the new map interface between clang and ↵Alexey Bataev2018-07-1945-1156/+1611
| | | | | | | | | | | libomptarget. The changes in the interface are the following: device IDs are now 64-bit integers (as opposed to 32-bit) map flags are 64-bit long (used to be 32-bit) mappings for partially mapped structs are now calculated at compile time and members of partially mapped structs are flagged using the MEMBER_OF field Support for is_device_ptr on struct members was dropped - this functionality is not supported by the OpenMP standard and its implementation is technically infeasible (however, use_device_ptr on struct members works as a non-standard extension of the compiler) llvm-svn: 337468
* [compiler-rt] Only set lto_flags if lto_supportedTeresa Johnson2018-07-191-3/+2
| | | | | | | | Fix bot failure from r37465. Move the new lto_flags append under the check for whether lto_supported. Otherwise TestingConfig may not have that member. llvm-svn: 337467
* [analyzer] Fix disappearing notes in DanglingInternalBufferChecker testsReka Kovacs2018-07-191-2/+3
| | | | | | Correct a mistake of the exact same kind I am writing this checker for. llvm-svn: 337466
* [compiler-rt] Add NewPM testing to CFI testsTeresa Johnson2018-07-194-8/+19
| | | | | | | | | | | | | | | | | | Summary: Executes both LTO and ThinLTO CFI tests an additional time using the new pass manager. I only bothered to add with gold and not lld as testing with one linker should be sufficient. I didn't add for APPLE or WIN32 since I don't have a way to test those. Depends on D49429. Reviewers: pcc Subscribers: dberris, mgorny, mehdi_amini, delcypher, dexonsmith, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49432 llvm-svn: 337465
* [X86][SSE] Add FPEXT vXf32 - vXf64 testsSimon Pilgrim2018-07-191-6/+79
| | | | | | Some basic subvector special cases based on PR36761 llvm-svn: 337464
* [analyzer] Add support for more basic_string API inReka Kovacs2018-07-193-71/+271
| | | | | | | | | | | | | DanglingInternalBufferChecker. A pointer referring to the elements of a basic_string may be invalidated by calling a non-const member function, except operator[], at, front, back, begin, rbegin, end, and rend. The checker now warns if the pointer is used after such operations. Differential Revision: https://reviews.llvm.org/D49360 llvm-svn: 337463
* [llvm-readobj] - Do not report invalid amount of sections.George Rimar2018-07-192-3/+6
| | | | | | | | | | | When output style is GNU and amount of sections is >= SHN_LORESERVE, llvm-readobj reports zero number of sections instead of actual value. The patch fixes that. Differential revision: https://reviews.llvm.org/D49544 llvm-svn: 337462
* [ThinLTO] Enable ThinLTO WholeProgramDevirt and LowerTypeTests in new PMTeresa Johnson2018-07-1911-32/+227
| | | | | | | | | | | | | | | | Summary: Enable these passes for CFI and WPD in ThinLTO and LTO with the new pass manager. Add a couple of tests for both PMs based on the clang tests tools/clang/test/CodeGen/thinlto-distributed-cfi*.ll, but just test through llvm-lto2 and not with distributed ThinLTO. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49429 llvm-svn: 337461
* [ELF] - Eliminate dead code. NFC.George Rimar2018-07-191-2/+1
| | | | | | Code was dead because we call postThunkContents only for SHT_SYMTAB. llvm-svn: 337460
* ELF: Replace the header-extension unit test with a lit onePavel Labath2018-07-194-64/+73
| | | | | | | | | The new test checks that we are actually able to read data from these kinds of elf headers correctly instead of just that we read the section number correctly. It is also easier to figure out what's going on in the test. llvm-svn: 337459
* [ELF] - One more test case for .eh_frame_hdr.George Rimar2018-07-191-0/+28
| | | | | | | | | | This is to test the following error message: https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L544 Which occurs when LLD meets unsupported address encoding when scans .eh_frame to build .eh_frame_hdr section. llvm-svn: 337458
* [Docs] Testing Debug Info Preservation in OptimizationsAnastasis Grammenos2018-07-191-2/+179
| | | | | | Differential Revision: https://reviews.llvm.org/D49053 llvm-svn: 337457
* [CodeGen] Disable aggressive structor optimizations at -O0, take 3Pavel Labath2018-07-193-13/+48
| | | | | | | | | | | | The previous version of this patch (r332839) was reverted because it was causing "definition with same mangled name as another definition" errors in some module builds. This was caused by an unrelated bug in module importing which it exposed. The importing problem was fixed in r336240, so this recommits the original patch (r332839). Differential Revision: https://reviews.llvm.org/D46685 llvm-svn: 337456
* [OpenMP][libomptarget] New map interface: remove translation code and ensure ↵George Rokos2018-07-193-330/+145
| | | | | | | | | | | | | | | proper alignment of struct members This patch removes the translation code since this functionality is now implemented in the compiler. target_data_begin and target_data_end are also patched to handle some special cases that used to be handled by the obsolete translation function, namely ensure proper alignment of struct members when we have partially mapped structs. Mapping a struct from a higher address (i.e. not from its beginning) can result in distortion of the alignment for some of its member fields. Padding restores the original (proper) alignment. Differential revision: https://reviews.llvm.org/D44186 llvm-svn: 337455
* Enable C++2a Chrono LiteralsErich Keane2018-07-192-3/+35
| | | | | | | | | | | | | | | | | | | C++2a via http://wg21.link/p0355 permits the library literals of 'd' and 'y'. This patch enables them in the Lexer so that they can be properly parsed. Note that 'd' gets confused with the hex character, so modifications to how octal, binary, and decimal numbers are parsed were required. Since this is simply making previously invalid code legal, this should be fine. Hex still greedily parses the 'd' as a hexit, since it would a: violate [lex.ext]p1 b: break existing code. Differential Revision: https://reviews.llvm.org/D49504 llvm-svn: 337454
* [CodeComplete] Fix accessibilty of protected members from base class.Eric Liu2018-07-193-16/+67
| | | | | | | | | | | | | | | | | | Summary: Currently, protected members from base classes are marked as inaccessible when completing in derived class. This patch fixes the problem by setting the naming class correctly when looking up results in base class according to [11.2.p5]. Reviewers: aaron.ballman, sammccall, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49421 llvm-svn: 337453
* Fix whitespace formatting in DWARFExpression::DumpLocationPavel Labath2018-07-191-14/+14
| | | | | | | | we were printing an extra space before the start for the expression and an extra space after some dwarf operators. This makes sure we only print exactly one space **between** operators and nowhere else. llvm-svn: 337452
* NFC: Remove extraneous semicolons as pointed out in the differential reviewNemanja Ivanovic2018-07-191-2/+2
| | | | | | | | The commit for https://reviews.llvm.org/D49424 missed the comment about the extraneous semicolons. Remove them. llvm-svn: 337451
* ARM: switch armv7em MachO triple to hard-float defaults and libcalls.Tim Northover2018-07-193-1/+40
| | | | | | | | | We were emitting incorrect calls to libm functions that LLVM had decided it knew about because the default is soft-float. Recommitted without breaking ELF this time. llvm-svn: 337450
* [PowerPC] Handle __builtin_xxpermdi the same way as GCC doesNemanja Ivanovic2018-07-192-24/+16
| | | | | | | | | | | | | The codegen for this builtin was initially implemented to match GCC. However, due to interest from users GCC changed behaviour to account for the big endian bias of the instruction and correct it. This patch brings the handling inline with GCC. Fixes https://bugs.llvm.org/show_bug.cgi?id=38192 Differential Revision: https://reviews.llvm.org/D49424 llvm-svn: 337449
* [UnJ] Document unroll and jam pass and loop metadataDavid Green2018-07-192-0/+76
| | | | | | | | | Add some quick words for unroll and jam to the list of passes and add unroll_and_jam metadata to the language ref. Differential Revision: https://reviews.llvm.org/D49349 llvm-svn: 337448
* [PCH+Modules] Load -fmodule-map-file content before including PCHsBruno Cardoso Lopes2018-07-192-16/+32
| | | | | | | | | | | | | | | | Consider: 1) Generate PCH with -fmodules and -fmodule-map-file 2) Use PCH with -fmodules and the same -fmodule-map-file If we don't load -fmodule-map-file content before including PCHs, the modules that are dependencies in PCHs cannot get loaded, since there's no matching module map file when reading back the AST. rdar://problem/40852867 Differential Revision: https://reviews.llvm.org/D48685 llvm-svn: 337447
* [x86/SLH] Major refactoring of SLH implementaiton. There are two bigChandler Carruth2018-07-191-174/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | changes that are intertwined here: 1) Extracting the tracing of predicate state through the CFG to its own function. 2) Creating a struct to manage the predicate state used throughout the pass. Doing #1 necessitates and motivates the particular approach for #2 as now the predicate management is spread across different functions focused on different aspects of it. A number of simplifications then fell out as a direct consequence. I went with an Optional to make it more natural to construct the MachineSSAUpdater object. This is probably the single largest outstanding refactoring step I have. Things get a bit more surgical from here. My current goal, beyond generally making this maintainable long-term, is to implement several improvements to how we do interprocedural tracking of predicate state. But I don't want to do that until the predicate state management and tracing is in reasonably clear state. Differential Revision: https://reviews.llvm.org/D49427 llvm-svn: 337446
* [DAGCombiner] Add rotate-extract testsSimon Pilgrim2018-07-193-0/+750
| | | | | | Add new tests from D47681 to current codegen. Also added i686 codegen tests. llvm-svn: 337445
* Use std::reference_wrapper instead of llvm::ReferenceStorageSerge Guelton2018-07-192-14/+2
| | | | | | | Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D49298 llvm-svn: 337444
* [XRay][compiler-rt] Profiling: No files when emptyDean Michael Berris2018-07-193-25/+29
| | | | | | | | | This change makes it so that the profiling mode implementation will only write files when there are buffers to write. Before this change, we'd always open a file even if there were no profiles collected when flushing. llvm-svn: 337443
* Fix spelling mistake in comments. NFCI.Simon Pilgrim2018-07-191-2/+2
| | | | llvm-svn: 337442
* [XRay][compiler-rt] FDR Mode: Add extents metadata to bufferDean Michael Berris2018-07-191-2/+30
| | | | | | | | | | | | When providing raw access to the FDR mode buffers, we used to not include the extents metadata record. This oversight means that processing the buffers in-memory will lose important information that would have been written in files. This change exposes the metadata record by serializing the data similarly to how we would do it when flushing to files. llvm-svn: 337441
* [Xray] Fix allocator build, MAP_NORESERVE flag is not always supportedDavid Carlier2018-07-191-1/+6
| | | | | | | | | | | | MAP_NORESERVE is not supported or a no-op on BSD. Reviewers: dberris Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D49494 llvm-svn: 337440
* [PDB] Add PDBSourcePath flag to support absolutize source file pathTakuto Ikuta2018-07-197-1/+651
| | | | | | | | | | | | | | | | | | | | | This patch changes relative path for source files in obj files to absolute path in PDB when linking with added flag. I will make obj file generated by clang-cl independent from build directory for chromium build. But I don't want to confuse visual studio debugger or require additional configuration. To attain this goal, I added flag to convert relative source file path in obj to absolute path when emitting PDB. By removing absolute path from obj files, we can share build cache between chromium developers even when they are doing debug build. That will make build time faster. More context: https://bugs.chromium.org/p/chromium/issues/detail?id=712796 https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/5HXSVX-7fPc llvm-svn: 337439
* [COFF] Don't produce base relocs for discardable sectionsMartin Storsjo2018-07-192-1/+43
| | | | | | | | | | | | | Dwarf debug info contains some data that contains absolute addresses. Since these sections are discardable and aren't loaded at runtime, there's no point in adding base relocations for them. This makes sure that after stripping out dwarf debug info, there are no base relocations that point to nonexistent sections. Differential Revision: https://reviews.llvm.org/D49350 llvm-svn: 337438
* [libFuzzer] fix the bot (the no-assert build)Kostya Serebryany2018-07-191-0/+1
| | | | llvm-svn: 337437
* [libFuzzer] quick hack to fix the botKostya Serebryany2018-07-191-0/+1
| | | | llvm-svn: 337436
* [SCEV] Fix buggy behavior in getAddExpr with truncsMax Kazantsev2018-07-192-1/+35
| | | | | | | | | | | | | | | | | SCEV tries to constant-fold arguments of trunc operands in SCEVAddExpr, and when it does that, it passes wrong flags into the recursion. It is only valid to pass flags that are proved for narrow type into a computation in wider type if we can prove that trunc instruction doesn't actually change the value. If it did lose some meaningful bits, we may end up proving wrong no-wrap flags for sum of arguments of trunc. In the provided test we end up with `nuw` where it shouldn't be because of this bug. The solution is to conservatively pass `SCEV::FlagAnyWrap` which is always a valid thing to do. Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D49471 llvm-svn: 337435
* [libFuzzer] first experimental attempt at DFT-based mutations ↵Kostya Serebryany2018-07-198-15/+66
| | | | | | (DFT=data-flow-trace) llvm-svn: 337434
* [clang]: Add support for "-fno-delete-null-pointer-checks"Manoj Gupta2018-07-1914-31/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Support for this option is needed for building Linux kernel. This is a very frequently requested feature by kernel developers. More details : https://lkml.org/lkml/2018/4/4/601 GCC option description for -fdelete-null-pointer-checks: This Assume that programs cannot safely dereference null pointers, and that no code or data element resides at address zero. -fno-delete-null-pointer-checks is the inverse of this implying that null pointer dereferencing is not undefined. This feature is implemented in as the function attribute "null-pointer-is-valid"="true". This CL only adds the attribute on the function. It also strips "nonnull" attributes from function arguments but keeps the related warnings unchanged. Corresponding LLVM change rL336613 already updated the optimizations to not treat null pointer dereferencing as undefined if the attribute is present. Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv Reviewed By: jyknight Subscribers: drinkcat, xbolva00, cfe-commits Differential Revision: https://reviews.llvm.org/D47894 llvm-svn: 337433
* Remove scheduling dependency from XRay :: Posix/fork_basic_logging.ccMatthew Voss2018-07-191-2/+2
| | | | | | | | | | | | | | | | | | | Summary: We've been seeing intermittent failures on our internal bots and we suspect this may be due to the OS scheduling the child process to run before the parent process. This version ensures that the parent and child can be run in either order. Reviewers: Maknee, dberris Reviewed By: dberris Subscribers: delcypher, #sanitizers, Maknee, llvm-commits Differential Revision: https://reviews.llvm.org/D49501 llvm-svn: 337432
OpenPOWER on IntegriCloud