platform/upstream/llvm.git
7 years agoChange the interface of TLI.isMultiStoresCheaperThanBitsMerge.
Wei Mi [Thu, 22 Dec 2016 19:38:22 +0000 (19:38 +0000)]
Change the interface of TLI.isMultiStoresCheaperThanBitsMerge.

This is for splitMergedValStore in DAG Combine to share the target query interface
with similar logic in CodeGenPrepare.

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

llvm-svn: 290363

7 years agoRevert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing...
Renato Golin [Thu, 22 Dec 2016 19:38:04 +0000 (19:38 +0000)]
Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification"

This reverts commit r290354, as it broke the build. We need to make sure
this builds on AArch64 before committing again.

llvm-svn: 290362

7 years ago[mips] Fix compact branch hazard detection, part 2
Petar Jovanovic [Thu, 22 Dec 2016 19:29:50 +0000 (19:29 +0000)]
[mips] Fix compact branch hazard detection, part 2

Follow up to D27209 fix, this patch now properly handles single transient
instruction in basic block.

Patch by Aleksandar Beserminji.

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

llvm-svn: 290361

7 years agoAdd the DAG mutation interface to the software pipeliner
Krzysztof Parzyszek [Thu, 22 Dec 2016 19:21:20 +0000 (19:21 +0000)]
Add the DAG mutation interface to the software pipeliner

llvm-svn: 290360

7 years agoFix a couple of incorrect format string warnings
Luke Drummond [Thu, 22 Dec 2016 19:15:07 +0000 (19:15 +0000)]
Fix a couple of incorrect format string warnings

This patch fixes use of incorrect `%zi` to format a plain `int`, and using
`%llu` to format a `uint64_t`. The fix is to use the new typesafe
`llvm::Formatv` based API.

Differential Revision: https://reviews.llvm.org/D28028
Subscribers: lldb-commits

llvm-svn: 290359

7 years agoPass -Wa,-mbig-obj in 64-bit mingw builds
Reid Kleckner [Thu, 22 Dec 2016 19:12:14 +0000 (19:12 +0000)]
Pass -Wa,-mbig-obj in 64-bit mingw builds

COFF has a 2**16 section limit, and on Win64, every COMDAT function
creates at least 3 sections: .text, .pdata, and .xdata. For MSVC, we
enable bigobj on a file-by-file basis, but GCC appears to hit the limit
on different files.

Fixes PR25953

llvm-svn: 290358

7 years agoBuild KillTheDoctor with mingw-w64
Reid Kleckner [Thu, 22 Dec 2016 19:11:42 +0000 (19:11 +0000)]
Build KillTheDoctor with mingw-w64

compiler-rt uses it in its lit tests.

llvm-svn: 290357

7 years agoFix warning introduced by r290297.
George Burgess IV [Thu, 22 Dec 2016 19:00:31 +0000 (19:00 +0000)]
Fix warning introduced by r290297.

llvm-svn: 290356

7 years agoFix two bugs in the pipeliner in renaming phis in the prolog and epilog
Krzysztof Parzyszek [Thu, 22 Dec 2016 18:49:55 +0000 (18:49 +0000)]
Fix two bugs in the pipeliner in renaming phis in the prolog and epilog

When the pipeliner is renaming phi values, it may need to iterate through
the phi operands to check for other phis. However, the pipeliner should
stop once it reaches a phi that is outside the pipelined loop.

Also, when the generateExistingPhis code is unable to reuse an existing
phi, the default code that computes the PhiOp2 is only to be used when
the pipeliner is generating the kernel. Otherwise, the phi may be a value
computed earlier in the same epilog.

Patch by Brendon Cahoon.

llvm-svn: 290355

