platform/upstream/llvm.git
9 years ago[Scalarizer] Fix potential for stale data in Scattered across invocations
Matt Wala [Thu, 23 Jul 2015 20:53:46 +0000 (20:53 +0000)]
[Scalarizer] Fix potential for stale data in Scattered across invocations

Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

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

llvm-svn: 243040

9 years agoSema: Avoid a stack overflow on large CFGs
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 20:15:50 +0000 (20:15 +0000)]
Sema: Avoid a stack overflow on large CFGs

Large CFGs cause `checkForFunctionCall()` to overflow its stack.  Break
the recursion by manually managing the call stack instead.

Patch by Vedant Kumar!

llvm-svn: 243039

9 years agoSema: Split out helper from checkForFunctionCall(), NFC
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 20:11:47 +0000 (20:11 +0000)]
Sema: Split out helper from checkForFunctionCall(), NFC

Split out `hasRecursiveCallInPath()` from `checkForFunctionCall()` to
flatten nesting and clarify the code.  This also simplifies a follow-up
patch that refactors the other logic in `checkForFunctionCall()`.

Patch by Vedant Kumar!

llvm-svn: 243038

9 years agoAdd LICM test cases
Michael Kruse [Thu, 23 Jul 2015 20:05:11 +0000 (20:05 +0000)]
Add LICM test cases

These test cases check whether Polly still gives the same results if
LICM runs before.  Currently, it does not and therefore these cases are
expected fails.

llvm-svn: 243037

9 years agoAlways execute polly::CodePreparation before Polly
Michael Kruse [Thu, 23 Jul 2015 20:00:20 +0000 (20:00 +0000)]
Always execute polly::CodePreparation before Polly

ScopDetection does not allow scops to begin with the entry block, were
allocas are added at code generation.

llvm-svn: 243036

9 years agoMost thread plans don't handle eStopReasonInstrumentation stop reasons,
Jim Ingham [Thu, 23 Jul 2015 19:55:02 +0000 (19:55 +0000)]
Most thread plans don't handle eStopReasonInstrumentation stop reasons,
but that wasn't added to the list of reasons they don't explain.  That
would mean we keep stepping after hitting the AsanDie breakpoint rather
than stopping when the Asan event occurred.

<rdar://problem/21925479>

llvm-svn: 243035

9 years agoX86: Use dyn_cast instead of isa+cast, NFC
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 19:27:07 +0000 (19:27 +0000)]
X86: Use dyn_cast instead of isa+cast, NFC

llvm-svn: 243034

9 years agoThis patch eanble register coalescing to coalesce the following:
Weiming Zhao [Thu, 23 Jul 2015 19:24:53 +0000 (19:24 +0000)]
This patch eanble register coalescing to coalesce the following:

  %vreg2<def> = MOVi32imm 1; GPR32:%vreg2
  %W1<def> = COPY %vreg2; GPR32:%vreg2
into:
  %W1<def> = MOVi32imm 1
Patched by Lawrence Hu (lawrence@codeaurora.org)

llvm-svn: 243033

9 years agoPatch out a fatal assertion in OpenMP runtime until preconditions are met
Jonathan Peyton [Thu, 23 Jul 2015 18:58:37 +0000 (18:58 +0000)]
Patch out a fatal assertion in OpenMP runtime until preconditions are met

Compiling simple testcase with g++ and linking it to the LLVM OpenMP runtime
compiled in debug mode trips an assertion that produces a fatal error. When
the assertion is skipped, the program runs successfully to completion and
produces the same answer as the sequential code. Intel will restore the
assertion with a patch that fixes the issues that cause it to trip.

Patch by John Mellor-Crummey

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

llvm-svn: 243032

9 years ago[libFuzzer] dump long running units to disk
Kostya Serebryany [Thu, 23 Jul 2015 18:37:22 +0000 (18:37 +0000)]
[libFuzzer] dump long running units to disk

llvm-svn: 243031

9 years agoDetect and throw on a class of bad regexes that we mistakenly accepted before. Thanks...
Marshall Clow [Thu, 23 Jul 2015 18:27:51 +0000 (18:27 +0000)]
Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report

llvm-svn: 243030

9 years agoUpdating the documentation for the hasAttr AST matcher, which behaves somewhat differ...
Aaron Ballman [Thu, 23 Jul 2015 17:54:59 +0000 (17:54 +0000)]
Updating the documentation for the hasAttr AST matcher, which behaves somewhat differently when used within clang-query. Fixes PR24217.

llvm-svn: 243029

9 years agomisc-unused-parameters: Fix bug where the check was looking at
Daniel Jasper [Thu, 23 Jul 2015 17:26:36 +0000 (17:26 +0000)]
misc-unused-parameters: Fix bug where the check was looking at
ParmVarDecls of function types.

llvm-svn: 243026

9 years ago[Compiler-RT] Remove dependency on libgcc_s/eh
Renato Golin [Thu, 23 Jul 2015 17:24:41 +0000 (17:24 +0000)]
[Compiler-RT] Remove dependency on libgcc_s/eh

Currently, for --rtlib=compiler-rt on GNU systems, we're assuming
that one has libgcc_s and libgcc_eh as low-level libraries, which
when used in conjunction with -lunwind or -lc++abi, breaks that
assumption.

My original fix was wrong, and this patch reverts it to prepare for
a new flag to choose the unwinder/C++ libraries. For the time being,
people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any
combination they need explicitly.

