platform/upstream/llvm.git
7 years agoUse a default constructor. (NFC)
Adrian Prantl [Tue, 8 Nov 2016 20:48:38 +0000 (20:48 +0000)]
Use a default constructor. (NFC)
Thanks to David Blaikie for suggesting this.

llvm-svn: 286292

7 years ago[TBAA] Drop support for "old style" scalar TBAA tags
Sanjoy Das [Tue, 8 Nov 2016 20:46:01 +0000 (20:46 +0000)]
[TBAA] Drop support for "old style" scalar TBAA tags

Summary:
We've had support for auto upgrading old style scalar TBAA access
metadata tags into the "new" struct path aware TBAA metadata for 3 years
now.  The only way to actually generate old style TBAA was explicitly
through the IRBuilder API.  I think this is a good time for dropping
support for old style scalar TBAA.

I'm not removing support for textual or bitcode upgrade -- if you have
IR with the old style scalar TBAA tags that go through the AsmParser orf
the bitcode parser before LLVM sees them, they will keep working as
usual.

Note:

  %val = load i32, i32* %ptr, !tbaa !N
  !N = < scalar tbaa node >

is equivalent to

  %val = load i32, i32* %ptr, !tbaa !M
  !N = < scalar tbaa node >
  !M = !{!N, !N, 0}

Reviewers: manmanren, chandlerc, sunfish

Subscribers: mcrosier, llvm-commits, mgorny

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

llvm-svn: 286291

7 years ago[asan/win] Add init hooks to .CRT$XLAB
Reid Kleckner [Tue, 8 Nov 2016 20:45:45 +0000 (20:45 +0000)]
[asan/win] Add init hooks to .CRT$XLAB

Summary:
User applications may register hooks in the .CRT$XL* callback list,
which is called very early by the loader. This is very common in
Chromium:
https://cs.chromium.org/search/?q=CRT.XL&sq=package:chromium&type=cs

This has flown under the radar for a long time because the loader
appears to catch exceptions originating from these callbacks. It's a
real problem when you're debugging an asan application, though, since it
makes the program crash early.

The solution is to add our own callback to this list, and sort it very
early in the list like we do elsewhere. Also add a test with such an
instrumented callback, and test that it gets called with asan.

Reviewers: etienneb

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 286290

7 years agoGlobalISel: allow CodeGen to fallback on VReg type/class issues.
Tim Northover [Tue, 8 Nov 2016 20:39:03 +0000 (20:39 +0000)]
GlobalISel: allow CodeGen to fallback on VReg type/class issues.

After instruction selection we perform some checks on each VReg just before
discarding the type information. These checks were assertions before, but that
breaks the fallback path so this patch moves the logic into the main flow and
reports a better error on failure.

llvm-svn: 286289

7 years agoClean up the stop printing header lines.
Jim Ingham [Tue, 8 Nov 2016 20:36:40 +0000 (20:36 +0000)]
Clean up the stop printing header lines.

I added a "thread-stop-format" to distinguish between the form
that is just the thread info (since the stop printing immediately prints
the frame info) and one with more frame 0 info - which is useful for
"thread list" and the like.

I also added a frame.no-debug boolean to the format entities so you can
print frame information differently between frames with source info and those
without.

This closes https://reviews.llvm.org/D26383.
<rdar://problem/28273697>

llvm-svn: 286288

7 years agoSimplify getLocation() function.
Rui Ueyama [Tue, 8 Nov 2016 20:30:19 +0000 (20:30 +0000)]
Simplify getLocation() function.

All tests pass without the first parameter, so I guess we don't need it.

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

llvm-svn: 286287

7 years agoStore the size the same way as any other OutputSection. NFC.
Rafael Espindola [Tue, 8 Nov 2016 20:25:44 +0000 (20:25 +0000)]
Store the size the same way as any other OutputSection. NFC.

llvm-svn: 286286

7 years ago[SystemZ] Add missing FP extension instructions
Ulrich Weigand [Tue, 8 Nov 2016 20:18:41 +0000 (20:18 +0000)]
[SystemZ] Add missing FP extension instructions

This completes assembler / disassembler support for all BFP
instructions provided by the floating-point extensions facility.
The instructions added here are not currently used for codegen.

llvm-svn: 286285

7 years ago[SystemZ] Add program mask and addressing mode instructions
Ulrich Weigand [Tue, 8 Nov 2016 20:17:02 +0000 (20:17 +0000)]
[SystemZ] Add program mask and addressing mode instructions

Add several instructions that operate on the program mask
or the addressing mode.  These are not really needed for
code generation under Linux, but are provided for completeness
for the assembler/disassembler.

llvm-svn: 286284

7 years ago[SystemZ] Model access registers as LLVM registers
Ulrich Weigand [Tue, 8 Nov 2016 20:15:26 +0000 (20:15 +0000)]
[SystemZ] Model access registers as LLVM registers