7 years ago[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruc...
Serge Rogatch [Thu, 22 Dec 2016 18:48:36 +0000 (18:48 +0000)]
[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification

Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime.

Reviewers: dberris, rengolin

Subscribers: llvm-commits, iid_iunknown, aemerson

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

llvm-svn: 290354

7 years agoMake alloc_size only applicable to Functions.
George Burgess IV [Thu, 22 Dec 2016 18:48:34 +0000 (18:48 +0000)]
Make alloc_size only applicable to Functions.

I don't remember why I didn't make alloc_size only applicable to
Functions a year ago, but I can't see any compelling reason not to do
so now.

Fixes PR31453.

llvm-svn: 290353

7 years ago[analyzer] Update GTestChecker to tighten API detection
Devin Coughlin [Thu, 22 Dec 2016 17:52:57 +0000 (17:52 +0000)]
[analyzer] Update GTestChecker to tighten API detection

Update the GTestChecker to tighten up the API detection and make it
cleaner in response to post-commit feedback. Also add tests for when
temporary destructors are enabled to make sure we get the expected behavior
when inlining constructors for temporaries.

llvm-svn: 290352

7 years agoAMDGPU: Use i16 for i16 shift amount
Matt Arsenault [Thu, 22 Dec 2016 16:36:25 +0000 (16:36 +0000)]
AMDGPU: Use i16 for i16 shift amount

llvm-svn: 290351

7 years ago[NewGVN] Add the pass to PassRegistry.def.
Davide Italiano [Thu, 22 Dec 2016 16:35:02 +0000 (16:35 +0000)]
[NewGVN] Add the pass to PassRegistry.def.

We need to hook up here to get it working with the new PM.
Add a test while here (and remove a typo).

llvm-svn: 290350

7 years agoAMDGPU: Fix missing 16-bit cmpx instructions
Matt Arsenault [Thu, 22 Dec 2016 16:27:14 +0000 (16:27 +0000)]
AMDGPU: Fix missing 16-bit cmpx instructions

llvm-svn: 290349

7 years agoAMDGPU: Use i16 comparison instructions
Matt Arsenault [Thu, 22 Dec 2016 16:27:11 +0000 (16:27 +0000)]
AMDGPU: Use i16 comparison instructions

llvm-svn: 290348

7 years agoAMDGPU: Fixed '!NodePtr->isKnownSentinel()' assert
Matt Arsenault [Thu, 22 Dec 2016 16:06:32 +0000 (16:06 +0000)]
AMDGPU: Fixed '!NodePtr->isKnownSentinel()' assert

Caused by dereferencing end iterator when trying to const cast the iterator.

Patch by Martin Sherburn

llvm-svn: 290347

7 years ago[GVN] Initial check-in of a new global value numbering algorithm.
Davide Italiano [Thu, 22 Dec 2016 16:03:48 +0000 (16:03 +0000)]
[GVN] Initial check-in of a new global value numbering algorithm.

The code have been developed by Daniel Berlin over the years, and
the new implementation goal is that of addressing shortcomings of
the current GVN infrastructure, i.e. long compile time for large
testcases, lack of phi predication, no load/store value numbering
etc...

The current code just implements the "core" GVN algorithm, although
other pieces (load coercion, phi handling, predicate system) are
already implemented in a branch out of tree. Once the core is stable,
we'll start adding pieces on top of the base framework.
The test currently living in test/Transform/NewGVN are a copy
of the ones in GVN, with proper `XFAIL` (missing features in NewGVN).
A flag will be added in a future commit to enable NewGVN, so that
interested parties can exercise this code easily.

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

llvm-svn: 290346

7 years ago[WebAssembly] Add an "explicit" keyword to a constructor.
Dan Gohman [Thu, 22 Dec 2016 16:03:02 +0000 (16:03 +0000)]
[WebAssembly] Add an "explicit" keyword to a constructor.

llvm-svn: 290345

7 years ago[WebAssembly] Don't use variadic operand indices in the MCOperandInfo array.
Dan Gohman [Thu, 22 Dec 2016 16:00:55 +0000 (16:00 +0000)]
[WebAssembly] Don't use variadic operand indices in the MCOperandInfo array.

llvm-svn: 290344

7 years ago[compiler-rt] Add missing includes of <errno.h> and <iterator>
Krzysztof Parzyszek [Thu, 22 Dec 2016 15:31:21 +0000 (15:31 +0000)]
[compiler-rt] Add missing includes of <errno.h> and <iterator>

The compilation failed due to undeclared identifiers: distance, errno,
and EINTR.

llvm-svn: 290343

7 years ago[WebAssembly] Don't old negative load/store offsets in fast-isel.
Dan Gohman [Thu, 22 Dec 2016 15:15:10 +0000 (15:15 +0000)]
[WebAssembly] Don't old negative load/store offsets in fast-isel.

WebAssembly's load/store offsets are unsigned and don't wrap, so it's not
valid to fold in a negative offset.

llvm-svn: 290342

7 years ago[analyzer] Improve suppress-on-sink behavior in incomplete analyses.
Artem Dergachev [Thu, 22 Dec 2016 14:48:52 +0000 (14:48 +0000)]
[analyzer] Improve suppress-on-sink behavior in incomplete analyses.

Warnings with suppress-on-sink are discarded during FlushReports when
BugReporter notices that all paths in ExplodedGraph that pass through the
warning eventually run into a sink node.

However, suppress-on-sink fails to filter out false positives when the analysis
terminates too early - by running into analyzer limits, such as block count
limits or graph size limits - and the interruption hits the narrow window
between throwing the leak report and reaching the no-return function call. In
such case the report is there, however suppression-on-sink doesn't work, because
the sink node was never constructed in the incomplete ExplodedGraph.

This patch implements a very partial solution: also suppress reports thrown
against a statement-node that corresponds to a statement that belongs to a
no-return block of the CFG.

rdar://problem/28832541

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

llvm-svn: 290341

7 years ago[clang-tidy] cppcoreguidelines-slicing: display discarded state size in bytes
Clement Courbet [Thu, 22 Dec 2016 14:12:31 +0000 (14:12 +0000)]
[clang-tidy] cppcoreguidelines-slicing: display discarded state size in bytes

https://reviews.llvm.org/D27212

llvm-svn: 290340

7 years ago[ELF] Linkerscript: print location of undefined symbol usage
Eugene Leviant [Thu, 22 Dec 2016 13:13:12 +0000 (13:13 +0000)]
[ELF] Linkerscript: print location of undefined symbol usage

Differential revision: https://reviews.llvm.org/D27194

llvm-svn: 290339

7 years ago[AMDGPU] Add pseudo SDWA instructions
Sam Kolton [Thu, 22 Dec 2016 12:57:41 +0000 (12:57 +0000)]
[AMDGPU] Add pseudo SDWA instructions

Summary: This is needed for later SDWA support in CodeGen.

Reviewers: vpykhtin, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

llvm-svn: 290338

7 years agoclang-format: Less eagerly try to keep label-value pairs on a line.
Daniel Jasper [Thu, 22 Dec 2016 12:37:06 +0000 (12:37 +0000)]
clang-format: Less eagerly try to keep label-value pairs on a line.

Before:
  string v =
      StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa,
                                                           aaaaaaaaaaaaaaa),
             bbbbbbbbbbbbbbbbbbbbbbb);