llvm-svn: 243025

9 years agoRemoved redundant alias checks generated during run time.
Johannes Doerfert [Thu, 23 Jul 2015 17:04:54 +0000 (17:04 +0000)]
Removed redundant alias checks generated during run time.

  As specified in PR23888, run-time alias check generation is expensive
  in terms of compile-time. This reduces the compile time by computing
  minimal/maximal access only once for each base pointer

Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in>
llvm-svn: 243024

9 years agoisl: Translate brisebarre to use UNIX line endings
Tobias Grosser [Thu, 23 Jul 2015 15:35:45 +0000 (15:35 +0000)]
isl: Translate brisebarre to use UNIX line endings

A similar patch will be upstreamed to ISL. We commit this ahead of time to
unblock people that are annoyed the permanent diffs we see in git.

llvm-svn: 243020

9 years agoSpeed up NativeProcessLinux::GetLoadedModuleFileSpec
Pavel Labath [Thu, 23 Jul 2015 14:47:33 +0000 (14:47 +0000)]
Speed up NativeProcessLinux::GetLoadedModuleFileSpec

Summary:
GetLoadedModuleFileSpec was reading /proc/pid/maps character by character, which was very slow,
since we do that for every shared library, which android tends to have a lot. Switching to
ProcFileReader saves us about 0.4 seconds in attach time.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 243019

9 years agoAdd missing files for objc_boxable feature.
Alex Denisov [Thu, 23 Jul 2015 14:45:41 +0000 (14:45 +0000)]
Add missing files for objc_boxable feature.

Original patch [r240761] is missing all new files because of committer's mistake.

llvm-svn: 243018

9 years ago[CMake] Fix libomp_check_linker_flag function
Jonathan Peyton [Thu, 23 Jul 2015 14:41:35 +0000 (14:41 +0000)]
[CMake] Fix libomp_check_linker_flag function

libomp_check_linker_flag rewrites src_to_link.c and CMakeLists.txt in build
directory for test project, but cmake does not rebuild the project. The root
cause is that on some filesystems (ext3, reiserfs) timestamp resoultion is 1
second. So cmake does not rebuild test project if check takes less than 1 second.
This patch puts each test in its own directory to avoid the timestamp problem.

Patch by Chris Bergstrom

http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-July/000817.html

llvm-svn: 243017

9 years agoNFC. Explicitly specify attributes in BasicAA/cs-cs.ll test.
Igor Laevsky [Thu, 23 Jul 2015 14:31:18 +0000 (14:31 +0000)]
NFC. Explicitly specify attributes in BasicAA/cs-cs.ll test.
This will simplify verifying correctness for a changes which modify attributes.

llvm-svn: 243016

9 years agoDelete dead code.
Rafael Espindola [Thu, 23 Jul 2015 13:42:16 +0000 (13:42 +0000)]
Delete dead code.

llvm-svn: 243015

9 years agoUse the getSymbol with an explicit symbol table. NFC.
Rafael Espindola [Thu, 23 Jul 2015 13:41:25 +0000 (13:41 +0000)]
Use the getSymbol with an explicit symbol table. NFC.

llvm-svn: 243014

9 years ago[NativeProcessLinux] Fix a couple of warnings
Pavel Labath [Thu, 23 Jul 2015 13:07:37 +0000 (13:07 +0000)]
[NativeProcessLinux] Fix a couple of warnings

llvm-svn: 243013

9 years agoUse helper function. NFC.
Rafael Espindola [Thu, 23 Jul 2015 12:51:44 +0000 (12:51 +0000)]
Use helper function. NFC.

llvm-svn: 243012

9 years agoAdd a version of getSymbol with an explicit symbol table. Use it. NFC.
Rafael Espindola [Thu, 23 Jul 2015 12:49:40 +0000 (12:49 +0000)]
Add a version of getSymbol with an explicit symbol table. Use it. NFC.

llvm-svn: 243011

9 years ago[X86] Allow load folding into PUSH instructions
Michael Kuperstein [Thu, 23 Jul 2015 12:23:45 +0000 (12:23 +0000)]
[X86] Allow load folding into PUSH instructions

Adds pushes to the folding tables.
This also required a fix to the TD definition, since the memory forms of
the push instructions did not have the right mayLoad/mayStore flags.

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

llvm-svn: 243010

9 years ago[X86][AVX512F] Add FP scalar intrinsics
Asaf Badouh [Thu, 23 Jul 2015 12:13:32 +0000 (12:13 +0000)]
[X86][AVX512F] Add FP scalar intrinsics
intrinsics for: add/sub/mul/div/min/max in their FP scalar versions

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

llvm-svn: 243009

9 years ago[x86] change FP scalar builtin naming convention
Asaf Badouh [Thu, 23 Jul 2015 12:10:51 +0000 (12:10 +0000)]
[x86] change FP scalar builtin naming convention

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

llvm-svn: 243008

9 years ago[asan] Trying to make peace with the Windows bots, take 2
Kuba Brecka [Thu, 23 Jul 2015 11:53:58 +0000 (11:53 +0000)]
[asan] Trying to make peace with the Windows bots, take 2

