platform/upstream/llvm.git
7 years agoRevert "[ARM] Recommit the glueless lowering of addc/adde in Thumb1, including the...
Vitaly Buka [Wed, 22 Mar 2017 05:07:44 +0000 (05:07 +0000)]
Revert "[ARM] Recommit the glueless lowering of addc/adde in Thumb1, including the amended (no UB anymore) fix for adding/subtracting -2147483648."

Fails check-llvm with ubsan

This reverts commit r298417.

llvm-svn: 298482

7 years ago[ScalarEvolution] Predicate implication from operations
Max Kazantsev [Wed, 22 Mar 2017 04:48:46 +0000 (04:48 +0000)]
[ScalarEvolution] Predicate implication from operations

This patch allows SCEV predicate analysis to prove implication of some expression predicates
from context predicates related to arguments of those expressions.
It introduces three new rules:

For addition:
  (A >X && B >= 0) || (B >= 0 && A > X) ===> (A + B) > X.

For division:
  (A > X) && (0 < B <= X + 1) ===> (A / B > 0).
  (A > X) && (-B <= X < 0) ===> (A / B >= 0).

Using these rules, SCEV is able to prove facts like "if X > 1 then X / 2 > 0".
They can also be combined with the same context, to prove more complex expressions like
"if X > 1 then X/2 + 1 > 1".

Diffirential Revision: https://reviews.llvm.org/D30887

Reviewed by: sanjoy

llvm-svn: 298481

7 years ago[XRay][compiler-rt] Remove dependency on <system_error>
Dean Michael Berris [Wed, 22 Mar 2017 04:40:32 +0000 (04:40 +0000)]
[XRay][compiler-rt] Remove dependency on <system_error>

Summary:
Depending on C++11 <system_error> introduces a link-time requirement to
C++11 symbols. Removing it allows us to depend on header-only C++11 and
up libraries.

Partially fixes http://llvm.org/PR32274 -- we know there's more invasive work
to be done, but we're doing it incrementally.

Reviewers: dblaikie, kpw, pelikan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31233

llvm-svn: 298480

7 years agolit: remove python2-isms
Brian Gesiak [Wed, 22 Mar 2017 04:23:01 +0000 (04:23 +0000)]
lit: remove python2-isms

Summary:
`assert.assertItemEqual` went away in Python 3. Seeing how lists
are ordered, comparing a list against each other should work just
as well.

Patch by @jbergstroem (Johan Bergström).

Reviewers: modocache, gparker42

Reviewed By: modocache

Differential Revision: https://reviews.llvm.org/D31229

llvm-svn: 298479

7 years ago[InstCombine] Teach SimplifyDemandedUseBits to shrink Constants on the left side...
Craig Topper [Wed, 22 Mar 2017 04:03:53 +0000 (04:03 +0000)]
[InstCombine] Teach SimplifyDemandedUseBits to shrink Constants on the left side of subtracts

Summary: Subtracts can have constants on the left side, but we don't shrink them based on demanded bits. This patch fixes that to match the right hand side.

Reviewers: davide, majnemer, spatel, sanjoy, hfinkel

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31119

llvm-svn: 298478

7 years agoSuppress warning on unreachable [[clang::fallthrough]] within a template instantiation.
Richard Smith [Wed, 22 Mar 2017 01:49:19 +0000 (01:49 +0000)]
Suppress warning on unreachable [[clang::fallthrough]] within a template instantiation.

We don't know whether some other instantiation of the template might be able to
reach the annotation, so warning on it has a high chance of false positives.

Patch by Ahmed Asadi!

Differential Revision: https://reviews.llvm.org/D31069

llvm-svn: 298477

7 years agoXFAIL CFI stats test while LLD produces corrupt PDBs that confuse DIA
Reid Kleckner [Wed, 22 Mar 2017 01:45:08 +0000 (01:45 +0000)]
XFAIL CFI stats test while LLD produces corrupt PDBs that confuse DIA

llvm-svn: 298476

7 years agoUpdate LLD tests for codeview dumping changes
Reid Kleckner [Wed, 22 Mar 2017 01:43:49 +0000 (01:43 +0000)]
Update LLD tests for codeview dumping changes

llvm-svn: 298475