After:
  string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ",
                    SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa),
                    bbbbbbbbbbbbbbbbbbbbbbb);

llvm-svn: 290337

7 years ago[AMDGPU] Disassembler: fix for disaasembling v_mac_f32/16_dpp/sdwa
Sam Kolton [Thu, 22 Dec 2016 11:30:48 +0000 (11:30 +0000)]
[AMDGPU] Disassembler: fix for disaasembling v_mac_f32/16_dpp/sdwa

Summary: Real instruction should copy constraints from real instruction. This allows auto-generated disassembler to correctly process tied operands.

Reviewers: nhaustov, vpykhtin, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

llvm-svn: 290336

7 years ago[ELF] - Use error() instead of fatal() during relaxation of R_X86_64_GOTTPOFF
George Rimar [Thu, 22 Dec 2016 11:05:05 +0000 (11:05 +0000)]
[ELF] - Use error() instead of fatal() during relaxation of R_X86_64_GOTTPOFF

This is last known noticable fatal() in target.cpp.
We also have other ones for unknown relocations or
creating unknown targets, but that one can be just error I think.

Used yaml2obj to generate test.

Differential revision: https://reviews.llvm.org/D28049

llvm-svn: 290335

7 years agoDo not return null or Undefined from find{All,}ByVersion.
Rui Ueyama [Thu, 22 Dec 2016 09:54:32 +0000 (09:54 +0000)]
Do not return null or Undefined from find{All,}ByVersion.

Vectors returned form that function contained nullptrs or Undefined symbols.
This patch filter them out. This makes use of the function a bit easier.

llvm-svn: 290334

7 years ago[X86][AVX2] Passing the appropriate memory operand class to VPMADDWD instruction.
Ayman Musa [Thu, 22 Dec 2016 08:42:46 +0000 (08:42 +0000)]
[X86][AVX2] Passing the appropriate memory operand class to VPMADDWD instruction.

Replacing the memory operand in the ymm version of VPMADDWD from i128mem to i256mem.

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

llvm-svn: 290333

7 years agoMake -color-diagnostics an alias to -color-diagnostics=always.
Rui Ueyama [Thu, 22 Dec 2016 08:20:28 +0000 (08:20 +0000)]
Make -color-diagnostics an alias to -color-diagnostics=always.

Previously, that was an alias to -color-diagnostics=auto. However,
Clang's -fcolor-diagnostics is an alias to -fcolor-diagnostics=always,
so that was confusing. This patch fixes that issue.

llvm-svn: 290332

7 years ago[PM] Loosen the check ever so slightly -- MSVC appears to not include
Chandler Carruth [Thu, 22 Dec 2016 07:53:20 +0000 (07:53 +0000)]
[PM] Loosen the check ever so slightly -- MSVC appears to not include
a space after the comma in template arguments with our hacky type name
system.

llvm-svn: 290331

7 years ago[XRay] [compiler-rt] Move machine-dependent code into machine-dependent files
Diana Picus [Thu, 22 Dec 2016 07:35:56 +0000 (07:35 +0000)]
[XRay] [compiler-rt] Move machine-dependent code into machine-dependent files

Reapply r290077.

Authors: pelikan

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

llvm-svn: 290330

7 years agoSpeculative revert of r290310 to see if that's the change that's making some of
Richard Smith [Thu, 22 Dec 2016 07:24:39 +0000 (07:24 +0000)]
Speculative revert of r290310 to see if that's the change that's making some of
the bots unhappy.

llvm-svn: 290329

7 years ago[PM] Make a couple of CHECK lines a bit more precise, NFC.
Chandler Carruth [Thu, 22 Dec 2016 07:14:35 +0000 (07:14 +0000)]
[PM] Make a couple of CHECK lines a bit more precise, NFC.

I was staring at these and didn't realize these were module-layer
proxies as opposed to some other layer. Justin and I have a plan to
rename things to make the names themselves much easier to reason about,
but I at least want the CHECK lines to be precise for now.

llvm-svn: 290328

7 years ago[PM] Remove now-dead extern template and explicit instantiation
Chandler Carruth [Thu, 22 Dec 2016 07:14:33 +0000 (07:14 +0000)]
[PM] Remove now-dead extern template and explicit instantiation
declarations.

