summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [SCEV] See through op.with.overflow intrinsics (re-apply)Sanjoy Das2016-05-294-5/+425
| | | | | | | | | | | | | | | | | | | Summary: This change teaches SCEV to see reduce `(extractvalue 0 (op.with.overflow X Y))` into `op X Y` (with a no-wrap tag if possible). This was first checked in at r265912 but reverted in r265950 because it exposed some issues around how SCEV handled post-inc add recurrences. Those issues have now been fixed. Reviewers: atrick, regehr Subscribers: mcrosier, mzolotukhin, llvm-commits Differential Revision: http://reviews.llvm.org/D18684 llvm-svn: 271152
* [SCEV] Don't always add no-wrap flags to post-inc add recsSanjoy Das2016-05-297-18/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes PR27315. The post-inc version of an add recurrence needs to "follow the same rules" as a normal add or subtract expression. Otherwise we miscompile programs like ``` int main() { int a = 0; unsigned a_u = 0; volatile long last_value; do { a_u += 3; last_value = (long) ((int) a_u); if (will_add_overflow(a, 3)) { // Leave, and don't actually do the increment, so no UB. printf("last_value = %ld\n", last_value); exit(0); } a += 3; } while (a != 46); return 0; } ``` This patch changes SCEV to put no-wrap flags on post-inc add recurrences only when the poison from a potential overflow will go ahead to cause undefined behavior. To avoid regressing performance too much, I've assumed infinite loops without side effects is undefined behavior to prove poison<->UB equivalence in more cases. This isn't ideal, but is not new to LLVM as a whole, and far better than the situation I'm trying to fix. llvm-svn: 271151
* [ValueTracking] ICmp instructions propagate poisonSanjoy Das2016-05-292-0/+29
| | | | | | | This is a stripped down version of D19211, leaving out the questionable "branching in poison is UB" bit. llvm-svn: 271150
* [PM] SCCP should preserve GlobalsAA even if the IR is mutated.Davide Italiano2016-05-291-1/+4
| | | | llvm-svn: 271149
* [ELF] Unbreak build with GCC.Davide Italiano2016-05-281-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20777 llvm-svn: 271148
* [COFFDumper] Validate that the next offset is not too largeDavid Majnemer2016-05-281-0/+2
| | | | llvm-svn: 271147
* [COFFDumper] Make sure there is sufficient padding left in the string tableDavid Majnemer2016-05-281-1/+4
| | | | llvm-svn: 271146
* [SymbolDumper] Validate the string table offset before using itDavid Majnemer2016-05-281-6/+6
| | | | llvm-svn: 271145
* Revert r271136 [OpenCL] Add the default header file opencl-c.h for OpenCL C ↵Yaxun Liu2016-05-283-16912/+0
| | | | | | language due to build failure on ppc64/hexagon/systemz. llvm-svn: 271144
* [COFFDumper] Make sure there is sufficient padding left in the checksumDavid Majnemer2016-05-281-0/+2
| | | | llvm-svn: 271143
* [SymbolDumper] Validate the string table offset before using itDavid Majnemer2016-05-281-5/+6
| | | | llvm-svn: 271142
* [CVSymbolVisitor] It's possible for an error to occur in begin()David Majnemer2016-05-281-0/+1
| | | | | | | If the begin iterator fails, we cannot dereference it's contents. Instead, we must immediately stop processing symbols. llvm-svn: 271141
* [Object] Return an error code instead of assertingDavid Majnemer2016-05-281-4/+4
| | | | | | This makes it easier to report errors up the stack. llvm-svn: 271140
* [llvm-readobj] Validate the string table offset before using itDavid Majnemer2016-05-281-2/+8
| | | | llvm-svn: 271139
* CodeGen: support blocks on COFF targets in DLLsSaleem Abdulrasool2016-05-282-3/+105
| | | | | | | | | | | This extends the blocks support to support blocks with a dynamically linked blocks runtime. The previous code generation would work only for static builds of the blocks runtime. Mark the block "isa" pointers and functions as dllimport if no explicit declaration marked with __declspec(dllexport) is found. This additional check allows for the use of the functionality in the runtime library if desired. llvm-svn: 271138
* Use consume instead of manually using drop_frontDavid Majnemer2016-05-281-2/+2
| | | | llvm-svn: 271137
* [OpenCL] Add the default header file opencl-c.h for OpenCL C languageYaxun Liu2016-05-283-0/+16912
| | | | | | | | | | OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed. This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring. Differential Revision: http://reviews.llvm.org/D18369 llvm-svn: 271136
* Update test to deal with non-zero exit codesDavid Majnemer2016-05-281-1/+1
| | | | llvm-svn: 271135
* [AVX512] Add masked v16i32 and v8i64 unaligned store tests.Craig Topper2016-05-281-0/+12
| | | | llvm-svn: 271134
* Simplify. NFC.Rui Ueyama2016-05-281-2/+1
| | | | llvm-svn: 271133
* llvm-pdbdump should have a non-zero exit code on errorDavid Majnemer2016-05-281-19/+10
| | | | llvm-svn: 271132
* [X86][SSE] (Reapplied) Replace (V)PMOVSX and (V)PMOVZX integer extension ↵Simon Pilgrim2016-05-2817-858/+362
| | | | | | | | | | | | intrinsics with generic IR (llvm) This patch removes the llvm intrinsics VPMOVSX and (V)PMOVZX sign/zero extension intrinsics and auto-upgrades to SEXT/ZEXT calls instead. We already did this for SSE41 PMOVSX sometime ago so much of that implementation can be reused. Reapplied now that the the companion patch (D20684) removes/auto-upgrade the clang intrinsics has been committed. Differential Revision: http://reviews.llvm.org/D20686 llvm-svn: 271131
* Tighten some of the name map checks furtherDavid Majnemer2016-05-281-1/+5
| | | | llvm-svn: 271130
* ValueMapper: fix assertion when null-mapping a constant for linking metadataMehdi Amini2016-05-282-3/+28
| | | | | | | | | | | | | | | | Summary: When RF_NullMapMissingGlobalValues is set, mapValue can return null for GlobalValue. When mapping the operands of a constant that is referenced from metadata, we need to handle this case and actually return null instead of mapping this constant. Reviewers: dexonsmith, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20713 llvm-svn: 271129
* Determination of statements that contain matrix multiplicationRoman Gareev2016-05-284-6/+277
| | | | | | | | | | | | | | | | | Add determination of statements that contain, in particular, matrix multiplications and can be optimized with [1] to try to get close-to-peak performance. It can be enabled via polly-pm-based-opts, which is false by default. Refs: [1] - http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf Contributed-by: Roman Gareev <gareevroman@gmail.com> Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: http://reviews.llvm.org/D20575 llvm-svn: 271128
* [InstCombine] add tests to show bitcast interferenceSanjay Patel2016-05-281-0/+90
| | | | llvm-svn: 271125
* Fix production of R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX.Rafael Espindola2016-05-288-45/+121
| | | | | | | | We were producing R_X86_64_GOTPCRELX for invalid instructions and sometimes producing R_X86_64_GOTPCRELX instead of R_X86_64_REX_GOTPCRELX. llvm-svn: 271118
* regenerate checksSanjay Patel2016-05-281-42/+52
| | | | llvm-svn: 271117
* Make test more realistic.Rafael Espindola2016-05-283-66/+66
| | | | | | | It doesn't make mach sense to fetch less than 64 bits from a got entry. llvm-svn: 271116
* join RUN lines; NFCSanjay Patel2016-05-281-2/+1
| | | | llvm-svn: 271115
* [x86] avoid printing unnecessary sign bits of hex immediates in asm comments ↵Sanjay Patel2016-05-2812-70/+79
| | | | | | | | | | | (PR20347) It would be better to check the valid/expected size of the immediate operand, but this is generally better than what we print right now. Differential Revision: http://reviews.llvm.org/D20385 llvm-svn: 271114
* [X86] Try to zero elts when lowering 256-bit shuffle with PSHUFB.Ahmed Bougacha2016-05-283-35/+100
| | | | | | | | Otherwise we fallback to a blend of PSHUFBs later on. Differential Revision: http://reviews.llvm.org/D19661 llvm-svn: 271113
* Simplify and clang-format a table.Rafael Espindola2016-05-281-5/+5
| | | | llvm-svn: 271112
* Fix default reloc model on ARM.Rafael Espindola2016-05-282-2/+7
| | | | llvm-svn: 271111
* [driver][mips] Fix local variable naming. NFCSimon Atanasyan2016-05-281-6/+6
| | | | llvm-svn: 271110
* [driver][mips] Revert support for CodeSourcery MIPS toolchainSimon Atanasyan2016-05-28180-4/+762
| | | | | | This is revert of r270366. The support for CS toolchain were dropped too early. llvm-svn: 271109
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-28126-581/+176
| | | | | | | | | | | | | | | | | | | Quite a few libcxx tests seem to follow the format: #if _LIBCPP_STD_VER > X // Do test. #else // Empty test. #endif We should instead use the UNSUPPORTED lit directive to exclude the test on earlier C++ standards. This gives us a more accurate number of test passes for those standards and avoids unnecessary conflicts with other lit directives on the same tests. Reviewers: bcraig, ericwf, mclow.lists Differential revision: http://reviews.llvm.org/D20730 llvm-svn: 271108
* [MC] Return early when .fill size is negativePetr Hosek2016-05-281-1/+1
| | | | | | | | | Rather than invoking emitFill with negative size, which may trigger an undefined behavior, return immediately after emitting the warning. Differential Revision: http://reviews.llvm.org/D20768 llvm-svn: 271107
* [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with ↵Simon Pilgrim2016-05-286-60/+66
| | | | | | | | | | | | | | generic IR (clang) The VPMOVSX and (V)PMOVZX sign/zero extension intrinsics can be safely represented as generic __builtin_convertvector calls instead of x86 intrinsics. This patch removes the clang builtins and their use in the sse2/avx headers - a companion patch will remove/auto-upgrade the llvm intrinsics. Note: We already did this for SSE41 PMOVSX sometime ago. Differential Revision: http://reviews.llvm.org/D20684 llvm-svn: 271106
* Bounds check the number of bitmap blocks in the name mapDavid Majnemer2016-05-281-0/+10
| | | | llvm-svn: 271105
* An empty record cannot be null-terminatedDavid Majnemer2016-05-281-0/+3
| | | | llvm-svn: 271104
* Make sure the directory contains info for all streamsDavid Majnemer2016-05-281-3/+8
| | | | llvm-svn: 271103
* [MC] Support symbolic expressions in assembly directivesPetr Hosek2016-05-288-62/+159
| | | | | | | | | This matches the behavior of GNU assembler which supports symbolic expressions in absolute expressions used in assembly directives. Differential Revision: http://reviews.llvm.org/D20752 llvm-svn: 271102
* [pdb] Finish conversion to zero copy pdb access.Zachary Turner2016-05-2833-350/+228
| | | | | | | | | | | | | | This converts remaining uses of ByteStream, which was still left in the symbol stream and type stream, to using the new StreamInterface zero-copy classes. RecordIterator is finally deleted, so this is the only way left now. Additionally, more error checking is added when iterating the various streams. With this, the transition to zero copy pdb access is complete. llvm-svn: 271101
* [ELF][MIPS] Always resolve MIPS GP-relative relocations to 'local' definitionsSimon Atanasyan2016-05-282-6/+45
| | | | | | | | | | | | | | In case of MIPS, GP-relative relocations always resolve to a definition in a regular input file, ignoring the one-definition rule. Such relocations are used to setup GP relative offsets in a function's prologue. So we, for example, should not attempt to create a dynamic relocation even if the target symbol is preemptible. Fixes bug 27880. Differential Revision: http://reviews.llvm.org/D20664 llvm-svn: 271100
* Revert "Revert "Map DynamicNoPIC to Static on non-darwin.""Renato Golin2016-05-284-41/+101
| | | | | | | | This reverts commit r271096, as reverting it broke even more buildbots! But that also means I'll break on ARM again... :( llvm-svn: 271099
* Move test only for the relevant platformXinliang David Li2016-05-282-4/+8
| | | | llvm-svn: 271098
* Add a comment about why we need to buffer the attribute changes.Sean Silva2016-05-281-0/+3
| | | | llvm-svn: 271097
* Revert "Map DynamicNoPIC to Static on non-darwin."Renato Golin2016-05-284-101/+41
| | | | | | This reverts commit r271052, as it broke some ARM buildbots. llvm-svn: 271096
* [libFuzzer] fix a failure that occurs when running individual inputsKostya Serebryany2016-05-281-0/+1
| | | | llvm-svn: 271095
OpenPOWER on IntegriCloud