Commit Graph

235305 Commits

Author SHA1 Message Date
Mike Aizatsky 8ba86a5a48 [libFuzzer] Let user specify extra stats file.
Summary: If AFL_DRIVER_EXTRA_STATS_FILENAME is set and valid, write to it peak_rss_mb and slowest_unit_time_sec. These are both stats that libFuzzer can print but afl cannot.

Reviewers: kcc, aizatsky, metzman

Subscribers: llvm-commits

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

llvm-svn: 274273
2016-06-30 20:43:06 +00:00
Tobias Grosser 3898a0468c Propagate on-error status
This ensures that the error status set with -polly-on-isl-error-abort is
maintained even after running DependenceInfo and ScheduleOptimizer. Both
passes temporarily set the error status to CONTINUE as the dependence
analysis uses a compute-out and the scheduler may not be able to derive
a schedule. In both cases we want to not abort, but to handle the error
gracefully. Before this commit, we always set the error reporting to ABORT
after these passes. After this commit, we use the error reporting mode that was
active earlier.

This comes without a test case as this would require us to introduce (memory)
errors which would trigger the isl errors.

llvm-svn: 274272
2016-06-30 20:42:58 +00:00
Tobias Grosser af14993016 Simplify: get isl_ctx only once [NFC]
... instead of call S.getIslCtx() many times.

llvm-svn: 274271
2016-06-30 20:42:56 +00:00
Vassil Vassilev 488b3bde3d [CMake] Module builds depend on target intrinsics_gen to be built first.
When compiling with modules, header A and B can be in the same module M.
B depends on intrinsics_gen and A doesn't. Compiling a source file #include-ing
header A, we implicitly request module M to be built. It puts header A and B in
the same TU and tries to build them. Since B depends on intrinsics_gen (which
might not be built yet) we run into build failures.

This should fix our modules buildbot.

Patch reviewed by Chris Bieneman.

llvm-svn: 274270
2016-06-30 20:35:56 +00:00
Justin Lebar fb2efeb804 Fix ASTMatchersNodeTest to work on Windows.
It was failing because it had an explicit check for whether we're on
Windows.

There are a few other similar explicit checks in this file which I
didn't remove because they serve as reasonable documentation that the
test doesn't work with a Windows triple.

llvm-svn: 274269
2016-06-30 20:29:29 +00:00
Chandler Carruth 3629343d2b Introduce a *draft* of a code of conduct for the LLVM community and the
associated reporting guide.

I want to emphasize that at this point these are just drafts!

This is the result of very extended discussion on the mailing lists on
several different threads:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091218.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/099120.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307070.html

The reporting guide in particular I anticipate will be shaped somewhat
by the advisory committee when they are selected. But hopefully this
serves as a good starting point and good guidance while the advisory
committee is being sorted out.

I'd like to thank all the folks who contributed to this. Many, *many*
people worked to help with drafting, wording, suggestions, and edits.
Also, this is based on widely used existing codes of coduct as mentioned
in the text, and the original authors of those deserve many thanks as
well.

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

llvm-svn: 274268
2016-06-30 20:27:54 +00:00
Richard Smith b8c414ccd1 Fix typo-correction crash if a typo occurs within the operand of a
function-style cast to a non-dependent type which is then used in an invalid
way. We'd lose the "type dependent" bit here, and downstream Sema processing
would then discard the expression if it was used in a context where its type
rendered it invalid.

llvm-svn: 274267
2016-06-30 20:24:30 +00:00
Etienne Bergeron 5220d4e760 [compiler-rt] Re-active unittest previously broken on windows.
Summary: These tests are working fine.

Reviewers: rnk

Subscribers: kubabrecka, wang0109, llvm-commits, chrisha

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

llvm-svn: 274265
2016-06-30 20:06:29 +00:00
Etienne Bergeron fb4ba14b70 [compiler-rt] Fix TLS resource leaking in unittest
Summary:
The thread specific key wasn't not released.
Running the unittest in loop will fail after 1024 iteraions.

```
 ./projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-i386-Test --gtest_filter=SanitizerCommon.PthreadDestructorIterations --gtest_repeat=2000 --gtest_break_on_failure
```

```
Repeating all tests (iteration 1023) . . .

Note: Google Test filter = SanitizerCommon.PthreadDestructorIterations
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.PthreadDestructorIterations
/usr/local/google/home/etienneb/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_posix_test.cc:54: Failure
Value of: pthread_key_create(&key, &destructor)
  Actual: 11
Expected: 0
Aborted (core dumped)
```