We're using a custom class here instead of the helper template, these
bits just didn't get deleted when the other bits did get deleted. This
was found by a really nice MSVC warning about explicitly instantiating
a template where some member functions aren't defined and thus can't be
instantiatied.

llvm-svn: 290327

7 years ago[CrashReproducer] Add support for merging -ivfsoverlay
Bruno Cardoso Lopes [Thu, 22 Dec 2016 07:06:03 +0000 (07:06 +0000)]
[CrashReproducer] Add support for merging -ivfsoverlay

Merge all VFS mapped files inside -ivfsoverlay inputs into the vfs
overlay provided by the crash reproducer. This is the last missing piece
to allow crash reproducers to fully work with user frameworks; when
combined with headermaps, it allows clang to find additional frameworks.

rdar://problem/27913709

llvm-svn: 290326

7 years ago[PM] Introduce a reasonable port of the main per-module pass pipeline
Chandler Carruth [Thu, 22 Dec 2016 06:59:15 +0000 (06:59 +0000)]
[PM] Introduce a reasonable port of the main per-module pass pipeline
from the old pass manager in the new one.

I'm not trying to support (initially) the numerous options that are
currently available to customize the pass pipeline. If we end up really
wanting them, we can add them later, but I suspect many are no longer
interesting. The simplicity of omitting them will help a lot as we sort
out what the pipeline should look like in the new PM.

I've also documented to the best of my ability *why* each pass or group
of passes is used so that reading the pipeline is more helpful. In many
cases I think we have some questionable choices of ordering and I've
left FIXME comments in place so we know what to come back and revisit
going forward. But for now, I've left it as similar to the current
pipeline as I could.

Lastly, I've had to comment out several places where passes are not
ported to the new pass manager or where the loop pass infrastructure is
not yet ready. I did at least fix a few bugs in the loop pass
infrastructure uncovered by running the full pipeline, but I didn't want
to go too far in this patch -- I'll come back and re-enable these as the
infrastructure comes online. But I'd like to keep the comments in place
because I don't want to lose track of which passes need to be enabled
and where they go.

One thing that seemed like a significant API improvement was to require
that we don't build pipelines for O0. It seems to have no real benefit.

I've also switched back to returning pass managers by value as at this
API layer it feels much more natural to me for composition. But if
others disagree, I'm happy to go back to an output parameter.

I'm not 100% happy with the testing strategy currently, but it seems at
least OK. I may come back and try to refactor or otherwise improve this
in subsequent patches but I wanted to at least get a good starting point
in place.

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

llvm-svn: 290325

7 years agoFix an assertion in DwarfExpression when emitting fragments in vector registers
Adrian Prantl [Thu, 22 Dec 2016 06:10:41 +0000 (06:10 +0000)]
Fix an assertion in DwarfExpression when emitting fragments in vector registers

When DwarfExpression is emitting a fragment that is located in a
register and that fragment is smaller than the register, and the
register must be composed from sub-registers (are you still with me?)
the last DW_OP_piece operation must not be larger than the size of the
fragment itself, since the last piece of the fragment could be smaller
than the last subregister that is being emitted.

rdar://problem/29779065

llvm-svn: 290324

7 years agoDefine a getter function for a lazily-created object.
Rui Ueyama [Thu, 22 Dec 2016 05:31:52 +0000 (05:31 +0000)]
Define a getter function for a lazily-created object.

Previously, you had to call initDemangledSyms() before accessing DemangledSyms.
Now getDemangledSyms() initializes it and then returns it. So it is now less easy
to use it in a wrong way.

llvm-svn: 290323

7 years agoRefactor the DIExpression fragment query interface (NFC)
Adrian Prantl [Thu, 22 Dec 2016 05:27:12 +0000 (05:27 +0000)]
Refactor the DIExpression fragment query interface (NFC)
... so it becomes available to DIExpressionCursor.

llvm-svn: 290322

7 years agoSimplify. NFC.
Rui Ueyama [Thu, 22 Dec 2016 05:22:29 +0000 (05:22 +0000)]
Simplify. NFC.

llvm-svn: 290321

7 years agoDefine a function to avoid a magic variable 0x3.
Rui Ueyama [Thu, 22 Dec 2016 05:11:12 +0000 (05:11 +0000)]
Define a function to avoid a magic variable 0x3.

llvm-svn: 290320

7 years agoMake FormatStyle.GetStyleOfFile test work on MSVC
Antonio Maiorano [Thu, 22 Dec 2016 05:10:07 +0000 (05:10 +0000)]
Make FormatStyle.GetStyleOfFile test work on MSVC

Modify getStyle to use vfs::FileSystem::makeAbsolute just like FS.addFile does,
rather than sys::fs::make_absolute. The latter gets the CWD from the platform,
while the former expects it to be set by the client, causing a mismatch when
converting relative paths to absolute.

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

llvm-svn: 290319

7 years agoRemove a typedef that is used only once.
Rui Ueyama [Thu, 22 Dec 2016 04:40:56 +0000 (04:40 +0000)]
Remove a typedef that is used only once.

llvm-svn: 290318

7 years agoDAG: Add helper for testing constant values
Matt Arsenault [Thu, 22 Dec 2016 04:39:45 +0000 (04:39 +0000)]
DAG: Add helper for testing constant values