7 years ago[codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLIST
Reid Kleckner [Wed, 22 Mar 2017 01:37:38 +0000 (01:37 +0000)]
[codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLIST

They are structurally the same, but now we need to distinguish them
because one record lives in the IPI stream and the other lives in TPI.

llvm-svn: 298474

7 years ago[GlobalISel]: Create VREGs for ConstantInt args
Aditya Nandakumar [Wed, 22 Mar 2017 01:16:39 +0000 (01:16 +0000)]
[GlobalISel]: Create VREGs for ConstantInt args

This patch changes the behavior of IRTranslating intrinsics where we
now create VREG + G_CONSTANT for ConstantInt values. We already do this
for FloatingPoint values. This makes it easier for the backends to
select code and it won't have to de-duplicate creation+selection of
constants.

Reviewed by: ab

llvm-svn: 298473

7 years agoDon't compose DWARF expressions with multiple subregisters.
Adrian Prantl [Wed, 22 Mar 2017 01:16:01 +0000 (01:16 +0000)]
Don't compose DWARF expressions with multiple subregisters.

If a register location can only be described by a complex expression
(i.e., multiple subregisters) it doesn't safely compose with another
complex expression. For example, it is not possible to apply a
DW_OP_deref operation to multiple DW_OP_pieces.

llvm-svn: 298472

7 years agoDwarfExpression: Defer emitting DWARF register operations
Adrian Prantl [Wed, 22 Mar 2017 01:15:57 +0000 (01:15 +0000)]
DwarfExpression: Defer emitting DWARF register operations
until the rest of the expression is known.

This is still an NFC refactoring in preparation of a subsequent bugfix.

This reapplies r298388 with a bugfix for non-physical frame registers.

llvm-svn: 298471

7 years agoReverting r298421 due to using a header that's unavailable to all systems and some...
Aaron Ballman [Wed, 22 Mar 2017 01:08:54 +0000 (01:08 +0000)]
Reverting r298421 due to using a header that's unavailable to all systems and some other post-commit review feedback.

llvm-svn: 298470

7 years agoRemove -ffp-contract=fast from this test
Adam Nemet [Wed, 22 Mar 2017 00:58:18 +0000 (00:58 +0000)]
Remove -ffp-contract=fast from this test

It does not need it and causes mismatch after -ffp-contract=fast is turned
into an FMF.

llvm-svn: 298469

7 years agoChange -ffp-contract=fast test to run on Aarch64
Adam Nemet [Wed, 22 Mar 2017 00:58:15 +0000 (00:58 +0000)]
Change -ffp-contract=fast test to run on Aarch64

(I don't have powerpc enabled in my build and I am changing
how -ffp-contract=fast works.)

llvm-svn: 298468

7 years ago[COFF] Put the PDB next to the image if the user doesn't pass /PDB:
Reid Kleckner [Wed, 22 Mar 2017 00:57:14 +0000 (00:57 +0000)]
[COFF] Put the PDB next to the image if the user doesn't pass /PDB:

Summary: This is compatible with MSVC link.exe.

Reviewers: ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31224

llvm-svn: 298467

7 years agoBreak the cycle between Host and PluginProcessUtility.
Zachary Turner [Wed, 22 Mar 2017 00:27:54 +0000 (00:27 +0000)]
Break the cycle between Host and PluginProcessUtility.

There are only two users of NativeRegisterContextRegisterInfo,
and both are in process plugins.  Moving this code from Host
to Plugins/Process/Utility thus makes sense, and as it is the
only dependency from Host -> PluginProcessUtility, it also
breaks this cycle, reducing LLDB's overall cycle count from
45 to 44.

llvm-svn: 298466

7 years agoDelete the remainder of platform specific code in FileSpec.
Zachary Turner [Wed, 22 Mar 2017 00:27:24 +0000 (00:27 +0000)]
Delete the remainder of platform specific code in FileSpec.

Differential Revision: https://reviews.llvm.org/D31129

llvm-svn: 298465

7 years ago[Modules] Rebuild modules on umbrella header mismatch
Bruno Cardoso Lopes [Wed, 22 Mar 2017 00:11:21 +0000 (00:11 +0000)]
[Modules] Rebuild modules on umbrella header mismatch

This restores behavior pre-r230064 since after PCMCache work (r298278)
we don't reload PCMs from disk within the same compiler invocation.

Testcases from r230064 are still left around since they still guarantee
the correct behavior we're expecting.

rdar://problem/19889777

llvm-svn: 298464

7 years agoDefine Config::Is64.
Rui Ueyama [Wed, 22 Mar 2017 00:01:11 +0000 (00:01 +0000)]
Define Config::Is64.

This is a shorthand for Config->Wordsize == 8. So this is not strictly
necessary but seems handy. "Is 64 bit?" is easier to read than "Is
wordsize 8 byte?"

llvm-svn: 298463

7 years agoMake test more robust
Adam Nemet [Tue, 21 Mar 2017 23:50:52 +0000 (23:50 +0000)]
Make test more robust

Set the flags on FAdd locally rather than assuming nothing will change it from
way earlier in the test.

llvm-svn: 298462

7 years agoResubmit "Improve StringMap iterator support."
Zachary Turner [Tue, 21 Mar 2017 23:45:03 +0000 (23:45 +0000)]
Resubmit "Improve StringMap iterator support."

The issue was trying to advance past the end of the iterator
when computing the end() iterator.

llvm-svn: 298461

7 years ago[GlobalISel] Update DBG_VALUEs referencing DCE'd instructions.
Ahmed Bougacha [Tue, 21 Mar 2017 23:42:54 +0000 (23:42 +0000)]
[GlobalISel] Update DBG_VALUEs referencing DCE'd instructions.

Quentin points out that r298358 would cause us to emit different code
with debug info.  That's a big no-no; also erase the instructions that
only live thanks to DBG_VALUE users.

Adrian explained how this is an existing problem and an OK thing to do:
clang has allocas for all variables so shouldn't be affected at -O0, but
swift uses a bit of inlineasm to explicitly keep values live for the
purpose of debug info quality.  I'm not sure there is a better scheme.

llvm-svn: 298460

7 years ago[GlobalISel] Don't translate br to layout successor.
Ahmed Bougacha [Tue, 21 Mar 2017 23:42:50 +0000 (23:42 +0000)]
[GlobalISel] Don't translate br to layout successor.

MI can represent fallthrough to layout successor blocks, and our
post-isel representation uses that extensively.

We might as well use it too, to avoid translating and carrying along
unnecessary branches.

llvm-svn: 298459

7 years ago[IR] Remove validAlignment and validPointer methods DataLayout as they aren't used.
Craig Topper [Tue, 21 Mar 2017 23:04:23 +0000 (23:04 +0000)]
[IR] Remove validAlignment and validPointer methods DataLayout as they aren't used.

I don't think validAlignment has been used since r34358 in 2007. I think validPointer was copied from validAlignment some time later, but it definitely wasn't used in the first commit that contained it.

llvm-svn: 298458

7 years agoMake elf::ScriptConfig a LinkerScript class member variable.
Rui Ueyama [Tue, 21 Mar 2017 23:03:09 +0000 (23:03 +0000)]
Make elf::ScriptConfig a LinkerScript class member variable.

LinkerScript used to be a template class, so we couldn't instantiate
that class in elf::link. We instantiated ScriptConfig class earlier
instead so that the linker script parser can store configurations to
the object.

Now that LinkerScript is not a template, it doesn't make sense to
separate ScriptConfig from LinkerScript. This patch merges them.

llvm-svn: 298457

7 years agoRename LinkerScriptBase -> LinkerScript.
Rui Ueyama [Tue, 21 Mar 2017 23:02:51 +0000 (23:02 +0000)]
Rename LinkerScriptBase -> LinkerScript.

llvm-svn: 298456

7 years ago[deps script] Sort cycles by the difficulty of breaking.
Zachary Turner [Tue, 21 Mar 2017 22:46:46 +0000 (22:46 +0000)]
[deps script] Sort cycles by the difficulty of breaking.

When passing --discover-cycles and --show-counts, it displays
the number of dependencies between each hop of the cycle,
and sorts by the sum.  Dependencies at the top of the list
should be the easiest to break.

llvm-svn: 298455

7 years agoAMDGPU: Remove hasSideEffects from SI_RETURN_TO_EPILOG
Matt Arsenault [Tue, 21 Mar 2017 22:28:48 +0000 (22:28 +0000)]
AMDGPU: Remove hasSideEffects from SI_RETURN_TO_EPILOG

llvm-svn: 298454

7 years agoGlobalISel: respect BooleanContents when extending i1.
Tim Northover [Tue, 21 Mar 2017 22:22:05 +0000 (22:22 +0000)]
GlobalISel: respect BooleanContents when extending i1.

The world isn't just x86 & ARM, some targets need to store -1 into the byte
when legalizing a bool store.

llvm-svn: 298453

7 years agoAMDGPU: Rename SI_RETURN
Matt Arsenault [Tue, 21 Mar 2017 22:18:10 +0000 (22:18 +0000)]
AMDGPU: Rename SI_RETURN

This is used for a specific type of return to a shader part's
epilog code. Rename to try avoiding confusion from a true
call's return.

llvm-svn: 298452

7 years agoMirror CMake changes from r298412 to Xcode project
Tim Hammerquist [Tue, 21 Mar 2017 22:08:16 +0000 (22:08 +0000)]
Mirror CMake changes from r298412 to Xcode project

<rdar://problem/31181635>
M    lldb.xcodeproj/project.pbxproj

llvm-svn: 298451

7 years agoRevert "[compiler-rt][asan] Turn on ASAN unittests for win64."
Reid Kleckner [Tue, 21 Mar 2017 22:07:06 +0000 (22:07 +0000)]
Revert "[compiler-rt][asan] Turn on ASAN unittests for win64."

This reverts commit r296878.

These test still require too much swap to pass reliably.

llvm-svn: 298450

7 years agoRemove the -faltivec alias option and replace it with -maltivec everywhere.
Eric Christopher [Tue, 21 Mar 2017 22:06:18 +0000 (22:06 +0000)]
Remove the -faltivec alias option and replace it with -maltivec everywhere.
The alias was only ever used on darwin and had some issues there,
and isn't used in practice much. Also fixes a problem with -mno-altivec
not turning off -maltivec.

Also add a diagnostic for faltivec/fno-altivec that directs users to use
maltivec options and include the altivec.h file explicitly.

llvm-svn: 298449

7 years agoSplitKit: Fix subreg copy related problems
Matthias Braun [Tue, 21 Mar 2017 21:58:08 +0000 (21:58 +0000)]
SplitKit: Fix subreg copy related problems

Fix two problems related to r298025:
- SplitKit would create duplicate VNIs in some cases leading to crashs
  when hoisting copies.
- VirtRegMap could fail expanding copies at the beginning of a basic
  block.

This fixes http://llvm.org/PR32353

llvm-svn: 298448

7 years agoSort. NFC.
Rui Ueyama [Tue, 21 Mar 2017 21:49:16 +0000 (21:49 +0000)]
Sort. NFC.

llvm-svn: 298447

7 years agoAdd support for -fno-auto-profile and -fno-profile-sample-use
Dehao Chen [Tue, 21 Mar 2017 21:40:53 +0000 (21:40 +0000)]
Add support for -fno-auto-profile and -fno-profile-sample-use

Summary: We need to be able to disable samplepgo for specific files by supporting -fno-auto-profile and -fno-profile-sample-use

Reviewers: davidxl, dnovillo, echristo

Reviewed By: echristo

Subscribers: echristo, cfe-commits

Differential Revision: https://reviews.llvm.org/D31213

llvm-svn: 298446

7 years agoDefine Config::Endianness.
Rui Ueyama [Tue, 21 Mar 2017 21:40:08 +0000 (21:40 +0000)]
Define Config::Endianness.

This is a shorthand for `Config->IsLE ? support::little : support::big`.

llvm-svn: 298445

7 years agoAMDGPU: Mark all unspecified CC functions in tests as amdgpu_kernel
Matt Arsenault [Tue, 21 Mar 2017 21:39:51 +0000 (21:39 +0000)]
AMDGPU: Mark all unspecified CC functions in tests as amdgpu_kernel

Currently the default C calling convention functions are treated
the same as compute kernels. Make this explicit so the default
calling convention can be changed to a non-kernel.

Converted with perl -pi -e 's/define void/define amdgpu_kernel void/'
on the relevant test directories (and undoing in one place that actually
wanted a non-kernel).

llvm-svn: 298444

7 years agoApply clang-tidy's performance-unnecessary-value-param to parts of clang.
Benjamin Kramer [Tue, 21 Mar 2017 21:35:04 +0000 (21:35 +0000)]
Apply clang-tidy's performance-unnecessary-value-param to parts of clang.

No functionality change intended.

llvm-svn: 298443

7 years agoApply clang-tidy's performance-unnecessary-value-param to clang-tidy.
Benjamin Kramer [Tue, 21 Mar 2017 21:34:58 +0000 (21:34 +0000)]
Apply clang-tidy's performance-unnecessary-value-param to clang-tidy.

No functionality change intended.

llvm-svn: 298442

7 years ago[c-index-test] Fix memory leak in c-index-test tool.
Argyrios Kyrtzidis [Tue, 21 Mar 2017 21:34:05 +0000 (21:34 +0000)]
[c-index-test] Fix memory leak in c-index-test tool.

llvm-svn: 298441

7 years agoRevert "Improve StringMap iterator support."
Zachary Turner [Tue, 21 Mar 2017 21:23:57 +0000 (21:23 +0000)]
Revert "Improve StringMap iterator support."

This is causing crashes in clang, so reverting until the problem
is figured out.

llvm-svn: 298440

7 years agoGlobalISel: widen booleans by zero-extending to a byte.
Tim Northover [Tue, 21 Mar 2017 21:12:04 +0000 (21:12 +0000)]
GlobalISel: widen booleans by zero-extending to a byte.

A bool is represented by a single byte, which the ARM ABI requires to be either
0 or 1. So we cannot use G_ANYEXT when legalizing the type.

llvm-svn: 298439

7 years agoFix test failure I introduced
Marshall Clow [Tue, 21 Mar 2017 21:05:28 +0000 (21:05 +0000)]
Fix test failure I introduced

llvm-svn: 298438

7 years agoFix clang errors caused by StringMap iterator changes.
Zachary Turner [Tue, 21 Mar 2017 20:41:51 +0000 (20:41 +0000)]
Fix clang errors caused by StringMap iterator changes.

llvm-svn: 298437

7 years agoImprove StringMap iterator support.
Zachary Turner [Tue, 21 Mar 2017 20:27:36 +0000 (20:27 +0000)]
Improve StringMap iterator support.

StringMap's iterators did not support LLVM's
iterator_facade_base, which made it unusable in various
STL algorithms or with some of our range adapters.
This patch makes both StringMapConstIterator as well as
StringMapIterator support iterator_facade_base.

With this in place, it is easy to make an iterator adapter
that iterates over only keys, and whose value_type is
StringRef.  So I add StringMapKeyIterator as well, and
provide the method StringMap::keys() that returns a
range that can be iterated.

Differential Revision: https://reviews.llvm.org/D31171

llvm-svn: 298436

7 years agoRemove eol-style:native from StringMap.h
Zachary Turner [Tue, 21 Mar 2017 20:21:56 +0000 (20:21 +0000)]
Remove eol-style:native from StringMap.h

llvm-svn: 298435

7 years agoDon't make unqualified calls to functions that could well be found via
Chandler Carruth [Tue, 21 Mar 2017 20:15:42 +0000 (20:15 +0000)]
Don't make unqualified calls to functions that could well be found via
ADL as reasonable extension points.

All of this would be cleaner if this code followed the more usual LLVM
convention of not having deeply nested namespaces inside of .cpp files
and instead having a `using namespace ...;` at the top. Then the static
function would be in the global namespace and easily referred to as
`::join`. Instead we have to write a fairly contrived qualified name.
I figure the authors can clean this up with a less ambiguous name, using
the newly provided LLVM `join` function, or any other solution, but this
at least fixes the build.

llvm-svn: 298434

7 years agoiFix Test deprecation behavior in C89 mode as a result of r298410
Erich Keane [Tue, 21 Mar 2017 20:14:46 +0000 (20:14 +0000)]
iFix Test deprecation behavior in C89 mode as a result of r298410

llvm-svn: 298433

7 years ago[InstCombine] regenerate checks; NFC
Sanjay Patel [Tue, 21 Mar 2017 20:14:38 +0000 (20:14 +0000)]
[InstCombine] regenerate checks; NFC

llvm-svn: 298432

7 years agoLet llvm.objectsize be conservative with null pointers
George Burgess IV [Tue, 21 Mar 2017 20:09:35 +0000 (20:09 +0000)]
Let llvm.objectsize be conservative with null pointers

D28494 adds another parameter to @llvm.objectsize. Clang needs to be
sure to pass that third arg whenever applicable.

llvm-svn: 298431

7 years agoLet llvm.objectsize be conservative with null pointers
George Burgess IV [Tue, 21 Mar 2017 20:08:59 +0000 (20:08 +0000)]
Let llvm.objectsize be conservative with null pointers

This adds a parameter to @llvm.objectsize that makes it return
conservative values if it's given null.

This fixes PR23277.

Differential Revision: https://reviews.llvm.org/D28494

llvm-svn: 298430

7 years agoClang change: Do not inline hot callsites for samplepgo in thinlto compile phase.
Dehao Chen [Tue, 21 Mar 2017 19:55:46 +0000 (19:55 +0000)]
Clang change: Do not inline hot callsites for samplepgo in thinlto compile phase.

Summary:
Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro
file, thus we do not want to inline hot callsites in the first phase.

Reviewers: tejohnson, eraman

Reviewed By: tejohnson

Subscribers: mehdi_amini, cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D31202

llvm-svn: 298429

7 years agoDo not inline hot callsites for samplepgo in thinlto compile phase.
Dehao Chen [Tue, 21 Mar 2017 19:55:36 +0000 (19:55 +0000)]
Do not inline hot callsites for samplepgo in thinlto compile phase.

Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in profile, thus we do not want to inline hot callsites in the first phase.

Reviewers: tejohnson, eraman

Reviewed By: tejohnson

Subscribers: mehdi_amini, llvm-commits, Prazek

Differential Revision: https://reviews.llvm.org/D31201

llvm-svn: 298428

7 years ago[ADT] Add a version of llvm::join() that takes a range.
Zachary Turner [Tue, 21 Mar 2017 19:35:05 +0000 (19:35 +0000)]
[ADT] Add a version of llvm::join() that takes a range.

llvm-svn: 298427

7 years ago[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a...
Coby Tayree [Tue, 21 Mar 2017 19:33:32 +0000 (19:33 +0000)]
[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression

This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"

LLVM side: https://reviews.llvm.org/D31173
Differential Revision: https://reviews.llvm.org/D31174

llvm-svn: 298426

7 years ago[X86][MS-compatability][llvm] allow MS TYPE/SIZE/LENGTH operators as a part of a...
Coby Tayree [Tue, 21 Mar 2017 19:31:55 +0000 (19:31 +0000)]
[X86][MS-compatability][llvm] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression

This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"

Clang side: https://reviews.llvm.org/D31174

Differential Revision: https://reviews.llvm.org/D31173

llvm-svn: 298425

7 years ago[CMake] fix CLANG_INCLUDE_DIRS CMake export
Guillaume Papin [Tue, 21 Mar 2017 19:17:53 +0000 (19:17 +0000)]
[CMake] fix CLANG_INCLUDE_DIRS CMake export

Summary:
This change should fixes the export of CLANG_INCLUDE_DIRS variable in ClangConfig.cmake.

Unlike for the other variables, CLANG_INSTALL_PREFIX wasn't escaped meaning CLANG_INCLUDE_DIRS
resulting in the path "/include" instead of "${CLANG_INSTALL_PREFIX}/include".

Reviewers: beanz

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D30911

llvm-svn: 298424

7 years ago[X86] Remove extra semicolon to placate GCC. NFCI.
Davide Italiano [Tue, 21 Mar 2017 19:17:23 +0000 (19:17 +0000)]
[X86] Remove extra semicolon to placate GCC. NFCI.

llvm-svn: 298423

7 years agoFix a couple of 'C++11'-isms from the last checkin, which broke the '03 bot.
Marshall Clow [Tue, 21 Mar 2017 19:12:21 +0000 (19:12 +0000)]
Fix a couple of 'C++11'-isms from the last checkin, which broke the '03 bot.

llvm-svn: 298422

7 years agoPrevent cppcoreguidelines-pro-bounds-array-to-pointer-decay from diagnosing array...
Aaron Ballman [Tue, 21 Mar 2017 19:01:17 +0000 (19:01 +0000)]
Prevent cppcoreguidelines-pro-bounds-array-to-pointer-decay from diagnosing array to pointer decay stemming from system macros.

Patch by Breno Rodrigues Guimaraes.

llvm-svn: 298421

7 years agoFix array sizes where address space is not yet known
Konstantin Zhuravlyov [Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)]
Fix array sizes where address space is not yet known

For variables in generic address spaces, for example:

```
unsigned char V[6442450944];
...
```

the address space is not yet known when we get into
*getConstantArrayType*, it is 0. AMDGCN target's
address space 0 has 32 bits pointers, so when we
call *getPointerWidth* with 0, the array size is
trimmed to 32 bits, which is not right.

Differential Revision: https://reviews.llvm.org/D30845

llvm-svn: 298420

7 years agoFix build broken by StringList move.
Zachary Turner [Tue, 21 Mar 2017 18:45:42 +0000 (18:45 +0000)]
Fix build broken by StringList move.

llvm-svn: 298419

7 years agoAdd a bit more to one of the chrono tests
Marshall Clow [Tue, 21 Mar 2017 18:40:46 +0000 (18:40 +0000)]
Add a bit more to one of the chrono tests

llvm-svn: 298418

7 years ago[ARM] Recommit the glueless lowering of addc/adde in Thumb1,
Artyom Skrobov [Tue, 21 Mar 2017 18:39:41 +0000 (18:39 +0000)]
[ARM] Recommit the glueless lowering of addc/adde in Thumb1,
including the amended (no UB anymore) fix for adding/subtracting -2147483648.

This reverts r298328 "[ARM] Revert r297443 and r297820."
and partially reverts r297842 "Revert "[Thumb1] Fix the bug when adding/subtracting -2147483648""

llvm-svn: 298417

7 years agoImplement P0548: 'common_type and duration' This involves a subtle change in the...
Marshall Clow [Tue, 21 Mar 2017 18:38:57 +0000 (18:38 +0000)]
Implement P0548: 'common_type and duration' This involves a subtle change in the return type of the unary +/- operators for std::chrono::duration, though I expect that no one will notice.

llvm-svn: 298416

7 years agoDelete eol-style:native SVN property.
Zachary Turner [Tue, 21 Mar 2017 18:31:08 +0000 (18:31 +0000)]
Delete eol-style:native SVN property.

llvm-svn: 298415

7 years agoModules: Remove an invalid check in unit tests for r298278
Duncan P. N. Exon Smith [Tue, 21 Mar 2017 18:26:18 +0000 (18:26 +0000)]
Modules: Remove an invalid check in unit tests for r298278

This is a fixup for the unit tests from r298278 (originally r298165).

Since the buffer that RawB2 pointed at was later deleted, a new call to
getBuffer may very well return a buffer at the same/old address.  Which is
fine.  Just delete the spurious check.

A Windows bot was occasionally hitting this in practice:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7086

llvm-svn: 298414

7 years ago[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests
Bob Haarman [Tue, 21 Mar 2017 18:25:35 +0000 (18:25 +0000)]
[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests

Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed.

Reviewers: davidxl, beanz

Reviewed By: beanz

Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits

Differential Revision: https://reviews.llvm.org/D31098

llvm-svn: 298413

7 years agoMove StringList from Core -> Utility.
Zachary Turner [Tue, 21 Mar 2017 18:25:04 +0000 (18:25 +0000)]
Move StringList from Core -> Utility.

llvm-svn: 298412

7 years ago[OpenMP] libomptarget: Disable on MacOS X
George Rokos [Tue, 21 Mar 2017 18:19:09 +0000 (18:19 +0000)]
[OpenMP] libomptarget: Disable on MacOS X

Disable compilation of libomptarget on MacOS X.

Differential Revision: https://reviews.llvm.org/D31055

llvm-svn: 298411

7 years agoCorrect class-template deprecation behavior
Erich Keane [Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)]
Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Differential Revision: https://reviews.llvm.org/D27486

llvm-svn: 298410

7 years agoCreate instance of DynamicLoaderPOSIXDYLD on NetBSD
Kamil Rytarowski [Tue, 21 Mar 2017 17:39:15 +0000 (17:39 +0000)]
Create instance of DynamicLoaderPOSIXDYLD on NetBSD

Summary:
NetBSD is a modern ELF UNIX-like system.

There is requires DynamicLoaderPOSIXDYLD e.g. for ELF AUXV reading from the client.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg, kettenis

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31192

llvm-svn: 298409

7 years agoAdd stub for PluginProcessNetBSD
Kamil Rytarowski [Tue, 21 Mar 2017 17:30:47 +0000 (17:30 +0000)]
Add stub for PluginProcessNetBSD

Summary:
This is the base for introduction of further features to support Process Tracing on NetBSD, in local and remote setup.

This code is also a starting point to synchronize the development with other BSDs. Currently NetBSD is ahead and other systems can catch up.

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, joerg, kettenis, labath

Reviewed By: labath

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31138

llvm-svn: 298408

7 years agoEnable AUXV and QPassSignals in gdb-remote for NetBSD
Kamil Rytarowski [Tue, 21 Mar 2017 17:27:59 +0000 (17:27 +0000)]
Enable AUXV and QPassSignals in gdb-remote for NetBSD

Summary:
NetBSD is an ELF platform and it uses Elf Auxiliary Vector like Linux and other modern BSDs.

While there enable QPassSignals for the NetBSD port as well.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31146

llvm-svn: 298407

7 years agoEnable ProcessPOSIXLog on NetBSD
Kamil Rytarowski [Tue, 21 Mar 2017 17:26:55 +0000 (17:26 +0000)]
Enable ProcessPOSIXLog on NetBSD

Summary:
NetBSD can share the same logging functionality with Linux and FreeBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, emaste, joerg, kettenis

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31191

llvm-svn: 298406

7 years agoAdd NetBSD case in Entry::Type::ThreadID
Kamil Rytarowski [Tue, 21 Mar 2017 17:25:47 +0000 (17:25 +0000)]
Add NetBSD case in Entry::Type::ThreadID

Summary:
NetBSD native threads are printed as 64-bit unsigned integers.

The underlying system type of a thread identity is lwpid_t of type int32_t. For consistency with Linux and FreeBSD share the 64-bit unsigned integer type.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31132

llvm-svn: 298405

7 years agoUse ProfileSummary:getProfileCount to get ScaledCount for ModuleSummary
Dehao Chen [Tue, 21 Mar 2017 17:22:35 +0000 (17:22 +0000)]
Use ProfileSummary:getProfileCount to get ScaledCount for ModuleSummary

Summary: ModuleSummary should use the standard interface of ProfileSummary::getProfileCount.

Reviewers: eraman, tejohnson

Reviewed By: tejohnson

Subscribers: tejohnson, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D31154

llvm-svn: 298404

7 years agoUpdate comment.
Rui Ueyama [Tue, 21 Mar 2017 17:22:13 +0000 (17:22 +0000)]
Update comment.

llvm-svn: 298403

7 years agoRemove stray paren that got in while attempting to fix the build for AttributeList
Reid Kleckner [Tue, 21 Mar 2017 17:15:50 +0000 (17:15 +0000)]
Remove stray paren that got in while attempting to fix the build for AttributeList

llvm-svn: 298402

7 years agoRevert 298388 and 298389 because they broke some AMDGPU tests.
Adrian Prantl [Tue, 21 Mar 2017 17:14:30 +0000 (17:14 +0000)]
Revert 298388 and 298389 because they broke some AMDGPU tests.

llvm-svn: 298401

7 years agoRecommit r298282 with fixes for memory allocation/deallocation
Krzysztof Parzyszek [Tue, 21 Mar 2017 17:09:27 +0000 (17:09 +0000)]
Recommit r298282 with fixes for memory allocation/deallocation

[Hexagon] Recognize polynomial-modulo loop idiom again

Regain the ability to recognize loops calculating polynomial modulo
operation. This ability has been lost due to some changes in the
preceding optimizations. Add code to preprocess the IR to a form
that the pattern matching code can recognize.

llvm-svn: 298400

7 years agoUpdate for LLVM API rename of AttributeSet -> AttributeList
Reid Kleckner [Tue, 21 Mar 2017 17:09:20 +0000 (17:09 +0000)]
Update for LLVM API rename of AttributeSet -> AttributeList

llvm-svn: 298399

7 years agoFix RST docs AttributeList heading underline
Reid Kleckner [Tue, 21 Mar 2017 17:05:00 +0000 (17:05 +0000)]
Fix RST docs AttributeList heading underline

llvm-svn: 298398

7 years agoAMDGPU: Buffer descriptor changes for GFX9
Marek Olsak [Tue, 21 Mar 2017 17:00:39 +0000 (17:00 +0000)]
AMDGPU: Buffer descriptor changes for GFX9

Reviewers: arsenm

Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, dstuttard, tpr

Differential Revision: https://reviews.llvm.org/D31158

llvm-svn: 298397

7 years agoAMDGPU: Always use VGPR indexing on GFX9
Marek Olsak [Tue, 21 Mar 2017 17:00:32 +0000 (17:00 +0000)]
AMDGPU: Always use VGPR indexing on GFX9

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, dstuttard, tpr

Differential Revision: https://reviews.llvm.org/D31157

llvm-svn: 298396

7 years ago[Hexagon] Add -march=hexagon to a testcase
Krzysztof Parzyszek [Tue, 21 Mar 2017 16:59:40 +0000 (16:59 +0000)]
[Hexagon] Add -march=hexagon to a testcase

llvm-svn: 298395

7 years agoUpdate Clang for LLVM rename AttributeSet -> AttributeList
Reid Kleckner [Tue, 21 Mar 2017 16:57:30 +0000 (16:57 +0000)]
Update Clang for LLVM rename AttributeSet -> AttributeList

llvm-svn: 298394

7 years agoRename AttributeSet to AttributeList
Reid Kleckner [Tue, 21 Mar 2017 16:57:19 +0000 (16:57 +0000)]
Rename AttributeSet to AttributeList

Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.

Rename AttributeSetImpl to AttributeListImpl to follow suit.

It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.

Reviewers: sanjoy, javed.absar, chandlerc, pete

Reviewed By: pete

Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits

Differential Revision: https://reviews.llvm.org/D31102

llvm-svn: 298393

7 years ago[index/AST] Determine if a typedef shares a name and spelling location with its under...
Argyrios Kyrtzidis [Tue, 21 Mar 2017 16:56:02 +0000 (16:56 +0000)]
[index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type

In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.

llvm-svn: 298392

7 years ago[Modules] Find PrivateHeaders when looking into subframeworks
Bruno Cardoso Lopes [Tue, 21 Mar 2017 16:43:51 +0000 (16:43 +0000)]
[Modules] Find PrivateHeaders when looking into subframeworks

Fix the current parsing of subframeworks in modulemaps to lookup for
headers based on whether they are frameworks.

rdar://problem/30563982

llvm-svn: 298391

7 years agoAMDGPU: Fix not including v2i16/v2f16 in register class
Matt Arsenault [Tue, 21 Mar 2017 16:42:50 +0000 (16:42 +0000)]
AMDGPU: Fix not including v2i16/v2f16 in register class

llvm-svn: 298390

7 years agoDon't compose DWARF expressions with multiple subregisters.
Adrian Prantl [Tue, 21 Mar 2017 16:37:39 +0000 (16:37 +0000)]
Don't compose DWARF expressions with multiple subregisters.

If a register location can only be described by a complex expression
(i.e., multiple subregisters) it doesn't safely compose with another
complex expression. For example, it is not possible to apply a
DW_OP_deref operation to multiple DW_OP_pieces.

llvm-svn: 298389

7 years agoDwarfExpression: Defer emitting DWARF register operations
Adrian Prantl [Tue, 21 Mar 2017 16:37:35 +0000 (16:37 +0000)]
DwarfExpression: Defer emitting DWARF register operations
until the rest of the expression is known.

This is still an NFC refactoring in preparation of a subsequent bugfix.

llvm-svn: 298388

7 years agoAMDGPU: Fix asserting on 0 dmask for image intrinsics
Matt Arsenault [Tue, 21 Mar 2017 16:32:17 +0000 (16:32 +0000)]
AMDGPU: Fix asserting on 0 dmask for image intrinsics

Fold these to undef during lowering so users get eliminated.

llvm-svn: 298387

7 years agoAMDGPU: Convert image intrinsic uses in tests
Matt Arsenault [Tue, 21 Mar 2017 16:24:12 +0000 (16:24 +0000)]
AMDGPU: Convert image intrinsic uses in tests

llvm-svn: 298386

7 years agoDAG: Fold bitcast/extract_vector_elt of undef to undef
Matt Arsenault [Tue, 21 Mar 2017 16:20:16 +0000 (16:20 +0000)]
DAG: Fold bitcast/extract_vector_elt of undef to undef

Fixes not eliminating store when intrinsic is lowered to undef.

llvm-svn: 298385

7 years agotsan: fix pie_no_aslr test
Dmitry Vyukov [Tue, 21 Mar 2017 15:37:48 +0000 (15:37 +0000)]
tsan: fix pie_no_aslr test

It failed on clang-cmake-aarch64-39vma.
Restrict it to x86_64 only.

llvm-svn: 298383

7 years agoRevert r298274: "Use pthreads for thread-local lsan allocator cache on darwin"
Chandler Carruth [Tue, 21 Mar 2017 15:31:15 +0000 (15:31 +0000)]
Revert r298274: "Use pthreads for thread-local lsan allocator cache on darwin"

This fixes a failure currently present on the upstream linux boxes (and
reproduces for me as well):
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/1130/steps/64-bit%20check-asan-dynamic/logs/stdio

llvm-svn: 298382