summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Delete the pdb diff test.Zachary Turner2017-07-081-212/+0
| | | | | | | This is failing on Linux for unknown reasons, so I need to get the bots green while I investigate. llvm-svn: 307459
* [ODRHash] Support FriendDeclRichard Trieu2017-07-084-4/+159
| | | | llvm-svn: 307458
* Remove a variable that was only used in asserts and had a duplicate copy in ↵Eric Christopher2017-07-081-3/+2
| | | | | | something we did use anyhow. llvm-svn: 307457
* [X86] Move AVX512VPOPCNTDQ in __builtin_cpu_support's enum to match trunk gcc.Craig Topper2017-07-081-0/+2
| | | | | | | | There are two other features before it that we don't currently support in the the frontend or backend so I left placeholders to keep the encoding correct. I think the compiler-rt implementation of this feature is even further out of date. llvm-svn: 307456
* Fix warnings introduced by r307434.Richard Smith2017-07-082-1/+5
| | | | llvm-svn: 307455
* The x86 instruction unwinder can be asked to disassemble non-instruction Jason Molenda2017-07-083-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | blocks of memory, and if the final bytes of that block look like a long x86 instruction, it can cause the llvm disassembler to read past the end of the buffer. Use the maximum allowed instruction length that we pass to the llvm disassembler as a way to limit this to the size of the buffer. An example of how to trigger this is when lldb does a function call, it puts a breakpoint on the beginning of main() and uses that as the return address from the function call. When we stop at that location, lldb may try to find the first frame up the stack. Because this is on the first instruction of a function, it will get the word-size value at the stack pointer and assume that this was the caller's pc value. But this is random stack memory and could point to anything - an object in memory, something in the data section, whatever. And if we have a symbol for that thing, we'll try to disassemble it. This was leading to infrequent crashes in customer scenarios; figured out what was happening with address sanitizer. <rdar://problem/30463256> llvm-svn: 307454
* Add name offset flags, for parity with cvtres.exe.Eric Beckmann2017-07-073-4/+203
| | | | | | | | | | | | | | | | | | | Summary: The original cvtres.exe sets the high bit when an identifier offset points to a string. Even though this is not mentioned in the spec, and in fact does not seem to cause errors with most cases, for some reason this causes a failure in Chromium where the new resource file is not verified as a new version. This patch sets this high bit flag, and also adds a test case to check that the output of our library is always identical to original cvtres. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35099 llvm-svn: 307452
* [InstCombine] Make InstCombine's IRBuilder be passed by reference everywhereCraig Topper2017-07-0714-793/+778
| | | | | | | | Previously the InstCombiner class contained a pointer to an IR builder that had been passed to the constructor. Sometimes this would be passed to helper functions as either a pointer or the pointer would be dereferenced to be passed by reference. This patch makes it a reference everywhere including the InstCombiner class itself so there is more inconsistency. This a large, but mechanical patch. I've done very minimal formatting changes on it despite what clang-format wanted to do. llvm-svn: 307451
* Fix diagnostic in verify test to match new Clang outputEric Fiselier2017-07-071-1/+1
| | | | llvm-svn: 307450
* Revert r307445 as it breaks on certain platforms.Dehao Chen2017-07-072-39/+6
| | | | llvm-svn: 307449
* Make sure SANITIZER_MIN_OSX_VERSION is defined before using it.Kuba Mracek2017-07-071-1/+1
| | | | llvm-svn: 307448
* [MS] Don't statically initialize dllimport member function pointersReid Kleckner2017-07-073-40/+63
| | | | | | | | | | | | | | | | | | | | Summary: r306137 made dllimport pointers to member functions non-constant. This is correct because a load must be executed to resolve any dllimported data. However, r306137 did not account for the use of dllimport member function pointers used as template arguments. This change re-lands r306137 with a template instantiation fix. This fixes PR33570. Reviewers: rnk, majnemer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34714 llvm-svn: 307446
* Add sample PGO integration test to cover profile annotation and inlining.Dehao Chen2017-07-072-6/+39
| | | | | | | | | | | | | | Summary: The patch makes the integration test cover major sample PGO components. Reviewers: davidxl Reviewed By: davidxl Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D34725 llvm-svn: 307445
* Add testcase for r305850.Lang Hames2017-07-072-0/+16
| | | | | | Accidentally left this out of the original commit. llvm-svn: 307444
* Update buildgo.sh to pass -isysroot on Darwin.Kuba Mracek2017-07-071-1/+1
| | | | llvm-svn: 307443
* [PowerPC] NFC : Common up definitions of isIntS16Immediate and update ↵Lei Huang2017-07-073-30/+14
| | | | | | parameter to int16_t llvm-svn: 307442
* remove deprecated register storage class specifierEd Maste2017-07-077-148/+148
| | | | | | | | | | While importing libomp into the FreeBSD base system we encountered Clang warnings that "'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]". Differential Revision: https://reviews.llvm.org/D35124 llvm-svn: 307441
* ProfData: Fix some unchecked Errors in unit testsDavid Blaikie2017-07-073-124/+146
| | | | | | | | | | | | | | | | | | | | | The 'NoError' function was meant to be used as the input to ASSERT/EXPECT_TRUE, but it is easy to forget this (it could be annotated with nodiscard to help this) so many sites that look like they're checked are not (& silently discard the failure). Only one site actually has an Error sneaking out this way and I've replaced that one with a FIXME+consumeError. The rest of the code has been modified to use the EXPECT_THAT_ERROR macros Zach introduced a while back. Between the options available this seems OK/good/something to standardize on - though it's difficult to build a matcher that could handle checking for a specific llvm::Error result, so those remain using the custom ErrorEquals (& the nodiscard added to ensure it is not misused as it was previous to this patch). It could still be generalized a bit further (even not as far as a matcher, but at least support multiple kinds of Error, etc) & added to the general Error utility header. llvm-svn: 307440
* Increase the import-threshold for crtical functions.Dehao Chen2017-07-075-4/+18
| | | | | | | | | | | | | | Summary: For interative sample-pgo, if a hot call site is inlined in the profiling binary, we should inline it in before profile annotation in the backend. Before that, the compile phase first collects all GUIDs that needs to be imported and creates virtual "hot" call edge in the summary. However, "hot" is not good enough to guarantee the callsites get inlined. This patch introduces "critical" call edge, and assign much higher importing threshold for those edges. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: sanjoy, mehdi_amini, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D35096 llvm-svn: 307439
* Enable the new PM + SamlePGO + ThinLTO testing.Dehao Chen2017-07-071-3/+1
| | | | | | | | | | | | | | Summary: This patch should be enabled after https://reviews.llvm.org/D34895 Reviewers: chandlerc, tejohnson, davidxl Reviewed By: tejohnson Subscribers: sanjoy, mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D34896 llvm-svn: 307438
* Add sample PGO support to ThinLTO new pass manager.Dehao Chen2017-07-072-15/+40
| | | | | | | | | | | | | | | | | | | | | Summary: For SamplePGO + ThinLTO, because profile annotation is done twice at both PrepareForThinLTO pipeline and backend compiler, the following changes are needed at the PrepareForThinLTO phase to ensure the IR is not changed dramatically. Otherwise the profile annotation will be inaccurate in the backend compiler. * disable hot-caller heuristic * disable loop unrolling * disable indirect call promotion This will unblock the new PM testing for sample PGO (tools/clang/test/CodeGen/pgo-sample-thinlto-summary.c), which will be covered in another cfe patch. Reviewers: chandlerc, tejohnson, davidxl Reviewed By: tejohnson Subscribers: sanjoy, mehdi_amini, Prazek, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D34895 llvm-svn: 307437
* [PDB] More changes to bring lld PDBs to parity with MSVC.Zachary Turner2017-07-076-26/+21
| | | | | | | | | | | | | | | | | | | 1) Don't write a /src/headerblock stream. This appears to be written conditionally by MSVC, but it's not clear what the condition is. For now, just remove it since we dont' know what it is anyway and the particular pdb we've checked in for the test doesn't have one. 2) Write a valid timestamp for the PDB file signature. This leads to non-reproducible builds, but it matches the default behavior of link, so it should be out default as well. If we need reproducibility, we should add a separate command line option for it that is off by default. 3) Write an empty FPO stream. MSVC seems to always write an FPO stream. This change makes the stream directory match up, although we still need to make the contents of the FPO stream match. llvm-svn: 307436
* [LoopUnrollRuntime] Support multiple exit blocks unrolling when prolog ↵Anna Thomas2017-07-072-81/+165
| | | | | | | | | | | | | | | remainder generated With the NFC refactoring in rL307417 (git SHA 987dd01), all the logic is in place to support multiple exit/exiting blocks when prolog remainder is generated. This patch removed the assert that multiple exit blocks unrolling is only supported when epilog remainder is generated. Also, added test runs and checks with PROLOG prefix in runtime-loop-multiple-exits.ll test cases. llvm-svn: 307435
* [modules ts] Basic for module linkage.Richard Smith2017-07-079-27/+198
| | | | | | | | | | In addition to the formal linkage rules, the Modules TS includes cases where internal-linkage symbols within a module interface unit can be referenced from outside the module via exported inline functions / templates. We give such declarations "module-internal linkage", which is formally internal linkage, but results in an externally-visible symbol. llvm-svn: 307434
* [PatternMatch] Implemenet m_SignMask using Constant::isMinSignedValue ↵Craig Topper2017-07-071-10/+11
| | | | | | instead of doing splat detection and analyzing the resulting APInt. llvm-svn: 307433
* [PatternMatch] Implement m_AnyZero using Constant::isZeroValue instead of ↵Craig Topper2017-07-071-4/+10
| | | | | | ORing together isNullValue and isNegativeZeroValue. NFCI llvm-svn: 307432
* [PatternMatch] Implement m_One and m_AllOnes using ↵Craig Topper2017-07-071-18/+22
| | | | | | | | Constant::isOneValue/isAllOnesValue instead of doing our own splat detection and checking the resulting APInt. Should result in less compiled code. llvm-svn: 307431
* [APInt] Add a fastpath for the single word case of isOneValue to match ↵Craig Topper2017-07-071-1/+5
| | | | | | isNullValue, isAllOnesValue, etc. NFCI llvm-svn: 307430
* [DAGCombiner] use local variable to shorten code; NFCISanjay Patel2017-07-071-36/+31
| | | | llvm-svn: 307429
* [RegAllocFast] Don't insert kill flags of super-register for partial killQuentin Colombet2017-07-072-2/+43
| | | | | | | | | | | | | | | | | When reusing a register for a new definition, the fast register allocator used to insert a kill flag at the previous last use of that register to inform later passes that this register is free between the redef and the last use. However, this may be wrong when subregisters are involved. Indeed, a partially redef would have trigger a kill of the full super register, potentially wrongly marking all the other subregisters as free. Given we don't track which lanes are still live, we cannot set the kill flag in such case. Note: This bug has been latent for about 7 years (r104056). llvmg.org/PR33677 llvm-svn: 307428
* [RegAllocFast] Add the proper initialize method to use the .mir infrastructureQuentin Colombet2017-07-074-0/+6
| | | | | | NFC llvm-svn: 307427
* [llvm-pdbutil] Fix build.Zachary Turner2017-07-072-216/+227
| | | | | | | | | | Some platforms require an explicit specialization of std::hash for PdbRaw_FeaturesSig. Also a test involving case sensitivity needed to be fixed. For now that particular check just accepts any path even if they're completely different. Long term we should output paths in the correct case to match MSVC. llvm-svn: 307426
* [Local] Update the comment for removeUnreachableBlocks.Davide Italiano2017-07-071-2/+3
| | | | | | | It referenced a wrong function name, and didn't mention what the second argument did. This should be slightly more accurate now. llvm-svn: 307425
* FuzzerUtilDarwin.cpp: We need to pass modifiable strings to posix_spawnMatthias Braun2017-07-071-2/+11
| | | | | | | | This fixes a bug where unmodifiable strings where passed to posix_spawn. This is an attempt to unbreak the greendragon libFuzzer bot. llvm-svn: 307424
* Use windows path syntax when writing PDB module name.Zachary Turner2017-07-074-46/+74
| | | | | | | | | | | | | | Without this we would just append whatever the user wrote on the command line, so if we're in C:\foo and we run lld-link bar/baz.obj, we would write C:\foo\bar/baz.obj in various places in the PDB. MSVC linker does not do this, so we shouldn't either. This fixes some differences in the diff test, so we update the test as well. Differential Revision: https://reviews.llvm.org/D35092 llvm-svn: 307423
* Fix some differences between lld and MSVC generated PDBs.Zachary Turner2017-07-0716-51/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of things were different about our generated PDBs. 1) We were outputting the wrong Version on the PDB Stream. The version we were setting was newer than what MSVC is setting. It's not clear what the implications are, but we change LLD to use PdbImplVC70, as MSVC does. 2) For the optional debug stream indices in the DBI Stream, we were outputting 0 to mean "the stream is not present". MSVC outputs uint16_t(-1), which is the "correct" way to specify that a stream is not present. So we fix that as well. 3) We were setting the PDB Stream signature to 0. This is supposed to be the result of calling time(nullptr). Although this leads to non-deterministic builds, a better way to solve that is by having a command line option explicitly for generating a reproducible build, and have the default behavior of lld-link match the default behavior of link. To test this, I'm making use of the new and improved `pdb diff` sub command. To make it suitable for writing tests against, I had to modify the diff subcommand slightly to print less verbose output. Previously it would always print | <column> | <value1> | <value2> | which is quite verbose, and the values are fragile. All we really want to know is "did we produce the same value as link?" So I added command line options to print a single character representing the result status (different, identical, equivalent), and another to hide the value display. Note that just inspecting the diff output used to write the test, you can see some things that are obviously wrong. That is just reflective of the fact that this is the state of affairs today, not that we're asserting that this is "correct". We can use this as a starting point to discover differences, fix them, and update the test. Differential Revision: https://reviews.llvm.org/D35086 llvm-svn: 307422
* [llvm-pdbutil] Improve diff mode.Zachary Turner2017-07-079-264/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're getting to the point that some MS tools (e.g. DIA) can recognize our PDBs but others (e.g. link.exe) cannot. I think the way forward is to improve our tooling to help us find differences more easily. For example, if we can compile the same program with clang-cl and cl and have a tool tell us all the places where the PDBs differ, this could tell us what we're doing wrong. It's tricky though, because there are a lot of "benign" differences in a PDB. For example, if the string table in one PDB consists of "foo" followed by "bar" and in the other PDB it consists of "bar" followed by "foo", this is not necessarily a critical difference, as long as the uses of these strings also refer to the correct location. On the other hand, if the second PDB doesn't even contain the string "foo" at all, this is a critical difference. diff mode has been in llvm-pdbutil for quite a while, but because of the above challenge along with some others, it's been hard to make it useful. I think this patch addresses that. It looks for all the same things, but it now prints the output in tabular format (carefully formatted and aligned into tables and fields), and it highlights critical differences in red, non-critical differences in yellow, and identical fields in green. This makes it easy to spot the places we differ, and the general concept of outputting arbitrary fields in tabular format can be extended to provide analysis into many of the different types of information that show up in a PDB. Differential Revision: https://reviews.llvm.org/D35039 llvm-svn: 307421
* [X86] Replace 'fallthrough' comments with LLVM_FALLTHROUGH.Craig Topper2017-07-071-6/+6
| | | | llvm-svn: 307420
* vim: add 'builtin', 'nobuiltin', 'nonnull', and 'speculatable' to the ↵Craig Topper2017-07-071-0/+4
| | | | | | keyword list. llvm-svn: 307419
* [cloning] Do not duplicate types when cloning functionsGor Nishanov2017-07-072-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an addon to the change rl304488 cloning fixes. (Originally rl304226 reverted rl304228 and reapplied rl304488 https://reviews.llvm.org/D33655) rl304488 works great when DILocalVariables that comes from the inlined function has a 'unique-ed' type, but, in the case when the variable type is distinct we will create a second DILocalVariable in the scope of the original function that was inlined. Consider cloning of the following function: ``` define private void @f() !dbg !5 { %1 = alloca i32, !dbg !11 call void @llvm.dbg.declare(metadata i32* %1, metadata !14, metadata !12), !dbg !18 ret void, !dbg !18 } !14 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !17) ; came from an inlined function !15 = distinct !DISubprogram(name: "inlined", linkageName: "inlined", scope: null, file: !6, line: 8, type: !7, isLocal: true, isDefinition: true, scopeLine: 9, isOptimized: false, unit: !0, variables: !16) !16 = !{!14} !17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32) ``` Without this fix, when function 'f' is cloned, we will create another DILocalVariable for "inlined", due to its type being distinct. ``` define private void @f.1() !dbg !23 { %1 = alloca i32, !dbg !26 call void @llvm.dbg.declare(metadata i32* %1, metadata !28, metadata !12), !dbg !30 ret void, !dbg !30 } !14 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !17) !15 = distinct !DISubprogram(name: "inlined", linkageName: "inlined", scope: null, file: !6, line: 8, type: !7, isLocal: true, isDefinition: true, scopeLine: 9, isOptimized: false, unit: !0, variables: !16) !16 = !{!14} !17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32) ; !28 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !29) ; OOPS second DILocalVariable !29 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32) ``` Now we have two DILocalVariable for "inlined" within the same scope. This result in assert in AsmPrinter/DwarfDebug.h:131: void llvm::DbgVariable::addMMIEntry(const llvm::DbgVariable &): Assertion `V.Var == Var && "conflicting variable"' failed. (Full example: See: https://bugs.llvm.org/show_bug.cgi?id=33492) In this change we prevent duplication of types so that when a metadata for DILocalVariable is cloned it will get uniqued to the same metadate node as an original variable. Reviewers: loladiro, dblaikie, aprantl, echristo Reviewed By: loladiro Subscribers: EricWF, llvm-commits Differential Revision: https://reviews.llvm.org/D35106 llvm-svn: 307418
* [LoopUnrollRuntime] NFC: use the precomputed loop exit in ConnectPrologAnna Thomas2017-07-071-11/+11
| | | | | | | | | Minor refactoring to use the preexisting loop exit that's already calculated. We do not need to recompute the loop exit in ConnectProlog. Apart from avoiding redundant computation, this is required for supporting multiple loop exits when Prolog remainder loops are generated. llvm-svn: 307417
* [PPC CodeGen] Expand the bitreverse.i32 intrinsic.Tony Jiang2017-07-075-23/+180
| | | | | | | Differential Revision: https://reviews.llvm.org/D33572 Fix PR: https://bugs.llvm.org/show_bug.cgi?id=33093 llvm-svn: 307413
* [LTO] Add a test for ThinLTO + --defsym.Davide Italiano2017-07-071-0/+14
| | | | | | We also get this right since r307303. llvm-svn: 307412
* Fix some more -Wimplicit-fallthrough warnings. NFCI.Simon Pilgrim2017-07-074-5/+9
| | | | llvm-svn: 307411
* [LTO] Add a test for ThinLTO + --wrap.Davide Italiano2017-07-072-0/+21
| | | | | | | | We should get this right after r307303. Differential Revision: https://reviews.llvm.org/D35126 llvm-svn: 307410
* [ARM] Implement interleaved access bug fix from r306334Matthew Simpson2017-07-072-1/+32
| | | | | | | r306334 fixed a bug in AArch64 dealing with wide interleaved accesses having pointer types. The bug also exists in ARM, so this patch copies over the fix. llvm-svn: 307409
* Fix-up for r307307: vm_info.max_address is the first non-addressable ↵Kuba Mracek2017-07-071-1/+1
| | | | | | pointer, so we need to subtract one. llvm-svn: 307408
* [AMDGPU] Assembler: refactor convert methods (VOP3 and MIMG)Sam Kolton2017-07-072-125/+57
| | | | | | | | | | | | Summary: Simplified converter methods for VOP3 and MIMG. Reviewers: dp, artem.tamazov Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, vpykhtin, t-tye Differential Revision: https://reviews.llvm.org/D35047 llvm-svn: 307407
* Fix variable names. NFC.Rafael Espindola2017-07-071-18/+18
| | | | llvm-svn: 307406
* [MachO] Add missing byte-swaps when reading dyld_infoTom Stellard2017-07-071-3/+3
| | | | | | | | | | | | | | | | | | | | Summary: This fixes the following tests on big-endian hosts: lld :: mach-o/dylib-install-names.yaml lld :: mach-o/force_load-dylib.yaml lld :: mach-o/lib-search-paths.yaml lld :: mach-o/upward-dylib-load-command.yaml Reviewers: lhames, kledzik, ruiu Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35022 llvm-svn: 307405
OpenPOWER on IntegriCloud