There are some test failures after r243003 and r243004 ("Rename the ABI
versioning symbol to '__asan_version_mismatch_check' instead abusing
'__asan_init'"). See http://reviews.llvm.org/D11004

llvm-svn: 243007

9 years ago[LinkerScript] Fix case when setting custom NONE segment
Denis Protivensky [Thu, 23 Jul 2015 11:46:59 +0000 (11:46 +0000)]
[LinkerScript] Fix case when setting custom NONE segment

llvm-svn: 243006

9 years ago[asan] Trying to make peace with the Windows bots
Kuba Brecka [Thu, 23 Jul 2015 11:20:14 +0000 (11:20 +0000)]
[asan] Trying to make peace with the Windows bots

There are some test failures after r243003 and r243004 ("Rename the ABI
versioning symbol to '__asan_version_mismatch_check' instead abusing
'__asan_init'"). See http://reviews.llvm.org/D11004

llvm-svn: 243005

9 years ago[asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead...
Kuba Brecka [Thu, 23 Jul 2015 10:55:13 +0000 (10:55 +0000)]
[asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'

We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.

Reviewed at http://reviews.llvm.org/D11004

llvm-svn: 243004

9 years ago[asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead...
Kuba Brecka [Thu, 23 Jul 2015 10:54:06 +0000 (10:54 +0000)]
[asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'

We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.

Reviewed at http://reviews.llvm.org/D11004

llvm-svn: 243003

9 years ago[ELF] Apply segments from linker scripts
Denis Protivensky [Thu, 23 Jul 2015 10:34:30 +0000 (10:34 +0000)]
[ELF] Apply segments from linker scripts

Put sections to segments according to linker scripts if available.
Rework the code of TargetLayout::assignSectionsToSegments so it operates
on the given list of segments, which can be either read from linker scripts
or constructed as before.
Handle NONE segments defined in linker scripts by putting corresponding sections
to PT_NULL segment.
Consider flags set for segments through linker scripts.

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

llvm-svn: 243002

9 years ago[X86] Fix order of operands for ins and outs instructions when parsing intel syntax
Michael Kuperstein [Thu, 23 Jul 2015 10:23:48 +0000 (10:23 +0000)]
[X86] Fix order of operands for ins and outs instructions when parsing intel syntax

Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11337

llvm-svn: 243001

9 years agoRemove XFAIL from ReturnValueTestCase after rL242972
Tamas Berghammer [Thu, 23 Jul 2015 09:49:59 +0000 (09:49 +0000)]
Remove XFAIL from ReturnValueTestCase after rL242972

llvm-svn: 243000

9 years ago[GMR] Add a late run of GlobalsModRef to the main pass pipeline behind
Chandler Carruth [Thu, 23 Jul 2015 09:34:01 +0000 (09:34 +0000)]
[GMR] Add a late run of GlobalsModRef to the main pass pipeline behind
the general GMR-in-non-LTO flag.

Without this, we have the global information during the CGSCC pipeline
for GVN and such, but don't have it available during the late loop
optimizations such as the vectorizer. Moreover, after the CGSCC pipeline
has finished we have substantially more accurate and refined call graph
information, function annotations, etc, which will make GMR even more
powerful than it is early in the pipelien.

Note that we have to play silly games with preserving AliasAnalysis
(which is now trivially preserved) in order to let a module analysis
magically be preserved into the entire function pass pipeline.
Simultaneously we have to not make GMR an immutable pass in order to be
able to re-run it and collect fresh data on the final call graph.

llvm-svn: 242999

9 years agoSupport printing relocations in files with no section table.
Rafael Espindola [Thu, 23 Jul 2015 09:11:05 +0000 (09:11 +0000)]
Support printing relocations in files with no section table.

llvm-svn: 242998

9 years agoAdd jstopinfo support to llgs
Pavel Labath [Thu, 23 Jul 2015 09:09:29 +0000 (09:09 +0000)]
Add jstopinfo support to llgs

Summary:
This adds support for jstopinfo field of stop-reply packets. This field enables us to avoid
querying full thread stop data on most stops  (see r242593 for more details).

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 242997

9 years ago[lldb-mi] Remove unwanted comment blocks.
Bruce Mitchener [Thu, 23 Jul 2015 09:04:56 +0000 (09:04 +0000)]
[lldb-mi] Remove unwanted comment blocks.

Summary:
This removes Authors:, Gotchas:, Changes: and Copyright:.

It leaves a couple of Gotcha: blocks that were not empty.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242996

9 years agoUse typdef to simplify the code. NFC.
Rafael Espindola [Thu, 23 Jul 2015 08:48:14 +0000 (08:48 +0000)]
Use typdef to simplify the code. NFC.

llvm-svn: 242995

9 years agoX86: Fixed assertion failure in 32-bit mode
Elena Demikhovsky [Thu, 23 Jul 2015 08:25:23 +0000 (08:25 +0000)]
X86: Fixed assertion failure in 32-bit mode
The DAG Node "SCALAR_TO_VECTOR" may be created if the type of the scalar element is legal.
Added a check for the scalar type before creating this node.
Added a test that fails with assertion on the current version.

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

llvm-svn: 242994

9 years agoAvoid using -Wl,-z,defs on Cygwin.
Yaron Keren [Thu, 23 Jul 2015 08:06:12 +0000 (08:06 +0000)]
Avoid using -Wl,-z,defs on Cygwin.

Prior to CMAKE 2.8.4 that was covered by the WIN32 conditional but
from 2.8.4 CMAKE no longer defined WIN32 when running under Cygwin
and it needs its own test.

Patch by Martell Malone!

http://reviews.llvm.org/D11347

llvm-svn: 242993

9 years agoRevert r242990: "AVX-512: Implemented encoding , DAG lowering and ..."
Chandler Carruth [Thu, 23 Jul 2015 08:03:44 +0000 (08:03 +0000)]
Revert r242990: "AVX-512: Implemented encoding , DAG lowering and ..."

This commit broke the build. Numerous build bots broken, and it was
blocking my progress so reverting.

It should be trivial to reproduce -- enable the BPF backend and it
should fail when running llvm-tblgen.

llvm-svn: 242992

9 years ago[GMR] Switch the function info we store for every function to be a much
Chandler Carruth [Thu, 23 Jul 2015 07:50:52 +0000 (07:50 +0000)]
[GMR] Switch the function info we store for every function to be a much
more dense datastructure. We actually only have 3 bits of information
and an often-null pointer here. This fits very nicely into a
pointer-size value in the DenseMap from Function -> Info. Then we take
one more pointer hop to get to a secondary DenseMap from GlobalValue ->
ModRefInfo when we actually have precise info for particular globals.

This is more code than I would really like to do this packing, but it
ended up reasonably cleanly laid out. It should ensure we don't hit
scaling limitations with more widespread use of GMR.

llvm-svn: 242991

9 years agoAVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate...
Igor Breger [Thu, 23 Jul 2015 07:39:21 +0000 (07:39 +0000)]
AVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate with/without saturation
Added tests for DAG lowering ,encoding and intrinsic

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

llvm-svn: 242990

9 years ago[ScalarEvolution] Change addRequired to addRequiredTransitive on two passes where...
Craig Topper [Thu, 23 Jul 2015 07:33:48 +0000 (07:33 +0000)]
[ScalarEvolution] Change addRequired to addRequiredTransitive on two passes where ScalarEvolution stores long lived raw pointers to objects those passes own.

This prevents the pointers from dangling when those passes are freed.

http://reviews.llvm.org/D11236
Patch by Steve King.

llvm-svn: 242989

9 years agoReplace a 0 with nullptr. NFC
Craig Topper [Thu, 23 Jul 2015 07:17:53 +0000 (07:17 +0000)]
Replace a 0 with nullptr. NFC

llvm-svn: 242988

9 years agoAVX : Fix ISA disabling in case AVX512VL , some instructions should be disabled only...
Igor Breger [Thu, 23 Jul 2015 07:11:14 +0000 (07:11 +0000)]
AVX : Fix ISA disabling in case AVX512VL , some instructions should be disabled only if AVX512BW and AVX512VL present.
Tests added.

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

llvm-svn: 242987

9 years ago[X86][AVX512BW] add madd and maddubs intrinsics
Asaf Badouh [Thu, 23 Jul 2015 07:07:25 +0000 (07:07 +0000)]
[X86][AVX512BW] add madd and maddubs intrinsics

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

llvm-svn: 242986

9 years agoFix the shell script check_clang_tidy.sh in r242984.
NAKAMURA Takumi [Thu, 23 Jul 2015 06:03:40 +0000 (06:03 +0000)]
Fix the shell script check_clang_tidy.sh in r242984.

llvm-svn: 242985

9 years agoAppease test/clang-tidy/misc-unused-parameters.cpp for targeting *-win32, to add...
NAKAMURA Takumi [Thu, 23 Jul 2015 05:52:02 +0000 (05:52 +0000)]
Appease test/clang-tidy/misc-unused-parameters.cpp for targeting *-win32, to add -fno-delayed-template-parsing.

Note, clang-tidy tests wouldn't run on Windows hosts since they are disabled with REQUIRES:shell.
The failure would be raised with cross building.

llvm-svn: 242984

9 years agoRemove unnecessary in C++11 c_str() calls
Yaron Keren [Thu, 23 Jul 2015 05:49:29 +0000 (05:49 +0000)]
Remove unnecessary in C++11 c_str() calls

While theoratically required in pre-C++11 to avoid re-allocation upon call,
C++11 guarantees that c_str() returns a pointer to the internal array so
pre-calling c_str() is no longer required.

llvm-svn: 242983

9 years ago[NVPTX] run LSR before straight-line optimizations
Jingyue Wu [Thu, 23 Jul 2015 04:59:07 +0000 (04:59 +0000)]
[NVPTX] run LSR before straight-line optimizations

Summary:
Straight-line optimizations can simplify the loop body and make LSR's
cost analysis more precise. This significantly improves several Eigen3
CUDA benchmarks.

With this change, EigenContractionKernel runs up to 40% faster
(https://bitbucket.org/eigen/eigen/src/753ceee5f206ff7dde9f6a41a5a420749fc9406f/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h?at=default#cl-502).
EigenConvolutionKernel2D runs up to 10% faster
(https://bitbucket.org/eigen/eigen/src/753ceee5f206ff7dde9f6a41a5a420749fc9406f/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h?at=default#cl-605).

I have some difficulties writing small tests that benefit from this
reordering due to a seemingly issue with LSR (being discussed at
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-July/088244.html).

See the review thread for the compilation time impact of GVN.

Reviewers: eliben, jholewinski

Subscribers: llvm-commits, jholewinski

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

llvm-svn: 242982

9 years agoRefactor duplicated code and check for invalid symbol table size.
Rafael Espindola [Thu, 23 Jul 2015 03:24:22 +0000 (03:24 +0000)]
Refactor duplicated code and check for invalid symbol table size.

llvm-svn: 242981

9 years agoAdd test to verify we emit warning when the deprecated virtual function is overloaded.
Davide Italiano [Thu, 23 Jul 2015 02:54:59 +0000 (02:54 +0000)]
Add test to verify we emit warning when the deprecated virtual function is overloaded.

Suggested by Richard Smith.

llvm-svn: 242980

9 years agoFix comment in test.
Dawn Perchik [Thu, 23 Jul 2015 02:15:55 +0000 (02:15 +0000)]
Fix comment in test.

llvm-svn: 242979

9 years agoRevert r242975.
Evgeniy Stepanov [Thu, 23 Jul 2015 01:29:26 +0000 (01:29 +0000)]
Revert r242975.

Breaks Mac build.

llvm-svn: 242978

9 years agoArrayRef-ize a pointer/length pair.
Richard Smith [Thu, 23 Jul 2015 00:53:59 +0000 (00:53 +0000)]
ArrayRef-ize a pointer/length pair.

llvm-svn: 242977

9 years ago[GMR] Further improve the FunctionInfo API inside of GlobalsModRef, NFC.
Chandler Carruth [Thu, 23 Jul 2015 00:12:32 +0000 (00:12 +0000)]
[GMR] Further improve the FunctionInfo API inside of GlobalsModRef, NFC.

This takes the operation of merging a callee's information into the
current information and embeds it into the FunctionInfo type itself.
This is much cleaner as now we don't need to expose iteration of the
globals, etc.

Also, switched all the uses of a raw integer two maintain the mod/ref
info during the SCC walk into just directly manipulating it in the
FunctionInfo object.

llvm-svn: 242976

9 years ago[sanitizer] Implement logging to syslog.
Evgeniy Stepanov [Wed, 22 Jul 2015 23:57:19 +0000 (23:57 +0000)]
[sanitizer] Implement logging to syslog.

Previously, Android target had a logic of duplicating all sanitizer
output to logcat. This change extends it to all posix platforms via
the use of syslog, controlled by log_to_syslog flag. Enabled by
default on Android, off everywhere else.

A bit of cmake magic is required to allow Printf() to call a libc
function. I'm adding a stub implementation to support no-libc builds
like dfsan and safestack.

llvm-svn: 242975

9 years ago[GMR] Wrap all of the per-function information behind a more strongly
Chandler Carruth [Wed, 22 Jul 2015 23:56:31 +0000 (23:56 +0000)]
[GMR] Wrap all of the per-function information behind a more strongly
typed interface as a precursor to rewriting how it is stored.

This way we know that the access paths are controlled and it should be
easy to store these bits in a different way.

No functionality changed.

llvm-svn: 242974

9 years agoDowngrade error about adding 'dllimport' to used free function to warning (PR24215)
Hans Wennborg [Wed, 22 Jul 2015 23:54:51 +0000 (23:54 +0000)]
Downgrade error about adding 'dllimport' to used free function to warning (PR24215)

The code will still work as it can reference the function via its thunk.

llvm-svn: 242973

9 years agoFix TestReturnValue.py after 242903 changes that added vector register return value...
Greg Clayton [Wed, 22 Jul 2015 23:47:29 +0000 (23:47 +0000)]
Fix TestReturnValue.py after 242903 changes that added vector register return value tests. These were failing on x86_64 and i386.

It also pointed out an error in our return values where the ABI only relies on xmm registers, not ymm registers for vector return types.

llvm-svn: 242972

9 years agoMove EHPersonality to CGCleanup
David Majnemer [Wed, 22 Jul 2015 23:46:21 +0000 (23:46 +0000)]
Move EHPersonality to CGCleanup

This makes it possible to use EHPersonality in other parts of CodeGen.

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

llvm-svn: 242971

9 years ago[MS Compat] Allow _Atomic(Type) and 'struct _Atomic' to coexist
David Majnemer [Wed, 22 Jul 2015 23:46:18 +0000 (23:46 +0000)]
[MS Compat] Allow _Atomic(Type) and 'struct _Atomic' to coexist

MSVC 2013 ships, as part of its STL implementation, a class named
'_Atomic'.  This is unfortunate because this keyword is in conflict with
the C11 keyword with the same name.  Our solution was to disable this
keyword when targeting MSVC 2013 and reenable it for 2015.

However, this makes it impossible for clang's headers to make use of
_Atomic.  This is problematic in the case of libc++ as it makes heavy
use of this keyword.

Let the keywordness of _Atomic float under certain circumstances:
the body of a class named _Atomic, or a class with a base specifier
named _Atomic, will not have the keyword variant of _Atomic for the
duration of the class body.  This is sufficient to allow us to correctly
handle _Atomic in the STL while permitting us to use _Atomic as a
keyword everywhere else.

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

llvm-svn: 242970

9 years agoDon't specify languages when setting breakpoints in C function names. We won't be...
Greg Clayton [Wed, 22 Jul 2015 23:45:52 +0000 (23:45 +0000)]
Don't specify languages when setting breakpoints in C function names. We won't be able to tell from the symbol value alone what language the symbol is.

llvm-svn: 242969

9 years agoFix the variable used to reply to the qGDBServerVersion
Jason Molenda [Wed, 22 Jul 2015 23:42:54 +0000 (23:42 +0000)]
Fix the variable used to reply to the qGDBServerVersion
packet so that debugserver will send a reply like

name:debugserver;version:340.99;

<rdar://problem/21933963>

llvm-svn: 242968

9 years agoMark this test as XFAIL with older compilers, since they hit PR18097
Justin Bogner [Wed, 22 Jul 2015 23:32:57 +0000 (23:32 +0000)]
Mark this test as XFAIL with older compilers, since they hit PR18097

llvm-svn: 242967

9 years ago[asan] Enable build of asan-rt on android/aarch64.
Evgeniy Stepanov [Wed, 22 Jul 2015 23:31:50 +0000 (23:31 +0000)]
[asan] Enable build of asan-rt on android/aarch64.

llvm-svn: 242966

9 years ago[dsymutil] Check archive members timestamps.
Frederic Riss [Wed, 22 Jul 2015 23:24:00 +0000 (23:24 +0000)]
[dsymutil] Check archive members timestamps.

The debug map contains the timestamp of the object files in references.
We do not check these in the general case, but it's really useful if
you have archives where different versions of an object file have been
appended. This allows llvm-dsymutil to find the right one.

llvm-svn: 242965

9 years ago[PM/AA] Cleanup comments, formatting, and organization of the AA
Chandler Carruth [Wed, 22 Jul 2015 23:16:02 +0000 (23:16 +0000)]
[PM/AA] Cleanup comments, formatting, and organization of the AA
interface prior to making more substantial and invasive changes.

No functionality changed, and should hopefully keep subsequent patches
as clean and focused as possible in addition to making the comments and
such more clear.

llvm-svn: 242964

9 years ago[PM/AA] Extract the ModRef enums from the AliasAnalysis class in
Chandler Carruth [Wed, 22 Jul 2015 23:15:57 +0000 (23:15 +0000)]
[PM/AA] Extract the ModRef enums from the AliasAnalysis class in
preparation for de-coupling the AA implementations.

In order to do this, they had to become fake-scoped using the
traditional LLVM pattern of a leading initialism. These can't be actual
scoped enumerations because they're bitfields and thus inherently we use
them as integers.

I've also renamed the behavior enums that are specific to reasoning
about the mod/ref behavior of functions when called. This makes it more
clear that they have a very narrow domain of applicability.

I think there is a significantly cleaner API for all of this, but
I don't want to try to do really substantive changes for now, I just
want to refactor the things away from analysis groups so I'm preserving
the exact original design and just cleaning up the names, style, and
lifting out of the class.

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

llvm-svn: 242963

9 years agoFix dumb use-after-free bug introduced in r242868.
Richard Smith [Wed, 22 Jul 2015 22:51:15 +0000 (22:51 +0000)]
Fix dumb use-after-free bug introduced in r242868.

llvm-svn: 242960

9 years agoMerge C++03 and C++11 implementations of mem_fn and __mem_fn.
Eric Fiselier [Wed, 22 Jul 2015 22:43:27 +0000 (22:43 +0000)]
Merge C++03 and C++11 implementations of mem_fn and __mem_fn.

The implementation of mem_fn doesn't actually require any  C++11 support.
For some reason there were 17 overloads for mem_fn in C++03 when only one
is needed. This patch removes the extra overloads and uses the same implementation
of mem_fn in C++03 and C++11.

__mem_fn does require variadics to implement the call operator. Instead of
having two entirely different implementations of the __mem_fn struct, this patch
uses the same __mem_fn struct but provides different call operators when
variadics are not available.

The only thing left in <__functional_03> is the C++03 implementation of
std::function.

llvm-svn: 242959

9 years ago[asan] Remove CHECK line for kernel32.dll
Reid Kleckner [Wed, 22 Jul 2015 22:39:36 +0000 (22:39 +0000)]
[asan] Remove CHECK line for kernel32.dll

Windows 8 users report that it isn't present in the address space by
default anymore.

Fixes PR23773.

llvm-svn: 242958

9 years ago[MSVC Compatibility] Use a better predicate for __BOOL_DEFINED
David Majnemer [Wed, 22 Jul 2015 22:36:26 +0000 (22:36 +0000)]
[MSVC Compatibility] Use a better predicate for __BOOL_DEFINED

Instead of using CPlusPlus, use Bool.  No functionality change is
intended, it just makes things a tad bit more clear.

llvm-svn: 242957

9 years ago[GMR] Continue my quest to remove linked datastructures from GMR, NFC.
Chandler Carruth [Wed, 22 Jul 2015 22:32:34 +0000 (22:32 +0000)]
[GMR] Continue my quest to remove linked datastructures from GMR, NFC.

This replaces the next-to-last std::map with a DenseMap. While DenseMap
doesn't yet make tons of sense (there are 32 bytes or so in the value
type), my next change will reduce the value type to a single pointer --
we only need a pointer and 3 bits, and that is exactly what we can have.

llvm-svn: 242956

9 years ago[ConstantFolding] Support folding loads from a GlobalAlias
David Majnemer [Wed, 22 Jul 2015 22:29:30 +0000 (22:29 +0000)]
[ConstantFolding] Support folding loads from a GlobalAlias

The MSVC ABI requires that we generate an alias for the vtable which
means looking through a GlobalAlias which cannot be overridden improves
our ability to devirtualize.

Found while investigating PR20801.

Patch by Andrew Zhogin!

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

llvm-svn: 242955

9 years agoRevert "Improve merging of stores from static constructors in GlobalOpt"
Anthony Pesch [Wed, 22 Jul 2015 22:26:54 +0000 (22:26 +0000)]
Revert "Improve merging of stores from static constructors in GlobalOpt"

This reverts commit 0a9dee959a30b81b9e7df64c9a58ff9898c24024.

llvm-svn: 242954

9 years agoRevert "IPO: Avoid brace initialization of a map, some versions of libc++ don't like it"
Anthony Pesch [Wed, 22 Jul 2015 22:26:52 +0000 (22:26 +0000)]
Revert "IPO: Avoid brace initialization of a map, some versions of libc++ don't like it"

This reverts commit fc2dad0c68f8d32273d3c2d790ed496961f829af.

llvm-svn: 242953

9 years ago[asan] Disable ctrl+c test until I figure out how to make it portable
Reid Kleckner [Wed, 22 Jul 2015 22:25:07 +0000 (22:25 +0000)]
[asan] Disable ctrl+c test until I figure out how to make it portable

llvm-svn: 242952

9 years agoRemove almost everything in <__functional_base_03>
Eric Fiselier [Wed, 22 Jul 2015 22:23:49 +0000 (22:23 +0000)]
Remove almost everything in <__functional_base_03>

This patch removes a large amount of duplicate code found in both
<__functional_base> and <__functional_base_03>. The only code that remains
in <__functional_base_03> is the C++03 implementation of __invoke and
__invoke_return.

llvm-svn: 242951

9 years ago[GMR] Make the collection of readers and writers of globals much more
Chandler Carruth [Wed, 22 Jul 2015 22:10:05 +0000 (22:10 +0000)]
[GMR] Make the collection of readers and writers of globals much more
efficient, NFC.

Previously, we built up vectors of function pointers to track readers
and writers. The primary problem here is that we would add the same
function to this vector every time we found an instruction that reads or
writes to the pointer. This could be a *lot* of redudant function
pointers. Instead of doing that, we can use a SmallPtrSet.

This does more than just reduce the size of the list of readers or
writers. We walk the entire lists of each and do a map lookup for each
one. By having sets, we will only do one map lookup per reader or writer
function.

But only one user of the pointer analyzer actually needs this
information, so we can also skip accumulating it (and doing a lot of
heap allocations) for all the other pointer analysis. This is
particularly useful because there are very many more pointers in some of
the other cases.

llvm-svn: 242950

9 years agoForce the gnu archive format to fix the test on darwin.
Rafael Espindola [Wed, 22 Jul 2015 22:09:44 +0000 (22:09 +0000)]
Force the gnu archive format to fix the test on darwin.

llvm-svn: 242949

9 years ago[asan] Make __asan_handle_no_return tolerate unregistered threads
Reid Kleckner [Wed, 22 Jul 2015 21:58:31 +0000 (21:58 +0000)]
[asan] Make __asan_handle_no_return tolerate unregistered threads

Summary:
On Windows, thread injection by the kernel or other running processes is
a fairly common occurrence, so ASan should be resilient to it.  The
comments on GetCurrentThread() say that it can return null, so we
shouldn't be CHECK failing if it does.

Sending control-C is one way to get the kernel to inject a thread into
your process, so I wrote a test around it.

Reviewers: llvm-commits

Subscribers: samsonov

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

llvm-svn: 242948

9 years agofix typo; NFC
Sanjay Patel [Wed, 22 Jul 2015 21:56:41 +0000 (21:56 +0000)]
fix typo; NFC

llvm-svn: 242947

9 years agofix indent; NFC
Sanjay Patel [Wed, 22 Jul 2015 21:47:13 +0000 (21:47 +0000)]
fix indent; NFC

llvm-svn: 242946

9 years agoIPO: Avoid brace initialization of a map, some versions of libc++ don't like it
Justin Bogner [Wed, 22 Jul 2015 21:41:12 +0000 (21:41 +0000)]
IPO: Avoid brace initialization of a map, some versions of libc++ don't like it

Should fix the build failure on these darwin bots:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/12427/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/10389/

llvm-svn: 242945

9 years agoSet the live address on child const results in a way that is more maintainable for...
Enrico Granata [Wed, 22 Jul 2015 21:39:15 +0000 (21:39 +0000)]
Set the live address on child const results in a way that is more maintainable for sustained merges with our internal branches

llvm-svn: 242944

9 years agoUpdate version to 3.8.0svn
Hans Wennborg [Wed, 22 Jul 2015 21:36:42 +0000 (21:36 +0000)]
Update version to 3.8.0svn

llvm-svn: 242942

9 years ago[lit] Fix launching executables relative to the cwd after 'cd'
Reid Kleckner [Wed, 22 Jul 2015 21:35:27 +0000 (21:35 +0000)]
[lit] Fix launching executables relative to the cwd after 'cd'

This was affecting test/asan/TestCases/Windows/coverage-basic.cc in
compiler-rt. It does something like:

  cd %T/mydir
  %clang %s -o t.exe
  ./t.exe

Previously, we'd end up looking for t.exe relative to the cwd of the lit
process, not the cwd of the test.

llvm-svn: 242941

9 years ago[PeepholeOptimizer] Refactor optimizeUncoalescable logic
Bruno Cardoso Lopes [Wed, 22 Jul 2015 21:30:16 +0000 (21:30 +0000)]
[PeepholeOptimizer] Refactor optimizeUncoalescable logic

Reapply r242294.

- Create a new CopyRewriter for Uncoalescable copy-like instructions
- Change the ValueTracker to return a ValueTrackerResult

This makes optimizeUncoalescable looks more like optimizeCoalescable and
use the CopyRewritter infrastructure.

This is also the preparation for looking up into PHI nodes in the
ValueTracker.

rdar://problem/20404526

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

llvm-svn: 242940

9 years agoWebAssembly: basic bitcode → assembly CodeGen test
JF Bastien [Wed, 22 Jul 2015 21:28:15 +0000 (21:28 +0000)]
WebAssembly: basic bitcode → assembly CodeGen test

Summary:
Add a basic CodeGen bitcode test which (for now) only prints out the function name and nothing else. The current code merely implements the basic needed for the test run to not crash / assert. Getting to that point required:

 - Basic InstPrinter.
 - Basic AsmPrinter.
 - DiagnosticInfoUnsupported (not strictly required, but nice to have, duplicated from AMDGPU/BPF's ISelLowering).
 - Some SP and register setup in WebAssemblyTargetLowering.
 - Basic LowerFormalArguments.
 - GenInstrInfo.
 - Placeholder LowerFormalArguments.
 - Placeholder CanLowerReturn and LowerReturn.
 - Basic DAGToDAGISel::Select, which requiresGenDAGISel.inc as well as GET_INSTRINFO_ENUM with GenInstrInfo.inc.
 - Remove WebAssemblyFrameLowering::determineCalleeSaves and rely on default.
 - Implement WebAssemblyFrameLowering::hasFP, same as AArch64's implementation.

Follow-up patches will implement a real AsmPrinter, which will require adding MI opcodes specific to WebAssembly.

Reviewers: sunfish

Subscribers: aemerson, jfb, llvm-commits

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

llvm-svn: 242939

9 years agoMIR Serialization: Serialize the machine instruction's debug location.
Alex Lorenz [Wed, 22 Jul 2015 21:15:11 +0000 (21:15 +0000)]
MIR Serialization: Serialize the machine instruction's debug location.

llvm-svn: 242938

9 years agoRename RunCallBacksToRun to llvm::sys::RunSignalHandlers
Yaron Keren [Wed, 22 Jul 2015 21:11:17 +0000 (21:11 +0000)]
Rename RunCallBacksToRun to llvm::sys::RunSignalHandlers

And expose it in Signals.h, allowing clients to call it directly,
possibly LLVMErrorHandler which currently calls RunInterruptHandlers
but not RunSignalHandlers, thus for example not printing the stack
backtrace on Unixish OSes. On Windows it does happen because
RunInterruptHandlers ends up calling the callbacks as well via
Cleanup(). This difference in behaviour and code structures in
*/Signals.inc should be patched in the future.

llvm-svn: 242936

9 years agoImprove merging of stores from static constructors in GlobalOpt
Anthony Pesch [Wed, 22 Jul 2015 21:10:45 +0000 (21:10 +0000)]
Improve merging of stores from static constructors in GlobalOpt

Summary:
While working on a project I wound up generating a fairly large lookup table (10k entries) of callbacks inside of a static constructor. Clang was taking upwards of ~10 minutes to compile the lookup table. I generated a smaller test case (http://www.inolen.com/static_initializer_test.ll) that, after running with -ftime-report, pointed fingers at GlobalOpt and MemCpyOptimizer.

Running globalopt took around ~9 minutes. The slowdown came from how GlobalOpt merged stores from static constructors individually into the global initializer in EvaluateStaticConstructor. For each store it discovered and wanted to commit, it would copy the existing global initializer and then merge in the individual store. I changed this so that stores are now grouped by global, and sorted from most significant to least significant by their GEP indexes (e.g. a store to GEP 0, 0 comes before GEP 0, 0, 1). With this representation, the existing initializer can be copied and all new stores merged into it in a single pass.

With this patch and http://reviews.llvm.org/D11198, the lookup table that was taking ~10 minutes to compile now compiles in around 5 seconds. I've ran 'make check' and the test-suite, which all passed.

I'm not really sure who to tag as a reviewer, Lang mentioned that Chandler may be appropriate.

Reviewers: chandlerc, nlewycky

Subscribers: nlewycky, llvm-commits

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

llvm-svn: 242935

9 years agoMIR Parser: Extract the MDNode parsing code into a separate method. NFC.
Alex Lorenz [Wed, 22 Jul 2015 21:07:04 +0000 (21:07 +0000)]
MIR Parser: Extract the MDNode parsing code into a separate method. NFC.

This change would allow the machine instruction parser to reuse this method when
parsing the metadata node for the machine instruction's debug location property.

llvm-svn: 242934

9 years ago[asan] Test clang's SEH implementation as well as MSVC's
Reid Kleckner [Wed, 22 Jul 2015 20:54:24 +0000 (20:54 +0000)]
[asan] Test clang's SEH implementation as well as MSVC's

llvm-svn: 242933

9 years agoXtimeout TestProcessAttach for Linux.
Chaoren Lin [Wed, 22 Jul 2015 20:52:17 +0000 (20:52 +0000)]
Xtimeout TestProcessAttach for Linux.

llvm-svn: 242932