summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
...
* IR: Refactor GEP range checks, reuse them for other parts of foldingDavid Majnemer2013-11-101-28/+51
| | | | llvm-svn: 194341
* Move the old pass manager infrastructure into a legacy namespace andChandler Carruth2013-11-092-13/+21
| | | | | | | | | | | | | | | | | | | give the files a legacy prefix in the right directory. Use forwarding headers in the old locations to paper over the name change for most clients during the transitional period. No functionality changed here! This is just clearing some space to reduce renaming churn later on with a new system. Even when the new stuff starts to go in, it is going to be hidden behind a flag and off-by-default as it is still WIP and under development. This patch is specifically designed so that very little out-of-tree code has to change. I'm going to work as hard as I can to keep that the case. Only direct forward declarations of the PassManager class are impacted by this change. llvm-svn: 194324
* Remove ^M from the file.Bill Wendling2013-11-081-1419/+1415
| | | | llvm-svn: 194251
* IR: Properly canonicalize PointerType in ConstantExpr GEPsDavid Majnemer2013-11-071-5/+6
| | | | | | | No additional test was needed, Other/constant-fold-gep.ll detects this just fine. llvm-svn: 194221
* IR: Do not canonicalize constant GEPs into an out-of-bounds array accessDavid Majnemer2013-11-071-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Consider a GEP of: i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 0) If we proceeded to GEP the aforementioned object by 8, would form a GEP of: i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 8) Note that we would go through the first array member, causing an out-of-bounds accesses. This is problematic because we might get fooled if we are trying to evaluate loads using this GEP, for example, based off of an object with a constant initializer where the array is zero. This fixes PR17732. Reviewers: nicholas, chandlerc, void Reviewed By: void CC: llvm-commits, echristo, void, aemerson Differential Revision: http://llvm-reviews.chandlerc.com/D2093 llvm-svn: 194220
* [llvm-c] Implement LLVMPrintValueToStringPeter Zotov2013-11-061-0/+10
| | | | | | Original patch by Chris Wailes llvm-svn: 194135
* Use error_code in GVMaterializer.Rafael Espindola2013-11-051-4/+15
| | | | | | They just propagate out the bitcode reader error, so we don't need a new enum. llvm-svn: 194091
* Revert "llvm-cov: Added command-line option to change dir."Yuchen Wu2013-11-051-8/+6
| | | | | | This reverts commit d8acf0078cf363252727acff00f85ae8074f95b3. llvm-svn: 194040
* llvm-cov: Added command-line option to change dir.Yuchen Wu2013-11-051-6/+8
| | | | | | | This will allow for much easier testing when the input files are in a different folder from the test script. llvm-svn: 194034
* Support for reading run counts in llvm-cov.Yuchen Wu2013-11-051-1/+13
| | | | | | | | | | | | This patch enables llvm-cov to correctly output the run count stored in the GCDA file. GCOVProfiling currently does not generate this information, so the GCDA run data had to be hacked on from a GCDA file generated by gcc. This is corrected by a subsequent patch. With the run and program data included, both llvm-cov and gcov produced the same output. llvm-svn: 194033
* Added command-line option to output llvm-cov to file.Yuchen Wu2013-11-021-10/+11
| | | | | | | Added -o option to llvm-cov. If no output file is specified, it defaults to STDOUT. llvm-svn: 193899
* Remove linkonce_odr_auto_hide.Rafael Espindola2013-11-013-10/+2
| | | | | | | | | | | | | | | linkonce_odr_auto_hide was in incomplete attempt to implement a way for the linker to hide symbols that are known to be available in every TU and whose addresses are not relevant for a particular DSO. It was redundant in that it all its uses are equivalent to linkonce_odr+unnamed_addr. Unlike those, it has never been connected to clang or llvm's optimizers, so it was effectively dead. Given that nothing produces it, this patch just nukes it (other than the llvm-c enum value). llvm-svn: 193865
* Enable variable arguments support for intrinsics.Andrew Trick2013-10-312-2/+47
| | | | llvm-svn: 193766
* Add calls to doInitialization() and doFinalization() in verifyFunction()Rafael Espindola2013-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | The function verifyFunction() in lib/IR/Verifier.cpp misses some calls. It creates a temporary FunctionPassManager that will run a single Verifier pass. Unfortunately, FunctionPassManager is no PassManager and does not call doInitialization() and doFinalization() by itself. Verifier does important tasks in doInitialization() such as collecting type information used to check DebugInfo metadata and doFinalization() does some additional checks. Therefore these checks were missed and debug info couldn't be verified at all, it just crashed if the function had some. verifyFunction() is currently not used in llvm unless -debug option is enabled, and in unittests/IR/VerifierTest.cpp VerifierTest had to be changed to create the function in a module from which the type debug info can be collected. Patch by Michael Kruse. llvm-svn: 193719
* Fix misapplied patch in r193597Anders Waldenborg2013-10-291-2/+2
| | | | | | Sorry Peter Zotov, entirely my fault. llvm-svn: 193598
* llvm-c: Make LLVM{Get,Set}Alignment work on {Load,Store}Inst tooAnders Waldenborg2013-10-291-4/+22
| | | | | | | | Patch by Peter Zotov Differential Revision: http://llvm-reviews.chandlerc.com/D1910 llvm-svn: 193597
* Revert r193251 : Use address-taken to disambiguate global variable and ↵Shuxin Yang2013-10-272-4/+0
| | | | | | indirect memops. llvm-svn: 193489
* llvm-cov dump to dbgs() instead of outs().Yuchen Wu2013-10-251-13/+14
| | | | llvm-svn: 193390
* Support for reading program counts in llvm-cov.Yuchen Wu2013-10-251-12/+17
| | | | | | | | | | | | | llvm-cov will now be able to read program counts from the GCDA file and output it in the same format as gcov. The program summary tag was identified from gcov-io.h as "\0\0\0\a3". There is currently a bug in GCOVProfiling.cpp which does not generate the run- or program-counting IR, so this change was tested manually by modifying the GCDA file and comparing the gcov and llvm-cov outputs. llvm-svn: 193389
* Fixed llvm-cov to count edges instead of blocks.Yuchen Wu2013-10-241-2/+11
| | | | | | | | | | | | | | | | | This was a fundamental flaw in llvm-cov where it treated the values in the GCDA files as block counts instead of edge counts. This created incorrect line counts when branching was present. Instead, the edge counts should be summed to obtain the correct block count. The fix was tested using custom test files as well as single source files from the test-suite directory. The behaviour can be verified by reading the GCOV documentation that describes the GCDA spec ("ARC_COUNTS gives the counter values for those arcs that are instrumented") and the header description provided by GCOVProfiling.cpp ("instruments the code that runs to records (sic) the edges between blocks that run and emit a complementary "gcda" file on exit"). llvm-svn: 193299
* Use a map instead of vector to store line counts.Yuchen Wu2013-10-231-22/+10
| | | | | | | | | | | | There are a few motivations for this: - Using a map allows for checking if line is in map. This differentiates unexecutable lines (such as comments) from unexecuted logical lines of code. "#####" is now outputted in this case, in line with gcov. - Source files are no longer read in twice: once when storing the line counts, and once when outputting the data. - Greatly simplifies the function FileInfo::addLineCount(). llvm-svn: 193264
* Use address-taken to disambiguate global variable and indirect memops.Shuxin Yang2013-10-232-0/+4
| | | | | | | | | | Major steps include: 1). introduces a not-addr-taken bit-field in GlobalVariable 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable dosen't have its address taken. 3). AA use this info for disambiguation. llvm-svn: 193251
* Test commit. Added whitespace in GCOV.cpp.Yuchen Wu2013-10-231-1/+1
| | | | llvm-svn: 193224
* llvm-cov: Use uint32_t for loop variables to be more consistent.Bob Wilson2013-10-221-2/+2
| | | | | | | | | The loop bounds here are uint32_t variables, so it makes sense for the loop variables to have the same type. Patch by Yuchen Wu! llvm-svn: 193192
* llvm-cov: fix a typo and rename a variable.Bob Wilson2013-10-221-4/+4
| | | | | | | | | Rename Size to EndPos, which makes more sense because the variable stores the last location of the blocks. Patch by Yuchen Wu! llvm-svn: 193189
* Fix llvm-cov counts to be 64-bit integers to avoid overflows.Bob Wilson2013-10-221-2/+2
| | | | | | | | | | Line counts in llvm-cov are read in as 64-bit integers but were being truncated to 32-bit in collectLineCounts(), which caused overflow for large counts. This patch fixes all counts to be uint64_t. Patch by Yuchen Wu! llvm-svn: 193172
* llvm-c: Add LLVMPrintTypeToStringAnders Waldenborg2013-10-221-0/+10
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1963 llvm-svn: 193149
* Change llvm-cov output formatting to be more similar to gcov.Bob Wilson2013-10-221-7/+9
| | | | | | | | | | | | - Replaced tabs with proper padding - print() takes two arguments, which are the GCNO and GCDA filenames - Files are listed at the top of output, appended by line 0 - Stripped strings of trailing \0s - Removed last two lines of whitespace in output Patch by Yuchen Wu! llvm-svn: 193148
* Move the printing of llvm-cov information out from collectLineCounts().Bob Wilson2013-10-221-1/+0
| | | | | | | | | | collectLineCounts() should only organize the output data. This is done in anticipation of subsequent changes which will pass in GCNO and GCDA filenames into the print function where it is printed similar to the gcov output. Patch by Yuchen Wu! llvm-svn: 193134
* Changing DebugInfoFinder to iterate over all the compile units.Michael Kuperstein2013-10-171-1421/+1419
| | | | | | | | Solves http://llvm.org/bugs/show_bug.cgi?id=17507 Committed on behalf of alon.mishne@intel.com llvm-svn: 192879
* llvm-c: Add LLVMDumpTypeAnders Waldenborg2013-10-161-0/+4
| | | | | | | | | | The C API currently allows to dump values (LLVMDumpValue), but a similar method for types was not exported. Patch by Peter Zotov Differential Revision: http://llvm-reviews.chandlerc.com/D1911 llvm-svn: 192852
* [llvm-c] Add LLVMPrintModuleToString.Anders Waldenborg2013-10-161-0/+10
| | | | | | | | | Like LLVMDumpModule but returns the string (that needs to be freed with LLVMDisposeMessage) instead of printing it to stderr. Differential Revision: http://llvm-reviews.chandlerc.com/D1941 llvm-svn: 192821
* TypeFinder: prefer iterative algorithm to keep stack usage low.Will Dietz2013-10-161-10/+18
| | | | | | | Introduce subtype_reverse_iterator to maintain the numbering assigned during the recursive type walk. llvm-svn: 192770
* Add support for metadata representing .ident directives.Rafael Espindola2013-10-161-0/+20
| | | | llvm-svn: 192764
* Add an assert that we have a scope that matters for methodsEric Christopher2013-10-151-1/+4
| | | | | | | and remove a call to getNonCompileUnitScope as a method shouldn't be in the compile unit scope. llvm-svn: 192748
* Clean up, formatting, comments. No functional change.Eric Christopher2013-10-151-100/+88
| | | | llvm-svn: 192747
* Remove x86_sse42_crc32_64_8 intrinsic. It has no functional difference from ↵Craig Topper2013-10-151-0/+7
| | | | | | x86_sse42_crc32_32_8 and was not mapped to a clang builtin. I'm not even sure why this form of the instruction is even called out explicitly in the docs. Also add AutoUpgrade support to convert it into the other intrinsic with appropriate trunc and zext. llvm-svn: 192672
* Debug Info: In DIBuilder, the context field of subprogram is updated to useManman Ren2013-10-102-5/+27
| | | | | | | | DIScopeRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192378
* Debug Info: In DIBuilder, the context and type fields of template_type andManman Ren2013-10-092-8/+8
| | | | | | | | template_value are updated to use DIRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192320
* Debug Info: In DIBuilder, the context field of a forward decl is updatedManman Ren2013-10-091-1/+1
| | | | | | to use DIScopeRef. llvm-svn: 192309
* Add a GlobalAlias::isValidLinkage to reduce code duplication.Rafael Espindola2013-10-091-2/+1
| | | | | | Thanks to Reid Kleckner for the suggestion. llvm-svn: 192298
* Debug Info: In DIBuilder, the context field of a DICompositeType is updatedManman Ren2013-10-091-4/+4
| | | | | | | | to use DIScopeRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192256
* Debug Info: In DIBuilder, the context fields of a static member and aManman Ren2013-10-081-2/+2
| | | | | | typedef are updated to use DIScopeRef. llvm-svn: 192254
* Debug Info: In DIBuilder, the derived-from field of DICompositeTypeManman Ren2013-10-081-5/+5
| | | | | | | | is updated to use DITypeRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192251
* Debug Info: In DIBuilder, the derived-from field of DIDerivedTypeManman Ren2013-10-081-8/+8
| | | | | | | | is updated to use DITypeRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192246
* Change objectsize intrinsic to accept different address spaces.Matt Arsenault2013-10-071-0/+22
| | | | | | | Bitcasting everything to i8* won't work. Autoupgrade the old intrinsic declarations to use the new mangling. llvm-svn: 192117
* Add support for aliases with linkonce_odr.Rafael Espindola2013-10-061-1/+1
| | | | | | This will be used to extend constructor aliases in clang. llvm-svn: 192066
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-052-61/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192018
* Temporarily revert r191792 as it is causing some LTO debug failuresEric Christopher2013-10-042-28/+61
| | | | | | | on platforms with relocations in debug info and also temporarily revert r191800 due to conflicts with the revert of r191792. llvm-svn: 191967
* Add v4f16 to supported value types.Pete Cooper2013-10-031-0/+2
| | | | | | This is useful for some ARM intrinsics such as VCVTN which does a <4 x float> <-> <4 x half> conversion. llvm-svn: 191870
OpenPOWER on IntegriCloud