Add the 16 access registers as LLVM registers.  This allows removing
a lot of special cases in the assembler and disassembler where we
were handling access registers; this can all just use the generic
register code now.

Also add a bunch of instructions to operate on access registers,
for assembler/disassembler use only.  No change in code generation
intended.

llvm-svn: 286283

7 years agoRename a function to avoid function overloading. NFC.
Rui Ueyama [Tue, 8 Nov 2016 20:02:23 +0000 (20:02 +0000)]
Rename a function to avoid function overloading. NFC.

llvm-svn: 286282

7 years ago[clang-move] Move all code from old.h/cc directly when moving all class declarations...
Haojian Wu [Tue, 8 Nov 2016 19:55:13 +0000 (19:55 +0000)]
[clang-move] Move all code from old.h/cc directly when moving all class declarations from old.h.

Summary: When moving all code to new.h/cc,  these code also will be formatted based on the given code style.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 286281

7 years ago[LoopDistribute] Preserve GlobalsAA also in the new Pass Manager.
Davide Italiano [Tue, 8 Nov 2016 19:52:32 +0000 (19:52 +0000)]
[LoopDistribute] Preserve GlobalsAA also in the new Pass Manager.

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

llvm-svn: 286280

7 years agoRemove FormatContext from libClang as it is now unused.
Daniel Jasper [Tue, 8 Nov 2016 19:47:19 +0000 (19:47 +0000)]
Remove FormatContext from libClang as it is now unused.

llvm-svn: 286279

7 years agoDon't store Twine in a local variable.
Eli Friedman [Tue, 8 Nov 2016 19:43:56 +0000 (19:43 +0000)]
Don't store Twine in a local variable.

Fixes post-commit review comment from r286177.

llvm-svn: 286275

7 years ago[WebAssembly] Convert stackified IMPLICIT_DEF into constant 0.
Dan Gohman [Tue, 8 Nov 2016 19:40:38 +0000 (19:40 +0000)]
[WebAssembly] Convert stackified IMPLICIT_DEF into constant 0.

Since IMPLIFIT_DEF instructions are omitted in the output, when the output
of an IMPLICIT_DEF instruction is stackified, the resulting register lacks
an explicit push, leading to a push/pop mismatch. Fix this by converting
such IMPLICIT_DEFs into CONST_I32 0 instructions so that they have explicit
pushes.

llvm-svn: 286274

7 years ago[GlobalISel] Dump all instructions inserted by selector.
Ahmed Bougacha [Tue, 8 Nov 2016 19:27:13 +0000 (19:27 +0000)]
[GlobalISel] Dump all instructions inserted by selector.

This is helpful when multiple instructions are inserted.

llvm-svn: 286273

7 years ago[GlobalISel] Permit select() to erase.
Ahmed Bougacha [Tue, 8 Nov 2016 19:27:10 +0000 (19:27 +0000)]
[GlobalISel] Permit select() to erase.

Erasing reverse_iterators is problematic; iterate manually.
While there, keep track of the range of inserted instructions.
It can miss instructions inserted elsewhere, but those are harder
to track.

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

llvm-svn: 286272

7 years ago[LibcallsShrinkWrap] This pass doesn't preserve the CFG.
Davide Italiano [Tue, 8 Nov 2016 19:18:20 +0000 (19:18 +0000)]
[LibcallsShrinkWrap] This pass doesn't preserve the CFG.

For example, it invalidates the domtree, causing assertions
in later passes which need dominator infos. Make it preserve
GlobalsAA, as suggested by Eli.

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

llvm-svn: 286271

7 years agoFix typo in comment. NFC.
Chad Rosier [Tue, 8 Nov 2016 19:10:25 +0000 (19:10 +0000)]
Fix typo in comment. NFC.

llvm-svn: 286270

7 years agoCODE_OWNERS: Take ownership of the loop vectorizer.
Michael Kuperstein [Tue, 8 Nov 2016 18:44:40 +0000 (18:44 +0000)]
CODE_OWNERS: Take ownership of the loop vectorizer.

llvm-svn: 286269

7 years ago[SystemZ] Always use semantic instruction classes
Ulrich Weigand [Tue, 8 Nov 2016 18:37:48 +0000 (18:37 +0000)]
[SystemZ] Always use semantic instruction classes

Define a couple of additional semantic classes and use them
throughout the .td files to make them more consistent and
more easily readable.

No functional change.

llvm-svn: 286268

7 years ago[SystemZ] Refactor InstRR* instruction format patterns
Ulrich Weigand [Tue, 8 Nov 2016 18:36:31 +0000 (18:36 +0000)]
[SystemZ] Refactor InstRR* instruction format patterns

This changes the InstRR (and related) patterns to no longer
automatically add an "r" at the end of the mnemonic.  This
makes the .td files more obviously understandable, and also
allows using the patterns for those few instructions that
do not follow the *r scheme.

