Commit Graph

232416 Commits

Author SHA1 Message Date
Alexey Bataev ad537bb8a0 [OPENMP 4.5] Fixed codegen for 'priority' and destructors in task-based
directives.

'kmp_task_t' record type added a new field for 'priority' clause and
changed the representation of pointer to destructors for privates used
within loop-based directives.
Old representation:

typedef struct kmp_task {                   /* GEH: Shouldn't this be
aligned somehow? */
  void *shareds;                            /**< pointer to block of
    pointers to shared vars   */
  kmp_routine_entry_t routine;              /**< pointer to routine
    to call for executing task */
  kmp_int32 part_id;                        /**< part id for the
    task                          */
  kmp_routine_entry_t destructors;        /* pointer to function to
  invoke deconstructors of firstprivate C++ objects */
  /*  private vars  */
} kmp_task_t;

New representation:

typedef struct kmp_task {                   /* GEH: Shouldn't this be
aligned somehow? */
  void *shareds;                            /**< pointer to block of
    pointers to shared vars   */
  kmp_routine_entry_t routine;              /**< pointer to routine
    to call for executing task */
  kmp_int32 part_id;                        /**< part id for the
    task                          */
  kmp_cmplrdata_t data1; /* Two known
optional additions: destructors and priority */
  kmp_cmplrdata_t data2; /* Process
destructors first, priority second */
/* future data */
  /*  private vars  */
} kmp_task_t;

Also excessive initialization of 'destructors' fields to 'null' was
removed from codegen if it is known that no destructors shal be used.
Currently a special bit is used in 'kmp_tasking_flags_t' bitfields
('destructors_thunk' bitfield).

llvm-svn: 271201
2016-05-30 09:06:50 +00:00
Diana Picus f353a5e06d [BPF] Remove exit-on-error from tests (PR27768, PR27769)
The exit-on-error flag is necessary to avoid some assertions/unreachables. We
can get past them by creating a few dummy nodes.

Fixes PR27768, PR27769.

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

llvm-svn: 271200
2016-05-30 08:28:34 +00:00
Haojian Wu 3b9f4cf462 Fix a wrong check in misc-unused-using-decls
Summary:
We should check whether a UsingDecl is defined in macros or in class
definition, not TargetDecls of the UsingDecl.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 271199
2016-05-30 07:42:22 +00:00
Yaxun Liu 669b44e857 [OpenCL] Remove tests without triple from test/Headers/opencl-c-header.cl.
This test requires triples with Itanium C++ ABI whereas triples with MSVC environment uses Microsoft C++ ABI.

llvm-svn: 271198
2016-05-30 06:42:48 +00:00
Yaxun Liu e8f49b9db7 [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.

Re-commit after fixing failures on ppc64/systemz etc.

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

llvm-svn: 271197
2016-05-30 02:22:28 +00:00
Sanjoy Das 3e5ce2b737 [IndVars] Assert that the incoming IR is in LCSSA
Since we already assert that the outgoing IR is in LCSSA, it is easy to
get misled into thinking that -indvars broke LCSSA if the incoming IR is
non-LCSSA.  Checking this pre-condition will make such cases break in
more obvious ways.

Inspired by (but does _not_ fix) PR26682.

llvm-svn: 271196
2016-05-30 01:37:39 +00:00
Eric Fiselier 9ef549212c Fix bug in test allocator that incorrectly computed the allocation size
llvm-svn: 271195
2016-05-30 01:31:04 +00:00
Lang Hames f96bc6eb0c [Kaleidoscope][BuildingAJIT] Don't build Chapter 5 on Windows for now.
The TCP setup code is currently *nix based and does not build on Windows.

llvm-svn: 271194
2016-05-30 01:18:32 +00:00
Lang Hames a243ba9cad [Kaleidoscope][BuildingAJIT] Add code for Chapter 5 - remote JITing.
This chapter demonstrates lazily JITing from ASTs with the expressions being
executed on a remote machine via a TCP connection. It needs some polish, but is
substantially complete.

Currently x86-64 SysV ABI (Darwin and Linux) only, but other architectures
can be supported by changing the server code to use alternative ABI support
classes from llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h.

llvm-svn: 271193
2016-05-30 00:09:26 +00:00
Joerg Sonnenberger ed58207c46 Make it easier to process merges in a normal buildable directory tree by
allowing the user to specify the base directory of the checkout.

llvm-svn: 271192
2016-05-29 22:09:54 +00:00
Daniel Jasper e77f19c0af clang-format: Fix segfault introduced by allowing wraps after comments.
llvm-svn: 271191
2016-05-29 22:07:22 +00:00
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