Reviewers: rnk

Subscribers: kubabrecka, llvm-commits, chrisha

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

llvm-svn: 274264
2016-06-30 19:56:14 +00:00
Yunzhong Gao b386955adc Add an artificial line-0 debug location when the compiler emits a call to
__stack_chk_fail(). This avoids a compiler crash.

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

llvm-svn: 274263
2016-06-30 18:49:04 +00:00
Wei Mi 95685faeee Refine the set of UniformAfterVectorization instructions.
Except the seed uniform instructions (conditional branch and consecutive ptr
instructions), dependencies to be added into uniform set should only be used
by existing uniform instructions or intructions outside of current loop.

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

llvm-svn: 274262
2016-06-30 18:42:56 +00:00
Justin Lebar 27ee130e38 [CUDA] Give templated device functions internal linkage, templated kernels external linkage.
Summary:
This lets LLVM perform IPO over these functions.  In particular, it
allows LLVM to emit ld.global.nc for loads to __restrict pointers in
kernels that are never written to.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

llvm-svn: 274261
2016-06-30 18:41:33 +00:00
Richard Smith cc4bb63351 PR28373: fix crash-on-invalid if the condition of an if-statement fails typo-correction.
llvm-svn: 274260
2016-06-30 18:36:34 +00:00
Justin Bogner fbac64d678 CodeGen: Add the other BuildMI overload for MachineInstr&
The change in r274193 missed this variant.

llvm-svn: 274259
2016-06-30 18:32:12 +00:00
Rafael Espindola d86e8bb0ed Delete MCCodeGenInfo.
MC doesn't really care about CodeGen stuff, so this was just
complicating target initialization.

llvm-svn: 274258
2016-06-30 18:25:11 +00:00
Justin Lebar 8b08d2c5c8 Don't instantiate a full host toolchain in ASTMatchersTest.
Summary:
This test was stat()'ing large swaths of /usr/lib hundreds of times, as
every invocation of matchesConditionally*() created a new Linux
toolchain.

In addition to being slow, perf indicated this was causing substantial
contention in the kernel.

Something is...interesting in the kernel, as without this patch I
sometimes see ~11m spent in the kernel, and sometimes ~5m.  This
corresponds to bimodal ninja check-clang times of ~30s and ~20s.

It's not clear to me exactly what causes the bimodality.  In any case,
this change makes this test run in 2.5s, down from 17s, and it seems to
cause us to get the 20s ninja check-clang time unconditionally.

Reviewers: chandlerc

Subscribers: cfe-commits, klimek

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

llvm-svn: 274257
2016-06-30 18:12:25 +00:00
Oleksiy Vyalov 6e181cf341 Improve ADB utilization within Android platform.
http://reviews.llvm.org/D21770

llvm-svn: 274256
2016-06-30 18:10:27 +00:00
Marshall Clow f7aaf31c53 Mark issues 2550, 2551, 2555, 2685, 2698 as complete. These issues are wording clarifications; no code changes required.
llvm-svn: 274255
2016-06-30 18:05:19 +00:00
Sean Callanan 3696f86188 Removed the redundant "%d errors parsing expression" error. Nobody keeps score.
<rdar://problem/24306284>

llvm-svn: 274254
2016-06-30 18:00:32 +00:00
Marshall Clow 2f63da2887 Mark issues 2667, 2669, 2670, 2671, 2673 as complete. These issues are wording clarifications; no code changes required.
llvm-svn: 274253
2016-06-30 17:59:01 +00:00
Marshall Clow e46c0885ff Implement LWG#2688: 'clamp misses preconditions and has extraneous condition on result'. We already did this, just added tests
llvm-svn: 274252
2016-06-30 17:52:51 +00:00
Etienne Bergeron 078d8f69b6 revert http://reviews.llvm.org/D21101
llvm-svn: 274251
2016-06-30 17:52:24 +00:00
Marshall Clow bc4618647f Temporarily XFAIL the incomplete type tests for GCC while I figure out why adding a static_assert in r274235 broken them
llvm-svn: 274250
2016-06-30 17:49:36 +00:00
Lang Hames 759b30edfc [Support] Fix a bug in ErrorList::join / joinErrors.
When concatenating two error lists the ErrorList::join method (which is called
by joinErrors) was failing to set the checked bit on the second error, leading
to a 'failure to check error' assertion.

llvm-svn: 274249
2016-06-30 17:43:06 +00:00
Zachary Turner ab58ae8730 [pdb] Re-add code to write PDB files.
Somehow all the functionality to write PDB files got removed,
probably accidentally when uploading the patch perhaps the wrong
one got uploaded.  This re-adds all the code, as well as the
corresponding test.