Also add some more sub-formats of the RRF format class, to
match operand names and sequence from the PoP better.

No functional change.

llvm-svn: 286267

7 years ago[SystemZ] Rename some Inst* instruction format classes
Ulrich Weigand [Tue, 8 Nov 2016 18:32:50 +0000 (18:32 +0000)]
[SystemZ] Rename some Inst* instruction format classes

Now that we've added instruction format subclasses like
InstRIb, it makes sense to rename the old InstRI to InstRIa.

Similar for InstRX, InstRXY, InstRS, InstRSY, and InstSS.

No functional change.

llvm-svn: 286266

7 years ago[MC][AArch64] Cleanup end-of-line parsing in AArch64 AsmParser.
Nirav Dave [Tue, 8 Nov 2016 18:31:04 +0000 (18:31 +0000)]
[MC][AArch64] Cleanup end-of-line parsing in AArch64 AsmParser.

Reviewers: t.p.northover, rengolin

Subscribers: llvm-commits, aemerson

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

llvm-svn: 286265

7 years agoRevert "Remove now unnecessary FormatRewriterContext."
Daniel Jasper [Tue, 8 Nov 2016 18:30:52 +0000 (18:30 +0000)]
Revert "Remove now unnecessary FormatRewriterContext."

This reverts commit r286262. I accidentally committed it without all of
the changes.

llvm-svn: 286264

7 years ago[SystemZ] Refactor branch and conditional instruction patterns
Ulrich Weigand [Tue, 8 Nov 2016 18:30:50 +0000 (18:30 +0000)]
[SystemZ] Refactor branch and conditional instruction patterns

Rework patterns for branches, call & return instructions,
compare-and-branch, compare-and-trap, and conditional move
instructions.

In particular, simplify creation of patterns for the extended
opcodes of instructions that take a CC mask.

Also, use semantical instruction classes for all the instructions
instead of open-coding them in SystemZInstrInfo.td.

Adds a couple of the basic branch instructions (that are unused
for codegen) for the assembler/disassembler.

llvm-svn: 286263

7 years agoRemove now unnecessary FormatRewriterContext.
Daniel Jasper [Tue, 8 Nov 2016 18:29:19 +0000 (18:29 +0000)]
Remove now unnecessary FormatRewriterContext.

llvm-svn: 286262

7 years agoDon't add null and discarded sections to the global list.
Rafael Espindola [Tue, 8 Nov 2016 18:23:02 +0000 (18:23 +0000)]
Don't add null and discarded sections to the global list.

Avoids having to skip them multiple times.

llvm-svn: 286261

7 years agoNFC small changes in MemDep
Piotr Padlewski [Tue, 8 Nov 2016 18:20:51 +0000 (18:20 +0000)]
NFC small changes in MemDep

llvm-svn: 286260

7 years ago[RegAllocGreedy] Another fix about NewVRegs for last chance recoloring after r281783.
Wei Mi [Tue, 8 Nov 2016 18:19:36 +0000 (18:19 +0000)]
[RegAllocGreedy] Another fix about NewVRegs for last chance recoloring after r281783.

About when we should move a vreg from CurrentNewVRegs to NewVRegs,
if the vreg in CurrentNewVRegs was added into RecoloringCandidate and was
evicted, it shouldn't be added to NewVRegs because its physical register
will be restored at the end of tryLastChanceRecoloring after the recoloring
failed. If the vreg in CurrentNewVRegs was not in RecoloringCandidate, i.e.
it was evicted in selectOrSplitImpl inside tryRecoloringCandidates, its
physical register will not be restored even if the recoloring failed. In
that case, we need to add the vreg to NewVRegs.

Same as r281783, the problem was seen on out-of-tree target and we didn't
have a test case that reproduce the problem with in-tree targets.

llvm-svn: 286259

7 years ago[Test Suite] Properly quote python string
Chris Bieneman [Tue, 8 Nov 2016 18:14:42 +0000 (18:14 +0000)]
[Test Suite] Properly quote python string

Oops!

llvm-svn: 286258

7 years agoRemove mentions of clang-analyzer-alpha
Alexander Kornienko [Tue, 8 Nov 2016 18:12:56 +0000 (18:12 +0000)]
Remove mentions of clang-analyzer-alpha

llvm-svn: 286257

7 years ago[InstCombine] move min/max tests to min/max test file; NFC
Sanjay Patel [Tue, 8 Nov 2016 18:12:19 +0000 (18:12 +0000)]
[InstCombine] move min/max tests to min/max test file; NFC

llvm-svn: 286256

7 years ago[InstCombine] update checks; NFC
Sanjay Patel [Tue, 8 Nov 2016 18:06:14 +0000 (18:06 +0000)]
[InstCombine] update checks; NFC

