Adrian Prantl [Fri, 16 Dec 2016 16:17:24 +0000 (16:17 +0000)]
Fix debug info metadata for upstream change in LLVM.
llvm-svn: 289953
Benjamin Kramer [Fri, 16 Dec 2016 16:09:06 +0000 (16:09 +0000)]
[include-fixer] Desugar incomplete types.
This will look through typedefs so include-fixer will look up the target
of the typedef instead of the typedef itself (which is already in
scope).
llvm-svn: 289952
Jun Bum Lim [Fri, 16 Dec 2016 16:03:31 +0000 (16:03 +0000)]
[CodeGenPrep] Skip merging empty case blocks
This is recommit of r287553 after fixing the invalid loop info after eliminating an empty block:
Summary: Merging an empty case block into the header block of switch could cause ISel to add COPY instructions in the header of switch, instead of the case block, if the case block is used as an incoming block of a PHI. This could potentially increase dynamic instructions, especially when the switch is in a loop. I added a test case which was reduced from the benchmark I was targetting.
Reviewers: t.p.northover, mcrosier, manmanren, wmi, joerg, davidxl
Subscribers: joerg, qcolombet, danielcdh, hfinkel, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D22696
llvm-svn: 289951
Simon Pilgrim [Fri, 16 Dec 2016 15:23:32 +0000 (15:23 +0000)]
[X86][AVX] Call lowerVectorShuffleWithSHUFPS directly instead of calling DAG.getVectorShuffle (PR27885)
We've already done the hardwork of ensuring the mask is safe for 'SHUFPS'.
llvm-svn: 289950
Hafiz Abid Qadeer [Fri, 16 Dec 2016 14:44:34 +0000 (14:44 +0000)]
Remove an unused type declaration.
llvm-svn: 289947
Simon Pilgrim [Fri, 16 Dec 2016 14:30:04 +0000 (14:30 +0000)]
[X86][AVX512] use a single shufps for 512-bit vectors when it can save instructions
This is the 512-bit counterpart to the 128-bit transform checked in here:
https://reviews.llvm.org/rL289837
This patch is based on the draft by @sroland (Roland Scheidegger) that is attached to PR27885:
https://llvm.org/bugs/show_bug.cgi?id=27885
llvm-svn: 289946
Simon Pilgrim [Fri, 16 Dec 2016 14:21:57 +0000 (14:21 +0000)]
[X86][AVX512] Add tests showing missed opportunity to efficiently lower v16i32 to VSHUFPS (PR27885)
llvm-svn: 289945
Nico Weber [Fri, 16 Dec 2016 14:02:28 +0000 (14:02 +0000)]
Speculatively revert r289925, see PR31407
llvm-svn: 289944
Krzysztof Parzyszek [Fri, 16 Dec 2016 13:58:01 +0000 (13:58 +0000)]
[MIRParser] Add parsing hex literals of arbitrary size as unsigned integers
The current code does not parse hex literals larger than 32-bit.
llvm-svn: 289943
Daniel Jasper [Fri, 16 Dec 2016 13:53:46 +0000 (13:53 +0000)]
Move VerifierSupport into namespace llvm.
It currently is in an unnamed namespace and then it shouldn't be used
from something in the header file. This actually triggers a warning with
GCC:
../include/llvm/IR/Verifier.h:39:7: warning: ‘llvm::TBAAVerifier’ has a field ‘llvm::TBAAVerifier::Diagnostic’ whose type uses the anonymous namespace [enabled by default]
llvm-svn: 289942
Benjamin Kramer [Fri, 16 Dec 2016 13:13:03 +0000 (13:13 +0000)]
[GlobalISel] Silence unused variable warnings in Release builds.
llvm-svn: 289941
Diana Picus [Fri, 16 Dec 2016 12:54:46 +0000 (12:54 +0000)]
[ARM] GlobalISel: Select add i32, i32
Add the minimal support necessary to select a function that returns the sum of
two i32 values.
This includes some support for argument/return lowering of i32 values through
registers, as well as the handling of copy and add instructions throughout the
GlobalISel pipeline.
Differential Revision: https://reviews.llvm.org/D26677
llvm-svn: 289940
Artem Dergachev [Fri, 16 Dec 2016 12:21:55 +0000 (12:21 +0000)]
[analyzer] Add another exception for Qt in MallocChecker
Treat pointers passed to QObject::connectImpl() as escaping.
rdar://problem/
29550440
Differential Revision: https://reviews.llvm.org/D27717
llvm-svn: 289939
George Rimar [Fri, 16 Dec 2016 11:59:52 +0000 (11:59 +0000)]
[ELF] - Accept --sort-section=xxx command form.
--sort-section=xxx is the same as --sort-section xxx,
was found in one of FreeBSD ports.
llvm-svn: 289938
Simon Pilgrim [Fri, 16 Dec 2016 11:48:51 +0000 (11:48 +0000)]
[X86][SSE] Combine shuffles to MOVSS/MOVSD whatever the domain.
We already do the same thing in shuffle lowering; but don't do it if we have SSE41 (PBLEND) instead.
llvm-svn: 289937
Dylan McKay [Fri, 16 Dec 2016 11:40:00 +0000 (11:40 +0000)]
[AVR] Add a test for 64-bit left shifts
llvm-svn: 289936
Chandler Carruth [Fri, 16 Dec 2016 11:31:39 +0000 (11:31 +0000)]
Revert r289863: [LV] Enable vectorization of loops with conditional
stores by default
This uncovers a crasher in the loop vectorizer on PPC when building the
Python runtime. I'll send the testcase to the review thread for the
original commit.
llvm-svn: 289934
Florian Hahn [Fri, 16 Dec 2016 11:10:26 +0000 (11:10 +0000)]
[codegen] Add generic functions to skip debug values.
Summary:
This commits moves skipDebugInstructionsForward and
skipDebugInstructionsBackward from lib/CodeGen/IfConversion.cpp
to include/llvm/CodeGen/MachineBasicBlock.h and updates
some codgen files to use them.
This refactoring was suggested in https://reviews.llvm.org/D27688
and I thought it's best to do the refactoring in a separate
review, but I could also put both changes in a single review
if that's preferred.
Also, the names for the functions aren't the snappiest and
I would be happy to rename them if anybody has suggestions.
Reviewers: eli.friedman, iteratee, aprantl, MatzeB
Subscribers: MatzeB, llvm-commits
Differential Revision: https://reviews.llvm.org/D27782
llvm-svn: 289933
Diana Picus [Fri, 16 Dec 2016 10:35:20 +0000 (10:35 +0000)]
[ARM] Expose methods to get the CCAssignFn. NFCI
Add two public methods to ARMTargetLowering: CCAssignFnForCall and
CCAssignFnForReturn, which are just calling the already existing private method
CCAssignFnForNode. These will come in handy for GlobalISel on ARM.
We also replace all calls to CCAssignFnForNode in ARMISelLowering.cpp, because
the new methods are friendlier to the reader.
llvm-svn: 289932
Andrew V. Tischenko [Fri, 16 Dec 2016 09:56:02 +0000 (09:56 +0000)]
Extra coverage tests to demonstrate fixes in D72618 and D26855
llvm-svn: 289931
Piotr Padlewski [Fri, 16 Dec 2016 09:14:47 +0000 (09:14 +0000)]
[clang-tidy] fix missing anchor for MPI Module
Summary: MPIModule was not linked to plugins
Reviewers: alexfh, Alexander_Droste, hokein
Subscribers: JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D27813
llvm-svn: 289930
Chandler Carruth [Fri, 16 Dec 2016 07:31:20 +0000 (07:31 +0000)]
Revert r289638: [PowerPC] Fix logic dealing with nop after calls (and tail-call eligibility)
This patch appears to result in trampolines in vtables being miscompiled
when they in turn tail call a method.
I've posted some preliminary details about the failure on the thread for
this commit and talked to Hal. He was comfortable going ahead and
reverting until we sort out what is wrong.
llvm-svn: 289928
Mehdi Amini [Fri, 16 Dec 2016 06:29:14 +0000 (06:29 +0000)]
Extract a TBAAVerifier out of the verifier (NFC)
This is intended to be used (in a later patch) by the BitcodeReader
to detect invalid TBAA and drop them when loading bitcode, so that
we don't break client that have legacy bitcode with possible invalid
TBAA.
Differential Revision: https://reviews.llvm.org/D27838
llvm-svn: 289927
Nico Weber [Fri, 16 Dec 2016 05:13:02 +0000 (05:13 +0000)]
attempt to fix windows build
llvm-svn: 289926
Ekaterina Romanova [Fri, 16 Dec 2016 05:10:11 +0000 (05:10 +0000)]
Update .debug_line section version information to match DWARF version.
One more attempt to re-commit the patch r285355, which I had to revert in r285362, because some tests were failing (the reason is because the size of the line_table varied depending on the full file name).
In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler.
This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted.
Differential Revision: https://reviews.llvm.org/D16697
llvm-svn: 289925
Nico Weber [Fri, 16 Dec 2016 05:03:44 +0000 (05:03 +0000)]
attempt to fix bots after r289914/r289919
llvm-svn: 289924
Nico Weber [Fri, 16 Dec 2016 04:51:25 +0000 (04:51 +0000)]
Revert 279703, it caused PR31404.
llvm-svn: 289923
Zachary Turner [Fri, 16 Dec 2016 04:27:00 +0000 (04:27 +0000)]
Add methods to enable using formatv syntax in LLDB.
This adds formatv-backed formatting functions in various
places in LLDB such as StreamString, logging, constructing
error messages, etc. A couple of callsites are changed
from Printf style syntax to formatv style syntax to
illustrate its usage. Additionally, a FileSpec formatter
is introduced so that FileSpecs can be formatted natively.
Differential Revision: https://reviews.llvm.org/D27632
llvm-svn: 289922
Adrian Prantl [Fri, 16 Dec 2016 04:26:15 +0000 (04:26 +0000)]
Update for LLVM global variable debug info API change.
llvm-svn: 289921
Adrian Prantl [Fri, 16 Dec 2016 04:25:54 +0000 (04:25 +0000)]
[IR] Remove the DIExpression field from DIGlobalVariable.
This patch implements PR31013 by introducing a
DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
DIExpression.
Currently, DIGlobalVariables holds a DIExpression. This is not the
best way to model this:
(1) The DIGlobalVariable should describe the source level variable,
not how to get to its location.
(2) It makes it unsafe/hard to update the expressions when we call
replaceExpression on the DIGLobalVariable.
(3) It makes it impossible to represent a global variable that is in
more than one location (e.g., a variable with multiple
DW_OP_LLVM_fragment-s). We also moved away from attaching the
DIExpression to DILocalVariable for the same reasons.
This reapplies r289902 with additional testcase upgrades.
<rdar://problem/
29250149>
https://llvm.org/bugs/show_bug.cgi?id=31013
Differential Revision: https://reviews.llvm.org/D26769
llvm-svn: 289920
Akira Hatanaka [Fri, 16 Dec 2016 04:18:53 +0000 (04:18 +0000)]
Remove "-disable-llvm-optzns -verify" from the RUN line.
llvm-svn: 289919
Teresa Johnson [Fri, 16 Dec 2016 04:11:51 +0000 (04:11 +0000)]
[ThinLTO] Thin link efficiency: More efficient export list computation
Summary:
Instead of checking whether a global referenced by a function being
imported is defined in the same module, speculatively always add the
referenced globals to the module's export list. After all imports are
computed, for each module prune any not in its defined set from its
export list.
For a huge C++ app with aggressive importing thresholds, even with
D27687 we spent a lot of time invoking modulePath() from
exportGlobalInModule (modulePath() was still the 2nd hottest routine in
profile). The reason is that with comdat/linkonce the summary lists for
each GUID can be long. For the app in question, for example, we were
invoking exportGlobalInModule almost 2 million times, and we traversed
an average of 63 entries in the summary list each time.
This patch reduced the thin link time for the app by about 10% (on top
of D27687) when using aggressive importing thresholds, and about 3.5% on
average with default importing thresholds.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27755
llvm-svn: 289918
Chandler Carruth [Fri, 16 Dec 2016 04:08:31 +0000 (04:08 +0000)]
Add extra headers that got deleted by my revert in r289916 but for which
new usage had already grown in the file.
llvm-svn: 289917
Chandler Carruth [Fri, 16 Dec 2016 04:05:22 +0000 (04:05 +0000)]
Revert patch series introducing the DAG combine to match a load-by-bytes
idiom.
r289538: Match load by bytes idiom and fold it into a single load
r289540: Fix a buildbot failure introduced by r289538
r289545: Use more detailed assertion messages in the code ...
r289646: Add a couple of assertions to the load combine code ...
This DAG combine has a bad crash in it that is quite hard to trigger
sadly -- it relies on sneaking code with UB through the SDAG build and
into this particular combine. I've responded to the original commit with
a test case that reproduces it.
However, the code also has other problems that will require substantial
changes to address and so I'm going ahead and reverting it for now. This
should unblock us and perhaps others that are hitting the crash in the
wild and will let a fresh patch with updated approach come in cleanly
afterward.
Sorry for any trouble or disruption!
llvm-svn: 289916
Peter Collingbourne [Fri, 16 Dec 2016 03:45:59 +0000 (03:45 +0000)]
COFF: Cache the result of library searches.
File system operations were still dominating the profile on Windows. In this
case we were spending a significant amount of our time repeatedly searching
for libraries as a result of processing linker directives. Address this
by caching whether we have already found a library with a given name. For
chrome_child.dll:
Before: 10.53s
After: 6.88s
Differential Revision: https://reviews.llvm.org/D27840
llvm-svn: 289915
Akira Hatanaka [Fri, 16 Dec 2016 03:19:41 +0000 (03:19 +0000)]
[Sema] Fix handling of enumerators used as default arguments of lambda
expressions in a function or class template.
This patch makes the following changes:
- Create a DependentScopeDeclRefExpr for the default argument instead of
a CXXDependentScopeMemberExpr.
- Pass CombineWithOuterScope=true so that the outer scope in which the
enum is declared is searched for the instantiation of the enum.
This is the first part of https://reviews.llvm.org/D23096. Fixes PR28795
rdar://problem/
27535319
llvm-svn: 289914
Jason Molenda [Fri, 16 Dec 2016 02:48:39 +0000 (02:48 +0000)]
Fix a bug when using a StructuredData darwin-log plugin
where we would insert a breakpoint into a system library
but never remove it, so the second time we ran the binary
there would be two breakpoints and the debugger would
stop there.
<rdar://problem/
29654974>
llvm-svn: 289913
Felix Berger [Fri, 16 Dec 2016 02:47:56 +0000 (02:47 +0000)]
[clang-tidy] Do not move parameter if only DeclRefExpr occurs inside of a loop
Summary: This fixes a bug where the performance-unnecessary-value-param check suggests a fix to move the parameter inside of a loop which could be invoked multiple times.
Reviewers: sbenza, aaron.ballman, alexfh
Subscribers: JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D27187
llvm-svn: 289912
Davide Italiano [Fri, 16 Dec 2016 02:28:38 +0000 (02:28 +0000)]
[SimplifyLibCalls] Use a lambda. NFCI.
llvm-svn: 289911
Antonio Maiorano [Fri, 16 Dec 2016 01:51:43 +0000 (01:51 +0000)]
clang-format-vsix: add command to format document
Bound to Ctrl+R, Ctrl+D by default. Also added section on how to debug the extension to the Readme.
Differential Revision: https://reviews.llvm.org/D27501
llvm-svn: 289910
Antonio Maiorano [Fri, 16 Dec 2016 01:37:01 +0000 (01:37 +0000)]
clang-format-vsix: add a date stamp to the VSIX version number to ensure upgradability
Presently, the version number of the VSIX matches the LLVM version number. However, as this number doesn't change often, it means that as we release new versions of this VSIX, it will have the same version number, which means users must first uninstall the old version before installing the new one. With this change, we generate a 4th part to the version number that is a date stamp (year, month, day); for example: 4.0.0.161203.
Differential Revision: https://reviews.llvm.org/D27438
llvm-svn: 289909
Adrian Prantl [Fri, 16 Dec 2016 01:01:40 +0000 (01:01 +0000)]
Revert "Update for LLVM global variable debug info API change."
This reverts commit 289901 while investigating bot breakage.
llvm-svn: 289908
Eugene Zelenko [Fri, 16 Dec 2016 01:00:40 +0000 (01:00 +0000)]
[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 289907
Adrian Prantl [Fri, 16 Dec 2016 01:00:30 +0000 (01:00 +0000)]
Revert "[IR] Remove the DIExpression field from DIGlobalVariable."
This reverts commit 289902 while investigating bot berakage.
llvm-svn: 289906
Richard Smith [Fri, 16 Dec 2016 00:58:48 +0000 (00:58 +0000)]
[c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.
llvm-svn: 289905
Tim Shen [Fri, 16 Dec 2016 00:47:17 +0000 (00:47 +0000)]
[APFloatTest] Log when test fails. NFC
Reviewers: iteratee
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27828
llvm-svn: 289904
Peter Collingbourne [Fri, 16 Dec 2016 00:43:00 +0000 (00:43 +0000)]
Add missing library dep.
llvm-svn: 289903
Adrian Prantl [Fri, 16 Dec 2016 00:36:43 +0000 (00:36 +0000)]
[IR] Remove the DIExpression field from DIGlobalVariable.
This patch implements PR31013 by introducing a
DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
DIExpression.
Currently, DIGlobalVariables holds a DIExpression. This is not the
best way to model this:
(1) The DIGlobalVariable should describe the source level variable,
not how to get to its location.
(2) It makes it unsafe/hard to update the expressions when we call
replaceExpression on the DIGLobalVariable.
(3) It makes it impossible to represent a global variable that is in
more than one location (e.g., a variable with multiple
DW_OP_LLVM_fragment-s). We also moved away from attaching the
DIExpression to DILocalVariable for the same reasons.
<rdar://problem/
29250149>
https://llvm.org/bugs/show_bug.cgi?id=31013
Differential Revision: https://reviews.llvm.org/D26769
llvm-svn: 289902
Adrian Prantl [Fri, 16 Dec 2016 00:35:42 +0000 (00:35 +0000)]
Update for LLVM global variable debug info API change.
llvm-svn: 289901
Ehsan Amiri [Fri, 16 Dec 2016 00:33:07 +0000 (00:33 +0000)]
[PPC] corrections in two testcases
Removing sensitivity to scheduling (by using CHECK-DAG instead of CHECK) and
some other minor corrections.
In preparation to commit Power9 processor model.
llvm-svn: 289900
Peter Collingbourne [Fri, 16 Dec 2016 00:26:30 +0000 (00:26 +0000)]
IPO: Introduce ThinLTOBitcodeWriter pass.
This pass prepares a module containing type metadata for ThinLTO by splitting
it into regular and thin LTO parts if possible, and writing both parts to
a multi-module bitcode file. Modules that do not contain type metadata are
written unmodified as a single module.
All globals with type metadata are added to the regular LTO module, and
the rest are added to the thin LTO module.
Differential Revision: https://reviews.llvm.org/D27324
llvm-svn: 289899
Evandro Menezes [Fri, 16 Dec 2016 00:18:00 +0000 (00:18 +0000)]
[AArch64] Add FeatureSlowMisaligned128Store to Exynos M1 and M2
This feature now gates such stores after r289845. Thus the Exynos
processors now need this feature.
llvm-svn: 289898
Kelvin Li [Fri, 16 Dec 2016 00:15:54 +0000 (00:15 +0000)]
Fix typo in error messages. NFC.
llvm-svn: 289897
Teresa Johnson [Thu, 15 Dec 2016 23:50:06 +0000 (23:50 +0000)]
[ThinLTO] Thin link efficiency improvement: don't re-export globals (NFC)
Summary:
We were reinvoking exportGlobalInModule numerous times redundantly.
No need to re-export globals referenced by a global that was already
imported from its module. This resulted in a large speedup in the thin
link for a big application, particularly when importing aggressiveness
was cranked up.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27687
llvm-svn: 289896
Davide Italiano [Thu, 15 Dec 2016 23:48:07 +0000 (23:48 +0000)]
[SimplifyLibCalls] Add a test to make sure we lower fls(0) correctly.
llvm-svn: 289895
Davide Italiano [Thu, 15 Dec 2016 23:45:11 +0000 (23:45 +0000)]
[SimplifyLibCalls] Lower fls() to llvm.ctlz().
Differential Revision: https://reviews.llvm.org/D14590
llvm-svn: 289894
David Blaikie [Thu, 15 Dec 2016 23:39:25 +0000 (23:39 +0000)]
DebugInfo: Make a Generic test case actually generic (remove datalayout/triple)
llvm-svn: 289893
David Blaikie [Thu, 15 Dec 2016 23:37:38 +0000 (23:37 +0000)]
DebugInfo: Address non-deterministic output (iterating a SmallPtrSet) in 289697
Post-commit review feedback from Adrian Prantl.
Hopefully this fixes that up :)
llvm-svn: 289892
Quentin Colombet [Thu, 15 Dec 2016 23:32:25 +0000 (23:32 +0000)]
[IRTranslator] Merge the entry and ABI lowering blocks.
The IRTranslator uses an additional block before the LLVM-IR entry block
to perform all the ABI lowering and the constant hoisting. Thus, this
block is the actual entry block and it falls through the LLVM-IR entry
block. However, with such representation, we end up with two basic
blocks that are not maximal.
Therefore, this patch adds a bit of canonicalization by merging both the
LLVM-IR entry block and the ABI lowering/constants hoisting into one
block, making the resulting block more likely to be maximal (indeed the
LLVM-IR entry block might not have been maximal).
llvm-svn: 289891
Kuba Mracek [Thu, 15 Dec 2016 23:20:54 +0000 (23:20 +0000)]
[sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT when building compiler-rt from clang/runtime/CMakeLists.txt
Differential Revision: https://reviews.llvm.org/D26558
llvm-svn: 289890
David Blaikie [Thu, 15 Dec 2016 23:17:52 +0000 (23:17 +0000)]
DebugInfo: Emit ranges for functions with DISubprograms but lacking locations on any instructions
This seems more consistent, and helps tidy up/simplify some other code
in this change.
llvm-svn: 289889
Davide Italiano [Thu, 15 Dec 2016 23:11:00 +0000 (23:11 +0000)]
[SimplifyLibCalls] Remove redundant folding logic for ffs().
Lowering to llvm.cttz() will result in constant folding anyway
if the argument to ffs is a constant. Pointed out by Eli for
fls() in D14590.
llvm-svn: 289888
Anna Zaks [Thu, 15 Dec 2016 22:55:21 +0000 (22:55 +0000)]
[asan][docs] Fix the documentation to use clang++ for the C++ example
After Darwin has been updated not to link in stdc++ on Darwin this actually
started to break.
Differential Revision: https://reviews.llvm.org/D27598
llvm-svn: 289887
Anna Zaks [Thu, 15 Dec 2016 22:55:18 +0000 (22:55 +0000)]
[analyzer] Teach the analyzer that pointers can escape into __cxa_demangle
This fixes a reported false positive in the malloc checker.
Differential Revision: https://reviews.llvm.org/D27599
llvm-svn: 289886
Anna Zaks [Thu, 15 Dec 2016 22:55:15 +0000 (22:55 +0000)]
[analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null
This is a big deal for ObjC, where nullability annotations are extensively
used. I've also changed "Null" -> "null" and removed "is" as this is the
pattern that Sema is using.
Differential Revision: https://reviews.llvm.org/D27600
llvm-svn: 289885
Anna Zaks [Thu, 15 Dec 2016 22:55:11 +0000 (22:55 +0000)]
[analyzer] Refer to macro names in diagnostics for macros representing a literal
When a macro expending to a literal is used in a comparison, use the macro name
in the diagnostic rather than the literal. This improves readability of path
notes.
Added tests for various macro literals that could occur. Only BOOl, Int, and
NULL tests have changed behavior with this patch.
Differential Revision: https://reviews.llvm.org/D27726
llvm-svn: 289884
Anna Zaks [Thu, 15 Dec 2016 22:55:03 +0000 (22:55 +0000)]
[analyzer] Include type name in Retain Count Checker diagnostics
The more detailed diagnostic will make identifying which object the
diagnostics refer to easier.
Differential Revision: https://reviews.llvm.org/D27740
llvm-svn: 289883
Eli Friedman [Thu, 15 Dec 2016 22:41:40 +0000 (22:41 +0000)]
Don't combine splats with other shuffles.
We sometimes end up creating shuffles which are worse than the obvious
translation of the IR.
Fixes https://llvm.org/bugs/show_bug.cgi?id=31301 .
Differential Revision: https://reviews.llvm.org/D27793
llvm-svn: 289882
Kuba Mracek [Thu, 15 Dec 2016 22:40:24 +0000 (22:40 +0000)]
Ifdef out utmp.h on Darwin to un-break the build after r289878 ([msan] Intercept getutent and friends).
llvm-svn: 289881
Yichao Yu [Thu, 15 Dec 2016 22:36:53 +0000 (22:36 +0000)]
Fix R_AARCH64_MOVW_UABS_G3 relocation
Summary: The relocation is missing mask so an address that has non-zero bits in 47:43 may overwrite the register number. (Frequently shows up as target register changed to `xzr`....)
Reviewers: t.p.northover, lhames
Subscribers: davide, aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D27609
llvm-svn: 289880
Chris Bieneman [Thu, 15 Dec 2016 22:01:17 +0000 (22:01 +0000)]
[CMake] Refactor LLDB libraries and tools to be components
In LLVM's CMake we have a convention that components have both a build and an install target. Making LLDB follow this convention will allow LLDB to take advantage of the LLVM_DISTRIBUTION_COMPONENTS build option from LLVM.
llvm-svn: 289879
Evgeniy Stepanov [Thu, 15 Dec 2016 22:00:14 +0000 (22:00 +0000)]
[msan] Intercept getutent and friends.
Differential Revision: https://reviews.llvm.org/D27791
llvm-svn: 289878
Matt Arsenault [Thu, 15 Dec 2016 21:57:11 +0000 (21:57 +0000)]
AMDGPU: Select branch on undef to uniform scc branch
llvm-svn: 289877
Teresa Johnson [Thu, 15 Dec 2016 21:42:56 +0000 (21:42 +0000)]
[gold] Add datalayout to test where it was missing
Needed due to change to require datalayout (r289719).
Found this in my own testing, maybe there aren't any bots using a v1.12
gold yet.
llvm-svn: 289876
Teresa Johnson [Thu, 15 Dec 2016 21:39:42 +0000 (21:39 +0000)]
[ThinLTO] Revert part of r289843 that belonged to another patch.
The code change for D27687 accidentally got committed along with the
main change in r289843. Revert it temporarily, so that I can recommit it
along with its test as intended.
llvm-svn: 289875
Eli Friedman [Thu, 15 Dec 2016 21:36:59 +0000 (21:36 +0000)]
Don't combine a shuffle of two BUILD_VECTORs with duplicate elements.
Targets can't handle this case well in general; we often transform
a shuffle of two cheap BUILD_VECTORs to element-by-element insertion,
which is very inefficient.
Fixes https://llvm.org/bugs/show_bug.cgi?id=31364 . Partially
fixes https://llvm.org/bugs/show_bug.cgi?id=31301.
Differential Revision: https://reviews.llvm.org/D27787
llvm-svn: 289874
Devin Coughlin [Thu, 15 Dec 2016 21:27:06 +0000 (21:27 +0000)]
[analyzer] Add a new SVal to support pointer-to-member operations.
Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal
supports both pointers to member functions and pointers to member data.
A patch by Kirill Romanenkov!
Differential Revision: https://reviews.llvm.org/D25475
llvm-svn: 289873
Sanjoy Das [Thu, 15 Dec 2016 21:23:44 +0000 (21:23 +0000)]
[Verifier] Allow TBAA metadata on atomicrmw and atomiccmpxchg
This used to be allowed before r289402 by default (before r289402 you
could have TBAA metadata on any instruction), and while I'm not sure
that it helps, it does sound reasonable enough to not fail the verifier
and we have out-of-tree users who use this.
llvm-svn: 289872
Teresa Johnson [Thu, 15 Dec 2016 20:53:31 +0000 (20:53 +0000)]
[ThinLTO] Remove stale comment (NFC)
This should have been removed with r288446.
llvm-svn: 289871
David L. Jones [Thu, 15 Dec 2016 20:53:26 +0000 (20:53 +0000)]
Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ModuleFile.
Summary:
When reading an ASTRecord, each RecordData is logically contained within a
single ModuleFile, and global(er) state is contained by a single ASTReader. This
means that any operations that read from a RecordData and reference an ASTReader
or a ModuleFile, will always reference the same ASTReader or ModuleFile.
ASTRecordReader groups these together so that parameters don't need to be
duplicated ad infinitum. Most uses of the Idx variable seem to be redunant
aliases as well, but I'll leave that for now.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27784
llvm-svn: 289870
Ehsan Amiri [Thu, 15 Dec 2016 20:51:09 +0000 (20:51 +0000)]
[PPC] Use CHECK-DAG instead of CHECK in the testcase
This test is currently sensitive to scheduling. Using CHECK-DAG allows us to
preserve the main purpose of the test and remove this sensivity.
In preparation to commit Power9 processor model.
llvm-svn: 289869
Matt Arsenault [Thu, 15 Dec 2016 20:50:12 +0000 (20:50 +0000)]
AMDGPU: Fix asserting on returned tail calls
llvm-svn: 289868
Teresa Johnson [Thu, 15 Dec 2016 20:48:19 +0000 (20:48 +0000)]
[ThinLTO] Thin link efficiency: skip candidate added later with higher threshold (NFC)
Summary:
Thin link efficiency improvement. After adding an importing candidate to
the worklist we might have later added it again with a higher threshold.
Skip it when popped from the worklist if we recorded a higher threshold
than the current worklist entry, it will get processed again at the
higher threshold when that entry is popped.
This required adding the summary's GUID to the worklist, so that it can
be used to query the recorded highest threshold for it when we pop from the
worklist.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27696
llvm-svn: 289867
Matt Arsenault [Thu, 15 Dec 2016 20:40:20 +0000 (20:40 +0000)]
AMDGPU: Assembler support for vintrp instructions
llvm-svn: 289866
Michal Gorny [Thu, 15 Dec 2016 20:31:08 +0000 (20:31 +0000)]
[test] Extend llvm_shlib_dir fix to unittests
Extend the fix from rL286952 to unittests. The fix added clang built
library directories (via llvm_shlib_dir) to LD_LIBRARY_PATH.
The previous logic has used llvm_libs_dir only which points to installed
LLVM when doing stand-alone builds.
The patch also removes the redundant win32 code that is no longer
necessary now that shlibdir is used unconditionally.
Differential Revision: https://reviews.llvm.org/D27812
llvm-svn: 289865
Hans Wennborg [Thu, 15 Dec 2016 20:11:12 +0000 (20:11 +0000)]
Revert r289690 "[sanitizer] intercept bstring functions, patch by Kuang-che Wu (https://reviews.llvm.org/D27659)"
It breaks programs on Mac. See comments on the code review for details.
llvm-svn: 289864
Matthew Simpson [Thu, 15 Dec 2016 20:11:05 +0000 (20:11 +0000)]
[LV] Enable vectorization of loops with conditional stores by default
This patch sets the default value of the "-enable-cond-stores-vec" command line
option to "true".
Differential Revision: https://reviews.llvm.org/D27814
llvm-svn: 289863
Andrea Di Biagio [Thu, 15 Dec 2016 20:01:26 +0000 (20:01 +0000)]
[SimplifyCFG] Merge debug locations when hoisting an instruction from a then/else branch. NFC.
Now that a new API to merge debug locations has been committed at r289661 (see
review D26256 for more details), we can use it to "improve" the code added by
revision r280995.
Instead of nulling the debugloc of a commoned instruction, we use the 'merged'
debug location. At the moment, this is just a no functional change since
function `DILocation::getMergedLocation()` is just a stub and would always
return a null location.
Differential Revision: https://reviews.llvm.org/D27804
llvm-svn: 289862
Geoff Berry [Thu, 15 Dec 2016 19:55:19 +0000 (19:55 +0000)]
[LiveRangeEdit] Change eliminateDeadDef assert to if condition.
The assert could potentially fire (though no cases have been
encountered), so just check that the instruction we're handling
specially for rematerialization only has one def to begin with.
Reviewed by Wei Mi over email.
llvm-svn: 289861
Peter Collingbourne [Thu, 15 Dec 2016 19:37:46 +0000 (19:37 +0000)]
LibDriver: Allow resource files to be archive members.
It seems pointless to add a resource to an archive because it won't have
any symbols to link against (and link.exe doesn't have an equivalent of
--whole-archive), but lib.exe allows it for some reason.
llvm-svn: 289859
Zachary Turner [Thu, 15 Dec 2016 19:33:31 +0000 (19:33 +0000)]
Re-add the check for __has_attribute in StringLiteral.
llvm-svn: 289858
Boris Ulasevich [Thu, 15 Dec 2016 19:29:42 +0000 (19:29 +0000)]
BrainF example: fixing segfault caused by outdated code with missing MCJIT dependency
Differential Revision: https://reviews.llvm.org/D26280
llvm-svn: 289857
Zachary Turner [Thu, 15 Dec 2016 19:22:58 +0000 (19:22 +0000)]
Ignore -Wgcc-compat diagnostic in StringLiteral.
llvm-svn: 289856
Sanjay Patel [Thu, 15 Dec 2016 19:13:37 +0000 (19:13 +0000)]
[InstCombine] add folds for icmp (smin X, Y), X
Min/max canonicalization (r287585) exposes the fact that we're missing combines for min/max patterns.
This patch won't solve the example that was attached to that thread, so something else still needs fixing.
The line between InstCombine and InstSimplify gets blurry here because sometimes the icmp instruction that
we want to fold to already exists, but sometimes it's the swapped form of what we want.
Corresponding changes for smax/umin/umax to follow.
Differential Revision: https://reviews.llvm.org/D27531
llvm-svn: 289855
Reid Kleckner [Thu, 15 Dec 2016 19:08:02 +0000 (19:08 +0000)]
Fix some remaining documentation references to MSVC 2013
MSVC 2015 has been the minimum supported version of VS since October.
Differential Revision: https://reviews.llvm.org/D25710
llvm-svn: 289854
Zachary Turner [Thu, 15 Dec 2016 19:02:43 +0000 (19:02 +0000)]
[StringRef] Add enable-if to StringLiteral.
to prevent StringLiteral from being created with a non-literal
char array, clang has a macro enable_if() that can be used
in such a way as to guarantee that the constructor is disabled
unless the length fo the string can be computed at compile time.
This only works on clang, but at least it should allow bots
to catch abuse of StringLiteral.
Differential Revision: https://reviews.llvm.org/D27780
llvm-svn: 289853
Saleem Abdulrasool [Thu, 15 Dec 2016 18:54:27 +0000 (18:54 +0000)]
xray: fix assembly macro definition
projects/compiler-rt/lib/xray/xray_trampoline_x86_64.S:33:7: error: unexpected token in '.endm' directive
.endm SAVE_REGISTERS
^
projects/compiler-rt/lib/xray/xray_trampoline_x86_64.S:52:7: error: unexpected token in '.endm' directive
.endm RESTORE_REGISTERS
^
Remove the trailing name on the `.endm` which does not take the name of the
macro. This should bring the compiler-rt build bot back into working state.
llvm-svn: 289852
Saleem Abdulrasool [Thu, 15 Dec 2016 18:54:25 +0000 (18:54 +0000)]
sanitizers: silence -pedantic warning
projects/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc:142:2: warning: extra ';' [-Wpedantic]
}; // namespace
^
Identified by gcc 6.
llvm-svn: 289851
Mehdi Amini [Thu, 15 Dec 2016 18:54:00 +0000 (18:54 +0000)]
Fix printf specifier handling: invalid specifier should not be marked as "consuming data arguments"
Reviewers: rsmith, bruno, dexonsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27796
llvm-svn: 289850
Kostya Serebryany [Thu, 15 Dec 2016 18:47:22 +0000 (18:47 +0000)]
[libFuzzer] doc update
llvm-svn: 289849