Commit Graph

232405 Commits

Author SHA1 Message Date
Sanjoy Das 496f274257 [IndVarSimplify] Extract the logic of `-indvars` out into a class; NFC
This will be used later to port IndVarSimplify to the new pass manager.

llvm-svn: 271190
2016-05-29 21:42:00 +00:00
Lang Hames 9c53a638cb [Orc] Fix a type in the OrcRemoteClientUtility.
This function failed to type-check as it was. No test case yet (we only have
regression tests for the remote-JIT code, and LLI don't use this function), but
an upcoming chapter of the Kaleidoscope Building A JIT tutorials will use
this.

llvm-svn: 271189
2016-05-29 21:17:13 +00:00
David Blaikie 3612e4ff9d Enable some accidentally dead tests and fix up the bitrot
Problem found by Nico, originally committed by me in r213213. The .test
prefix wasn't actually being run. Once that was fixed the test cases had
outdated command line syntax and IR debug info format, so updated for
those issues to get them back up and running.

Thanks Nico!

llvm-svn: 271188
2016-05-29 19:50:23 +00:00
Simon Pilgrim 6d1a0c4c75 [X86][SSE] Make unsigned integer vector types generally available
As discussed on http://reviews.llvm.org/D20684, move the unsigned integer vector types used for zero extension to make them available for general use.

llvm-svn: 271187
2016-05-29 18:49:08 +00:00
Kostya Serebryany 4795210f9c [libFuzzer] fix a use-after-free (!) in libFuzzer caused by r270905: that CL caused a push_back in the main corpus invalidating the vector<> iterators in rare cases.
llvm-svn: 271186
2016-05-29 15:58:57 +00:00
Martin Probst 7ea9b6d783 clang-format: [JS] Support shebang lines on the very first line.
Summary:
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be run using e.g. node. This change treats # lines on the first line
as line comments.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 271185
2016-05-29 14:41:36 +00:00
Martin Probst 409697ecb9 clang-format: [JS] fix async parsing.
Summary:
Only treat the sequence `async function` as the start of a function expression,
as opposed to every occurrence of the token `async` (whoops).

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 271184
2016-05-29 14:41:07 +00:00
Martin Probst 1244ecbbd2 clang-format: [JS] FormatToken.startsSequence/endsSequence.
Refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into FormatToken.startsSequence/endsSequence. This allows checking tokens within
the pointered linked list structure with a lookahead, automatically ignoring
comments, which is useful in many places (e.g. see subsequent commit).

llvm-svn: 271183
2016-05-29 14:41:02 +00:00
Benjamin Kramer 442b9a90a4 Avoid unnecessary std::string copies. NFC.
llvm-svn: 271182
2016-05-29 11:04:56 +00:00
Benjamin Kramer 728f4448a9 Remove some 'const' specifiers that do nothing but prevent moving the argument.
Found by clang-tidy's misc-move-const-arg. While there drop some
obsolete c_str() calls.

llvm-svn: 271181
2016-05-29 10:46:35 +00:00
Benjamin Kramer 0da23a2713 [ProfileData] Clean up string handling a bit.
llvm-svn: 271180
2016-05-29 10:31:00 +00:00
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