llvm-svn: 286255

7 years ago[Test Suite] Attempt to fix issue zturner reported to me
Chris Bieneman [Tue, 8 Nov 2016 17:53:18 +0000 (17:53 +0000)]
[Test Suite] Attempt to fix issue zturner reported to me

Not sure why this didn't explode more massively, but this should fix the issue with the non-framework tests.

llvm-svn: 286254

7 years agoGlobalISel: support selecting fpext/fptrunc instructions on AArch64.
Tim Northover [Tue, 8 Nov 2016 17:44:07 +0000 (17:44 +0000)]
GlobalISel: support selecting fpext/fptrunc instructions on AArch64.

llvm-svn: 286253

7 years agoFix PR27500: on MSP430 the branch destination offset is measured in words, not bytes.
Anton Korobeynikov [Tue, 8 Nov 2016 17:19:59 +0000 (17:19 +0000)]
Fix PR27500: on MSP430 the branch destination offset is measured in words, not bytes.

Summary: In addition, the branch instructions will have proper BB destinations, not offsets, like before.

Reviewers: asl

Subscribers: llvm-commits

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

llvm-svn: 286252

7 years agoRemove unused include. NFC.
Chad Rosier [Tue, 8 Nov 2016 16:51:19 +0000 (16:51 +0000)]
Remove unused include. NFC.

llvm-svn: 286250

7 years ago[docs] fix link to AMD manuals (PR30946)
Sanjay Patel [Tue, 8 Nov 2016 16:49:24 +0000 (16:49 +0000)]
[docs] fix link to AMD manuals (PR30946)

llvm-svn: 286249

7 years ago[ELF] Attempt to fix buildbot (duplicate _gp symbol)
Eugene Leviant [Tue, 8 Nov 2016 16:44:48 +0000 (16:44 +0000)]
[ELF] Attempt to fix buildbot (duplicate _gp symbol)

llvm-svn: 286247

7 years agoUse the last 7 bits to represent the discriminator to fit it in 1 byte ULEB128 (NFC).
Dehao Chen [Tue, 8 Nov 2016 16:32:32 +0000 (16:32 +0000)]
Use the last 7 bits to represent the discriminator to fit it in 1 byte ULEB128 (NFC).

From experiments, discriminator is rarely greater than 127. Here we enforce it to be no greater than 127 so that it will always fit in 1 byte.

llvm-svn: 286245

7 years ago[ELF] Better error reporting for duplicate symbol
Eugene Leviant [Tue, 8 Nov 2016 16:26:32 +0000 (16:26 +0000)]
[ELF] Better error reporting for duplicate symbol

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

llvm-svn: 286244

7 years ago[clang-format] Remove (SourceManager, FileID) variants
Daniel Jasper [Tue, 8 Nov 2016 16:11:33 +0000 (16:11 +0000)]
[clang-format] Remove (SourceManager, FileID) variants

In Format, remove the reformat() and clean() functions taking a SourceManager
and a FileID. Keep the versions taking StringRef Code.

- there was duplicated functionality
- the FileID versions were harder to use
- the clean() version is dead code anyways

Patch by Krasimir Georgiev. Thank you.

llvm-svn: 286243

7 years agoRemove dead arguments. NFC.
Rafael Espindola [Tue, 8 Nov 2016 15:51:00 +0000 (15:51 +0000)]
Remove dead arguments. NFC.

llvm-svn: 286242

7 years ago[X86][SSE] Regenerate test (just adds missing header)
Simon Pilgrim [Tue, 8 Nov 2016 15:42:49 +0000 (15:42 +0000)]
[X86][SSE] Regenerate test (just adds missing header)

llvm-svn: 286241

7 years ago[ELF] - Fix mistype. NFC.
George Rimar [Tue, 8 Nov 2016 15:26:21 +0000 (15:26 +0000)]
[ELF] - Fix mistype. NFC.

Thanks to Malcolm Parsons who pointed on that.

llvm-svn: 286239

7 years ago[TargetLowering] Fix undef vector element issue with true/false result handling
Simon Pilgrim [Tue, 8 Nov 2016 15:07:01 +0000 (15:07 +0000)]
[TargetLowering] Fix undef vector element issue with true/false result handling

Fixed an issue with vector usage of TargetLowering::isConstTrueVal / TargetLowering::isConstFalseVal boolean result matching.

The comment said we shouldn't handle constant splat vectors with undef elements. But the the actual code was returning false if the build vector contained no undef elements....

This patch now ignores the number of undefs (getConstantSplatNode will return null if the build vector is all undefs).

The change has also unearthed a couple of missed opportunities in AVX512 comparison code that will need to be addressed.

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

llvm-svn: 286238

7 years agoDelete the InterpSection class.
Rafael Espindola [Tue, 8 Nov 2016 14:56:27 +0000 (14:56 +0000)]
Delete the InterpSection class.

