aboutsummaryrefslogtreecommitdiff
path: root/unittests
AgeCommit message (Collapse)Author
2018-03-29Style update. NFC.Rafael Espindola
Rename 3 functions to start with lowercase letters. Don't repeat the name in the comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328848 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29[MSF] Default to FPM2, and always mark FPM pages allocated.Zachary Turner
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328812 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29[IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to ↵Craig Topper
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328806 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ORC] Restore the narrower check from before r328687.Lang Hames
This should get the builders green again while I investigate why r328706 was insufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328711 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[PatternMatch] Add matchers for vector operationsDaniel Neilson
Summary: There aren't any matchers for the three vector operations: insertelement, extractelement, and shufflevector. This patch adds them as well as corresponding unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328709 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ORC] Re-add the Windows check that was dropped in r328687.Lang Hames
This check prevents the ORC execution tests from running on Windows (which is not supported yet). This should fix the windows bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328706 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[ORC] Fix ORC on platforms without indirection support.Lang Hames
Previously this crashed because a nullptr (returned by createLocalIndirectStubsManagerBuilder() on platforms without indirection support) functor was unconditionally invoked. Patch by Andres Freund. Thanks Andres! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328687 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27[YAML] Remove unit test of multibyte non-printable escaping that uses C++11 ↵Graydon Hoare
escapes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328665 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27[YAML] Escape non-printable multibyte UTF8 in Output::scalarString.Graydon Hoare
The existing YAML Output::scalarString code path includes a partial and incorrect implementation of YAML escaping logic. In particular, the logic put in place in rL321283 escapes non-printable bytes only if they are not part of a multibyte UTF8 sequence; implicitly this means that all multibyte UTF8 sequences -- printable and non -- are passed through verbatim. The simplest solution to this is to direct the Output::scalarString method to use the standalone yaml::escape function, and this _almost_ works, except that the existing code in that function _over_ escapes: any multibyte UTF8 sequence is escaped, even printable ones. While this is permitted for YAML, it is also more aggressive (and hard to read for non-English locales) than necessary, and the entire point of rL321283 was to back off such aggressive over-escaping. So in this change, I have both redirected Output::scalarString to use yaml::escape _and_ modified yaml::escape to optionally restrict its escaping to non-printables. This preserves behaviour of any existing clients while giving them a path to more moderate escaping should they desire. Reviewers: JDevlieghere, thegameg, MatzeB, vladimir.plyashkun Reviewed By: thegameg Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44863 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26[DebugInfoPDB] Add DIA implementation of findLineNumbersByRVAAaron Smith
This method is used to find line numbers for PDBSymbolData that have an invalid virtual address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328586 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26[DebugInfoPDB] Add DIA implementation of addressForVA and addressForRVAAaron Smith
These are used in finding line numbers for PDBSymbolData git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23Fix layering by moving ValueTypes.h from CodeGen to IRDavid Blaikie
ValueTypes.h is implemented in IR already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328397 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23Fix layering of MachineValueType.h by moving it from CodeGen to SupportDavid Blaikie
This is used by llvm tblgen as well as by LLVM Targets, so the only common place is Support for now. (maybe we need another target for these sorts of things - but for now I'm at least making them correct & we can make them better if/when people have strong feelings) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328395 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23[AMDGPU] Remove use of OpenCL triple environment and replace with function ↵Tony Tye
attribute for AMDGPU - Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target. - Use function attribute to communicate to the AMDGPU backend to add implicit arguments for OpenCL kernels for the AMDHSA OS. Differential Revision: https://reviews.llvm.org/D43736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328349 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23[ORC] Join materialization thread in unit testBenjamin Kramer
There's are race between this thread and the destructor of the test ORC components on the main threads. I saw flaky failures there in about 4% of the runs of this unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328300 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22[MIR] Making MIR Printing, opt -dot-cfg, and -debug printing fasterRoman Tereshin
Value::printAsOperand has been scanning the entire module just to print a single value as an operand, regardless being asked to print a type or not at all, and regardless really needing to scan the module to print a type. It made some of the users of the method exceptionally slow on large IR-modules (or large MIR-files with large IR-modules embedded). This patch defers scanning a module looking for struct types, mostly numbered struct types, as much as possible, speeding up those users w/o changing any APIs at all. See speedup examples below: Release Build: # 83 seconds -> 5.5 seconds time ./bin/llc -start-before=irtranslator -stop-after=irtranslator \ -global-isel -global-isel-abort=2 -simplify-mir sqlite3.O0.ll -o \ sqlite3.O0.ll.regbankselected.mir # 133 seconds -> 6.2 seconds time ./bin/opt sqlite3.O0.ll -dot-cfg -disable-output Release + Asserts Build: # 95 seconds -> 5.5 seconds time ./bin/llc -start-before=irtranslator -stop-after=irtranslator \ -global-isel -global-isel-abort=2 -simplify-mir sqlite3.O0.ll -o \ sqlite3.O0.ll.regbankselected.mir # 146 seconds -> 6.2 seconds time ./bin/opt sqlite3.O0.ll -dot-cfg -disable-output # 1096 seconds -> 553 seconds time ./bin/llc -debug-only=isel -fast-isel=false -stop-after=isel \ sqlite3.O0.ll -o /dev/null 2> err where sqlite3.O0.ll is non-optimized IR produced from sqlite-amalgamation (http://sqlite.org/download.html), which is entire SQLite3 implementation in a single C-file. Benchmarked on 4-cores / 8 threads PCI-E SSD iMac running macOS Reviewers: dexonsmith, bkramer, void, chandlerc, aditya_nandakumar, dsanders, qcolombet, Reviewed By: bogner Subscribers: thegameg, llvm-commits Differential Revision: https://reviews.llvm.org/D44132 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328246 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22Revert "Revert "[InstrProf] Support for external functions in text format.""Mircea Trofin
Summary: This reverts commit 364eb09576a7667bc6d3ff80c52a83014ccac976 and separates out the portion that was fixing binary reader error propagation - turns out, there are production cases where that causes a regression. Will re-introduce the error propagation fix separately. The fix to the text reader error propagation is still "in". Reviewers: bkramer Reviewed By: bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44807 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328244 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22Revert "[InstrProf] Support for external functions in text format."Benjamin Kramer
This reverts commit r328132. Breaks FDO selfhost. I'm seeing error: /tmp/profraw: Invalid instrumentation profile data (bad magic) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328207 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22[DIA] Add IPDBSectionContrib interfaces and DIA implementationAaron Smith
To resolve symbol context at a particular address, we need to determine the compiland for the address. We are able to determine the parent compiland of PDBSymbolFunc, PDBSymbolTypeUDT, PDBSymbolTypeEnum symbols indirectly through line information. However no such information is availabile for PDBSymbolData, i.e. variables. The Section Contribution table from PDBs has information about each compiland's contribution to sections by address. For example, a piece of a contribution looks like, VA RelativeVA Sect No. Offset Length Compiland 14000087B0 000087B0 0001 000077B0 000000BB exe_main.obj So given an address, it's possible to determine its compiland with this information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328178 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21Fix a couple of layering violations in TransformsDavid Blaikie
Remove #include of Transforms/Scalar.h from Transform/Utils to fix layering. Transforms depends on Transforms/Utils, not the other way around. So remove the header and the "createStripGCRelocatesPass" function declaration (& definition) that is unused and motivated this dependency. Move Transforms/Utils/Local.h into Analysis because it's used by Analysis/MemoryBuiltins.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328165 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21[InstrProf] Encapsulates access to AddrToMD5Map.Mircea Trofin
Summary: This fixes a unittest failure introduced by D44717 D44717 introduced lazy sorting of the internal data structures of the symbol table. The AddrToMD5Map getter was potentially exposing inconsistent (unsorted) state. We could sort in the accessor, however, a client may store the pointer and thus bypass the internal state management of the symbol table. The alternative in this CL blocks direct access to the state, thus ensuring consistent externally-observable state. Reviewers: davidxl, xur, eraman Reviewed By: xur Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44757 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21[PDB] Don't ignore bucket 0 when writing the PDB string table.Zachary Turner
The hash table is a list of buckets, and the *value* stored in the bucket cannot be 0 since that is reserved. However, the code here was incorrectly skipping over the 0'th bucket entirely. The 0'th bucket is perfectly fine, just none of these buckets can contain the value 0. As a result, whenever there was a string where hash(S) % Size was equal to 0, we would write the value in the next bucket instead. We never caught this in our tests due to *another* bug, which is that we would iterate the entire list of buckets looking for the value, only using the hash value as a starting point. However, the real algorithm stops when it finds 0 in a bucket since it takes that to mean "the item is not in the hash table". The unit test is updated to carefully construct a set of hash values that will cause one item to hash to 0 mod bucket count, and the reader is also updated to return an error indicating that the item is not found when it encounters a 0 bucket. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328162 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21[InstrProf] Support for external functions in text format.Mircea Trofin
Summary: External functions appearing as indirect call targets could not be found in the SymTab, and the value:counter record was represented, in the text format, using an empty string for the name. This would then cause a silent parsing error when reading. This CL: - adds explicit support for such functions - fixes the places where we would not propagate errors when reading - addresses a performance issue due to eager resorting of the SymTab. Reviewers: xur, eraman, davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44717 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21[dwarf] Unify unknown dwarf enum formatting codePavel Labath
Summary: We have had at least three pieces of code (in DWARFAbbreviationDeclaration, DWARFAcceleratorTable and DWARFDie) that have hand-rolled support for dumping unknown dwarf enum values. While not terrible, they are a bit distracting and enable small differences to creep in (Unknown_ffff vs. Unknown_0xffff). I ended up needing to add a fourth place (DWARFVerifier), so it seems it would be a good time to centralize. This patch creates an alternative to the XXXString dumping functions in the BinaryFormat library, which formats an unknown value as DW_TYPE_unknown_1234, instead of just an empty string. It is based on the formatv function, as that allows us to avoid materializing the string for unknown values (and because this way I don't have to invent a name for the new functions :P). In this patch I add formatters for dwarf attributes, forms, tags, and index attributes as these are the ones in use currently, but adding other enums is straight-forward. Reviewers: dblaikie, JDevlieghere, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44570 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328090 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20[ORC] Rename SymbolSource to MaterializationUnit, and make the materializationLang Hames
operation all-or-nothing, rather than allowing materialization on a per-symbol basis. This addresses a shortcoming of per-symbol materialization: If a MaterializationUnit (/SymbolSource) wants to materialize more symbols than requested (which is likely: most materializers will want to materialize whole modules) then it needs a way to notify the symbol table about the extra symbols being materialized. This process (checking what has been requested against what is being provided and notifying the symbol table about the difference) has to be repeated at every level of the JIT stack. Making materialization all-or-nothing eliminates this issue, simplifying both materializer implementations and the symbol table (VSO class) API. The cost is that per-symbol materialization (e.g. for individual symbols in a module) now requires multiple MaterializationUnits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-16[IR] Avoid the need to prefix MS C++ symbols with '\01'Reid Kleckner
Now the Windows mangling modes ('w' and 'x') do not do any mangling for symbols starting with '?'. This means that clang can stop adding the hideous '\01' leading escape. This means LLVM debug logs are less likely to contain ASCII escape characters and it will be easier to copy and paste MS symbol names from IR. Finally. For non-Windows platforms, names starting with '?' still get IR mangling, so once clang stops escaping MS C++ names, we will get extra '_' prefixing on MachO. That's fine, since it is currently impossible to construct a triple that uses the MS C++ ABI in clang and emits macho object files. Differential Revision: https://reviews.llvm.org/D7775 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327734 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-16HashTableTest: squelch some "comparison of integers of different signs" warningsPavel Labath
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327701 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-15Fix structure alignment issue.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327666 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-15Refactor the PDB HashTable class.Zachary Turner
It previously only worked when the key and value types were both 4 byte integers. We now have a use case for a non trivial value type, so we need to extend it to support arbitrary value types, which means templatizing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327647 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-15[DebugInfo] Add a new method IPDBSession::findLineNumbersBySectOffsetAaron Smith
Summary: Some PDB symbols do not have a valid VA or RVA but have Addr by Section and Offset. For example, a variable in thread-local storage has the following properties: get_addressOffset: 0 get_addressSection: 5 get_lexicalParentId: 2 get_name: g_tls get_symIndexId: 12 get_typeId: 4 get_dataKind: 6 get_symTag: 7 get_locationType: 2 This change provides a new method to locate line numbers by Section and Offset from those symbols. Reviewers: zturner, rnk, llvm-commits Subscribers: asmith, JDevlieghere Differential Revision: https://reviews.llvm.org/D44407 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-15[ORC] Re-apply r327566 with a fix for test-global-ctors.ll.Lang Hames
Also clang-formats the patch, which I should have done the first time around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327594 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."Reid Kleckner
This reverts commit r327566, it breaks test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll. The test doesn't crash with a stack trace, unfortunately. It merely returns 1 as the exit code. ASan didn't produce a report, and I reproduced this on my Linux machine and Windows box. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14[ORC] Switch from shared_ptr to unique_ptr for addModule methods.Lang Hames
Layer implementations typically mutate module state, and this is better reflected by having layers own the Module they are operating on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14DWARF: Unify form size handling codePavel Labath
Summary: This patch replaces the two switches which are deducing the size of various forms with a single implementation. I have put the new implementation into BinaryFormat, to avoid introducing dependencies between the two independent libraries (DebugInfo and CodeGen) that need this functionality. Reviewers: aprantl, JDevlieghere, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44418 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327486 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14[ORC] Add a 'lookup' convenience function for finding symbols in a list of VSOs.Lang Hames
The lookup function takes a list of VSOs, a set of symbol names (or just one symbol name) and a materialization function object. It returns an Expected<SymbolMap> (if given a set of names) or an Expected<JITEvaluatedSymbol> (if given just one name). The lookup method constructs an AsynchronousSymbolQuery for the given names, applies that query to each VSO in the list in turn, and then blocks waiting for the query to complete. If threading is enabled then the materialization function object can be used to execute the materialization on different threads. If threading is disabled the MaterializeOnCurrentThread utility must be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327474 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13[GISel]: Fix incorrect type used in Pattern Match for ICstAditya Nandakumar
getConstantVRegVal() returns int64_t but we use uint64_t. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327461 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-13Implement pure virtual method to fix build.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327431 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09[GISel]: Add helpers for easy building G_FCONSTANT along with matchersAditya Nandakumar
Added helpers to build G_FCONSTANT, along with matching ConstantFP and unit tests for the same. Sample usage. auto MIB = Builder.buildFConstant(s32, 0.5); // Build IEEESingle For Matching the above const ConstantFP* Tmp; mi_match(DstReg, MRI, m_GFCst(Tmp)); https://reviews.llvm.org/D44128 reviewed by: volkan git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327152 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08[Support] Pacify -Wsign-compare in unit test.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08[Support] Add WriteThroughMemoryBuffer.Zachary Turner
This is like MemoryBuffer (read-only) and WritableMemoryBuffer (writable private), but where the underlying file can be modified after writing. This is useful when you want to open a file, make some targeted edits, and then write it back out. Differential Revision: https://reviews.llvm.org/D44230 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327057 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08Expose must/may alias info in MemorySSA.Alina Sbirlea
Summary: Building MemorySSA gathers alias information for Defs/Uses. Store and expose this information when optimizing uses (when building MemorySSA), and when optimizing defs or updating uses (getClobberingMemoryAccess). Current patch does not propagate alias information through MemoryPhis. Reviewers: gbiv, dberlin Subscribers: Prazek, sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D38569 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327035 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08Fix unused function warning in StatisticTest.cppDaniel Sanders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327015 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08[DWARF] Don't attempt to parse line tables at invalid offsetsJames Henderson
Whilst working on improvements to the error handling of the debug line parsing code, I noticed that if an invalid offset were to be specified in a call to getOrParseLineTable(), an entry in the LineTableMap would still be created, even if the offset was not within the section range. The immediate parsing attempt afterwards would fail (it would end up getting a version of 0), and thereafter, any subsequent calls to getOrParseLineTable or getLineTable would return the default- constructed, invalid line table. In reality, we shouldn't even attempt to parse this table, and we should always return a nullptr from these two functions for this situation. I have tested this via a unit test, which required some new framework for unit testing debug line. My plan is to add quite a few more unit tests for the new error reporting mechanism that will follow shortly, hence the reason why the supporting code for the tests are written the way they are - I intend to extend the DwarfGenerator class to support generating debug line. At that point, I'll make sure that there are a few positive test cases for this and the parsing code too. Differential Revision: https://reviews.llvm.org/D44200 Reviewers: JDevlieghere, aprantl git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326995 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08Support resetting STATISTIC() values using llvm::ResetStatistics()Daniel Sanders
Summary: Most of the time, compiler statistics can be obtained using a process that performs a single compilation and terminates such as llc. However, this isn't always the case. JITs for example, perform multiple compilations over their lifetime and STATISTIC() will record cumulative values across all of them. Provide tools like this with the facilities needed to measure individual compilations by allowing them to reset the STATISTIC() values back to zero using llvm::ResetStatistics(). It's still the tools responsibility to ensure that they perform compilations in such a way that the results are meaningful to their intended use. Reviewers: qcolombet, rtereshin, bogner, aditya_nandakumar Reviewed By: bogner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44181 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326981 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07Teach identify_file_magic to identify PDB files.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326924 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07[SampleFDO] Extend SampleProfReader to handle demangled names.Wei Mi
SampleProfReader assumes function names in the profile are all mangled names. However, there are cases that few demangled names are somehow contained in the profile (usually because of debug info problems), which may trigger parsing error in SampleProfReader and cause the whole profile to be unusable. The patch extends SampleProfReader to handle profiles with demangled names, so that those profiles can still be useful. Differential revision: https://reviews.llvm.org/D44161 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326905 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07[DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefnAaron Smith
Summary: This helps to determine the line number for a PDB type with definition Reviewers: zturner, llvm-commits, rnk Reviewed By: zturner Subscribers: rengolin, JDevlieghere Differential Revision: https://reviews.llvm.org/D44119 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326857 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-06[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.Florian Hahn
In case PredBB == BB and StopAt == BB's terminator, StopAt != &*BI will fail, because BB's terminator instruction gets replaced. By using BB.getTerminator() we get the current terminator which we can use to compare. Reviewers: sanjoy, anna, reames Reviewed By: anna Differential Revision: https://reviews.llvm.org/D43822 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05GlobalISel: IRTranslate llvm.fabs.* intrinsicVolkan Keles
Summary: Fabs is a common floating-point operation, especially for some expansions. This patch adds a new generic opcode for llvm.fabs.* intrinsic in order to avoid building/matching this intrinsic. Reviewers: qcolombet, aditya_nandakumar, dsanders, rovka Reviewed By: aditya_nandakumar Subscribers: kristof.beyls, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D43864 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326749 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05[AMDGPU] Remove unused AMDOpenCL triple environmentTony Tye
Differential Revision: https://reviews.llvm.org/D43895 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326745 91177308-0d34-0410-b5e6-96231b3b80d8