platform/upstream/llvm.git
8 years agoAdd parentheses to silence -Wparentheses warnings.
Zachary Turner [Thu, 28 Apr 2016 20:26:30 +0000 (20:26 +0000)]
Add parentheses to silence -Wparentheses warnings.

llvm-svn: 267934

8 years ago[clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static...
Alexander Kornienko [Thu, 28 Apr 2016 20:20:01 +0000 (20:20 +0000)]
[clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables

Summary:
Variables with static storage duration are zero-initialized per
[stmt.dcl]p4 and [basic.start.init]p2.

Reviewers: sbenza, aaron.ballman

Subscribers: michael_miller, flx, cfe-commits

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

llvm-svn: 267933

8 years ago[RDF] Add option to keep dead phi nodes in DFG
Krzysztof Parzyszek [Thu, 28 Apr 2016 20:17:06 +0000 (20:17 +0000)]
[RDF] Add option to keep dead phi nodes in DFG

Dead phi nodes are needed for code motion (such as copy propagation),
where a new use would be placed in a location that would be dominated
by a dead phi. Such a transformation is not legal for copy propagation,
and the existence of the phi would prevent it, but if the phi is not
there, it may appear to be valid.

llvm-svn: 267932

8 years agoUsed llvm_unreached to quite a VC++ compiler warning.
Adrian McCarthy [Thu, 28 Apr 2016 20:14:44 +0000 (20:14 +0000)]
Used llvm_unreached to quite a VC++ compiler warning.

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

llvm-svn: 267931

8 years ago[CMake] [Darwin] Use libtool instead of ar && ranlib
Chris Bieneman [Thu, 28 Apr 2016 20:14:19 +0000 (20:14 +0000)]
[CMake] [Darwin] Use libtool instead of ar && ranlib

Summary: Using libtool instead of ar and ranlib on Darwin shaves a minute off my clang build. This is because on Darwin libtool is optimized to give hints to the kernel about filesystem interactions that allow it to be faster.

Reviewers: bogner, pete

Subscribers: llvm-commits

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

llvm-svn: 267930

8 years agoUpdate llvm-objdump for disassembly of ARM Mach-O files to always include the opcode...
Kevin Enderby [Thu, 28 Apr 2016 20:14:13 +0000 (20:14 +0000)]
Update llvm-objdump for disassembly of ARM Mach-O files to always include the opcode bytes.

As this is the expected behavior of the old darwin otool(1) for ARM Mach-O files.

rdar://25896249

llvm-svn: 267929

8 years agoRead the rest of the DBI substreams, and parse source info.
Zachary Turner [Thu, 28 Apr 2016 20:05:18 +0000 (20:05 +0000)]
Read the rest of the DBI substreams, and parse source info.

We now read out the rest of the substreams from the DBI streams.  One of
these substreams, the FileInfo substream, contains information about which
source files contribute to each module (aka compiland).  This patch
additionally parses out the file information from that substream, and
dumps it in llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19634
Reviewed by: ruiu

llvm-svn: 267928

8 years agoThis reverts commit r265505.
Kit Barton [Thu, 28 Apr 2016 20:00:42 +0000 (20:00 +0000)]
This reverts commit r265505.

Revert "[Power9] Implement add-pc, multiply-add, modulo, extend-sign-shift, random number, set bool, and dfp test significance".
This patch has caused a functional regression in SPEC2k6 namd, and a performance regression in mesa-pipe.

llvm-svn: 267927

8 years agoOne more fix for use of invalid PresumedLocs missed by r267914.
Richard Smith [Thu, 28 Apr 2016 19:54:51 +0000 (19:54 +0000)]
One more fix for use of invalid PresumedLocs missed by r267914.

llvm-svn: 267926

8 years ago[Hexagon] Add instruction aliases for vector unsigned compare-equal
Krzysztof Parzyszek [Thu, 28 Apr 2016 19:49:18 +0000 (19:49 +0000)]
[Hexagon] Add instruction aliases for vector unsigned compare-equal

Unsigned compare-equal instructions are mapped to signed compare-equal.

llvm-svn: 267925

8 years ago[analyzer] Add path note for localizability checker.
Devin Coughlin [Thu, 28 Apr 2016 19:44:40 +0000 (19:44 +0000)]
[analyzer] Add path note for localizability checker.

Add a path note indicating the location of the non-localized string
literal in NonLocalizedStringChecker.

rdar://problem/25981525

llvm-svn: 267924

8 years agoXFail TestBitfields.py Python API tests.
Chaoren Lin [Thu, 28 Apr 2016 19:40:19 +0000 (19:40 +0000)]
XFail TestBitfields.py Python API tests.

Summary:
Started failing after rL267895.
Possibly related to http://llvm.org/pr27510.

Reviewers: labath, tfiala

Subscribers: lldb-commits

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

llvm-svn: 267923

8 years agoAMDGPU: Emit error if too much LDS is used
Matt Arsenault [Thu, 28 Apr 2016 19:37:35 +0000 (19:37 +0000)]
AMDGPU: Emit error if too much LDS is used

llvm-svn: 267922

8 years agoUse a single context for lto.
Rafael Espindola [Thu, 28 Apr 2016 19:30:41 +0000 (19:30 +0000)]
Use a single context for lto.

Using multiple context used to be a really big memory saving because we
could free memory from each file while the linker proceeded with the
symbol resolution. We are getting lazier about reading data from the
bitcode, so I was curious if this was still a good tradeoff.

One thing that is a bit annoying is that we still have to copy the
symbol names. The problem is that the names are stored in the Module and
get freed when we move the module bits during linking.

Long term I think the solution is to add a symbol table to the bitcode.
That way IRObject file will not need to use a Module or a Context and we
can drop it while still keeping a StringRef to the names.

This patch is still be an interesting medium term improvement.

When linking llvm-as without debug info this patch is a small speedup:

master: 29.861877513 seconds
patch: 29.814533787 seconds

With debug info the numbers are

master: 34.765181469 seconds
patch: 34.563351584 seconds

The peak memory usage when linking llvm-as with debug info was

master: 599.10MB
patch: 600.13MB
llvm-svn: 267921

8 years agoRemove doInitialization() and doFinalization() member declarations without definitions.
Yaron Keren [Thu, 28 Apr 2016 19:21:30 +0000 (19:21 +0000)]
Remove doInitialization() and doFinalization() member declarations without definitions.
Visual C++ 2015 flags this in the IDE.

llvm-svn: 267919

8 years agoReset the TopRPTracker's position in ScheduleDAGMILive::initQueues
Krzysztof Parzyszek [Thu, 28 Apr 2016 19:17:44 +0000 (19:17 +0000)]
Reset the TopRPTracker's position in ScheduleDAGMILive::initQueues

ScheduleDAGMI::initQueues changes the RegionBegin to the first non-debug
instruction. Since it does not track register pressure, it does not affect
any RP trackers. ScheduleDAGMILive inherits initQueues from ScheduleDAGMI,
and it does reset the TopTPTracker in its schedule method. Any derived,
target-specific scheduler will need to do it as well, but the TopRPTracker
is only exposed as a "const" object to derived classes. Without the ability
to modify the tracker directly, this leaves a derived scheduler with a
potential of having the TopRPTracker out-of-sync with the CurrentTop.

The symptom of the problem:
  void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool):
  Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed.

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

llvm-svn: 267918

8 years agoSkip scanRelocs for non-alloc sections.
Rui Ueyama [Thu, 28 Apr 2016 18:42:04 +0000 (18:42 +0000)]
Skip scanRelocs for non-alloc sections.

Relocations against sections with no SHF_ALLOC bit are R_ABS relocations.
Currently we are creating Relocations vector for them, but that is wasteful.
This patch is to skip vector construction and to directly apply relocations
in place.

This patch seems to be pretty effective for large executables with debug info.
r266158 (Rafael's patch to change the way how we apply relocations) caused a
temporary performance degradation for such executables, but this patch makes
it even faster than before.

Time to link clang with debug info (output size is 1070 MB):

  before r266158: 15.312 seconds (0%)
  r266158:        17.301 seconds (+13.0%)
  Head:           16.484 seconds (+7.7%)
  w/patch:        13.166 seconds (-14.0%)

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

llvm-svn: 267917

8 years agoAMDGPU: Fix mishandling array allocations when promoting alloca
Matt Arsenault [Thu, 28 Apr 2016 18:38:48 +0000 (18:38 +0000)]
AMDGPU: Fix mishandling array allocations when promoting alloca

The canonical form for allocas is a single allocation of the array type.
In case we see a non-canonical array alloca, make sure we aren't
replacing this with an array N times smaller.

llvm-svn: 267916

8 years agoFix builds broken in r267910.
Eugene Zelenko [Thu, 28 Apr 2016 18:27:35 +0000 (18:27 +0000)]
Fix builds broken in r267910.

llvm-svn: 267915

8 years agoFix use of uninitialized value exposed by r267802. Accessors of an invalid
Richard Smith [Thu, 28 Apr 2016 18:26:32 +0000 (18:26 +0000)]
Fix use of uninitialized value exposed by r267802. Accessors of an invalid
PresumedLoc should not be called.

llvm-svn: 267914

8 years ago[CMake] Updating Apple CMake cache file
Chris Bieneman [Thu, 28 Apr 2016 18:24:29 +0000 (18:24 +0000)]
[CMake] Updating Apple CMake cache file

Changing the Apple CMake cache file to better match the way Apple Clang builds are built.

llvm-svn: 267913

8 years ago[CMake] Adding some missing CMake includes. NFC.
Chris Bieneman [Thu, 28 Apr 2016 18:22:01 +0000 (18:22 +0000)]
[CMake] Adding some missing CMake includes. NFC.

This happens to be working now because the includes exist in another CMake file that is included before this one. That will change with upcoming refactoring.

llvm-svn: 267912

8 years agoAdd "PIE Level" metadata to module flags.
Sriraman Tallam [Thu, 28 Apr 2016 18:15:44 +0000 (18:15 +0000)]
Add "PIE Level" metadata to module flags.

http://reviews.llvm.org/D19671

llvm-svn: 267911

8 years agoFix some Clang-tidy modernize and Include What You Use warnings.
Eugene Zelenko [Thu, 28 Apr 2016 18:04:41 +0000 (18:04 +0000)]
Fix some Clang-tidy modernize and Include What You Use warnings.

Differential revision: http://reviews.llvm.org/D19673

llvm-svn: 267910

8 years agoMake the test exercise all paths modified in r267746.
Paul Robinson [Thu, 28 Apr 2016 17:52:28 +0000 (17:52 +0000)]
Make the test exercise all paths modified in r267746.

llvm-svn: 267909

8 years ago[PGO] Fix incorrect Twine usage in emitting optimization remarks.
Rong Xu [Thu, 28 Apr 2016 17:49:56 +0000 (17:49 +0000)]
[PGO] Fix incorrect Twine usage in emitting optimization remarks.

Should not store Twine objects to local variables. This is fixed the test
failures with r267815 in VS2015 X64 build.

llvm-svn: 267908

8 years ago[test/asan] Update a test case to work with old Darwin SDK's
Vedant Kumar [Thu, 28 Apr 2016 17:48:35 +0000 (17:48 +0000)]
[test/asan] Update a test case to work with old Darwin SDK's

On Darwin, MAP_ANONYMOUS is a synonym for MAP_ANON. However, some SDK's
don't define MAP_ANONYMOUS. Use MAP_ANON to work around this.

(As a point of interest, the situation is exactly reversed on Linux.)

llvm-svn: 267907

8 years ago[OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different.
Yaxun Liu [Thu, 28 Apr 2016 17:34:57 +0000 (17:34 +0000)]
[OpenCL] Fix bug in mergeTypes which causes equivalent types treated as different.

When comparing unqualified types, canonical types should be used, otherwise equivalent types may be treated as different type.

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

llvm-svn: 267906

8 years agoMinor format change and fixing typos in the comments. NFC.
Rong Xu [Thu, 28 Apr 2016 17:31:22 +0000 (17:31 +0000)]
Minor format change and fixing typos in the comments. NFC.

llvm-svn: 267905

8 years agoDebug info: Apply an artificial debug location to __cyg_profile_func.* calls.
Adrian Prantl [Thu, 28 Apr 2016 17:21:56 +0000 (17:21 +0000)]
Debug info: Apply an artificial debug location to __cyg_profile_func.* calls.
The LLVM Verifier expects all inlinable calls in debuggable functions to
have a location.

rdar://problem/25818489

llvm-svn: 267904

8 years agoRe-apply r267784, r267824 and r267830.
Peter Collingbourne [Thu, 28 Apr 2016 17:09:37 +0000 (17:09 +0000)]
Re-apply r267784, r267824 and r267830.

I have updated the compiler-rt tests.

llvm-svn: 267903

8 years agoUpdate visibility flags for CFI tests.
Peter Collingbourne [Thu, 28 Apr 2016 17:09:09 +0000 (17:09 +0000)]
Update visibility flags for CFI tests.

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

llvm-svn: 267902

8 years ago[Hexagon] Define certain aliases for vector instructions
Krzysztof Parzyszek [Thu, 28 Apr 2016 16:43:16 +0000 (16:43 +0000)]
[Hexagon] Define certain aliases for vector instructions

Specifically:
  Vd = #0   -> Vd = vxor(Vd, Vd)
  Vdd = #0  -> Vdd.w = vsub(Vdd.w, Vdd.w)
  Vdd = Vss -> Vdd = vcombine(Vss.H, Vss.L)

llvm-svn: 267901

8 years ago[mips][atomics] Fix partword atomic binary operation implementation
Simon Dardis [Thu, 28 Apr 2016 16:26:43 +0000 (16:26 +0000)]
[mips][atomics] Fix partword atomic binary operation implementation

Currently Mips::emitAtomicBinaryPartword() does not properly respect the
width of pointers. For MIPS64 this causes the memory address that the ll/sc
sequence uses to be truncated. At runtime this causes a segmentation fault.

This can be fixed by applying similar changes as r266204, so that a full 64bit
pointer is loaded.

Reviewers: dsanders

Differential Review: http://reviews.llvm.org/D19651

llvm-svn: 267900

8 years ago[SLPVectorizer] Extend SLP Vectorizer to deal with aggregates.
Arch D. Robison [Thu, 28 Apr 2016 16:11:45 +0000 (16:11 +0000)]
[SLPVectorizer] Extend SLP Vectorizer to deal with aggregates.

The refactoring portion part was done as r267748.

http://reviews.llvm.org/D14185

llvm-svn: 267899

8 years ago[GVN] Minor code cleanup. NFC.
Chad Rosier [Thu, 28 Apr 2016 16:00:15 +0000 (16:00 +0000)]
[GVN] Minor code cleanup. NFC.

Differential Revision: http://reviews.llvm.org/D18828
Patch by Aditya Kumar!

llvm-svn: 267898

8 years ago[Hexagon] Handle double-vector registers as new-value producers
Krzysztof Parzyszek [Thu, 28 Apr 2016 15:54:48 +0000 (15:54 +0000)]
[Hexagon] Handle double-vector registers as new-value producers

Patch by Colin LeMahieu.

llvm-svn: 267897

8 years agoDebug Info: Restore the pre-r240853 behavior for DWARF2 bitfields.
Adrian Prantl [Thu, 28 Apr 2016 15:37:52 +0000 (15:37 +0000)]
Debug Info: Restore the pre-r240853 behavior for DWARF2 bitfields.

The DWARF2 specification of DW_AT_bit_offset is ambiguous for
little-endian machines, but by restoring to the old behavior
we match what debuggers expect and what other popular compilers
generate.

llvm-svn: 267896

8 years agoDebug info: Support DWARF4 bitfields via DW_AT_data_bit_offset.
Adrian Prantl [Thu, 28 Apr 2016 15:37:48 +0000 (15:37 +0000)]
Debug info: Support DWARF4 bitfields via DW_AT_data_bit_offset.

The DWARF2 specification of DW_AT_bit_offset was written from the perspective of
a big-endian machine with unclear semantics for other systems.  DWARF4
deprecated DW_AT_bit_offset and introduced a new attribute DW_AT_data_bit_offset
that simply counts the number of bits from the beginning of the containing
entity regardless of endianness.

After this patch LLVM emits DW_AT_bit_offset for DWARF 2 or 3 and
DW_AT_data_bit_offset when DWARF 4 or later is requested.

llvm-svn: 267895

8 years agoProvide location information (file name, line number) in TSan reports about global...
Kuba Brecka [Thu, 28 Apr 2016 15:27:10 +0000 (15:27 +0000)]
Provide location information (file name, line number) in TSan reports about global variables.

llvm-svn: 267894

8 years ago[EarlyCSE] Change LoadValue field Value *Data to Instruction *Inst. NFC.
Geoff Berry [Thu, 28 Apr 2016 15:22:37 +0000 (15:22 +0000)]
[EarlyCSE] Change LoadValue field Value *Data to Instruction *Inst. NFC.

Made in preparation for adding MemorySSA support to EarlyCSE.

llvm-svn: 267893

8 years ago[libFuzzer] Improve documentation
Kostya Serebryany [Thu, 28 Apr 2016 15:19:05 +0000 (15:19 +0000)]
[libFuzzer] Improve documentation

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 267892

8 years ago[RDF] Handle undefined registers in RDF copy propagation
Krzysztof Parzyszek [Thu, 28 Apr 2016 15:09:19 +0000 (15:09 +0000)]
[RDF] Handle undefined registers in RDF copy propagation

When updating the graph, make sure that new uses without reaching defs
are handled correctly.

llvm-svn: 267891

8 years ago[EarlyCSE] Sort includes. NFC.
Geoff Berry [Thu, 28 Apr 2016 14:59:27 +0000 (14:59 +0000)]
[EarlyCSE] Sort includes.  NFC.

Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 267890

8 years agoRangify for loops, NFC.
Yaron Keren [Thu, 28 Apr 2016 14:49:44 +0000 (14:49 +0000)]
Rangify for loops, NFC.

llvm-svn: 267889

8 years ago[Inliner] Formatting. NFC.
Chad Rosier [Thu, 28 Apr 2016 14:47:23 +0000 (14:47 +0000)]
[Inliner] Formatting. NFC.

Patch by Aditya Kumar!
Differential Revision: http://reviews.llvm.org/D19047

llvm-svn: 267888

8 years ago[InstCombine] Remove trailing whitespace. NFC.
Ahmed Bougacha [Thu, 28 Apr 2016 14:36:07 +0000 (14:36 +0000)]
[InstCombine] Remove trailing whitespace. NFC.

r267873.

llvm-svn: 267887

8 years agoRename isRelRelative
Rafael Espindola [Thu, 28 Apr 2016 14:34:39 +0000 (14:34 +0000)]
Rename isRelRelative

It was never a particularly good name and is now completely out of date.

llvm-svn: 267886

8 years ago[FIX] Correct assumption simplification
Johannes Doerfert [Thu, 28 Apr 2016 14:32:58 +0000 (14:32 +0000)]
[FIX] Correct assumption simplification

  Assumptions and restrictions can both be simplified with the domain of a
  statement but not the same way. After this patch we will correctly
  distinguish them.

llvm-svn: 267885

8 years agoAdd a test showing that we can gc parts of .eh_frame.
Rafael Espindola [Thu, 28 Apr 2016 14:31:09 +0000 (14:31 +0000)]
Add a test showing that we can gc parts of .eh_frame.

llvm-svn: 267884

8 years agoFix build.
Manuel Klimek [Thu, 28 Apr 2016 14:28:19 +0000 (14:28 +0000)]
Fix build.

llvm-svn: 267883

8 years agoReland r267691 fixing PR27535.
Vassil Vassilev [Thu, 28 Apr 2016 14:13:28 +0000 (14:13 +0000)]
Reland r267691 fixing PR27535.

llvm-svn: 267882

8 years agoAdd accidentally dropped test to r267880.
Tim Northover [Thu, 28 Apr 2016 14:01:49 +0000 (14:01 +0000)]
Add accidentally dropped test to r267880.

Forgot "git add".

llvm-svn: 267881

8 years agoARMv7k: define __ARM_PCS_VFP since we're hard-float.
Tim Northover [Thu, 28 Apr 2016 13:59:55 +0000 (13:59 +0000)]
ARMv7k: define __ARM_PCS_VFP since we're hard-float.

It's a little debateable because we're not truly AAPCS, so I'm
certainly not going to define __ARM_PCS, but __ARM_PCS_VFP seems to be
really an "hard-float" define, which is a useful thing to have.

llvm-svn: 267880

8 years ago[SystemZ] Support Swift calling convention
Bryan Chan [Thu, 28 Apr 2016 13:56:43 +0000 (13:56 +0000)]
[SystemZ] Support Swift calling convention

Summary:
Port rL265324 to SystemZ to allow using the 'swiftcall' attribute on that architecture.

Depends on D19414.

Reviewers: kbarton, rjmccall, uweigand

Subscribers: cfe-commits

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

llvm-svn: 267879

8 years agoFixed mistype in comment. NFC.
George Rimar [Thu, 28 Apr 2016 13:38:10 +0000 (13:38 +0000)]
Fixed mistype in comment. NFC.

llvm-svn: 267878

8 years agoFix spuriously dematerializing reference bug. Fixes PR26612.
Manuel Klimek [Thu, 28 Apr 2016 13:37:45 +0000 (13:37 +0000)]
Fix spuriously dematerializing reference bug. Fixes PR26612.

llvm-svn: 267877

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set
Michael Zuckerman [Thu, 28 Apr 2016 12:47:30 +0000 (12:47 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set

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

llvm-svn: 267876

8 years agotest: Make test case independent of earlier instructions
Tobias Grosser [Thu, 28 Apr 2016 12:36:39 +0000 (12:36 +0000)]
test: Make test case independent of earlier instructions

Instead of matching for %6, we use a regexp to match for the result strings.
This test case caused unrelated noise in http://reviews.llvm.org/D15722.

llvm-svn: 267875

8 years agoBlockGenerator: Drop leftover debug statement
Tobias Grosser [Thu, 28 Apr 2016 12:31:05 +0000 (12:31 +0000)]
BlockGenerator: Drop leftover debug statement

llvm-svn: 267874

8 years ago[InstCombine][SSE] Add MOVMSK support to SimplifyDemandedUseBits
Simon Pilgrim [Thu, 28 Apr 2016 12:22:53 +0000 (12:22 +0000)]
[InstCombine][SSE] Add MOVMSK support to SimplifyDemandedUseBits

The MOVMSK instructions copies a vector elements' sign bits to the low bits of a scalar register and zeros the high bits.

This patch adds MOVMSK support to SimplifyDemandedUseBits so that its aware that the upper bits are known to be zero. It also removes the call to MOVMSK if none of the lower bits are actually required and just returns zero.

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

llvm-svn: 267873

8 years ago[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.
Alexey Bataev [Thu, 28 Apr 2016 12:14:51 +0000 (12:14 +0000)]
[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.

OpenMP 4.5 defines 'taskloop simd' directive, which is combined
directive for 'taskloop' and 'simd' directives. Patch adds initial
codegen support for this directive and its 2 basic clauses 'safelen' and
'simdlen'.

llvm-svn: 267872

8 years agoRevert r267784, r267824 and r267830.
Benjamin Kramer [Thu, 28 Apr 2016 12:14:47 +0000 (12:14 +0000)]
Revert r267784, r267824 and r267830.

It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

llvm-svn: 267871

8 years agoRevert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"
Denis Zobnin [Thu, 28 Apr 2016 11:32:10 +0000 (11:32 +0000)]
Revert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"

This reverts commit r267866.

llvm-svn: 267870

8 years agoPR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4
Silviu Baranga [Thu, 28 Apr 2016 11:29:08 +0000 (11:29 +0000)]
PR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4

Summary:
According to the ACLE spec, "__ARM_FEATURE_FMA is defined to 1 if
the hardware floating-point architecture supports fused floating-point
multiply-accumulate".

This changes clang's behaviour from emitting this macro for v7-A and v7-R
cores to only emitting it when the target has VFPv4 (and therefore support
for the floating point multiply-accumulate instruction).

Fixes PR27216

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, cfe-commits

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

llvm-svn: 267869

8 years ago[include-fixer] Add an option to minimize include paths.
Benjamin Kramer [Thu, 28 Apr 2016 11:21:29 +0000 (11:21 +0000)]
[include-fixer] Add an option to minimize include paths.

This will always pick the shortest possible path based on -I options. Based
on the #include suggestion code for modules.

llvm-svn: 267868

8 years agoRemote flaky decorator from TestSignalsAPI on linux
Pavel Labath [Thu, 28 Apr 2016 10:42:47 +0000 (10:42 +0000)]
Remote flaky decorator from TestSignalsAPI on linux

The test seems to pass now, and the test does not seem to be doing anything unusual, so I don't
expect it to cause problems.

llvm-svn: 267867

8 years ago[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)
Denis Zobnin [Thu, 28 Apr 2016 10:13:18 +0000 (10:13 +0000)]
[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)

Rework implementation of several MS pragmas that use internal stack:
vtordisp, {bss|code|const|data}_seg.
This patch:
  1. Makes #pragma vtordisp use PragmaStack class as *_seg pragmas do;
  2. Fixes "#pragma vtordisp()" behavior: it shouldn't affect stack;
  3. Saves/restores the stacks on enter/exit a C++ method body.

llvm-svn: 267866

8 years agoRevert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"
Dmitry Polukhin [Thu, 28 Apr 2016 09:56:22 +0000 (09:56 +0000)]
Revert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"

This reverts commit r267534.

llvm-svn: 267865

8 years ago[tsan] Fix Darwin GCD support after separation of Processor and ThreadState
Kuba Brecka [Thu, 28 Apr 2016 09:26:30 +0000 (09:26 +0000)]
[tsan] Fix Darwin GCD support after separation of Processor and ThreadState

Recent TSan changes (r267678) which factor out parts of ThreadState into a Processor structure broke worker threads on OS X.  This fixes it by properly calling ProcCreate for GCD worker threads and by replacing some CHECKs with RAW_CHECK in early process initialization.  CHECK() in TSan calls the allocator, which requires a valid Processor.

llvm-svn: 267864

8 years ago[OPENMP] Simplified interface for codegen of tasks, NFC.
Alexey Bataev [Thu, 28 Apr 2016 09:23:51 +0000 (09:23 +0000)]
[OPENMP] Simplified interface for codegen of tasks, NFC.

Reduced number of arguments in member functions of runtime support
library for task-based directives.

llvm-svn: 267863

8 years ago[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
Alexey Bataev [Thu, 28 Apr 2016 09:15:06 +0000 (09:15 +0000)]
[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
directive.

OpenMP 4.5 defines 'taskloop' directive and 2 additional clauses
'grainsize' and 'num_tasks' for this directive. Patch adds codegen for
these clauses.
These clauses are generated as arguments of the '__kmpc_taskloop'
libcall and are encoded the following way:

void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup,  int sched, kmp_uint64 grainsize, void *task_dup);

If 'grainsize' is specified, 'sched' argument must be set to '1' and
'grainsize' argument must be set to the value of the 'grainsize' clause.
If 'num_tasks' is specified, 'sched' argument must be set to '2' and
'grainsize' argument must be set to the value of the 'num_tasks' clause.
It is possible because these 2 clauses are mutually exclusive and can't
be used at the same time on the same directive.
If none of these clauses is specified, 'sched' argument must be set to
'0'.

llvm-svn: 267862

8 years agoRevert "Fixed a bug where const this would cause parser errors about $__lldb_expr."
Pavel Labath [Thu, 28 Apr 2016 08:16:19 +0000 (08:16 +0000)]
Revert "Fixed a bug where const this would cause parser errors about $__lldb_expr."

This reverts commit r267833 as it breaks the build. It looks like some work in progress got
committed together with the actual fix, but I'm not sure which one is which, so I'll revert the
whole patch and let author resumbit it after fixing the build error.

llvm-svn: 267861

8 years agoremoved redundant '#'
Eric Liu [Thu, 28 Apr 2016 07:52:06 +0000 (07:52 +0000)]
removed redundant '#'

llvm-svn: 267860

8 years agoAddressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.
Eric Liu [Thu, 28 Apr 2016 07:52:03 +0000 (07:52 +0000)]
Addressed reviewer's post-submission comments from reviews.llvm.org/D18551.

Summary: Make SourceManager in Environment, WhitespaceManager, and FormatTokenAnalyzer etc constant members.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 267859

8 years agoAddressed review's comments.
Eric Liu [Thu, 28 Apr 2016 07:51:47 +0000 (07:51 +0000)]
Addressed review's comments.

llvm-svn: 267858

8 years agoAdd missing newline in clang-rename output.
Manuel Klimek [Thu, 28 Apr 2016 06:46:44 +0000 (06:46 +0000)]
Add missing newline in clang-rename output.

Patch by Miklos Vajna.

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

llvm-svn: 267855

8 years ago[X86] Remove unused operand from a function and all its callers. NFC
Craig Topper [Thu, 28 Apr 2016 05:58:46 +0000 (05:58 +0000)]
[X86] Remove unused operand from a function and all its callers. NFC

llvm-svn: 267854

8 years ago[CodeGen] Default CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to Expand in TargetLoweringBase...
Craig Topper [Thu, 28 Apr 2016 03:34:31 +0000 (03:34 +0000)]
[CodeGen] Default CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to Expand in TargetLoweringBase. This is what the majority of the targets want and removes a bunch of code. Set it to Legal explicitly in the few cases where that's the desired behavior.

llvm-svn: 267853

8 years agoRemove names of unreferenced parameters. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 03:17:56 +0000 (03:17 +0000)]
Remove names of unreferenced parameters. Patch from STL@microsoft.com

llvm-svn: 267852

8 years agoCodeGen: Add DetectDeadLanes pass.
Matthias Braun [Thu, 28 Apr 2016 03:07:16 +0000 (03:07 +0000)]
CodeGen: Add DetectDeadLanes pass.

The DetectDeadLanes pass performs a dataflow analysis of used/defined
subregister lanes across COPY instructions and instructions that will
get lowered to copies. It detects dead definitions and uses reading
undefined values which are obscured by COPY and subregister usage.

These dead definitions cause trouble in the register coalescer which
cannot deal with definitions suddenly becoming dead after coalescing
COPY instructions.

For now the pass only adds dead and undef flags to machine operands. It
should be possible to extend it in the future to remove the dead
instructions and redo the analysis for the affected virtual
registers.

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

llvm-svn: 267851

8 years agoTableGen: Produce CoveredBySubRegs summary for register classes
Matthias Braun [Thu, 28 Apr 2016 03:07:11 +0000 (03:07 +0000)]
TableGen: Produce CoveredBySubRegs summary for register classes

This will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267850

8 years agoTargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
Matthias Braun [Thu, 28 Apr 2016 03:07:07 +0000 (03:07 +0000)]
TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()

This function performs the reverse computation of
composeSubRegIndexLaneMask().

It will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267849

8 years agoTableGen: Support lanemasks for classes without subregisters
Matthias Braun [Thu, 28 Apr 2016 03:07:04 +0000 (03:07 +0000)]
TableGen: Support lanemasks for classes without subregisters

Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

llvm-svn: 267848

8 years agoAdd comment.
Rui Ueyama [Thu, 28 Apr 2016 03:04:15 +0000 (03:04 +0000)]
Add comment.

llvm-svn: 267847

8 years agoCGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]
NAKAMURA Takumi [Thu, 28 Apr 2016 02:45:21 +0000 (02:45 +0000)]
CGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]

llvm-svn: 267845

8 years agoAdd braces, move braces, and rename variables to avoid shadowing. Patch from STL...
Eric Fiselier [Thu, 28 Apr 2016 02:45:11 +0000 (02:45 +0000)]
Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com

llvm-svn: 267844

8 years agoProvide member function definitions to avoid warnings. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 02:18:48 +0000 (02:18 +0000)]
Provide member function definitions to avoid warnings. Patch from STL@microsoft.com

llvm-svn: 267843

8 years agoFix an inefficiency in the handling of $__lldb_local_vars in expressions.
Jim Ingham [Thu, 28 Apr 2016 02:17:02 +0000 (02:17 +0000)]
Fix an inefficiency in the handling of $__lldb_local_vars in expressions.

The code in ClangExpressionDeclMap::FindExternalVisibleDecls figures out what the token
means, and adds the namespace to the lookup context, but since it doesn't mark it as
special in the search context, we go on to pass the name $__lldb_local_vars to the ASTSource
for further lookup.  Unless we've done our job wrong, those lookups will always fail, but
the can be costly.

So I added a bit to m_found & use that to short-circuit the lookup.

<rdar://problem/25613384>

llvm-svn: 267842

8 years agoFindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.
NAKAMURA Takumi [Thu, 28 Apr 2016 02:15:16 +0000 (02:15 +0000)]
FindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.

  In file included from symbol.cc:1:
  symbols.h:2:24: error: typedef redefinition with different types ('unsigned int'
        vs 'unsigned long long')
        typedef unsigned size_t;
                         ^

llvm-svn: 267841

8 years agoLiveIntervalAnalysis: Fix handleMove() using wrong value numbers
Matthias Braun [Thu, 28 Apr 2016 02:11:49 +0000 (02:11 +0000)]
LiveIntervalAnalysis: Fix handleMove() using wrong value numbers

handleMove() was incorrectly swapping two value numbers. This was missed
before because the problem only occured when moving subregister definitions
and needed -verify-machineinstrs to be detected.

I cannot add a testcase as long as I cannot reapply r260905/r260806.

llvm-svn: 267840

8 years agoDo not call hasArg and getLastArg for the same option.
Rui Ueyama [Thu, 28 Apr 2016 02:08:54 +0000 (02:08 +0000)]
Do not call hasArg and getLastArg for the same option.

llvm-svn: 267839

8 years agoRename function parameters to avoid shadowing. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 02:00:52 +0000 (02:00 +0000)]
Rename function parameters to avoid shadowing. Patch from STL@microsoft.com

llvm-svn: 267838

8 years ago[AArch64] Expand CTTZ for all vector types.
Craig Topper [Thu, 28 Apr 2016 01:58:21 +0000 (01:58 +0000)]
[AArch64] Expand CTTZ for all vector types.

llvm-svn: 267837

8 years agoGuard Clang and GCC specific pragmas. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 01:49:03 +0000 (01:49 +0000)]
Guard Clang and GCC specific pragmas. Patch from STL@microsoft.com

llvm-svn: 267836

8 years agoFix include path in ClangTidy.cpp.
Stephen Hines [Thu, 28 Apr 2016 01:42:12 +0000 (01:42 +0000)]
Fix include path in ClangTidy.cpp.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=27355
To compile with other binary output directory structures in build systems like Android.

Reviewers: srhines, alexfh

Subscribers: tberghammer, danalbert, cfe-commits

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

llvm-svn: 267835

8 years agoAdd the ability to limit "source regexp" breakpoints to a particular function
Jim Ingham [Thu, 28 Apr 2016 01:40:57 +0000 (01:40 +0000)]
Add the ability to limit "source regexp" breakpoints to a particular function
within a source file.

This isn't done, I need to make the name match smarter (right now it requires an
exact match which is annoying for methods of a class in a namespace.

Also, though we use it in tests all over the place, it doesn't look like we have
a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch.

llvm-svn: 267834

8 years agoFixed a bug where const this would cause parser errors about $__lldb_expr.
Sean Callanan [Thu, 28 Apr 2016 01:36:21 +0000 (01:36 +0000)]
Fixed a bug where const this would cause parser errors about $__lldb_expr.

In templated const functions, trying to run an expression would produce the
error

error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo'
member declaration does not match because it is const qualified
error: 1 error parsing expression

which is no good.  It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."

Also added a test case.

<rdar://problem/24985958>

llvm-svn: 267833

8 years ago[analyzer] Move Checkers.inc to clang/include/...
Chih-Hung Hsieh [Thu, 28 Apr 2016 01:09:09 +0000 (01:09 +0000)]
[analyzer] Move Checkers.inc to clang/include/...

Simplify sharing of Checkers.inc with other files like ClangTidy.cpp.

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

llvm-svn: 267832

8 years agoFix bogus documentation for StringRef::slice in the End < Start case.
Richard Smith [Thu, 28 Apr 2016 00:57:14 +0000 (00:57 +0000)]
Fix bogus documentation for StringRef::slice in the End < Start case.

llvm-svn: 267831