There are helpers for testing for constant or constant build_vector,
and for splat ConstantFP vectors, but not for a constantfp or
non-splat ConstantFP vector.

llvm-svn: 290317

7 years agoAMDGPU: Fix missing commute table entries for cmpx
Matt Arsenault [Thu, 22 Dec 2016 04:39:41 +0000 (04:39 +0000)]
AMDGPU: Fix missing commute table entries for cmpx

No tests because these aren't currently used anywhere.

llvm-svn: 290316

7 years agoSema: print qualified name for overload candidates
Saleem Abdulrasool [Thu, 22 Dec 2016 04:26:57 +0000 (04:26 +0000)]
Sema: print qualified name for overload candidates

Print the fully qualified names for the overload candidates.  This makes
it easier to tell what the ambiguity is.  Especially if a template
is instantiated after a using namespace, it will not inherit the
namespace where it was declared.  The specialization will give a message
about a partial order being ambiguous for the same (unqualified) name,
which does not help identify the failure.

Addresses PR31450!

llvm-svn: 290315

7 years ago[ThinLTO] Save 8B per summary entry by rearranging the fields (NFC)
Mehdi Amini [Thu, 22 Dec 2016 04:09:29 +0000 (04:09 +0000)]
[ThinLTO] Save 8B per summary entry by rearranging the fields (NFC)

Size goes from 72B to 64B per entry.

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

llvm-svn: 290314

7 years agoAMDGPU: Swap order of operands in fadd/fsub combine
Matt Arsenault [Thu, 22 Dec 2016 04:03:40 +0000 (04:03 +0000)]
AMDGPU: Swap order of operands in fadd/fsub combine

FMA is canonicalized to constant in the middle operand. Do
the same so fmad matches and avoid an extra combine step.

llvm-svn: 290313

7 years agoAMDGPU: Check fast math flags in fadd/fsub combines
Matt Arsenault [Thu, 22 Dec 2016 04:03:35 +0000 (04:03 +0000)]
AMDGPU: Check fast math flags in fadd/fsub combines

llvm-svn: 290312

7 years agoAMDGPU: Form more FMAs if fusion is allowed
Matt Arsenault [Thu, 22 Dec 2016 03:55:35 +0000 (03:55 +0000)]
AMDGPU: Form more FMAs if fusion is allowed

Extend the existing fadd/fsub->fmad combines to produce
FMA if allowed.

llvm-svn: 290311

7 years agoOnly substitute into type of non-type template parameter once, rather than
Richard Smith [Thu, 22 Dec 2016 03:52:37 +0000 (03:52 +0000)]
Only substitute into type of non-type template parameter once, rather than
twice, in finalization of template argumetn deduction.

llvm-svn: 290310

7 years agoAMDGPU: Move combines into separate functions
Matt Arsenault [Thu, 22 Dec 2016 03:44:42 +0000 (03:44 +0000)]
AMDGPU: Move combines into separate functions

llvm-svn: 290309

7 years agoAMDGPU: Enable some f32 fadd/fsub combines for f16
Matt Arsenault [Thu, 22 Dec 2016 03:40:39 +0000 (03:40 +0000)]
AMDGPU: Enable some f32 fadd/fsub combines for f16

llvm-svn: 290308

7 years agoAMDGPU: Implement isFMAFasterThanFMulAndFAdd for f16
Matt Arsenault [Thu, 22 Dec 2016 03:21:48 +0000 (03:21 +0000)]
AMDGPU: Implement isFMAFasterThanFMulAndFAdd for f16

llvm-svn: 290307

7 years agoAMDGPU: setcc test cleanup
Matt Arsenault [Thu, 22 Dec 2016 03:21:45 +0000 (03:21 +0000)]
AMDGPU: setcc test cleanup

llvm-svn: 290306

7 years agoDriver: use the triple to query the arch, not the toolchain
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:04 +0000 (03:09 +0000)]
Driver: use the triple to query the arch, not the toolchain

Although the result is the same, the intent is much more clear this way:
we care about the architecture we are targeting.  NFC.

llvm-svn: 290305

7 years agoDriver: remove unnecessary parameter
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:02 +0000 (03:09 +0000)]
Driver: remove unnecessary parameter

We can query the Triple and EffectiveTriple from the ToolChain.  Avoid
passing in the argument and query it in the function.  NFC.

llvm-svn: 290304

7 years agoDriver: rename parameter to reduce confusion
Saleem Abdulrasool [Thu, 22 Dec 2016 03:09:00 +0000 (03:09 +0000)]
Driver: rename parameter to reduce confusion

The parameter to ParsePICOpts passed the effective triple and then used
that in a few places and used the actual triple in others.  This was
slightly confusing.  Rename the parameter to make it more obvious.

llvm-svn: 290303

7 years agoAMDGPU: Allow rcp and rsq usage with f16
Matt Arsenault [Thu, 22 Dec 2016 03:05:44 +0000 (03:05 +0000)]
AMDGPU: Allow rcp and rsq usage with f16

llvm-svn: 290302

