Commit Graph

232394 Commits

Author SHA1 Message Date
Sanjoy Das 375d6704c5 [SCEV] Remove the singleton `apply` function (re-apply r271155)
Polly has been updated in r271177 to not use it.

llvm-svn: 271178
2016-05-29 07:53:21 +00:00
Sanjoy Das 03bcb910de [Polly] Remove usage of the `apply` function
Summary:
API-wise `apply` is a somewhat unidiomatic one-off function, and
removing the only(?) use in polly will let me remove it from SCEV's
exposed interface.

Reviewers: jdoerfert, Meinersbur, grosser

Subscribers: grosser, mcrosier, pollydev

Differential Revision: http://reviews.llvm.org/D20779

llvm-svn: 271177
2016-05-29 07:33:16 +00:00
Craig Topper b8b4b7eb01 [X86] Simplify alignr builtin support by recognizing that NumLaneElts is always 16. NFC
llvm-svn: 271176
2016-05-29 07:06:02 +00:00
Craig Topper f565d37607 [X86] Remove some unnecessary declarations for old intrinsics from a test.
llvm-svn: 271175
2016-05-29 06:37:39 +00:00
Craig Topper 7355ac34a5 [X86] Simplify some of the autoupgrade code. NFC
llvm-svn: 271174
2016-05-29 06:37:33 +00:00
David Majnemer 61f179815a Don't dereference a symbol iterator before checking for the end case
llvm-svn: 271173
2016-05-29 06:18:08 +00:00
David Majnemer ba1439229a Make sure we don't add an empty string to the stringmap
llvm-svn: 271172
2016-05-29 06:18:06 +00:00
David Majnemer 21de7b99a0 [CVRecord] Don't assume that the record has two bytes of data in it
llvm-svn: 271171
2016-05-29 06:18:04 +00:00
David Majnemer 61f1caa555 Don't let the readArray size calculation overflow
llvm-svn: 271170
2016-05-29 06:18:01 +00:00
Tobias Grosser 6a114505c4 Temporarily xfail test case which broke after a fix in SCEV
This should keep the buildbots quite while we decide how to update the test
case.

llvm-svn: 271169
2016-05-29 06:03:44 +00:00
Zachary Turner d28449e2ca [pdb] Make an abstract base class for PDBFile.
This will allow us to mock it out in a unit test to begin
writing unit tests for the various PDB and codeview classes.

llvm-svn: 271168
2016-05-29 05:36:01 +00:00
Sanjoy Das 746addd261 Revert "[SCEV] Remove unused function; NFC"
This reverts commit r271155.  The `apply` function is actually used by
Polly.

llvm-svn: 271167
2016-05-29 04:08:50 +00:00
Rafael Espindola b50a95d298 Fix typo.
Thanks to David Majnemer for noticing.

llvm-svn: 271166
2016-05-29 03:03:22 +00:00
Craig Topper 832caf041f [CodeGen] Use the ArrayRef form CreateShuffleVector instead of building ConstantVectors or ConstantDataVectors and calling the other form.
llvm-svn: 271165
2016-05-29 02:39:30 +00:00
Craig Topper 6cbd7a23a3 [IR] Teach the ArrayRef<int> form of IRBuilder::CreateShuffleVector to use ConstantDataVector.
This will be used in a follow up commit to simplify code in clang that creates a ConstantDataVector and calls the other form.

llvm-svn: 271164
2016-05-29 02:39:20 +00:00
Rafael Espindola ab3e10a7a0 Mark test as requiring x86-registered-target.
llvm-svn: 271163
2016-05-29 02:36:16 +00:00
Rafael Espindola f8f01c3d59 Handle -Wa,--mrelax-relocations=[no|yes].
llvm-svn: 271162
2016-05-29 02:01:14 +00:00
Rafael Espindola fd82f0501f Add RelaxELFRelocations to TargetOptions.h.
It will be used in clang.

llvm-svn: 271161
2016-05-29 01:57:20 +00:00
Rafael Espindola 9768d73c74 Move RelaxELFRel out to llvm-mc.
llvm-svn: 271160
2016-05-29 01:11:00 +00:00
Davide Italiano 39893bd41c [PM] Reassociate: cache analyses more aggressively.
While here, add a FIXME for setPreserveCFG().

llvm-svn: 271159
2016-05-29 00:41:17 +00:00
Sanjoy Das 7066905ef3 [SCEV] Remove \brief from comments; NFC
With autobrief, \brief is not required.

llvm-svn: 271158
2016-05-29 00:38:29 +00:00
Sanjoy Das f857081c8c [SCEV] Consolidate comments; NFC
Consolidate documentation by removing comments from the .cpp file where
the comments in the .cpp file were copy-pasted from the header.

llvm-svn: 271157
2016-05-29 00:38:22 +00:00
Sanjoy Das 108fcf2e2c [SCEV] Rename functions to LLVM style; NFC
llvm-svn: 271156
2016-05-29 00:38:00 +00:00
Sanjoy Das 35c5d30ad6 [SCEV] Remove unused function; NFC
Moreover, I've never seen globally scoped `static inline` functions
elsewhere in LLVM, so this pattern is unusual if not unidiomatic.