We can just use a regular InputSection.

llvm-svn: 286237

7 years ago[JumpThreading] Unfold selects that depend on the same condition
Pablo Barrio [Tue, 8 Nov 2016 14:53:30 +0000 (14:53 +0000)]
[JumpThreading] Unfold selects that depend on the same condition

Summary:
These are good candidates for jump threading. This enables later opts
(such as InstCombine) to combine instructions from the selects with
instructions out of the selects. SimplifyCFG will fold the select
again if unfolding wasn't worth it.

Patch by James Molloy and Pablo Barrio.

Reviewers: rengolin, haicheng, sebpop

Subscribers: jojo, jmolloy, llvm-commits

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

llvm-svn: 286236

7 years agoRevert "[ELF] Make InputSection<ELFT>::writeTo virtual"
Rafael Espindola [Tue, 8 Nov 2016 14:47:16 +0000 (14:47 +0000)]
Revert "[ELF] Make InputSection<ELFT>::writeTo virtual"

This reverts commit r286100.

This saves 8 bytes of every InputSection.

llvm-svn: 286235

7 years agoDelete the CommonSection class.
Rafael Espindola [Tue, 8 Nov 2016 14:42:34 +0000 (14:42 +0000)]
Delete the CommonSection class.

With the current infrastructure it can be just an ordinary
InputSection like the real .bss sections.

llvm-svn: 286234

7 years ago[VectorLegalizer] Expansion of CTLZ using CTPOP when possible
Simon Pilgrim [Tue, 8 Nov 2016 14:10:28 +0000 (14:10 +0000)]
[VectorLegalizer] Expansion of CTLZ using CTPOP when possible

This patch avoids scalarization of CTLZ by instead expanding to use CTPOP (ref: "Hacker's Delight") when the necessary operations are available.

This also adds the necessary cost models for X86 SSE2 targets (the main beneficiary) to ensure vectorization only happens when its useful.

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

llvm-svn: 286233

7 years agocleanup hashSysV a bit.
Rafael Espindola [Tue, 8 Nov 2016 14:04:16 +0000 (14:04 +0000)]
cleanup hashSysV a bit.

Don't pass a reference to a StringRef and use a range loop.

llvm-svn: 286232

7 years ago[AArch64] Fix incorrect CSEL node created
Roger Ferrer Ibanez [Tue, 8 Nov 2016 13:34:41 +0000 (13:34 +0000)]
[AArch64] Fix incorrect CSEL node created

Under -enable-unsafe-fp-math, SELECT_CC lowering in AArch64
transforms floating point comparisons of the form "a == 0.0 ? 0.0 : x" to
"a == 0.0 ? a : x". But it incorrectly assumes that 'x' and 'a' have
the same type which can lead to a wrong CSEL node that crashes later
due to nonsensical copies.

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

llvm-svn: 286231

7 years ago[mips] Renable small data section test.
Simon Dardis [Tue, 8 Nov 2016 13:03:45 +0000 (13:03 +0000)]
[mips] Renable small data section test.

llvm-svn: 286230

7 years ago[X86][AVX512][Clang] Add support for mask_{move|store|load}_s{s/d} and int2mask/mask2...
Ayman Musa [Tue, 8 Nov 2016 12:00:30 +0000 (12:00 +0000)]
[X86][AVX512][Clang] Add support for mask_{move|store|load}_s{s/d} and int2mask/mask2int intrinsics.

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

llvm-svn: 286229

7 years ago[clang-tidy] Improve rename_check.py.
Kirill Bobyrev [Tue, 8 Nov 2016 11:43:50 +0000 (11:43 +0000)]
[clang-tidy] Improve rename_check.py.

-Start using argparse instead of mimicking CLI parsing.
-PEPify the code.
-Decrease the number of imports by slightly cleaning up the script.

Reviewers: alexfh

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

llvm-svn: 286228

7 years agoAdds the loop end location to the loop metadata.
Amara Emerson [Tue, 8 Nov 2016 11:18:59 +0000 (11:18 +0000)]
Adds the loop end location to the loop metadata.

This additional information can be used to improve the locations when generating remarks for loops.

Patch by Florian Hahn.

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

llvm-svn: 286227

7 years ago[ELF] Test case update (orphan.s)
Eugene Leviant [Tue, 8 Nov 2016 11:11:23 +0000 (11:11 +0000)]
[ELF] Test case update (orphan.s)

llvm-svn: 286226

7 years ago[ELF] Heuristic for placing orphan section
Eugene Leviant [Tue, 8 Nov 2016 10:44:48 +0000 (10:44 +0000)]
[ELF] Heuristic for placing orphan section

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

llvm-svn: 286225

7 years agoTest commit of vbyakovl.
Vladimir Yakovlev [Tue, 8 Nov 2016 10:32:10 +0000 (10:32 +0000)]
Test commit of vbyakovl.

