summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[InstCombine] snprintf optimizations"Benjamin Kramer2018-05-093-230/+0
| | | | | | | | This reverts commit r331849. It miscompiles snprintf(buf, sizeof(buf), "%s", "any constant string); into memcpy(buf, "%s", sizeof("any constant string")); llvm-svn: 331866
* [DebugInfo] Mark tests using -debug-only as REQUIRES: assertsBenjamin Kramer2018-05-092-0/+2
| | | | llvm-svn: 331865
* [X86] Cleanup WriteFStore/WriteVecStore schedulesSimon Pilgrim2018-05-0914-137/+26
| | | | | | | | MOVNTPD/MOVNTPS should be WriteFStore Standardized BDW/HSW/SKL/SKX WriteFStore/WriteVecStore - fixes some missed instregex patterns. (V)MASKMOVDQU was already using the default, its costs gets increased but is still nowhere near the real cost of that nasty instruction.... llvm-svn: 331864
* [mips] Move conditional moves out of isCodeGenOnlySimon Dardis2018-05-096-28/+62
| | | | | | | | Reviewers: atanasyan, smaksimovic, abeserminji Differential Revision: https://reviews.llvm.org/D46389 llvm-svn: 331863
* [wasm] Update test for variables->retainedNodes rename.Benjamin Kramer2018-05-092-3/+3
| | | | | | This fixes the test after LLVM r331841. llvm-svn: 331862
* Revert r331843 "[DebugInfo] Generate debug information for labels."Hans Wennborg2018-05-095-83/+0
| | | | | | | | | | | | | | | | It broke the Chromium build (see reply on the review). > Generate DILabel metadata and call llvm.dbg.label after label > statement to associate the metadata with the label. > > Differential Revision: https://reviews.llvm.org/D45045 > > Patch by Hsiangkai Wang. This doesn't revert the change to backend-unsupported-error.ll that seems to correspond to an llvm-side change. llvm-svn: 331861
* [COFF] Improve correctness of def parsing for GNU featuresMartin Storsjo2018-05-091-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | The operator == used for exporting a function with a different name in the DLL compared to the name in the import library (which is useful for adding linker level aliases for function in the import library) is a feature distinct and different from the operator = used for exporting a function with a different name (both in import library and DLL) than in the implementation producing the DLL. When creating an import library using dlltool, from a def file that contains forwards (Func = OtherDll.Func), this shouldn't affect the produced import library, which should still behave just as if it was a normal exported function. This clears a lot of confusion and subtle misunderstandings, and avoids a parameter that was used to avoid creating weak aliases when invoked from lld. (This parameter was added previously due to the existing conflation of the two features.) Differential Revision: https://reviews.llvm.org/D46245 llvm-svn: 331860
* [COFF] Improve correctness of def parsing for GNU featuresMartin Storsjo2018-05-096-19/+40
| | | | | | | | | | | | | | | | | | | | | | | | The operator == used for exporting a function with a different name in the DLL compared to the name in the import library (which is useful for adding linker level aliases for function in the import library) is a feature distinct and different from the operator = used for exporting a function with a different name (both in import library and DLL) than in the implementation producing the DLL. When creating an import library using dlltool, from a def file that contains forwards (Func = OtherDll.Func), this shouldn't affect the produced import library, which should still behave just as if it was a normal exported function. This clears a lot of confusion and subtle misunderstandings, and avoids a parameter that was used to avoid creating weak aliases when invoked from lld. (This parameter was added previously due to the existing conflation of the two features.) Differential Revision: https://reviews.llvm.org/D46245 llvm-svn: 331859
* Revert "[Driver] Use -fuse-line-directives by default in MSVC mode"Martin Storsjo2018-05-092-3/+2
| | | | | | | | | | | | This reverts commit SVN r331666. It was afterwards pointed out in https://reviews.llvm.org/D46520 that #line directives lose information about what parts come from a system header. That means the result of -E usually won't compile, since Windows headers are typically full of warnings and default-error warnings. llvm-svn: 331858
* [clang-format] Respect BreakBeforeClosingBrace while calculating lengthKrasimir Georgiev2018-05-096-20/+135
| | | | | | | | | | | | | | | | | | Summary: This patch makes `getLengthToMatchingParen` respect the `BreakBeforeClosingBrace` ParenState for matching scope closers. In order to distinguish between paren states introduced by real vs. fake parens, I've added the token opening the ParensState to that struct. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D46519 llvm-svn: 331857
* [driver] Add mips_Features_Group to Options to improve documentation sortingSimon Atanasyan2018-05-091-57/+67
| | | | | | | | | | | | | | | | | | | Move all of the MIPS-only options into a new m_mips_Features_Group. Nearly all other targets have most target-specific options grouped, but MIPS does not. The primary benefits are that the options will be listed together (and thus identifiable as MIPS-specific even if they have no help string) in the ClangCommandLineReference, and that Options.td is a bit more organized. A secondary benefit is that a custom version of clang can more easily hide/disable groups of options for unsupported targets. Patch by Vince Del Vecchio Differential Revision: https://reviews.llvm.org/D46450 llvm-svn: 331856
* [DWARF] Align non-accelerated function fullname searching with the ↵Pavel Labath2018-05-093-46/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apple-tables path Summary: Before this patch the two paths were doing very different things - the apple path searched the .apple_names section, which contained mangled names, as well as basenames of all functions. It returned any name it found. - the non-accelerated path looked in the "full name" index we built ourselves, which contained mangled as well as demangled names of all functions (but no basenames). Then however, if it did not find a match it did an extra search in the basename index, with some special handling for anonymous namespaces. This aligns the two paths by changing the non-accelerated path to return the same results as in the apple-tables one. In pratice, this means we will search in both the "basename", "method" and "fullname" indexes (in the manual indexes these are separate indexes. This means the function will return some slightly inappropriate results (e.g. bar::baz::foo when one asks for a "full name" foo), but this can be handled by additional filtering, independently indexing method. I've also stopped inserting demangled names into the "fullname" index, as that is inconsistent with the apple path. Reviewers: clayborg, JDevlieghere Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D46576 llvm-svn: 331855
* Add a test for r331746.Hans Wennborg2018-05-092-0/+391
| | | | | | Thanks to pcc for creating the test file! llvm-svn: 331854
* [DebugInfo] Fix test failed due to debug-label-mi.ll and debug-label-opt.llShiva Chen2018-05-092-17/+13
| | | | | | | | | | Make these two test cases more generic for other architectures. Please refer to '[DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr.' Patch by Hsiangkai Wang llvm-svn: 331853
* [MergedLoadStoreMotion] Fix a debug invariant bug in mergeStoresBjorn Pettersson2018-05-092-1/+158
| | | | | | | | | | | | | | | | | | | | | | | | Summary: MergedLoadStoreMotion::mergeStores is using some heuristics to limit the amount of stores that it tries to sink (see MagicCompileTimeControl in MergedLoadStoreMotion.cpp). The heuristic involves counting the number of instructions in one of the basic blocks that is part of the transformation. We now ignore dbg intrinsics when counting instruction for the MagicCompileTimeControl heuristic. This to make sure that the amount of stores that are sunk doesn't depend on the amount of debug information (if -g is used or not). Reviewers: Gerolf, davide, majnemer Reviewed By: davide Subscribers: dberlin, bjope, aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D46600 llvm-svn: 331852
* [ELF][MIPS] Add test case to cover LA25 r6 thunks generation. NFCSimon Atanasyan2018-05-091-25/+59
| | | | llvm-svn: 331851
* [LLVM-C] Correct types in Go bindingsRobert Widmann2018-05-091-12/+12
| | | | | | | | | | | | Summary: Fixes a test failure introduced in rL331114. Reviewers: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46631 llvm-svn: 331850
* [InstCombine] snprintf optimizationsDavid Bolvansky2018-05-093-0/+230
| | | | | | | | | | | | Reviewers: spatel, efriedma, majnemer, rja Reviewed By: rja Subscribers: rja, llvm-commits Differential Revision: https://reviews.llvm.org/D46285 llvm-svn: 331849
* [DebugInfo] Fix test failed due to new DISubprogram attributes.Shiva Chen2018-05-091-1/+1
| | | | | | | | | | | Please refer to '[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label'. I have renamed the 'variables' attributes to 'retainedNodes' to include local variables and local labels for the function. Patch by Hsiangkai Wang. llvm-svn: 331848
* [X86] Combine (vXi1 (bitcast (-1)))) and (vXi1 (bitcast (0))) to all ones or ↵Craig Topper2018-05-092-0/+48
| | | | | | all zeros vXi1 vector. llvm-svn: 331847
* Revert r331816 and r331820 - [globalisel] Add a combiner helpers for ↵Daniel Sanders2018-05-0912-248/+2
| | | | | | | | | | extending loads and use them in a pre-legalize combiner for AArch64 Reverting this to see if the clang-cmake-aarch64-global-isel and clang-cmake-aarch64-quick bots are failing because of this commit. We know it wasn't r331819. llvm-svn: 331846
* _Atomic of empty struct shouldn't assertJF Bastien2018-05-093-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: An _Atomic of an empty struct is pretty silly. In general we just widen empty structs to hold a byte's worth of storage, and we represent size and alignment as 0 internally and let LLVM figure out what to do. For _Atomic it's a bit different: the memory model mandates concrete effects occur when atomic operations occur, so in most cases actual instructions need to get emitted. It's really not worth trying to optimize empty struct atomics by figuring out e.g. that a fence would do, even though sane compilers should do optimize atomics. Further, wg21.link/p0528 will fix C++20 atomics with padding bits so that cmpxchg on them works, which means that we'll likely need to do the zero-init song and dance for empty atomic structs anyways (and I think we shouldn't special-case this behavior to C++20 because prior standards are just broken). This patch therefore makes a minor change to r176658 "Promote atomic type sizes up to a power of two": if the width of the atomic's value type is 0, just use 1 byte for width and leave alignment as-is (since it should never be zero, and over-aligned zero-width structs are weird but fine). This fixes an assertion: (NumBits >= MIN_INT_BITS && "bitwidth too small"), function get, file ../lib/IR/Type.cpp, line 241. It seems like this has run into other assertions before (namely the unreachable Kind check in ImpCastExprToType), but I haven't reproduced that issue with tip-of-tree. <rdar://problem/39678063> Reviewers: arphaman, rjmccall Subscribers: aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D46613 llvm-svn: 331845
* [DebugInfo] Examine all uses of isDebugValue() for debug instructions.Shiva Chen2018-05-09106-217/+233
| | | | | | | | | | | | | | | | | | Because we create a new kind of debug instruction, DBG_LABEL, we need to check all passes which use isDebugValue() to check MachineInstr is debug instruction or not. When expelling debug instructions, we should expel both DBG_VALUE and DBG_LABEL. So, I create a new function, isDebugInstr(), in MachineInstr to check whether the MachineInstr is debug instruction or not. This patch has no new test case. I have run regression test and there is no difference in regression test. Differential Revision: https://reviews.llvm.org/D45342 Patch by Hsiangkai Wang. llvm-svn: 331844
* [DebugInfo] Generate debug information for labels.Shiva Chen2018-05-096-2/+85
| | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. Differential Revision: https://reviews.llvm.org/D45045 Patch by Hsiangkai Wang. llvm-svn: 331843
* [DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr.Shiva Chen2018-05-0915-2/+313
| | | | | | | | | | | | | | | | | | | | | In order to convert LLVM IR to MachineInstr, we need a new TargetOpcode, DBG_LABEL, to ‘lower’ intrinsic llvm.dbg.label. The patch creates this new TargetOpcode and convert intrinsic llvm.dbg.label to MachineInstr through SelectionDAG. In SelectionDAG, debug information is stored in SDDbgInfo. We create a new data member of SDDbgInfo for labels and use the new data member, SDDbgLabel, to create DBG_LABEL MachineInstr. The new DBG_LABEL MachineInstr uses label metadata from LLVM IR as its parameter. So, the backend could get metadata information of labels from DBG_LABEL MachineInstr. Differential Revision: https://reviews.llvm.org/D45341 Patch by Hsiangkai Wang. llvm-svn: 331842
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-09753-1293/+1698
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* [PPC64] Add lazy symbol resolution stubs.Sean Fertile2018-05-095-43/+102
| | | | | | | | | | | | | | | Adds support for .glink resolver stubs from the example implementation in the V2 ABI (Section 4.2.5.3. Procedure Linkage Table). The stubs are written to the PltSection, and the sections are renamed to match the PPC64 ABI: .got.plt --> .plt Type = SHT_NOBITS .plt --> .glink And adds the DT_PPC64_GLINK dynamic tag to the dynamic section when the plt is not empty. Differential Revision: https://reviews.llvm.org/D45642 llvm-svn: 331840
* Revert r331819 [GlobalISel][Legalizer] More concise and faster widenScalar, NFCRoman Tereshin2018-05-096-174/+248
| | | | | | | Reverting this to see if the clang-cmake-aarch64-global-isel and clang-cmake-aarch64-quick bots are failing because of this commit llvm-svn: 331839
* [RuntimeDyld][MachO] Properly handle thumb to thumb calls within a section.Lang Hames2018-05-092-37/+64
| | | | | | | | | | | Previously thumb bits were only checked for external relocations (thumb to arm code and vice-versa). This patch adds detection for thumb callees in the same section asthe (also thumb) caller. The MachO/Thumb test case is updated to cover this, and redundant checks (handled by the MachO/ARM test) are removed. llvm-svn: 331838
* Make CMakeLists.txt formatting more consistent with the rest of LLVM.Nico Weber2018-05-091-1/+2
| | | | llvm-svn: 331837
* fix path to llvm-cfi-verify unittests in docsNico Weber2018-05-091-2/+2
| | | | llvm-svn: 331836
* Make llvm-cfi-verify CMakeLists.txt formatting more consistent with the rest ↵Nico Weber2018-05-092-4/+7
| | | | | | of LLVM. llvm-svn: 331835
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-09606-14009/+14009
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimesPetr Hosek2018-05-091-0/+1
| | | | | | | | | | This doesn't make any difference since we don't use RPATH/RUNPATH on Fuchsia but it avoids the CMake error when re-linking libraries while building with Ninja. Differntial Revision: https://reviews.llvm.org/D46610 llvm-svn: 331833
* Support a funclet operand bundle in LowerInvokeHeejin Ahn2018-05-092-2/+43
| | | | | | | | | | | | | | | | | Summary: The current LowerInvoke pass cannot handle invoke instructions with a funclet bundle operand. The order of operands for an invoke instruction is {call arguments, callee, funclet operand (if any), normal dest, unwind dest}. The current code assumes there is no funclet operand and incorrectly includes a funclet operand into call arguments. Reviewers: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46242 llvm-svn: 331832
* [sanitizer] Remove unneeded blank linesVitaly Buka2018-05-099-9/+0
| | | | llvm-svn: 331831
* Inline contents of LLVM_XRAY_TOOLS variable into its only use.Nico Weber2018-05-091-8/+4
| | | | | | | No behavior change. https://reviews.llvm.org/D46402 llvm-svn: 331830
* [sanitizer] Update .clang-format in compiler-rtVitaly Buka2018-05-099-0/+18
| | | | | | Historically style is Google, but we never used AllowShortIfStatementsOnASingleLine. llvm-svn: 331829
* Fix test by adding -triple=x86_64-unknown-linuxSriraman Tallam2018-05-091-1/+1
| | | | llvm-svn: 331828
* [CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug infoPetr Hosek2018-05-091-3/+3
| | | | | | | | | | Don't hardcode objcopy and strip names, rather use CMAKE_OBJCOPY and CMAKE_STRIP variables which allows users to override the tools used such as using llvm-objcopy and llvm-strip instead of binutils versions. Differential Revision: https://reviews.llvm.org/D46611 llvm-svn: 331827
* [CMake] Include llvm-strip in Fuchsia toolchain distributionPetr Hosek2018-05-091-0/+1
| | | | | | | | Now that llvm-strip is available, include it in the Fuchsia toolchain. Differential Revision: https://reviews.llvm.org/D46612 llvm-svn: 331826
* [libFuzzer] Guard symbolization with try-lock.Matt Morehouse2018-05-086-13/+67
| | | | | | | | | | | | | | | | | | Summary: When out-of-memory or timeout occurs, threads can be stopped during symbolization, thereby causing a deadlock when the OOM/TO handlers attempt symbolization. We avoid this deadlock by skipping symbolization if another thread is symbolizing. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46605 llvm-svn: 331825
* [SimplifyCFG] Fix a crash when folding PHIs.Davide Italiano2018-05-082-4/+107
| | | | | | | | | | | | | | | | | | | | | | | | We enter MergeBlockIntoPredecessor with a block looking like this: for.inc.us-lcssa: ; preds = %cond.end %k.1.lcssa.ph = phi i32 [ %conv15, %cond.end ] %t.3.lcssa.ph = phi i32 [ %k.1.lcssa.ph, %cond.end ] br label %for.inc, !dbg !66 [note the first arg of the PHI being a PHI]. FoldSingleEntryPHINodes gets rid of both PHIs (calling, eraseFromParent). But right before we call the function, we push into IncomingValues the only argument of the PHIs, and shortly after we try to iterate over something which has been invalidated before :( The fix its not trying to remove PHIs which have an incoming value coming from the same BB we're looking at. Fixes PR37300 and rdar://problem/39910460 Differential Revision: https://reviews.llvm.org/D46568 llvm-svn: 331824
* New option -z keep-text-section-prefix to keep text sections with prefixes ↵Sriraman Tallam2018-05-084-3/+60
| | | | | | | | | | separate. Separate output sections for selected text section prefixes to enable TLB optimizations and for readablilty. Differential Revision: https://reviews.llvm.org/D45841 llvm-svn: 331823
* Partially revert r331456: [clang-tidy] Remove AnalyzeTemporaryDtors option.Roman Lebedev2018-05-082-0/+5
| | | | | | | | | | | | | | | | | | | That broke every single .clang-tidy config out there which happened to specify AnalyzeTemporaryDtors option: YAML:5:24: error: unknown key 'AnalyzeTemporaryDtors' AnalyzeTemporaryDtors: false ^~~~~ Error parsing <...>/.clang-tidy: Invalid argument More so, that error isn't actually a error, the clang-tidy does not exit with $? != 0, it continues with the default config. Surely this breakage isn't the intended behavior. But if it is, feel free to revert this commit. llvm-svn: 331822
* MC: Remove dead code. NFCI.Peter Collingbourne2018-05-081-1/+0
| | | | | | We should never emit an SHT_DYNSYM into an object file. llvm-svn: 331821
* [globalisel] Correct r331816 to check the opcode before calling getOperand().Daniel Sanders2018-05-081-4/+4
| | | | | | | | | Fix a silly mistake in my pre-commit changes for r331816. It should check what opcode the insn is before extracting the operands. NFC at the moment since the caller already checked the opcode. llvm-svn: 331820
* [GlobalISel][Legalizer] More concise and faster widenScalar, NFCRoman Tereshin2018-05-086-248/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring LegalizerHelper::widenScalar member function reducing its size by approximately a factor of 2 and (hopefuly) making it more straightforward and regular by introducing widenScalarSrc and widenScalarDst helper methods. The new widenScalar* methods mutate the instructions in place instead of recreating them from scratch and removing the originals. The compile time implications of this were measured on sqlite3 amalgamation, targeting AArch64 in -O0: LegalizerHelper::widenScalar: > 25% faster Legalizer::runOnMachineFunction: ~ 4.0 - 4.5% faster Also adding MachineOperand::setCImm and refactoring out MachineIRBuilder::recordInsertion methods to make the change possible. Reviewers: aditya_nandakumar, bogner, javed.absar, t.p.northover, ab, dsanders, arsenm Reviewed By: aditya_nandakumar Subscribers: wdng, rovka, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D46414 llvm-svn: 331819
* Revert "Emit an error when mixing <stdatomic.h> and <atomic>"Volodymyr Sapsai2018-05-082-31/+0
| | | | | | | It reverts commit r331379 because turned out `__ALLOW_STDC_ATOMICS_IN_CXX__` doesn't work well in practice. llvm-svn: 331818
* Add support for LTO plugin option obj-pathRumeet Dhindsa2018-05-084-7/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D46598 llvm-svn: 331817
OpenPOWER on IntegriCloud