llvm-svn: 274248
2016-06-30 17:43:00 +00:00
Zachary Turner a30bd1a1bc Update llvm-pdbdump to use subcommands.
llvm-svn: 274247
2016-06-30 17:42:48 +00:00
Reid Kleckner 31abd80fbe [codeview] Emit qualified display names if -gline-tables-only is on
When -gmlt is on, we don't emit namespace or class scope information,
and the CodeView emission code in LLVM can't compute the fully qualified
name. If we know LLVM won't be able to get the name right, go ahead and
emit the qualified name in the frontend.

We could change our -gmlt emission strategy to include those scopes when
emitting codeview, but that would increase memory usage and slow down
LTO and add more complexity to debug info emission.

The same problem exists when you debug a -gmlt binary with GDB, so we
should consider removing '&& EmitCodeView' from the condition here at
some point in the future after evaluating the impact on object file
size.

llvm-svn: 274246
2016-06-30 17:41:31 +00:00
Reid Kleckner 12e64d953f Port some more debug info tests on Windows
llvm-svn: 274245
2016-06-30 17:41:27 +00:00
Adrian Prantl 9f4ef630e0 [CMake] Add an LLVM_ENABLE_MODULE_DEBUGGING flag for building with -gmodules.
This flag is only effective in builds with debug info and modules.
The default is On for Darwin only.

rdar://problem/27019000

llvm-svn: 274244
2016-06-30 17:15:44 +00:00
Marshall Clow c8afc869b0 Implement LWG#2684: 'priority_queue lacking comparator typedef'. We already did this, just added tests
llvm-svn: 274243
2016-06-30 16:03:50 +00:00
Adrian Prantl 8a75ee9317 Revert "[CMake] Move the -Xclang option before -fmodules-cache-path"
This reverts commit 3db82f646a0890eb7664d0351b5a3c79622e8bef.

Vassil already fixed this and I mechanically undid his fix without looking
too close at what I'm actually doing. Need more coffee.

llvm-svn: 274242
2016-06-30 15:58:36 +00:00
Marshall Clow 81fce9729c Implement LWG#2596: 'vector::data() should use addressof'
llvm-svn: 274241
2016-06-30 15:50:55 +00:00
Adrian Prantl c3201ee5f1 [CMake] Move the -Xclang option before -fmodules-cache-path
This fixes a typo introduced in r274196.
Thanks to Vassil Vassilev for noticing!

http://reviews.llvm.org/D21827
rdar://problem/27019000

llvm-svn: 274240
2016-06-30 15:44:35 +00:00
Etienne Bergeron 47cf4eabe6 [exceptions] Upgrade exception handlers when stack protector is used
Summary:
MSVC provide exception handlers with enhanced information to deal with security buffer feature (/GS).

To be more secure, the security cookies (GS and SEH) are validated when unwinding the stack.

The following code:
```
void f() {}

void foo() {
  __try {
    f();
  } __except(1) {
    f();
  }
}
```

Reviewers: majnemer, rnk

Subscribers: thakis, llvm-commits, chrisha

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

llvm-svn: 274239
2016-06-30 15:36:59 +00:00
Sanjay Patel 7521e1b880 fix formatting, add TODO; NFC
llvm-svn: 274238
2016-06-30 15:32:45 +00:00
Jun Bum Lim 596a3bd9ec [DSE] Fix bug in partial overwrite tracking
Summary:
Found cases where DSE incorrectly add partially-overwritten intervals.
Please see the test case for details.

Reviewers: mcrosier, eeckstein, hfinkel

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 274237
2016-06-30 15:32:20 +00:00
Marshall Clow e766a87b01 Implement LWG#2441: 'Exact-width atomic typedefs should be provided'
llvm-svn: 274236
2016-06-30 15:28:38 +00:00
Marshall Clow 497677449b Implement LWG#2436: 'Comparators for associative containers should always be CopyConstructible'
llvm-svn: 274235
2016-06-30 15:11:53 +00:00
Etienne Bergeron 2d1938be0d [compiler-rt] Fix broken (flaky) unittests based on FlagParser.
Summary:
The FlagParser is populating a static global class with the
unrecognized flags when parsing. That global class has a 
dcheck that limit the number of unrecognized flag to 20.