llvm-svn: 286224

7 years agoFix memory leaks (coverity issues 1365586 & 1365591)
Sylvestre Ledru [Tue, 8 Nov 2016 10:00:45 +0000 (10:00 +0000)]
Fix memory leaks (coverity issues 1365586 & 1365591)

Reviewers: hfinkel

Subscribers: george.burgess.iv, malcolm.parsons, boris.ulasevich, llvm-commits

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

llvm-svn: 286223

7 years ago[clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need...
Alexander Kornienko [Tue, 8 Nov 2016 08:28:19 +0000 (08:28 +0000)]
[clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them

llvm-svn: 286222

7 years ago[clang-tools-extra] Format sources with clang-format. NFC.
Mandeep Singh Grang [Tue, 8 Nov 2016 07:50:19 +0000 (07:50 +0000)]
[clang-tools-extra] Format sources with clang-format. NFC.

Summary:
Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.

Reviewers: klimek, alexfh

Subscribers: nemanjai

Tags: #clang-tools-extra

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

llvm-svn: 286221

7 years ago[ELF] - Fixed mistype. NFC.
George Rimar [Tue, 8 Nov 2016 07:46:52 +0000 (07:46 +0000)]
[ELF] - Fixed mistype. NFC.

llvm-svn: 286220

7 years agoUse AnalyzerOptions::getRegisteredCheckers() instead of clang/StaticAnalyzer/Checkers...
Alexander Kornienko [Tue, 8 Nov 2016 07:43:42 +0000 (07:43 +0000)]
Use AnalyzerOptions::getRegisteredCheckers() instead of clang/StaticAnalyzer/Checkers/Checkers.inc

Summary: Depends on D26310.

Reviewers: zaks.anna, hokein

Subscribers: cfe-commits

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

llvm-svn: 286219

7 years agoAdd a method to get the list of registered static analyzer checkers.
Alexander Kornienko [Tue, 8 Nov 2016 07:23:32 +0000 (07:23 +0000)]
Add a method to get the list of registered static analyzer checkers.

Summary:
This provides a better interface for clang-tidy and encapsulates the knowledge
about experimental checkers instead of leaving this to the clients.

Reviewers: zaks.anna

Subscribers: a.sidorin, NoQ, dcoughlin, cfe-commits

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

llvm-svn: 286218

7 years agoSCEVValidator: reduce indentation to increase readability [NFC]
Tobias Grosser [Tue, 8 Nov 2016 07:17:48 +0000 (07:17 +0000)]
SCEVValidator: reduce indentation to increase readability [NFC]

llvm-svn: 286217

7 years ago[AVX-512] Add an avx512f without avx512vl command line to vec_fp_to_int.ll and regene...
Craig Topper [Tue, 8 Nov 2016 06:58:53 +0000 (06:58 +0000)]
[AVX-512] Add an avx512f without avx512vl command line to vec_fp_to_int.ll and regenerate. This will make a change in a future patch easier to see. NFC

llvm-svn: 286216

7 years ago[lldb] Don't build unit tests for unsupported targets
Vedant Kumar [Tue, 8 Nov 2016 06:49:59 +0000 (06:49 +0000)]
[lldb] Don't build unit tests for unsupported targets

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

llvm-svn: 286215

7 years agoIR, Bitcode: Change bitcode reader to no longer own its memory buffer.
Peter Collingbourne [Tue, 8 Nov 2016 06:03:43 +0000 (06:03 +0000)]
IR, Bitcode: Change bitcode reader to no longer own its memory buffer.

Unique ownership is just one possible ownership pattern for the memory buffer
underlying the bitcode reader. In practice, as this patch shows, ownership can
often reside at a higher level. With the upcoming change to allow multiple
modules in a single bitcode file, it will no longer be appropriate for
modules to generally have unique ownership of their memory buffer.

The C API exposes the ownership relation via the LLVMGetBitcodeModuleInContext
and LLVMGetBitcodeModuleInContext2 functions, so we still need some way for
the module to own the memory buffer. This patch does so by adding an owned
memory buffer field to Module, and using it in a few other places where it
is convenient.

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

llvm-svn: 286214

7 years ago[clang-tidy] Simplify matchers
Alexander Kornienko [Tue, 8 Nov 2016 05:58:07 +0000 (05:58 +0000)]
[clang-tidy] Simplify matchers

llvm-svn: 286213

7 years agoclang-format: Use git-ls-tree to get file mode in diff mode
Stephen Hines [Tue, 8 Nov 2016 05:50:14 +0000 (05:50 +0000)]
clang-format: Use git-ls-tree to get file mode in diff mode

Summary:
If a file has been renamed/deleted from the filesystem and --diff mode
with two commits is active, attempting to get the file's mode will fail.
This change uses git-ls-tree instead to get the correct permissions for
the given revision.

Patch by Luis Hector Chavez!

Reviewers: djasper, lodato

Subscribers: srhines, cfe-commits

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

llvm-svn: 286212

7 years agotsan: more precise handling of atomic stores
Dmitry Vyukov [Tue, 8 Nov 2016 05:34:50 +0000 (05:34 +0000)]
tsan: more precise handling of atomic stores

Atomic stores terminate release sequences on the atomic variable,
and must use ReleaseStore primitive instead of Release.
This was broken in r192355 during a refactoring.
Restore correct behavior and add a test.

llvm-svn: 286211

7 years agocmake: Don't try to install exports if there aren't any
Justin Bogner [Tue, 8 Nov 2016 05:02:33 +0000 (05:02 +0000)]
cmake: Don't try to install exports if there aren't any

When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for clang's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

llvm-svn: 286210

7 years agocmake: Don't try to install exports if there aren't any
Justin Bogner [Tue, 8 Nov 2016 05:02:18 +0000 (05:02 +0000)]
cmake: Don't try to install exports if there aren't any

When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for LLVM's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

llvm-svn: 286209

7 years agoConvert some Expression parser functions to StringRef.
Zachary Turner [Tue, 8 Nov 2016 04:52:16 +0000 (04:52 +0000)]
Convert some Expression parser functions to StringRef.

llvm-svn: 286208

7 years agoBitcode: Decouple block info block state from reader.
Peter Collingbourne [Tue, 8 Nov 2016 04:17:11 +0000 (04:17 +0000)]
Bitcode: Decouple block info block state from reader.

As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html

Move block info block state to a new class, BitstreamBlockInfo.
Clients may set the block info for a particular cursor with the
BitstreamCursor::setBlockInfo() method.

At this point BitstreamReader is not much more than a container for an
ArrayRef<uint8_t>, so remove it and replace all uses with direct uses
of memory buffers.

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

llvm-svn: 286207

7 years agoBitcode: Split out block info reading into a separate function.
Peter Collingbourne [Tue, 8 Nov 2016 04:16:57 +0000 (04:16 +0000)]
Bitcode: Split out block info reading into a separate function.

We're about to make this more complicated.

llvm-svn: 286206

7 years ago[PowerPC] Implement remaining vector comparison builtins.
Tony Jiang [Tue, 8 Nov 2016 04:15:45 +0000 (04:15 +0000)]
[PowerPC] Implement remaining vector comparison builtins.

vector bool char vec_cmpeq (vector bool char, vector bool char);
vector bool int vec_cmpeq (vector bool int, vector bool int);
vector bool long long vec_cmpeq (vector bool long long, vector bool long lon
vector bool short vec_cmpeq (vector bool short, vector bool short);

llvm-svn: 286205

7 years agoRewrite OutputFormattedHelpText in terms of StringRef.
Zachary Turner [Tue, 8 Nov 2016 04:12:42 +0000 (04:12 +0000)]
Rewrite OutputFormattedHelpText in terms of StringRef.

This makes the logic easier to follow and also propagates
StringRef up to the API boundary, which is necessary for
making higher up StringRef API changes.

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

llvm-svn: 286204

7 years agoAdd a missing break statement. NFC.
George Burgess IV [Tue, 8 Nov 2016 04:01:50 +0000 (04:01 +0000)]
Add a missing break statement. NFC.

llvm-svn: 286203

7 years ago[libc++] Remove unnecessary MSVCRT exclusions
Shoaib Meenai [Tue, 8 Nov 2016 03:31:42 +0000 (03:31 +0000)]
[libc++] Remove unnecessary MSVCRT exclusions

Visual Studio 2013 and up have these functions, and we don't need to
support older versions.

There are some remaining _LIBCPP_MSVCRT exclusions which are present on
Visual Studio 2015 but not 2013. Those will be addressed in a follow-up.

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

llvm-svn: 286202

7 years agoMake a const variable static. NFC.
George Burgess IV [Tue, 8 Nov 2016 03:30:49 +0000 (03:30 +0000)]
Make a const variable static. NFC.

llvm-svn: 286201

7 years ago[LTO] Don't leak BitcodeFiles. Found by the asan bot.
Davide Italiano [Tue, 8 Nov 2016 01:46:02 +0000 (01:46 +0000)]
[LTO] Don't leak BitcodeFiles. Found by the asan bot.

llvm-svn: 286194

7 years ago[ELF] Don't leak the ".data" section. Fixes an asan failure.
Davide Italiano [Tue, 8 Nov 2016 01:42:38 +0000 (01:42 +0000)]
[ELF] Don't leak the ".data" section. Fixes an asan failure.

llvm-svn: 286193

7 years ago[asan] Add missing header in a test.
Evgeniy Stepanov [Tue, 8 Nov 2016 01:17:58 +0000 (01:17 +0000)]
[asan] Add missing header in a test.

llvm-svn: 286191

7 years agoGlobalISel: improve error diagnostics when IRTranslation fails.
Tim Northover [Tue, 8 Nov 2016 01:12:17 +0000 (01:12 +0000)]
GlobalISel: improve error diagnostics when IRTranslation fails.

llvm-svn: 286190

7 years agoCorrectly ignore unnamed bit-fields when checking whether a union has fields.
Richard Smith [Tue, 8 Nov 2016 01:07:26 +0000 (01:07 +0000)]
Correctly ignore unnamed bit-fields when checking whether a union has fields.

llvm-svn: 286189

7 years ago[asan] Fix asan-rt bitness issues in asan_device_setup on Android.
Evgeniy Stepanov [Tue, 8 Nov 2016 00:59:58 +0000 (00:59 +0000)]
[asan] Fix asan-rt bitness issues in asan_device_setup on Android.

asan_device_setup script is using LD_PRELOAD to inject the ASan
runtime library into the Zygote process. This breaks when the Zygote
or any of its descendants spawn a process with different bitness due
to the fact that the ASan-RT library name includes the target
architecture.

The fix is to preload the library through a symlink which has the
same name in lib and lib64.

llvm-svn: 286188

7 years ago[asan] Fix one test on Android N.
Evgeniy Stepanov [Tue, 8 Nov 2016 00:59:54 +0000 (00:59 +0000)]
[asan] Fix one test on Android N.

A fake strtol interceptor should at least make forward progress.

llvm-svn: 286187

7 years ago[clang-tidy] Don't warn implicit variables in peformance-unnecessary-copy-initialization.
Haojian Wu [Tue, 8 Nov 2016 00:45:34 +0000 (00:45 +0000)]
[clang-tidy] Don't warn implicit variables in peformance-unnecessary-copy-initialization.

Summary:

This will prevent the check warning the variables which have been
implicitly added by compiler, like the following case (in for-range loop):

  the variable '__end' is copy-constructed from a const reference...

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 286186

7 years agoGlobalISel: support selecting G_SELECT on AArch64.
Tim Northover [Tue, 8 Nov 2016 00:45:29 +0000 (00:45 +0000)]
GlobalISel: support selecting G_SELECT on AArch64.

llvm-svn: 286185

7 years ago[CMake] Fix llvm_setup_rpath function
Mandeep Singh Grang [Tue, 8 Nov 2016 00:45:05 +0000 (00:45 +0000)]
[CMake] Fix llvm_setup_rpath function

Summary:
Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
clause.
This also cleans up the fix made in r285908.

Patch by Azharuddin Mohammed

Reviewers: john.brawn, sgundapa, beanz

Subscribers: chapuni, mgorny, llvm-commits

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

llvm-svn: 286184

7 years agoGlobalISel: constrain PHI registers on AArch64.
Tim Northover [Tue, 8 Nov 2016 00:34:06 +0000 (00:34 +0000)]
GlobalISel: constrain PHI registers on AArch64.

Self-referencing PHI nodes need their destination operands to be constrained
because nothing else is likely to do so. For now we just pick a register class
naively.

Patch mostly by Ahmed again.

llvm-svn: 286183

7 years agocmake: Support exports correctly with LLVM_DISTRIBUTION_COMPONENTS
Justin Bogner [Mon, 7 Nov 2016 23:46:05 +0000 (23:46 +0000)]
cmake: Support exports correctly with LLVM_DISTRIBUTION_COMPONENTS

We need to apply the same export logic in clang as in llvm for
LLVM_DISTRIBUTION_COMPONENTS, or the clang exports will be invalid
when we use this config.

This makes using distribution components without setting
LLVM_TOOLCHAIN_ONLY=On work correctly.

llvm-svn: 286181

7 years ago[LTO] Add error message on IO error in compileOptimizedToFile.
Eli Friedman [Mon, 7 Nov 2016 23:43:07 +0000 (23:43 +0000)]
[LTO] Add error message on IO error in compileOptimizedToFile.

(No testcase because it's difficult to force an error here.)

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

llvm-svn: 286177

7 years agoSimplify the PrintableRepresentationSpecialCases code; we never used the ePrintableRe...
Enrico Granata [Mon, 7 Nov 2016 23:32:20 +0000 (23:32 +0000)]
Simplify the PrintableRepresentationSpecialCases code; we never used the ePrintableRepresentationSpecialCasesOnly value and with enum classes the names doesn't need to be that long

llvm-svn: 286176

7 years ago[AArch64] Remove dead check prefixes after r286110. NFC.
Chad Rosier [Mon, 7 Nov 2016 23:13:59 +0000 (23:13 +0000)]
[AArch64] Remove dead check prefixes after r286110. NFC.

llvm-svn: 286174