7 years agoAMDGPU: Custom lower f16 fdiv
Matt Arsenault [Thu, 22 Dec 2016 03:05:41 +0000 (03:05 +0000)]
AMDGPU: Custom lower f16 fdiv

llvm-svn: 290301

7 years agoAMDGPU: Implement f16 fcanonicalize
Matt Arsenault [Thu, 22 Dec 2016 03:05:37 +0000 (03:05 +0000)]
AMDGPU: Implement f16 fcanonicalize

llvm-svn: 290300

7 years agoAMDGPU: Update isFPImmLegal for f16
Matt Arsenault [Thu, 22 Dec 2016 03:05:30 +0000 (03:05 +0000)]
AMDGPU: Update isFPImmLegal for f16

I don't think this matters because ConstantFP is legal.

llvm-svn: 290299

7 years agoClear the PendingTypeTests vector after moving from it.
Peter Collingbourne [Thu, 22 Dec 2016 02:52:23 +0000 (02:52 +0000)]
Clear the PendingTypeTests vector after moving from it.

This is to put the vector into a well defined state. Apparently the state of a
vector after being moved from is valid but unspecified. Found with clang-tidy.

llvm-svn: 290298

7 years agoAdd the alloc_size attribute to clang, attempt 2.
George Burgess IV [Thu, 22 Dec 2016 02:50:20 +0000 (02:50 +0000)]
Add the alloc_size attribute to clang, attempt 2.

This is a recommit of r290149, which was reverted in r290169 due to msan
failures. msan was failing because we were calling
`isMostDerivedAnUnsizedArray` on an invalid designator, which caused us
to read uninitialized memory. To fix this, the logic of the caller of
said function was simplified, and we now have a `!Invalid` assert in
`isMostDerivedAnUnsizedArray`, so we can catch this particular bug more
easily in the future.

Fingers crossed that this patch sticks this time. :)

Original commit message:

This patch does three things:
- Gives us the alloc_size attribute in clang, which lets us infer the
  number of bytes handed back to us by malloc/realloc/calloc/any user
  functions that act in a similar manner.
- Teaches our constexpr evaluator that evaluating some `const` variables
  is OK sometimes. This is why we have a change in
  test/SemaCXX/constant-expression-cxx11.cpp and other seemingly
  unrelated tests. Richard Smith okay'ed this idea some time ago in
  person.
- Uniques some Blocks in CodeGen, which was reviewed separately at
  D26410. Lack of uniquing only really shows up as a problem when
  combined with our new eagerness in the face of const.

llvm-svn: 290297

7 years ago[AArch64] Correct the check of signed 9-bit imm in getIndexedAddressParts().
Haicheng Wu [Thu, 22 Dec 2016 01:39:24 +0000 (01:39 +0000)]
[AArch64] Correct the check of signed 9-bit imm in getIndexedAddressParts().

-256 is a legal indexed address part.

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

llvm-svn: 290296

7 years agoPass GetAssumptionCache to InlineFunctionInfo constructor
Easwaran Raman [Thu, 22 Dec 2016 01:07:01 +0000 (01:07 +0000)]
Pass GetAssumptionCache to InlineFunctionInfo constructor

Differential revision: https://reviews.llvm.org/D28038

llvm-svn: 290295

7 years ago[NVVMIntrRange] Only set range metadata if none is already present
David Majnemer [Thu, 22 Dec 2016 00:51:59 +0000 (00:51 +0000)]
[NVVMIntrRange] Only set range metadata if none is already present

The range metadata inserted by NVVMIntrRange is pessimistic, range
metadata already present could be more precise.

llvm-svn: 290294

7 years agoRenumber testcase metadata nodes after r290153.
Adrian Prantl [Thu, 22 Dec 2016 00:45:21 +0000 (00:45 +0000)]
Renumber testcase metadata nodes after r290153.

This patch renumbers the metadata nodes in debug info testcases after
https://reviews.llvm.org/D26769. This is a separate patch because it
causes so much churn. This was implemented with a python script that
pipes the testcases through llvm-as - | llvm-dis - and then goes
through the original and new output side-by side to insert all
comments at a close-enough location.

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

llvm-svn: 290292

7 years ago[LLParser] Make the line field of DIMacro(File) optional.
Adrian Prantl [Thu, 22 Dec 2016 00:29:00 +0000 (00:29 +0000)]
[LLParser] Make the line field of DIMacro(File) optional.

Otherwise these records do not survive roundtrips.

llvm-svn: 290291

7 years ago[clang-tidy] Ignore `size() == 0` in the container implementation.
Alexander Kornienko [Wed, 21 Dec 2016 23:44:23 +0000 (23:44 +0000)]
[clang-tidy] Ignore `size() == 0` in the container implementation.

llvm-svn: 290289

7 years agoLegalize metadata in legacy testcases
Adrian Prantl [Wed, 21 Dec 2016 23:38:17 +0000 (23:38 +0000)]
Legalize metadata in legacy testcases

llvm-svn: 290288

7 years agoLegalize metadata in legacy testcases
Adrian Prantl [Wed, 21 Dec 2016 23:36:06 +0000 (23:36 +0000)]
Legalize metadata in legacy testcases