llvm-svn: 271155
2016-05-29 00:37:45 +00:00
Sanjoy Das 01c1cb050a [SCEV] Comment and whitesapce changes in header
- Use doxygen-style comments
 - Don't repeat member names in comments
 - Add newlines between declarations

llvm-svn: 271154
2016-05-29 00:36:42 +00:00
Sanjoy Das ae09b3cd4c [IndVars] Eliminate op.with.overflow when possible (re-apply)
Summary:
If we can prove that an op.with.overflow intrinsic does not overflow, we
can get rid of the intrinsic, and replace it with non-wrapping
arithmetic.

This was first checked in at r265913 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: sanjoy, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18685

llvm-svn: 271153
2016-05-29 00:36:25 +00:00
Sanjoy Das f49ca52b9d [SCEV] See through op.with.overflow intrinsics (re-apply)
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
2016-05-29 00:34:42 +00:00
Sanjoy Das 7e4a64167d [SCEV] Don't always add no-wrap flags to post-inc add recs
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
2016-05-29 00:32:17 +00:00
Sanjoy Das 70c2bbd29c [ValueTracking] ICmp instructions propagate poison
This is a stripped down version of D19211, leaving out the questionable
"branching in poison is UB" bit.

llvm-svn: 271150
2016-05-29 00:31:18 +00:00
Davide Italiano 484b5ab39d [PM] SCCP should preserve GlobalsAA even if the IR is mutated.
llvm-svn: 271149
2016-05-29 00:31:15 +00:00
Davide Italiano e6c8fa4530 [ELF] Unbreak build with GCC.
Differential Revision:  http://reviews.llvm.org/D20777

llvm-svn: 271148
2016-05-28 23:27:38 +00:00
David Majnemer cab2b461ef [COFFDumper] Validate that the next offset is not too large
llvm-svn: 271147
2016-05-28 20:04:50 +00:00
David Majnemer efaaf410a6 [COFFDumper] Make sure there is sufficient padding left in the string table
llvm-svn: 271146
2016-05-28 20:04:48 +00:00
David Majnemer c6cb2ec36e [SymbolDumper] Validate the string table offset before using it
llvm-svn: 271145
2016-05-28 20:04:46 +00:00
Yaxun Liu 898eb39bfc Revert r271136 [OpenCL] Add the default header file opencl-c.h for OpenCL C language due to build failure on ppc64/hexagon/systemz.
llvm-svn: 271144
2016-05-28 19:50:40 +00:00
David Majnemer 37dafba713 [COFFDumper] Make sure there is sufficient padding left in the checksum
llvm-svn: 271143
2016-05-28 19:45:58 +00:00
David Majnemer b343310b4f [SymbolDumper] Validate the string table offset before using it
llvm-svn: 271142
2016-05-28 19:45:56 +00:00
David Majnemer 0042e20996 [CVSymbolVisitor] It's possible for an error to occur in begin()
If the begin iterator fails, we cannot dereference it's contents.
Instead, we must immediately stop processing symbols.

llvm-svn: 271141
2016-05-28 19:45:54 +00:00
David Majnemer e21296626c [Object] Return an error code instead of asserting
This makes it easier to report errors up the stack.

llvm-svn: 271140
2016-05-28 19:45:51 +00:00
David Majnemer a6d93fd73b [llvm-readobj] Validate the string table offset before using it
llvm-svn: 271139
2016-05-28 19:45:49 +00:00
Saleem Abdulrasool 442b88b9ec CodeGen: support blocks on COFF targets in DLLs
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
2016-05-28 19:41:35 +00:00
David Majnemer 78b0d72769 Use consume instead of manually using drop_front
llvm-svn: 271137
2016-05-28 19:17:48 +00:00
Yaxun Liu e54d7c44d0 [OpenCL] Add the default header file opencl-c.h for OpenCL C language
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
2016-05-28 19:09:01 +00:00
David Majnemer 8d106d5ea4 Update test to deal with non-zero exit codes
llvm-svn: 271135
2016-05-28 19:02:12 +00:00
Craig Topper cbdbbac875 [AVX512] Add masked v16i32 and v8i64 unaligned store tests.
llvm-svn: 271134
2016-05-28 18:59:06 +00:00
Rui Ueyama 8b972d221e Simplify. NFC.
llvm-svn: 271133
2016-05-28 18:40:38 +00:00
David Majnemer c165c889ab llvm-pdbdump should have a non-zero exit code on error
llvm-svn: 271132
2016-05-28 18:25:15 +00:00
Simon Pilgrim 9602d678cb [X86][SSE] (Reapplied) Replace (V)PMOVSX and (V)PMOVZX integer extension 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
2016-05-28 18:03:41 +00:00
David Majnemer 328b6d3903 Tighten some of the name map checks further
llvm-svn: 271130
2016-05-28 18:03:37 +00:00
Mehdi Amini bcc47419d9 ValueMapper: fix assertion when null-mapping a constant for linking metadata
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
2016-05-28 17:26:03 +00:00