Sanjay Patel [Wed, 9 Nov 2016 00:13:11 +0000 (00:13 +0000)]
[InstCombine] fix profitability equation for max-of-nots transform
As the test change shows, we can increase the critical path by adding
a 'not' instruction, so make sure that we're actually removing an
instruction if we do this transform.
This transform could also cause us to miss folds of min/max pairs.
llvm-svn: 286315
Sanjay Patel [Tue, 8 Nov 2016 23:49:15 +0000 (23:49 +0000)]
[InstCombine] reduce indentation; NFC
llvm-svn: 286314
Justin Lebar [Tue, 8 Nov 2016 23:45:51 +0000 (23:45 +0000)]
[CUDA] Use only the GVALinkage on function definitions.
Summary:
Previously we'd look at the GVALinkage of whatever FunctionDecl you
happened to be calling.
This is not right. In the absence of the gnu_inline attribute, to be
handled separately, the function definition determines the function's
linkage. So we need to wait until we get a def before we can know
whether something is known-emitted.
Reviewers: tra
Subscribers: cfe-commits, rsmith
Differential Revision: https://reviews.llvm.org/D26268
llvm-svn: 286313
Jim Ingham [Tue, 8 Nov 2016 23:43:36 +0000 (23:43 +0000)]
"thread backtrace" should use the thread-stop-format.
<rdar://problem/
28273697>
llvm-svn: 286312
Petr Hosek [Tue, 8 Nov 2016 23:02:49 +0000 (23:02 +0000)]
[CMake] Get libunwind building under LLVM/runtimes
The new LLVM runtimes directory requires the same conventions to be
followed across the runtime projects. These changes make libunwind
build under the runtimes subdirectory.
This patch contains the following changes:
* Rename LLVM_CONFIG to LLVM_CONFIG_PATH
* Check if compiler supports C++11 (required by libunwind)
Differential Revision: https://reviews.llvm.org/D26360
llvm-svn: 286308
Eric Liu [Tue, 8 Nov 2016 22:44:17 +0000 (22:44 +0000)]
[change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.
Summary:
when replacing symbol references in moved namespaces, trying to make the replace
name as short as possible by considering UsingDecl (i.e. UsingShadow) and
UsingDirectiveDecl (i.e. using namespace decl).
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25771
llvm-svn: 286307
Dominic Chen [Tue, 8 Nov 2016 22:39:14 +0000 (22:39 +0000)]
[analyzer] Provide Contains() on ImmutableMap program state partial trait.
Reviewers: zaks.anna, dcoughlin
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26373
llvm-svn: 286306
Zachary Turner [Tue, 8 Nov 2016 22:30:11 +0000 (22:30 +0000)]
Fix some size_t / uint32_t ambiguity errors.
llvm-svn: 286305
Zachary Turner [Tue, 8 Nov 2016 22:24:53 +0000 (22:24 +0000)]
[CodeView] Hook up CodeViewRecordIO to type serialization path.
Previously support had been added for using CodeViewRecordIO
to read (deserialize) CodeView type records. This patch adds
support for writing those same records. With this patch,
reading and writing of CodeView type records finally uses a single
codepath.
Differential Revision: https://reviews.llvm.org/D26253
llvm-svn: 286304
Zachary Turner [Tue, 8 Nov 2016 22:23:50 +0000 (22:23 +0000)]
Fix some cases where we were printf'ing StringRefs.
llvm-svn: 286303
Adrian Prantl [Tue, 8 Nov 2016 22:11:38 +0000 (22:11 +0000)]
Emit the DW_AT_type for a C++ static member definition
if it is more specific than the one in its DW_AT_specification.
If a static member is an array, the translation unit containing the
member definition may have a more specific type (including its length)
than TUs only seeing the class declaration. This patch adds a
DW_AT_type to the member's DW_TAG_variable in addition to the
DW_AT_specification in these cases. The member type in the
DW_AT_specification still shows the more generic type (without the
length) to avoid defeating type uniquing.
The DWARF standard discourages “duplicating” a DW_AT_type in a member
variable definition but doesn’t explicitly forbid it. Having the more
specific type (with the array length) available is what allows the
debugger to print the contents of a static array member variable.
https://reviews.llvm.org/D26368
rdar://problem/
28706946
llvm-svn: 286302
Jim Ingham [Tue, 8 Nov 2016 22:05:29 +0000 (22:05 +0000)]
Fix up the formats.html for the addition of the thread-stop-format.
<rdar://problem/
28273697>
llvm-svn: 286301
David L. Jones [Tue, 8 Nov 2016 22:03:23 +0000 (22:03 +0000)]
GlobalISel: make sure debugging variables are appropriately elided in release builds.
Summary:
There are two variables here that break. This change constrains both of them to
debug builds (via DEBUG() or #ifndef NDEBUG).
Reviewers: bkramer, t.p.northover
Subscribers: mehdi_amini, vkalintiris
Differential Revision: https://reviews.llvm.org/D26421
llvm-svn: 286300
Kostya Serebryany [Tue, 8 Nov 2016 21:57:37 +0000 (21:57 +0000)]
[libFuzzer] minor docs update
llvm-svn: 286299
Stephen Hines [Tue, 8 Nov 2016 21:54:49 +0000 (21:54 +0000)]
Revert "Define __ANDROID_API__ for all Android builds."
Summary: This reverts commit
a8804ddd9fe71304b28e5b834d134fe93e568ee0.
Subscribers: cfe-commits, pirama, eugenis, tberghammer, danalbert
Differential Revision: https://reviews.llvm.org/D26422
llvm-svn: 286298
Teresa Johnson [Tue, 8 Nov 2016 21:53:35 +0000 (21:53 +0000)]
[ThinLTO] Prevent exporting of locals used/defined in module level asm
Summary:
This patch uses the same approach added for inline asm in r285513 to
similarly prevent promotion/renaming of locals used or defined in module
level asm.
All static global values defined in normal IR and used in module level asm
should be included on either the llvm.used or llvm.compiler.used global.
The former were already being flagged as NoRename in the summary, and
I've simply added llvm.compiler.used values to this handling.
Module level asm may also contain defs of values. We need to prevent
export of any refs to local values defined in module level asm (e.g. a
ref in normal IR), since that also requires renaming/promotion of the
local. To do that, the summary index builder looks at all values in the
module level asm string that are not marked Weak or Global, which is
exactly the set of locals that are defined. A summary is created for
each of these local defs and flagged as NoRename.
This required adding handling to the BitcodeWriter to look at GV
declarations to see if they have a summary (rather than skipping them
all).
Finally, added an assert to IRObjectFile::CollectAsmUndefinedRefs to
ensure that an MCAsmParser is available, otherwise the module asm parse
would silently fail. Initialized the asm parser in the opt tool for use
in testing this fix.
Fixes PR30610.
Reviewers: mehdi_amini
Subscribers: johanengelen, krasin, llvm-commits
Differential Revision: https://reviews.llvm.org/D26146
llvm-svn: 286297
Kuba Brecka [Tue, 8 Nov 2016 21:30:41 +0000 (21:30 +0000)]
[asan] Speed up compilation of large C++ stringmaps (tons of allocas) with ASan
This addresses PR30746, <https://llvm.org/bugs/show_bug.cgi?id=30746>. The ASan pass iterates over entry-block instructions and checks each alloca whether it's in NonInstrumentedStaticAllocaVec, which is apparently slow. This patch gathers the instructions to move during visitAllocaInst.
Differential Revision: https://reviews.llvm.org/D26380
llvm-svn: 286296
Stephen Hines [Tue, 8 Nov 2016 21:23:26 +0000 (21:23 +0000)]
Define __ANDROID_API__ for all Android builds.
Summary:
Bug: https://llvm.org/bugs/show_bug.cgi?id=30940
This macro (along with __ANDROID__) should always be defined for Android
targets. We set it to the major (only) version of the Android API being
compiled for. The Android version is able to be set as an integer suffix
for any valid Android target.
Reviewers: danalbert, eugenis
Subscribers: cfe-commits, pirama, eugenis, tberghammer, danalbert
Differential Revision: https://reviews.llvm.org/D26385
llvm-svn: 286295
Andrew Kaylor [Tue, 8 Nov 2016 21:07:42 +0000 (21:07 +0000)]
[BasicAA] Teach BasicAA to handle the inaccessiblememonly and inaccessiblemem_or_argmemonly attributes
Differential Revision: https://reviews.llvm.org/D26382
llvm-svn: 286294
Matthias Braun [Tue, 8 Nov 2016 20:59:03 +0000 (20:59 +0000)]
AArch64DeadRegisterDefinitionsPass: Fix Changed flag
Fix a bug in the calculation of the changed flag introduced in r285488.
llvm-svn: 286293
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
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
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
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
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
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
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
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
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
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
Rui Ueyama [Tue, 8 Nov 2016 20:02:23 +0000 (20:02 +0000)]
Rename a function to avoid function overloading. NFC.
llvm-svn: 286282
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
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
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
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
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
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
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
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
Chad Rosier [Tue, 8 Nov 2016 19:10:25 +0000 (19:10 +0000)]
Fix typo in comment. NFC.
llvm-svn: 286270
Michael Kuperstein [Tue, 8 Nov 2016 18:44:40 +0000 (18:44 +0000)]
CODE_OWNERS: Take ownership of the loop vectorizer.
llvm-svn: 286269
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
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
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
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
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
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
Daniel Jasper [Tue, 8 Nov 2016 18:29:19 +0000 (18:29 +0000)]
Remove now unnecessary FormatRewriterContext.
llvm-svn: 286262
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
Piotr Padlewski [Tue, 8 Nov 2016 18:20:51 +0000 (18:20 +0000)]
NFC small changes in MemDep
llvm-svn: 286260
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
Chris Bieneman [Tue, 8 Nov 2016 18:14:42 +0000 (18:14 +0000)]
[Test Suite] Properly quote python string
Oops!
llvm-svn: 286258
Alexander Kornienko [Tue, 8 Nov 2016 18:12:56 +0000 (18:12 +0000)]
Remove mentions of clang-analyzer-alpha
llvm-svn: 286257
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
Sanjay Patel [Tue, 8 Nov 2016 18:06:14 +0000 (18:06 +0000)]
[InstCombine] update checks; NFC
llvm-svn: 286255
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
Tim Northover [Tue, 8 Nov 2016 17:44:07 +0000 (17:44 +0000)]
GlobalISel: support selecting fpext/fptrunc instructions on AArch64.
llvm-svn: 286253
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
Chad Rosier [Tue, 8 Nov 2016 16:51:19 +0000 (16:51 +0000)]
Remove unused include. NFC.
llvm-svn: 286250
Sanjay Patel [Tue, 8 Nov 2016 16:49:24 +0000 (16:49 +0000)]
[docs] fix link to AMD manuals (PR30946)
llvm-svn: 286249
Eugene Leviant [Tue, 8 Nov 2016 16:44:48 +0000 (16:44 +0000)]
[ELF] Attempt to fix buildbot (duplicate _gp symbol)
llvm-svn: 286247
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
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
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
Rafael Espindola [Tue, 8 Nov 2016 15:51:00 +0000 (15:51 +0000)]
Remove dead arguments. NFC.
llvm-svn: 286242
Simon Pilgrim [Tue, 8 Nov 2016 15:42:49 +0000 (15:42 +0000)]
[X86][SSE] Regenerate test (just adds missing header)
llvm-svn: 286241
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
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
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
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
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
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
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
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
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
Simon Dardis [Tue, 8 Nov 2016 13:03:45 +0000 (13:03 +0000)]
[mips] Renable small data section test.
llvm-svn: 286230
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
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
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
Eugene Leviant [Tue, 8 Nov 2016 11:11:23 +0000 (11:11 +0000)]
[ELF] Test case update (orphan.s)
llvm-svn: 286226
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
Vladimir Yakovlev [Tue, 8 Nov 2016 10:32:10 +0000 (10:32 +0000)]
Test commit of vbyakovl.
llvm-svn: 286224
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
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
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
George Rimar [Tue, 8 Nov 2016 07:46:52 +0000 (07:46 +0000)]
[ELF] - Fixed mistype. NFC.
llvm-svn: 286220
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
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
Tobias Grosser [Tue, 8 Nov 2016 07:17:48 +0000 (07:17 +0000)]
SCEVValidator: reduce indentation to increase readability [NFC]
llvm-svn: 286217
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
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
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
Alexander Kornienko [Tue, 8 Nov 2016 05:58:07 +0000 (05:58 +0000)]
[clang-tidy] Simplify matchers
llvm-svn: 286213
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
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
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
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
Zachary Turner [Tue, 8 Nov 2016 04:52:16 +0000 (04:52 +0000)]
Convert some Expression parser functions to StringRef.
llvm-svn: 286208
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
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