llvm-svn: 290287

7 years agoLegalize metadata in legacy testcases
Adrian Prantl [Wed, 21 Dec 2016 23:30:35 +0000 (23:30 +0000)]
Legalize metadata in legacy testcases

llvm-svn: 290286

7 years agoLegalize metadata in legacy testcases
Adrian Prantl [Wed, 21 Dec 2016 23:28:49 +0000 (23:28 +0000)]
Legalize metadata in legacy testcases

llvm-svn: 290285

7 years ago[GlobalISel] Add basic Selector-emitter tblgen backend.
Ahmed Bougacha [Wed, 21 Dec 2016 23:26:20 +0000 (23:26 +0000)]
[GlobalISel] Add basic Selector-emitter tblgen backend.

This adds a basic tablegen backend that analyzes the SelectionDAG
patterns to find simple ones that are eligible for GlobalISel-emission.

That's similar to FastISel, with one notable difference: we're not fed
ISD opcodes, so we need to map the SDNode operators to generic opcodes.
That's done using GINodeEquiv in TargetGlobalISel.td.

Otherwise, this is mostly boilerplate, and lots of filtering of any kind
of "complicated" pattern. On AArch64, this is sufficient to match G_ADD
up to s64 (to ADDWrr/ADDXrr) and G_BR (to B).

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

llvm-svn: 290284

7 years ago[AsmWriter] Remove redundant cast<>s. NFC.
Ahmed Bougacha [Wed, 21 Dec 2016 23:26:13 +0000 (23:26 +0000)]
[AsmWriter] Remove redundant cast<>s. NFC.

llvm-svn: 290283

7 years agospecify -DNDEBUG for BNI builds of all targets in the Xcode build
Sean Callanan [Wed, 21 Dec 2016 23:21:11 +0000 (23:21 +0000)]
specify -DNDEBUG for BNI builds of all targets in the Xcode build

llvm-svn: 290282

7 years ago[WebAssembly] Fix the opcode value for i64.rotr.
Dan Gohman [Wed, 21 Dec 2016 23:09:42 +0000 (23:09 +0000)]
[WebAssembly] Fix the opcode value for i64.rotr.

llvm-svn: 290281

7 years agoIR: Function summary representation for type tests.
Peter Collingbourne [Wed, 21 Dec 2016 23:03:45 +0000 (23:03 +0000)]
IR: Function summary representation for type tests.

Each function summary has an attached list of type identifier GUIDs. The
idea is that during the regular LTO phase we would match these GUIDs to type
identifiers defined by the regular LTO module and store the resolutions in
a top-level "type identifier summary" (which will be implemented separately).

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

llvm-svn: 290280

7 years agoIncrease the treshold in unit test to accomodate for qurantine size increase.
Evgeniy Stepanov [Wed, 21 Dec 2016 22:50:08 +0000 (22:50 +0000)]
Increase the treshold in unit test to accomodate for qurantine size increase.

Reviewers: eugenis

Patch by Alex Shlyapnikov.

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 290279

7 years ago[sancov] skip duplicated points
Mike Aizatsky [Wed, 21 Dec 2016 22:10:01 +0000 (22:10 +0000)]
[sancov] skip duplicated points

llvm-svn: 290278

7 years ago[sancov] hash prefix results in huge merge files, use shorter prefix
Mike Aizatsky [Wed, 21 Dec 2016 22:09:57 +0000 (22:09 +0000)]
[sancov] hash prefix results in huge merge files, use shorter prefix

llvm-svn: 290277

7 years agoPerform type-checking for a converted constant expression in a template
Richard Smith [Wed, 21 Dec 2016 21:42:57 +0000 (21:42 +0000)]
Perform type-checking for a converted constant expression in a template
argument even if the expression is value-dependent (we need to suppress the
final portion of the narrowing check, but the rest of the checking can still be
done eagerly).

This affects template template argument validity and partial ordering under
p0522r0.

llvm-svn: 290276

7 years ago[AArch64] Remove a redundant check. NFC.
Haicheng Wu [Wed, 21 Dec 2016 21:40:47 +0000 (21:40 +0000)]
[AArch64] Remove a redundant check. NFC.

The case AM.Scale == 0 is already handled by the code right above.

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

llvm-svn: 290275

7 years agoAdd the ability for DWARFDie objects to get the parent DWARFDie.
Greg Clayton [Wed, 21 Dec 2016 21:37:06 +0000 (21:37 +0000)]
Add the ability for DWARFDie objects to get the parent DWARFDie.

In order for the llvm DWARF parser to be used in LLDB we will need to be able to get the parent of a DIE. This patch adds that functionality by changing the DWARFDebugInfoEntry class to store a depth field instead of a sibling index. Using a depth field allows us to easily calculate the sibling and the parent without increasing the size of DWARFDebugInfoEntry.

I tested llvm-dsymutil on a debug version of clang where this fully parses DWARF in over 1200 .o files to verify there was no serious regression in performance.

Added a full suite of unit tests to test this functionality.

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

llvm-svn: 290274

7 years ago[CMake] Support distribution install for LLDB.framework
Chris Bieneman [Wed, 21 Dec 2016 21:23:27 +0000 (21:23 +0000)]
[CMake] Support distribution install for LLDB.framework