```
class UnknownFlags {
  static const int kMaxUnknownFlags = 20;
  const char *unknown_flags_[kMaxUnknownFlags];
  int n_unknown_flags_;

  [...]

  void Report() {
    if (!n_unknown_flags_) return;
    Printf("WARNING: found %d unrecognized flag(s):\n", n_unknown_flags_);
    for (int i = 0; i < n_unknown_flags_; ++i)
      Printf("    %s\n", unknown_flags_[i]);
    n_unknown_flags_ = 0;
  }
};

UnknownFlags unknown_flags;
```

Unittests based on that class must reset the counter 'n_unknown_flags_' or
the next usage of that class may fail arbitrary. This can be done by
reporting the pending unknown flags.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 274234
2016-06-30 15:11:13 +00:00
Sanjay Patel 7c6eab5777 [InstCombine] shrink switch conditions better (PR24766)
https://llvm.org/bugs/show_bug.cgi?id=24766#c2

This removes a hack that was added for the benefit of x86 codegen. 
It prevented shrinking the switch condition even to smaller legal (DataLayout) types.
We have a safety mechanism in CGP after:
http://reviews.llvm.org/rL251857
...so we're free to use the optimal (smallest) IR type now.

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

llvm-svn: 274233
2016-06-30 14:51:21 +00:00
Elliot Colp bda4cb6091 Test commit
llvm-svn: 274232
2016-06-30 14:42:47 +00:00
Etienne Bergeron c8ee9d9614 [compiler-rt] Reset global variables in ThreadRegistryThreadedTest
Summary:
The unittest 'ThreadRegistryThreadedTest' is failing when running in loop.
There are global variables that need to be cleared.

To repro:
```
projects\compiler-rt\lib\sanitizer_common\tests\Release\Sanitizer-x86_64-Test.exe --gtest_filter=SanitizerCommon.ThreadRegistryThreadedTest  --gtest_repeat=2
```

Output:
```
Repeating all tests (iteration 1) . . .

Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.ThreadRegistryThreadedTest
[       OK ] SanitizerCommon.ThreadRegistryThreadedTest (1 ms)
[----------] 1 test from SanitizerCommon (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[  PASSED  ] 1 test.

Repeating all tests (iteration 2) . . .

Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.ThreadRegistryThreadedTest
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(216): error: Value of: num_created[0]
  Actual: 2
Expected: 1
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(217): error: Value of: num_started[0]
  Actual: 2
Expected: 1
C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(220): error: Value of: num_created[i]
[...]
[  FAILED  ] SanitizerCommon.ThreadRegistryThreadedTest (294 ms)
[----------] 1 test from SanitizerCommon (294 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (299 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SanitizerCommon.ThreadRegistryThreadedTest

 1 FAILED TEST
```

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 274231
2016-06-30 14:37:26 +00:00
Etienne Bergeron e6f424460a [compiler-rt] Fix broken unittest using alloca on MSVC.
Summary:
The alloca header is not present on windows.

This test was committed recently:
  http://reviews.llvm.org/D21509
  http://reviews.llvm.org/rL273889

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha, kubabrecka

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

llvm-svn: 274230
2016-06-30 14:37:02 +00:00
Sanjay Patel 4520d9a1f5 [InstCombine] use ConstantExpr::getBitCast() instead of creating useless instruction
llvm-svn: 274229
2016-06-30 14:27:41 +00:00
Sanjay Patel 7ad98babfa [InstCombine] extend matchSelectFromAndOr() to work with i1 scalar types
If the incoming types are i1, then we don't have to pattern match any sext ops.

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

llvm-svn: 274228
2016-06-30 14:18:18 +00:00
Vassil Vassilev 9371770b9e [CMake] -fmodules-local-submodule-visibility is a cc1-only option.
This should fix modules builds on platforms other than Darwin after r274196.

llvm-svn: 274227
2016-06-30 14:17:42 +00:00
Rafael Espindola 222a9d09f3 Don't repeat names in comments. NFC.
llvm-svn: 274226
2016-06-30 12:44:52 +00:00
Rafael Espindola db6bd02185 Delete unused includes. NFC.
llvm-svn: 274225
2016-06-30 12:19:16 +00:00
Michael Zuckerman 5486eab385 [AVX512][BUILTIN][vpermilps][intrinsics] Fixing two incorrect IMM check.
Differential Revision: http://reviews.llvm.org/D21836

llvm-svn: 274224
2016-06-30 12:12:20 +00:00
Dmitry Polukhin 79e2673f25 Fix CodeGenCXX/mangle-abi-tag.cpp on clang-ppc64le-linux bot
llvm-svn: 274223
2016-06-30 11:15:52 +00:00