summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Remove ReadAfterLd from BMI and TBM instructions that don't have a ↵Craig Topper2018-03-292-4/+4
| | | | | | | | | | register operand in their memory form The memory form of these instructions only read an input from memory. They don't have any register operands. Differential Revision: https://reviews.llvm.org/D44836 llvm-svn: 328828
* [analyzer] Path-insensitive checker for writes into an auto-releasing pointerGeorge Karpenkov2018-03-294-0/+332
| | | | | | | | | | from the wrong auto-releasing pool, as such writes may crash. rdar://25301111 Differential Revision: https://reviews.llvm.org/D44722 llvm-svn: 328827
* [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).Eugene Zelenko2018-03-294-265/+249
| | | | llvm-svn: 328826
* Mark __cfi_check as dso_local.Rafael Espindola2018-03-292-0/+4
| | | | llvm-svn: 328825
* Try to fix sanitizer-x86_64-linux-fast bot due to change in r328820.Kevin Enderby2018-03-291-2/+2
| | | | llvm-svn: 328824
* [X86] Correct the placement of ReadAfterLd in BEXTR and BZHI. Add dedicated ↵Craig Topper2018-03-2912-72/+63
| | | | | | | | | | SchedRW for BEXTR/BZHI. These instructions have the memory operand before the register operand. So we need to put ReadDefault for all the load ops first. Then the ReadAfterLd Differential Revision: https://reviews.llvm.org/D44838 llvm-svn: 328823
* [NFC][LICM] Rearrange checks to have the cheap bail out firstPhilip Reames2018-03-291-6/+6
| | | | llvm-svn: 328822
* AMDGPU: Increase default stack alignmentMatt Arsenault2018-03-299-19/+24
| | | | | | | 8 and 16-byte values are common, so increase the default alignment to avoid realigning the stack in most functions. llvm-svn: 328821
* For llvm-nm and Mach-O files that are fully stripped, special case a ↵Kevin Enderby2018-03-293-2/+17
| | | | | | | | | | | | | | redacted LC_MAIN As a further refinement on: r328274 - For llvm-nm and Mach-O files also use function starts info in some cases when printing symbols we want to special case a redacted LC_MAIN so it is easier to find. rdar://38978929 llvm-svn: 328820
* [clangd] Fix repeated word typo. NFCFangrui Song2018-03-292-2/+2
| | | | llvm-svn: 328819
* AMDGPU: Fix selection error on constant loads with < 4 byte alignmentMatt Arsenault2018-03-293-6/+28
| | | | llvm-svn: 328818
* Simplify. NFC.Rui Ueyama2018-03-291-28/+11
| | | | llvm-svn: 328817
* Fix an accidental circular dependencePhilip Reames2018-03-291-1/+1
| | | | llvm-svn: 328816
* [Mips] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: sdardis, RKSimon, dsanders, atanasyan Reviewed By: atanasyan Subscribers: atanasyan, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44869 llvm-svn: 328815
* Try to fix a couple tests for Windows.Paul Robinson2018-03-292-6/+6
| | | | llvm-svn: 328814
* [SLPVectorizer] Add tests related to PR30787, NFCI.Dinar Temirbulatov2018-03-294-0/+390
| | | | llvm-svn: 328813
* [MSF] Default to FPM2, and always mark FPM pages allocated.Zachary Turner2018-03-294-40/+13
| | | | | | | | | | | | | | | | | | | | | | | | There are two FPMs in an MSF file, the idea being that for incremental updates you can write to the alternate one and then atomically swap them on commit. LLVM defaulted to using FPM1 on the first commit, but this differs from Microsoft's behavior which is to default to using FPM2 on the first commit. To eliminate some byte-level file differences, this patch changes LLVM's default to also be FPM2. Additionally, LLVM was trying to be "smart" about marking FPM pages allocated. In addition to marking every page belonging to the alternate FPM as unallocated, LLVM also marked pages at the end of the main FPM which were not needed as unallocated. In order to match the behavior of Microsoft-generated PDBs, we now always mark every FPM block as allocated, regardless of whether it is in the main FPM or the alt FPM, and regardless of whether or not it describes blocks which are actually in the file. This has the side benefit of simplifying our code. llvm-svn: 328812
* Exit early from a loop. NFC.Rui Ueyama2018-03-291-1/+1
| | | | | | | | This patch fixes an issue introduced in r328810 which made the algorithm to always run the loop O(n^2) times, though we can break early. The output remains the same. llvm-svn: 328811
* Refactor Writer::checkNoOverlappingSections. NFC.Rui Ueyama2018-03-291-47/+48
| | | | | | | This patch rewrites the function to remove lambda callbacks and use of template. The algorithm is the same as before. llvm-svn: 328810
* Generalize NRVO to cover C structs.Akira Hatanaka2018-03-2914-822/+481
| | | | | | | | | | | This commit generalizes NRVO to cover C structs (both trivial and non-trivial structs). rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D44968 llvm-svn: 328809
* [PDB] Print some more details when explaining MSF fields.Zachary Turner2018-03-292-7/+36
| | | | | | | | | | | When we determine that a field belongs to an MSF super block or the free page map, we wouldn't print any additional information. With this patch, we now print the value of the field (for super block fields) or the allocation status of the specified byte (in the case of offsets in the FPM). llvm-svn: 328808
* [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.Volodymyr Sapsai2018-03-299-45/+309
| | | | | | | | | | | | | | | | | | Deprecation replacement can be any text but if it looks like a name of ObjC method and has the same number of arguments as original method, replace all slot names so after applying a fix-it you have valid code. rdar://problem/36660853 Reviewers: aaron.ballman, erik.pilkington, rsmith Reviewed By: erik.pilkington Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D44589 llvm-svn: 328807
* [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to ↵Craig Topper2018-03-2962-69/+80
| | | | | | | | | | | | CodeGen layer. Currently EVT is in the IR layer only because of Function.cpp needing a very small piece of the functionality of EVT::getEVTString(). The rest of EVT is used in codegen making CodeGen a better place for it. The previous code converted a Type* to EVT and then called getEVTString. This was only expected to handle the primitive types from Type*. Since there only a few primitive types, we can just print them as strings directly. Differential Revision: https://reviews.llvm.org/D45017 llvm-svn: 328806
* Reapply "[DWARFv5] Emit file 0 to the line table."Paul Robinson2018-03-2920-137/+272
| | | | | | | | | | | | | | | | | DWARF v5 specifies that the root file (also given in the DW_AT_name attribute of the compilation unit DIE) should be emitted explicitly to the line table's list of files. This makes the line table more independent of the .debug_info section. We emit the new syntax only for DWARF v5 and later. Fixes the bug found by asan. Also XFAIL the new test for Darwin, which is stuck on DWARF v2, and fix up other tests so they stop failing on Windows. Last but not least, don't break "clang -g" of an assembler file that has .file directives in it. Differential Revision: https://reviews.llvm.org/D44054 llvm-svn: 328805
* [PDB] Fix a bug in the explain subcommand.Zachary Turner2018-03-292-12/+14
| | | | | | | | We were trying to dig into the super block fields and print a description of the field at the specified offset, but we were printing the wrong field due to an off-by-one-field-error. llvm-svn: 328804
* [ADT] NFC: Fix bogus StringSwitch rule-of-five boilerplateDavid Zarzycki2018-03-291-8/+5
| | | | | | | | | Now that 'Str' is constant, the rule-of-file logic needs updating. Reported by: vit9696@avp.su Reviewed by: jordan_rose@apple.com llvm-svn: 328803
* Remove unused function.Zachary Turner2018-03-291-8/+0
| | | | llvm-svn: 328802
* Set dso_local when clearing dllimport.Rafael Espindola2018-03-292-1/+5
| | | | llvm-svn: 328801
* Add a dllimport test.Rafael Espindola2018-03-291-0/+7
| | | | | | Thanks to rnk for the suggestion. llvm-svn: 328800
* [PDB] Add an explain subcommand.Zachary Turner2018-03-296-0/+371
| | | | | | | | | | | | | | | | | | | When investigating various things, we often have a file offset and what to know what's in the PDB at that address. For example we may be doing a binary comparison of two LLD-generated PDBs to look for sources of non-determinism, or we may wish to compare an LLD-generated PDB with a Microsoft generated PDB for sources of byte-for-byte incompatibility. In these cases, we can do a binary diff of the two files, and once we find a mismatched byte we can use explain to figure out what that byte is, immediately honining in on the problem. This patch implements this by trying to narrow the meaning of a particular file offset down as much as possible. Differential Revision: https://reviews.llvm.org/D44959 llvm-svn: 328799
* [JumpThreading] Don't select an edge that we know we can't threadHaicheng Wu2018-03-292-1/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In r312664 (D36404), JumpThreading stopped threading edges into loop headers. Unfortunately, I observed a significant performance regression as a result of this change. Upon further investigation, the problematic pattern looked something like this (after many high level optimizations): while (true) { bool cond = ...; if (!cond) { <body> } if (cond) break; } Now, naturally we want jump threading to essentially eliminate the second if check and hook up the edges appropriately. However, the above mentioned change, prevented it from doing this because it would have to thread an edge into the loop header. Upon further investigation, what is happening is that since both branches are threadable, JumpThreading picks one of them at arbitrarily. In my case, because of the way that the IR ended up, it tended to pick the one to the loop header, bailing out immediately after. However, if it had picked the one to the exit block, everything would have worked out fine (because the only remaining branch would then be folded, not thraded which is acceptable). Thus, to fix this problem, we can simply eliminate loop headers from consideration as possible threading targets earlier, to make sure that if there are multiple eligible branches, we can still thread one of the ones that don't target a loop header. Patch by Keno Fischer! Differential Revision: https://reviews.llvm.org/D42260 llvm-svn: 328798
* [test] Fix an XRay test on FreeBSDZhihao Yuan2018-03-291-1/+1
| | | | | | | | | | | | Summary: Fixing clang-test on FreeBSD as a follow-up of https://reviews.llvm.org/D43378 to handle the revert happened in r325749. Reviewers: devnexen, krytarowski, dberris Subscribers: emaste, dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D45002 llvm-svn: 328797
* .debug_names: Correctly align the AugmentationStringSize fieldPavel Labath2018-03-292-2/+102
| | | | | | | | | | | | | We should align the value of the field, not the overall section offset. This distinction matters if one of the debug_names contributions is not of size which is a multiple of four. The dwarf producers may choose to emit rounded contributions, but they are not required to do so. In the latter case, without this patch we would corrupt the parsing state, as we would adjust the offset even if subsequent contributions contained correctly rounded augmentation strings. llvm-svn: 328796
* Set calling convention for CUDA kernelYaxun Liu2018-03-2913-17/+92
| | | | | | | | | | | This patch sets target specific calling convention for CUDA kernels in IR. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44747 llvm-svn: 328795
* [ELF] - Add missing check calls to the tests.George Rimar2018-03-292-2/+4
| | | | llvm-svn: 328794
* Disable emitting static extern C aliases for amdgcn target for CUDAYaxun Liu2018-03-294-3/+19
| | | | | | | | | Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44987 llvm-svn: 328793
* [clangd] Mark "Source Hover" as implemented in the docsMarc-Andre Laperle2018-03-291-1/+1
| | | | | | | | | | | | | | Summary: Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewers: simark Reviewed By: simark Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D45044 llvm-svn: 328792
* Fix typoMatt Arsenault2018-03-292-9/+9
| | | | llvm-svn: 328791
* [llvm-mca] Correctly set the ReadAdvance information for register use operands.Andrea Di Biagio2018-03-297-37/+133
| | | | | | | | | | | | The tool was passing the wrong operand index to method MCSubtargetInfo::getReadAdvanceCycles(). That method requires a "UseIdx", and not the operand index. This was found when testing X86 code where instructions had a memory folded operand. This patch fixes the issue and adds test read-advance-1.s to ensure that the ReadAfterLd (a ReadAdvance of 3cy) information is correctly used. llvm-svn: 328790
* [ELF] Fix X86 & X86_64 PLT retpoline paddingAndrew Ng2018-03-296-20/+284
| | | | | | | | | | | | | | The PLT retpoline support for X86 and X86_64 did not include the padding when writing the header and entries. This issue was revealed when linker scripts were used, as this disables the built-in behaviour of filling the last page of executable segments with trap instructions. This particular behaviour was hiding the missing padding. Added retpoline tests with linker scripts. Differential Revision: https://reviews.llvm.org/D44682 llvm-svn: 328777
* [Hexagon] Aid bit-reverse load intrinsics lowering with bitcodeKrzysztof Parzyszek2018-03-295-23/+174
| | | | | | | | | | | The conversion of operatios to bitcode helps to eliminate an additional store in certain cases. We used to lower these load intrinsics in DAG to DAG conversion by which time, the "Dead Store Elimination" pass is already run. There is an associated LLVM patch. Patch by Sumanth Gundapaneni. llvm-svn: 328776
* [asan] Split the `throw_invoke_test.cc` into a Linux specific variantDan Liew2018-03-292-1/+48
| | | | | | | | | | | | and the general version to avoid use of libstdc++ on non-Linux platforms. This is motivated by the fact that using `libstdc++` is deprecated on Darwin and maybe removed some day. Differential Revision: https://reviews.llvm.org/D44733 llvm-svn: 328775
* [Hexagon] Add support to handle bit-reverse load intrinsicsKrzysztof Parzyszek2018-03-297-201/+237
| | | | | | Patch by Sumanth Gundapaneni. llvm-svn: 328774
* .debug_names: Parse DW_IDX_die_offset as a referencePavel Labath2018-03-298-17/+17
| | | | | | | | | | | Before this patch we were parsing the attributes as section offsets, as that is what apple_names is doing. However, this is not correct as DWARF v5 specifies that this attribute should use the Reference form class. This also updates all the testcases (except the ones that deliberately pass a different form) to use the correct form class. llvm-svn: 328773
* [Kaleidoscope] Tiny typo fixesSjoerd Meijer2018-03-295-14/+14
| | | | | | | | | | | Fixes for "lets" references which should be "let's" in the Kaleidoscope tutorial. Patch by: Robin Dupret Differential Revision: https://reviews.llvm.org/D44990 llvm-svn: 328772
* [X86][SSE] Don't bother re-adding combined target shuffles to the work listSimon Pilgrim2018-03-291-65/+16
| | | | | | | | | | We are re-adding all the bitcasts, constant masks and target shuffles to the work list for no apparent gain. Found while investigating adding SimplifyDemandedVectorElts to target shuffles. Differential Revision: https://reviews.llvm.org/D44942 llvm-svn: 328771
* NativeThreadProtocol: delete dead codePavel Labath2018-03-292-41/+0
| | | | | | | | | | | | These functions were unused as everyone just went straight for the direct operations on the register context. In fact, the Save/RestoreAllRegisters actually appear to be wrong (inverted). Thanks to Tatyana for pointing this out. These functions are not very useful now that we can guarantee that each thread always contains a valid register context, so I just delete them. llvm-svn: 328770
* Rename clang link from clang-X.Y to clang-XSylvestre Ledru2018-03-292-4/+7
| | | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. So, instead, I propose the following: Instead of having clang-7.0 in bin/, we will have clang-7 Since also matches was gcc is doing. Reviewers: tstellar, dlj, dim, hans Reviewed By: dim, hans Subscribers: dim, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41808 llvm-svn: 328769
* Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru2018-03-294-5/+8
| | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. Like patch https://reviews.llvm.org/D41808, I propose that we rename libLLVM-7.0svn.so to libLLVM-7svn.so This patch will also rename downstream libraries like liblldb-7.0 to liblldb-7 Reviewers: axw, beanz, dim, hans Reviewed By: dim, hans Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D41869 llvm-svn: 328768
* [Mips] Remove dead codeSimon Dardis2018-03-291-1/+0
| | | | | | | | | | | | I believe the role of ehDataReg has been replaced by MipsABIInfo::GetEhDataReg, thus removing the dead code. Patch By: Wei-Ren Chen. Reviewers: ehostunreach, sdardis Differential Revision: https://reviews.llvm.org/D44867 llvm-svn: 328767
OpenPOWER on IntegriCloud