This patch adds the last bit of support to get LLVM_DISTRIBUTION_COMPONENTS working with libLLDB when built as a framework.

This patch adds dummy install targets for binaries built into the framework's Resources directory, and makes the framework's install target depend on all the binaries that get installed with the framework.

llvm-svn: 290273

7 years agoFix for the __kmpc_global_num_threads function to return the value of the __kmp_all_n...
Andrey Churbanov [Wed, 21 Dec 2016 21:20:20 +0000 (21:20 +0000)]
Fix for the __kmpc_global_num_threads function to return the value of the __kmp_all_nth global var.

Patch by Yonghong Yan.

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

llvm-svn: 290272

7 years agocmake: Don't build llvm-config and tblgen concurrently in cross builds
Justin Bogner [Wed, 21 Dec 2016 21:19:00 +0000 (21:19 +0000)]
cmake: Don't build llvm-config and tblgen concurrently in cross builds

This sets USES_TERMINAL for the native llvm-config build, so that it
doesn't run at the same time as builds of other native tools (namely,
tablegen). Without this, if you're very unlucky with the timing it's
possible to be relinking libSupport as one of the tools is linking,
causing a spurious failure.

The tablegen build adopted USES_TERMINAL for this same reason in
r280748.

llvm-svn: 290271

7 years agoUpdate mailing list post URL and add libunwind reference
Ed Maste [Wed, 21 Dec 2016 20:51:42 +0000 (20:51 +0000)]
Update mailing list post URL and add libunwind reference

RTDyldMemoryManager.cpp describes the differing __register_frame
API between libunwind and libgcc, with a mailing list posting URL.

The original link was 404; replace it with what I believe is the
intended post, as well as a reference to the "OS X" implementation in
libunwind.

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

llvm-svn: 290269

7 years agoARM: define a macro for the FPv5 FPU in ARM mode.
Tim Northover [Wed, 21 Dec 2016 20:49:43 +0000 (20:49 +0000)]
ARM: define a macro for the FPv5 FPU in ARM mode.

FPv5 is in Cortex-M7 and the 64-bit CPUs when running in 32-bit mode. The name
is from the Cortex-M7 TRM.

llvm-svn: 290268

7 years ago[X86][SSE] Improve lowering of vXi64 multiplies
Simon Pilgrim [Wed, 21 Dec 2016 20:00:10 +0000 (20:00 +0000)]
[X86][SSE] Improve lowering of vXi64 multiplies

As mentioned on PR30845, we were performing our vXi64 multiplication as:

AloBlo = pmuludq(a, b);
AloBhi = pmuludq(a, psrlqi(b, 32));
AhiBlo = pmuludq(psrlqi(a, 32), b);
return AloBlo + psllqi(AloBhi, 32)+ psllqi(AhiBlo, 32);

when we could avoid one of the upper shifts with:

AloBlo = pmuludq(a, b);
AloBhi = pmuludq(a, psrlqi(b, 32));
AhiBlo = pmuludq(psrlqi(a, 32), b);
return AloBlo + psllqi(AloBhi + AhiBlo, 32);

This matches the lowering on gcc/icc.

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

llvm-svn: 290267

7 years agoRevert "[InstCombine] New opportunities for FoldAndOfICmp and FoldXorOfICmp"
David Majnemer [Wed, 21 Dec 2016 19:21:59 +0000 (19:21 +0000)]
Revert "[InstCombine] New opportunities for FoldAndOfICmp and FoldXorOfICmp"

This reverts commit r289813, it caused PR31449.

llvm-svn: 290266

7 years agoAMDGPU/SI: Fix file header
Tom Stellard [Wed, 21 Dec 2016 19:06:24 +0000 (19:06 +0000)]
AMDGPU/SI: Fix file header

llvm-svn: 290265

7 years agoTypeMetadataUtils: Simplify; spotted by Mehdi.
Peter Collingbourne [Wed, 21 Dec 2016 19:00:47 +0000 (19:00 +0000)]
TypeMetadataUtils: Simplify; spotted by Mehdi.

llvm-svn: 290264

7 years agoAdd missing includes on Windows.
Zachary Turner [Wed, 21 Dec 2016 18:50:52 +0000 (18:50 +0000)]
Add missing includes on Windows.

Patch by Andrey Khalyavin
Differential Revision: https://reviews.llvm.org/D27915

llvm-svn: 290263

7 years agoMake some diagnostic tests C++11 clean.
Paul Robinson [Wed, 21 Dec 2016 18:33:17 +0000 (18:33 +0000)]
Make some diagnostic tests C++11 clean.

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

llvm-svn: 290262

7 years ago[LLParser] Parse vector GEP constant expression correctly
Michael Kuperstein [Wed, 21 Dec 2016 18:29:47 +0000 (18:29 +0000)]
[LLParser] Parse vector GEP constant expression correctly

The constantexpr parsing was too constrained and rejected legal vector GEPs.
This relaxes it to be similar to the ones for instruction parsing.

This fixes PR30816.

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

llvm-svn: 290261