Simon Pilgrim [Fri, 8 Nov 2019 22:38:19 +0000 (22:38 +0000)]
Remove superfluous break after return. NFC.
Simon Pilgrim [Fri, 8 Nov 2019 22:37:11 +0000 (22:37 +0000)]
Fix shadow variable warning by reducing scope of CC/InverseCC CondCodes. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 22:30:12 +0000 (22:30 +0000)]
Remarks - fix shadow variable warnings. NFCI.
Avoid conflict with llvm::remarks::Magic global variable.
Richard Smith [Sat, 9 Nov 2019 09:17:57 +0000 (01:17 -0800)]
[cxx_status] Update with Belfast motions.
Jay Foad [Fri, 8 Nov 2019 23:08:24 +0000 (23:08 +0000)]
Refactor SimplifySelectsFeedingBinaryOp for D64713. NFC.
Dávid Bolvanský [Sat, 9 Nov 2019 08:02:40 +0000 (09:02 +0100)]
[Diagnostics] Fixed crash with non pointer type (PR43950)
Artem Dergachev [Sat, 9 Nov 2019 02:06:40 +0000 (18:06 -0800)]
[analyzer] Fix skipping the call during inlined defensive check suppression.
When bugreporter::trackExpressionValue() is invoked on a DeclRefExpr,
it tries to do most of its computations over the node in which
this DeclRefExpr is computed, rather than on the error node (or whatever node
is stuffed into it). One reason why we can't simply use the error node is
that the binding to that variable might have already disappeared from the state
by the time the bug is found.
In case of the inlined defensive checks visitor, the DeclRefExpr node
is in fact sometimes too *early*: the call in which the inlined defensive check
has happened might have not been entered yet.
Change the visitor to be fine with tracking dead symbols (which it is totally
capable of - the collapse point for the symbol is still well-defined), and fire
it up directly on the error node. Keep using "LVState" to find out which value
should we be tracking, so that there weren't any problems with accidentally
loading an ill-formed value from a dead variable.
Differential Revision: https://reviews.llvm.org/D67932
Artem Dergachev [Sat, 9 Nov 2019 02:04:27 +0000 (18:04 -0800)]
[analyzer] Nullability: Don't infer nullable when passing as nullable parameter.
You can't really infer anything from that.
Jason Molenda [Sat, 9 Nov 2019 02:20:27 +0000 (18:20 -0800)]
Temporarily change the default for use-g-packet-for-reading to false,
until we can automatically fall back to p/P if g/G are not supported;
it looks like there is a bug in debugserver's g/G packets taht needs
to be fixed, or debugserver should stop supporting g/G until that bug
is fixed. But we need lldb to be able to fall back to p/P correctly
for that to be a viable workaround.
Jonas Devlieghere [Sat, 9 Nov 2019 02:16:44 +0000 (18:16 -0800)]
Revert "Add a testcase for .dSYM path remapping dictionaries."
This reverts commit
2bbc4fdd8fa0ed58d610ab6260cb664c7cfef204.
Puyan Lotfi [Sat, 9 Nov 2019 02:06:23 +0000 (21:06 -0500)]
[clang][IFS][test] Fixing buildbot test fails for clang-ifs.
Checking for the exact triple fails on many bots. Leaving the triple
check blank.
Puyan Lotfi [Sat, 9 Nov 2019 01:21:28 +0000 (20:21 -0500)]
[clang][IFS] Adds support for more decl types in clang interface stubs.
Adding support for processing the following Decls: NonTypeTemplateParmDecl,
CXXConversionDecl, UnresolvedUsingValueDecl, UsingDecl, UsingShadowDecl,
TypeAliasTemplateDecl, TypeAliasDecl, VarTemplateDecl,
VarTemplateSpecializationDecl, UsingDirectiveDecl, TemplateTemplateParmDecl,
ClassTemplatePartialSpecializationDecl, IndirectFieldDecl.
Also, this allows for processing NamedDecls that don't have an identifier and
skips over VarDecls that are dependent on template types.
Differential Revision: https://reviews.llvm.org/D69995
Teresa Johnson [Fri, 8 Nov 2019 23:50:55 +0000 (15:50 -0800)]
ThinLTO : Import always_inline functions irrespective of the threshold
Summary: A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.
Patch by Bharathi Seshadri <bseshadr@cisco.com>
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70014
Jason Molenda [Fri, 8 Nov 2019 23:55:46 +0000 (15:55 -0800)]
Test case to verify that lldb falls back to p/P if g is unsupported
and that lldb uses the expedited register values in the ? packet
aka stop packet (T11 etc) and does not re-fetch them with the p packet.
This test is currently failing from the "[lldb-server] Add setting to
force 'g' packet use" commit; I'm marking it as @expectedFailureAll
until we can get this fixed.
David Blaikie [Fri, 8 Nov 2019 23:31:15 +0000 (15:31 -0800)]
DebugInfo: Remove redundant conditionals/checks from macro info emission
These checks fall out naturally from the current implementation without
needing to be explicitly considered anymore.
David Blaikie [Fri, 8 Nov 2019 23:26:17 +0000 (15:26 -0800)]
DebugInfo: Do not create a debug_macinfo section if no CUs have associated macros
Patch based on Sourabh Singh's D69839 patch.
Sam Clegg [Fri, 8 Nov 2019 19:13:10 +0000 (11:13 -0800)]
llvm-ranlib/nm: Don't print usage message except for usage errors
Also, fix a bug in ranlib where it didn't correctly detect being run
without any argument and would try to operate on the empty string.
Differential Revision: https://reviews.llvm.org/D70021
David Blaikie [Fri, 8 Nov 2019 23:14:58 +0000 (15:14 -0800)]
NVPTX: Don't insert an extra empty line at the end of the last section.
This was arbitrarily appearing in only the last section emitted - which
made tests more sensitive than they needed to be (removing the last
section - like the macinfo section change that's coming after this)
would, surprisingly, move the blank line to the previous section.
Adrian Prantl [Fri, 8 Nov 2019 17:24:31 +0000 (09:24 -0800)]
Debug Info: Nest Objective-C property function decls inside their container.
This has the nice side-effect of also fixing a crash in Clang.
Starting with DWARF 5 we are emitting ObjC method declarations as
children of their containing entity. This worked for interfaces, but
didn't consider the case of synthessized properties. When a property
of a protocol is synthesized in an interface implementation the
ObjCMethodDecl that was passed to CGF::StartFunction was the property
*declaration* which obviously couldn't have a containing
interface. This patch passes the containing interface all the way
through to CGDebugInfo, so the function declaration can be created
with the correct parent (= the class implementing the protocol).
rdar://problem/
53782400
Differential Revision: https://reviews.llvm.org/D66121
Alex Lorenz [Fri, 8 Nov 2019 22:50:26 +0000 (14:50 -0800)]
[clangd] NFC, reuse the source manager variable in the RawStringLiteral apply method
Differential Revision: https://reviews.llvm.org/D69544
Fangrui Song [Sun, 29 Sep 2019 15:26:12 +0000 (15:26 +0000)]
[MC] Emit unused undefined symbol even if its binding is not set
Recommit r373168, which was reverted by r373242. This actually exposed a
boringssl bug which has been fixed for more than one month.
For the following two cases, we currently suppress the symbols. This
patch emits them (compatible with GNU as).
* `test2_a = undef`: if `undef` is otherwise unused.
* `.hidden hidden`: if `hidden` is unused. This is the main point of the
patch, because omitting the symbol would cause a linker semantic
difference.
It causes a behavior change that is not compatible with GNU as:
.weakref foo1, bar1
When neither foo1 nor bar1 is used, we now emit bar1, which is arguably
more consistent.
Another change is that we will emit .TOC. for .TOC.@tocbase . For this
directive, suppressing .TOC. can be seen as a size optimization, but we
choose to drop it for simplicity and consistency.
Stephan T. Lavavej [Fri, 8 Nov 2019 02:04:55 +0000 (18:04 -0800)]
[www] More HTTPS and outdated link fixes.
Resolves D69981.
Sylvestre Ledru [Fri, 8 Nov 2019 22:39:27 +0000 (23:39 +0100)]
clang-format: refresh the list of options
Jan Korous [Fri, 8 Nov 2019 22:17:09 +0000 (14:17 -0800)]
Reland "[compiler-rt] Fix tests after
03b84e4f6d0"
This reverts commit
d6be9273c6035c07b25dd1494f76cd61d523b878.
Jan Korous [Fri, 8 Nov 2019 22:16:15 +0000 (14:16 -0800)]
Revert "Reland "[clang] Report sanitizer blacklist as a dependency in cc1""
This reverts commit
cae4a28864f4e8a55920e2b94e2cd43617902dec.
Sylvestre Ledru [Fri, 8 Nov 2019 22:26:29 +0000 (23:26 +0100)]
clang-format: Add to the release notes the new --dry-run/-n option
Melanie Blower [Fri, 8 Nov 2019 22:18:15 +0000 (14:18 -0800)]
Revert "Reapply "Fix crash on switch conditions of non-integer types in templates""
This reverts commit
759948467ea3181615d44d80f74ffeb260180fd0.
There were build bot failures in clang-tidy
joanlluch [Fri, 8 Nov 2019 22:16:44 +0000 (23:16 +0100)]
[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (3) (baseline tests)
Summary:
This is baseline tests for D69326
Incorporates a command line flag for the MSP430 and adds a test cases to help showing the effects of applying D69326
More details and motivation for this patch in D69326
Reviewers: spatel, asl, lebedev.ri
Reviewed By: spatel, asl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69975
Adrian Prantl [Fri, 8 Nov 2019 22:09:40 +0000 (14:09 -0800)]
Don't attempt to upgrade debug-info-tests to Python3.
There was CMake code that would attempt to detect Python 3 even if
LLVM was configured with Python 2, but it messed with the environment
for the other LLVM projects. This commit removes this functionality
and just lkeaves a hard error if Python < 3 is detected and
debuginfo-tests are required.
Adrian Prantl [Fri, 8 Nov 2019 22:05:45 +0000 (14:05 -0800)]
Add a testcase for .dSYM path remapping dictionaries.
rdar://problem/
56924558
Alex Suhan [Fri, 8 Nov 2019 21:37:13 +0000 (16:37 -0500)]
Basic: fix FileManager invalidation issue for file redirect
Insertion into SeenFileEntries can invalidate iterators, we need to do
another lookup on the re-intern path.
Shoaib Meenai [Fri, 8 Nov 2019 21:55:00 +0000 (13:55 -0800)]
[llvm-xray] Add basic test for AArch64 support
Based on a test provided by Ian Levesque <ianlevesque@fb.com>.
Jan Korous [Fri, 8 Nov 2019 21:56:37 +0000 (13:56 -0800)]
[clang] Fix -fsanitize-system-blacklist processing in cc1
Jan Korous [Fri, 8 Nov 2019 21:55:00 +0000 (13:55 -0800)]
Reland "[clang] Report sanitizer blacklist as a dependency in cc1"
This reverts commit
3182027282c59c51d5080d83365917fccd695854.
Jan Korous [Fri, 8 Nov 2019 21:54:28 +0000 (13:54 -0800)]
Reland "[clang] Report sanitizer blacklist as a dependency in cc1"
This reverts commit
9b8413ac6e56e7a6e0ba884773d13bcf9414bd43.
David Blaikie [Fri, 8 Nov 2019 20:56:49 +0000 (12:56 -0800)]
DebugInfo: Use separate macinfo contributions for each CU
The macinfo support was broken for LTO situations, by terminating
macinfo lists only once - multiple macinfo contributions were correctly
labeled, but they all continued/flowed into later contributions until
only one terminator appeared at the end of the section.
Correctly terminate each contribution & fix the parsing to handle this
situation too. The parsing fix is also necessary for dumping linked
binaries - the previous code would stop at the end of the first
contribution - missing all later contributions in a linked binary.
It'd be nice to improve the dumping to print the offsets of each
contribution so it'd be easier to know which CU AT_macro_info refers to
which macinfo contribution.
paul_hoad [Fri, 8 Nov 2019 21:12:22 +0000 (21:12 +0000)]
[clang-format] NFC allow Format.h to be clang-formatted but still maintain the same doc layout in ClangFormatStyleOptions.rst
Summary:
Format.h is used to generate ClangFormatStyleOptions.rst, the layout of the comments is critical to the rst file. Accidentally clang-formatting Format.h can lead to the .rst changing.
This revision simply add // clang-format off/on statement around the areas who formatting needs to be maintained, mainly around the options that are related to what happens when the line breaks due to `ColumnLimit` (which is what is happening to the comment)
This allows Format.h to be clang-formatted without causing a change in the documentation when dump_format_style.py is rerun, which is also part of the revision.
Reviewers: mitchell-stellar, klimek, sammccall, owenpan
Reviewed By: mitchell-stellar
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D69951
LLVM GN Syncbot [Fri, 8 Nov 2019 20:48:12 +0000 (20:48 +0000)]
gn build: Merge
f0af11d86f8
bmahjour [Fri, 8 Nov 2019 20:05:06 +0000 (15:05 -0500)]
[DDG] Data Dependence Graph - Pi Block
Summary:
This patch adds Pi Blocks to the DDG. A pi-block represents a group of DDG
nodes that are part of a strongly-connected component of the graph.
Replacing all the SCCs with pi-blocks results in an acyclic representation
of the DDG. For example if we have:
{a -> b}, {b -> c, d}, {c -> a}
the cycle a -> b -> c -> a is abstracted into a pi-block "p" as follows:
{p -> d} with "p" containing: {a -> b}, {b -> c}, {c -> a}
In this implementation the edges between nodes that are part of the pi-block
are preserved. The crossing edges (edges where one end of the edge is in the
set of nodes belonging to an SCC and the other end is outside that set) are
replaced with corresponding edges to/from the pi-block node instead.
Authored By: bmahjour
Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert
Reviewed By: Meinersbur
Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack
Tag: #llvm
Differential Revision: https://reviews.llvm.org/D68827
Eli Friedman [Thu, 31 Oct 2019 19:06:18 +0000 (12:06 -0700)]
[AArch64][X86] Don't assume __powidf2 is available on Windows.
We had some code for this for 32-bit ARM, but this doesn't really need
to be in target-specific code; generalize it.
(I think this started showing up recently because we added an
optimization that converts pow to powi.)
Differential Revision: https://reviews.llvm.org/D69013
Gil Rapaport [Fri, 8 Nov 2019 20:14:31 +0000 (22:14 +0200)]
Revert "[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)"
This reverts commit
11ed1c0239fd51fd2f064311dc7725277ed0a994 - causes an assert failure.
Fangrui Song [Fri, 8 Nov 2019 19:19:03 +0000 (11:19 -0800)]
[ELF] Fix stack-use-after-scope after D69592 and 69650
Nikita Popov [Fri, 8 Nov 2019 17:23:01 +0000 (18:23 +0100)]
Reapply [LVI] Normalize pointer behavior
Fix cache invalidation by not guarding the dereferenced pointer cache
erasure by SeenBlocks. SeenBlocks is only populated when actually
caching a value in the block, which doesn't necessarily have to happen
just because dereferenced pointers were calculated.
-----
Related to D69686. As noted there, LVI currently behaves differently
for integer and pointer values: For integers, the block value is always
valid inside the basic block, while for pointers it is only valid at
the end of the basic block. I believe the integer behavior is the
correct one, and CVP relies on it via its getConstantRange() uses.
The reason for the special pointer behavior is that LVI checks whether
a pointer is dereferenced in a given basic block and marks it as
non-null in that case. Of course, this information is valid only after
the dereferencing instruction, or in conservative approximation,
at the end of the block.
This patch changes the treatment of dereferencability: Instead of
including it inside the block value, we instead treat it as something
similar to an assume (it essentially is a non-nullness assume) and
incorporate this information in intersectAssumeOrGuardBlockValueConstantRange()
if the context instruction is the terminator of the basic block.
This happens either when determining an edge-value internally in LVI,
or when a terminator was explicitly passed to getValueAt(). The latter
case makes this change not fully NFC, because we can now fold
terminator icmps based on the dereferencability information in the
same block. This is the reason why I changed one JumpThreading test
(it would optimize the condition away without the change).
Of course, we do not want to recompute dereferencability on each
intersectAssume call, so we need a new cache for this. The
dereferencability analysis requires walking the entire basic block
and computing underlying objects of all memory operands. This was
previously done separately for each queried pointer value. In the
new implementation (both because this makes the caching simpler,
and because it is faster), I instead only walk the full BB once and
cache all the dereferenced pointers. So the traversal is now performed
only once per BB, instead of once per queried pointer value.
I think the overall model now makes more sense than before, and there
will be no more pitfalls due to differing integer/pointer behavior.
Differential Revision: https://reviews.llvm.org/D69914
Jan Korous [Fri, 8 Nov 2019 18:40:27 +0000 (10:40 -0800)]
[clang] Add VFS support for sanitizers' blacklists
Differential Revision: https://reviews.llvm.org/D69648
Tom Stellard [Fri, 8 Nov 2019 18:05:37 +0000 (10:05 -0800)]
[cmake] Remove LLVM_{BUILD,LINK}_LLVM_DYLIB options on Windows
Summary: The options aren't supported so they can be removed.
Reviewers: beanz, smeenai, compnerd
Reviewed By: compnerd
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69877
Melanie Blower [Fri, 8 Nov 2019 18:14:51 +0000 (10:14 -0800)]
Reapply "Fix crash on switch conditions of non-integer types in templates"
This patch reapplies commit
76945821b9cad3. The first version broke
buildbots due to clang-tidy test fails. The fails are because some
errors in templates are now diagnosed earlier (does not wait till
instantiation). I have modified the tests to add checks for these
diagnostics/prevent these diagnostics. There are no additional code
changes.
Summary of code changes:
Clang currently crashes for switch statements inside a template when the
condition is a non-integer field member because contextual implicit
conversion is skipped when parsing the condition. This conversion is
however later checked in an assert when the case statement is handled.
The conversion is skipped when parsing the condition because
the field member is set as type-dependent based on its containing class.
This patch sets the type dependency based on the field's type instead.
This patch fixes Bug 40982.
Reviewers: rnk, gribozavr2
Patch by: Elizabeth Andrews (eandrews)
Differential revision: https://reviews.llvm.org/D69950
evgeny [Fri, 8 Nov 2019 17:50:34 +0000 (20:50 +0300)]
[ThinLTO] Fix bug when importing writeonly variables
Patch enables import of write-only variables with non-trivial initializers
to fix linker errors. Initializers of imported variables are converted to
'zeroinitializer' to avoid promotion of referenced objects.
Differential revision: https://reviews.llvm.org/D70006
Tom Stellard [Thu, 31 Oct 2019 20:39:48 +0000 (13:39 -0700)]
[cmake] Remove SVN support from VersionFromVCS.cmake
Reviewers: phosek
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69682
Lei Huang [Fri, 8 Nov 2019 17:39:05 +0000 (11:39 -0600)]
[PowerPC][compiler-rt][builtins]Fix __fixunstfti builtin on PowerPC
__fixunstfti converts a long double (IBM double-double) to an unsigned 128 bit
integer. This patch enables it to handle a previously unhandled case in which
a negative low double may impact the result of the conversion.
Collaborated with @masoud.ataei and @renenkel.
Patch By: Baptiste Saleil
Differential Revision: https://reviews.llvm.org/D69193
Adrian Prantl [Fri, 8 Nov 2019 17:52:58 +0000 (09:52 -0800)]
Properly propagate is_variadic.
This fixes a copy&paste error made when adapting to new clang API
which was promptly caught by the bots.
Fangrui Song [Wed, 30 Oct 2019 23:45:21 +0000 (16:45 -0700)]
[ELF] Suggest extern "C" when the definition is mangled while an undefined reference is not
The definition may be mangled while an undefined reference is not.
This may come up when (1) the reference is from a C file or (2) the definition
misses an extern "C".
(2) is more common. Suggest an arbitrary mangled name that matches the
undefined reference, if such a definition exists.
ld.lld: error: undefined symbol: foo
>>> referenced by a.o:(.text+0x1)
>>> did you mean to declare foo(int) as extern "C"?
>>> defined in: a1.o
Reviewed By: dblaikie, ruiu
Differential Revision: https://reviews.llvm.org/D69650
Fangrui Song [Tue, 29 Oct 2019 22:28:19 +0000 (15:28 -0700)]
[ELF] Suggest extern "C" when an undefined reference is mangled while the definition is not
When missing an extern "C" declaration, an undefined reference may be
mangled while the definition is not. Suggest the missing
extern "C" and the base name.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D69592
Kazu Hirata [Fri, 8 Nov 2019 17:29:46 +0000 (09:29 -0800)]
[JumpThreading] Fix a comment typo (NFC)
Reviewers: kazu
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70013
Nick Desaulniers [Fri, 8 Nov 2019 17:16:20 +0000 (09:16 -0800)]
remove redundant LLVM version from version string when setting CLANG_VENDOR
Summary:
When downstream LLVM distributions (like AOSP) set the CLANG_VENDOR
cmake variable, the version string printed by the clang driver looks
like:
$ clang --version
[CLANG_VENDOR] clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) (based on LLVM X.X.X)
Rather than the more standard:
$ clang --version
clang version X.X.X ([CLANG_REPOSITORY_STRING] sha)
Based on feedback the the version string is a little long, the trailing
"(based on LLVM X.X.X)" is redundant and makes less sense after moving
LLVM to the monorepo. And it is only added should vendors set the cmake
variable CLANG_VENDOR. Let's remove it.
Reviewers: jyknight, eli.friedman, rsmith, rjmccall, efriedma
Reviewed By: efriedma
Subscribers: arphaman, efriedma, cfe-commits, srhines
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69925
Nikita Popov [Fri, 8 Nov 2019 17:20:43 +0000 (18:20 +0100)]
Revert "[LVI] Normalize pointer behavior"
This reverts commit
15bc4dc9a8949f9cffd46ec647baf0818d28fb28.
clang-cmake-x86_64-sde-avx512-linux buildbot reported quite a few
compile-time regressions in test-suite, will investigate.
Jonas Devlieghere [Fri, 8 Nov 2019 17:19:54 +0000 (09:19 -0800)]
[lldb] Make Asan/SIP workaround work for Python 3
Make the check generic instead of hard-coding the path to Python 2. This
also fixes the print-syntax to be compatible with both versions.
Jonas Devlieghere [Fri, 8 Nov 2019 17:06:39 +0000 (09:06 -0800)]
[lldb] Prevent Asan/SIP workaround from affecting Python in /usr/local/bin
The code that works around SIP was unintentionally being triggered for
/usr/local/bin/python as well. That caused trouble on GreenDragon where
we were swapping out a Python 3 executable with the system's Python 2
executable.
Adrian Prantl [Fri, 8 Nov 2019 17:02:51 +0000 (09:02 -0800)]
Fix two typos in one test name, three days before its 10th birthday! (NFC)
Adrian Prantl [Fri, 8 Nov 2019 16:58:50 +0000 (08:58 -0800)]
Adapt LLDB to clang API change in ObjCMethodDecl::create().
Nikita Popov [Tue, 5 Nov 2019 22:14:22 +0000 (23:14 +0100)]
[LVI] Normalize pointer behavior
Related to D69686. As noted there, LVI currently behaves differently
for integer and pointer values: For integers, the block value is always
valid inside the basic block, while for pointers it is only valid at
the end of the basic block. I believe the integer behavior is the
correct one, and CVP relies on it via its getConstantRange() uses.
The reason for the special pointer behavior is that LVI checks whether
a pointer is dereferenced in a given basic block and marks it as
non-null in that case. Of course, this information is valid only after
the dereferencing instruction, or in conservative approximation,
at the end of the block.
This patch changes the treatment of dereferencability: Instead of
including it inside the block value, we instead treat it as something
similar to an assume (it essentially is a non-nullness assume) and
incorporate this information in intersectAssumeOrGuardBlockValueConstantRange()
if the context instruction is the terminator of the basic block.
This happens either when determining an edge-value internally in LVI,
or when a terminator was explicitly passed to getValueAt(). The latter
case makes this change not fully NFC, because we can now fold
terminator icmps based on the dereferencability information in the
same block. This is the reason why I changed one JumpThreading test
(it would optimize the condition away without the change).
Of course, we do not want to recompute dereferencability on each
intersectAssume call, so we need a new cache for this. The
dereferencability analysis requires walking the entire basic block
and computing underlying objects of all memory operands. This was
previously done separately for each queried pointer value. In the
new implementation (both because this makes the caching simpler,
and because it is faster), I instead only walk the full BB once and
cache all the dereferenced pointers. So the traversal is now performed
only once per BB, instead of once per queried pointer value.
I think the overall model now makes more sense than before, and there
will be no more pitfalls due to differing integer/pointer behavior.
Differential Revision: https://reviews.llvm.org/D69914
Simon Pilgrim [Fri, 8 Nov 2019 16:26:07 +0000 (16:26 +0000)]
PODSmallVector - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 16:25:26 +0000 (16:25 +0000)]
TimeTraceProfiler - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 16:22:12 +0000 (16:22 +0000)]
Obj2YamlError - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 16:19:21 +0000 (16:19 +0000)]
CrashRecoveryContextCleanup - fix uninitialized variable warnings. NFCI.
Remove default values from constructor.
Adrian Prantl [Mon, 4 Nov 2019 22:28:14 +0000 (14:28 -0800)]
Redeclare Objective-C property accessors inside the ObjCImplDecl in which they are synthesized.
This patch is motivated by (and factored out from)
https://reviews.llvm.org/D66121 which is a debug info bugfix. Starting
with DWARF 5 all Objective-C methods are nested inside their
containing type, and that patch implements this for synthesized
Objective-C properties.
1. SemaObjCProperty populates a list of synthesized accessors that may
need to inserted into an ObjCImplDecl.
2. SemaDeclObjC::ActOnEnd inserts forward-declarations for all
accessors for which no override was provided into their
ObjCImplDecl. This patch does *not* synthesize AST function
*bodies*. Moving that code from the static analyzer into Sema may
be a good idea though.
3. Places that expect all methods to have bodies have been updated.
I did not update the static analyzer's inliner for synthesized
properties to point back to the property declaration (see
test/Analysis/Inputs/expected-plists/nullability-notes.m.plist), which
I believed to be more bug than a feature.
Differential Revision: https://reviews.llvm.org/D68108
rdar://problem/
53782400
Philip Reames [Fri, 8 Nov 2019 15:04:02 +0000 (07:04 -0800)]
[LICM] Support hosting of dynamic allocas out of loops
This patch implements a correct, but not terribly useful, transform. In particular, if we have a dynamic alloca in a loop which is guaranteed to execute, and provably not captured, we hoist the alloca out of the loop. The capture tracking is needed so that we can prove that each previous stack region dies before the next one is allocated. The transform decreases the amount of stack allocation needed by a linear factor (e.g. the iteration count of the loop).
Now, I really hope no one is actually using dynamic allocas. As such, why this patch?
Well, the actual problem I'm hoping to make progress on is allocation hoisting. There's a large draft patch out for review (https://reviews.llvm.org/D60056), and this patch was the smallest chunk of testable functionality I could come up with which takes a step vaguely in that direction.
Once this is in, it makes motivating the changes to capture tracking mentioned in TODOs testable. After that, I hope to extend this to trivial malloc free regions (i.e. free dominating all loop exits) and allocation functions for GCed languages.
Differential Revision: https://reviews.llvm.org/D69227
Philip Reames [Fri, 8 Nov 2019 15:00:55 +0000 (07:00 -0800)]
[LICM] Hoisting of widenable conditions out of loops
The change itself is straight forward and obvious, but ... there's an existing test checking for exactly the opposite. Both I and Artur think this is simply conservatism in the initial implementation. If anyone bisects a problem to this, a counter example will be very interesting.
Differential Revision: https://reviews.llvm.org/D69907
Tim Renouf [Fri, 8 Nov 2019 13:34:17 +0000 (13:34 +0000)]
[CostModel] Fixed isExtractSubvectorMask for undef index off end
ShuffleVectorInst::isExtractSubvectorMask, introduced in
[CostModel] Add SK_ExtractSubvector handling to getInstructionThroughput (PR39368)
erroneously thought that
%340 = shufflevector <4 x float> %339, <4 x float> undef, <3 x i32> <i32 2, i32 3, i32 undef>
is a subvector extract, even though it goes off the end of the parent
vector with the undef index. That then caused an assert in
BasicTTIImplBase::getExtractSubvectorOverhead.
This commit fixes that, by not considering the above a subvector
extract.
Differential Revision: https://reviews.llvm.org/D70005
Change-Id: I87b8b00b24bef19ffc9a1b82ef4eca3b8a246eaf
Yi-Hong Lyu [Thu, 12 Sep 2019 06:49:02 +0000 (06:49 +0000)]
[PowerPC] Remove redundant CRSET/CRUNSET in custom lowering of known CR bit spills
We lower known CR bit spills (CRSET/CRUNSET) to load and spill the known value
but forgot to remove the redundant spills.
e.g., This sequence was used to spill a CRUNSET:
crclr 4*cr5+lt
mfocrf r3,4
rlwinm r3,r3,20,0,0
stw r3,132(r1)
Custom lowering of known CR bit spills lower it to:
crxor 4*cr5+lt, 4*cr5+lt, 4*cr5+lt
li r3,0
stw r3,132(r1)
crxor is redundant if there is no use of 4*cr5+lt so we should remove it
Differential revision: https://reviews.llvm.org/D67722
Simon Pilgrim [Fri, 8 Nov 2019 15:06:33 +0000 (15:06 +0000)]
raw_ostream - fix static analyzer warnings. NFCI.
- uninitialized variables
- make BufferKind a scoped enum class
Simon Pilgrim [Fri, 8 Nov 2019 15:04:49 +0000 (15:04 +0000)]
YAMLTraits.h - fix uninitialized variable warning. NFCI.
Jan Vesely [Thu, 7 Nov 2019 21:27:04 +0000 (16:27 -0500)]
libclc: Drop the old python based build system
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D69966
Jan Vesely [Sat, 2 Nov 2019 22:15:56 +0000 (18:15 -0400)]
libclc: Drop travis
It only works for standalone repos.
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D69965
Raphael Isemann [Fri, 8 Nov 2019 14:39:42 +0000 (15:39 +0100)]
[lldb] Skip parts of TestCallOverriddenMethod.py on Linux
The function call and the constructor call fail now several Linux
bots (Swift CI, my own bot and Stella's Debian system), so let's disable
the relevant test parts until we can figure out why it is failing.
Roman Lebedev [Fri, 8 Nov 2019 14:27:42 +0000 (17:27 +0300)]
[NFC] ConstantRange::subWithNoWrap(): fixup comment
Roman Lebedev [Fri, 8 Nov 2019 14:19:56 +0000 (17:19 +0300)]
[ConstantRange] Add umul_sat()/smul_sat() methods
Summary:
To be used in `ConstantRange::mulWithNoOverflow()`,
may in future be useful for when saturating shift/mul ops are added.
These are precise as far as i can tell.
I initially though i will need `APInt::[us]mul_sat()` for these,
but it turned out much simpler to do what `ConstantRange::multiply()`
does - perform multiplication in twice the bitwidth, and then truncate.
Though here we want saturating signed truncation.
Reviewers: nikic, reames, spatel
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69994
Roman Lebedev [Fri, 8 Nov 2019 14:19:45 +0000 (17:19 +0300)]
[APInt] Add saturating truncation methods
Summary:
The signed one is needed for implementation of `ConstantRange::smul_sat()`,
unsigned is for completeness only.
Reviewers: nikic, RKSimon, spatel
Reviewed By: nikic
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69993
Kristof Beyls [Fri, 8 Nov 2019 11:07:53 +0000 (11:07 +0000)]
find_interesting_reviews.py: avoid crash on non-ascii data.
Simon Pilgrim [Fri, 8 Nov 2019 14:27:51 +0000 (14:27 +0000)]
OutputStream - fix static analyzer warnings. NFCI.
- uninitialized variables
- make getBufferCapacity() const
Simon Pilgrim [Fri, 8 Nov 2019 14:25:56 +0000 (14:25 +0000)]
directory_entry - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 14:21:34 +0000 (14:21 +0000)]
Timer - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 14:19:23 +0000 (14:19 +0000)]
ReplacementItem - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 14:17:46 +0000 (14:17 +0000)]
Hashing - fix uninitialized variable warnings. NFCI.
paul_hoad [Fri, 8 Nov 2019 14:34:07 +0000 (14:34 +0000)]
[clang-format] Ensure dump_format_style.py can generate ClangFormatStyleOptions.rst without manual intervention
Summary:
This revision is the last in a series of revisions to return `clang/doc/tools/dump_format_style.py` to be being able to parse Format.h without needing to manually merge the ClangFormatStyleOptions.rst file.
The final modification to dump_format_style.py is needed following the addition of a nested enumeration inside a nested structure following the introduction of {D68296}
Prior related revisions will allow for a fully clang-formatted `clang/include/clang/Format/Format.h` to once again be used at the source.
{D69951}
{D69433}
{D69404}
Reviewers: mitchell-stellar, klimek, sammccall, owenpan
Reviewed By: mitchell-stellar
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D70003
Aditya Kumar [Fri, 8 Nov 2019 05:20:34 +0000 (21:20 -0800)]
[llvm-xray] Add AArch64 to llvm-xray extract
This required adding support for resolving R_AARCH64_ABS64 relocations to
get accurate addresses for function names to resolve.
Authored by: ianlevesque (Ian Levesque)
Reviewers: dberris, phosek, smeenai, tetsuo-cpp
Differential Revision: https://reviews.llvm.org/D69967
LLVM GN Syncbot [Fri, 8 Nov 2019 14:31:11 +0000 (14:31 +0000)]
gn build: Merge
0dc0572b48e
Jason Liu [Fri, 8 Nov 2019 14:26:28 +0000 (09:26 -0500)]
[XCOFF][AIX] Differentiate usage of label symbol and csect symbol
Summary:
We are using symbols to represent label and csect interchangeably before, and that could be a problem.
There are cases we would need to add storage mapping class to the symbol if that symbol is actually the name of a csect, but it's hard for us to figure out whether that symbol is a label or csect.
This patch intend to do the following:
1. Construct a QualName (A name include the storage mapping class)
MCSymbolXCOFF for every MCSectionXCOFF.
2. Keep a pointer to that QualName inside of MCSectionXCOFF.
3. Use that QualName whenever we need a symbol refers to that
MCSectionXCOFF.
4. Adapt the snowball effect from the above changes in
XCOFFObjectWriter.cpp.
Reviewers: xingxue, DiggerLin, sfertile, daltenty, hubert.reinterpretcast
Reviewed By: DiggerLin, daltenty
Subscribers: wuzish, nemanjai, mgorny, hiraditya, kbarton, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69633
Dmitry Preobrazhensky [Fri, 8 Nov 2019 13:38:56 +0000 (16:38 +0300)]
[AMDGPU][MC] Corrected src0 for v_movrelsd_b32 and v_movrelsd_2_b32
See https://bugs.llvm.org/show_bug.cgi?id=40903
Reviewers: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D69888
Gil Rapaport [Mon, 7 Oct 2019 14:24:33 +0000 (17:24 +0300)]
[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)
This recommits
100e797adb433724a17c9b42b6533cd634cb796b (reverted in
009e032634b3bd7fc32071ac2344b12142286477 for failing an assert). While the
root cause was independently reverted in
eaff3004019f97c64c88ab76da6b25106b659b30,
this commit includes a LIT to make sure IVDescriptor's SinkAfter logic does not
try to sink branch instructions.
Simon Pilgrim [Fri, 8 Nov 2019 13:10:52 +0000 (13:10 +0000)]
BinaryStream - fix static analyzer warnings. NFCI.
- uninitialized variables
- documention warnings
- shadow variable names
paulhoad [Fri, 8 Nov 2019 13:15:45 +0000 (13:15 +0000)]
[clang-format] update comments in clang-format.py for python3 compatibility
Summary:
D23319 introduced python3 compatibility to clang-format.py, this is however not reflected by the documentation in the comments at the beginning of the file, which show how to use the script with python2 in .vimrc. While the actual mapping a user might want to use may well differ from my suggestion, I think it's nice to show the python2 and python3 version, such that a user can pick from the suggestions instead of googeling the python3 replacement for `:pyf` which they might not be familiar with.
EDIT: picking reviewers according to https://llvm.org/docs/Phabricator.html#finding-potential-reviewers
Reviewers: klimek, MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: ilya-biryukov, cfe-commits, llvm-commits, ychen
Patch By: pseyfert
Tags: #clang-tools-extra, #llvm, #clang
Differential Revision: https://reviews.llvm.org/D38446
Abel Kocsis [Fri, 8 Nov 2019 13:09:09 +0000 (14:09 +0100)]
Revert "test commit"
This reverts commit
b0a03f29d9a2d316d6be99e6a4825114f240c0b2.
Abel Kocsis [Fri, 8 Nov 2019 13:08:46 +0000 (14:08 +0100)]
Revert "test commit"
This reverts commit
3ffce13f8c7ecb21c5729aa358f1f9fc008bbea2.
Abel Kocsis [Fri, 8 Nov 2019 13:08:15 +0000 (14:08 +0100)]
Revert "Revert "Revert "[clang] Report sanitizer blacklist as a dependency in cc1"""
This reverts commit
3182027282c59c51d5080d83365917fccd695854.
Abel Kocsis [Fri, 8 Nov 2019 13:00:44 +0000 (14:00 +0100)]
Revert "Revert "[clang] Report sanitizer blacklist as a dependency in cc1""
This reverts commit
6b45e1bc11e91ea7b57a6ab1c19461a86dba33f8.
Abel Kocsis [Fri, 8 Nov 2019 12:37:24 +0000 (13:37 +0100)]
test commit
Abel Kocsis [Fri, 8 Nov 2019 12:35:49 +0000 (13:35 +0100)]
test commit
Jeremy Morse [Fri, 8 Nov 2019 11:33:40 +0000 (11:33 +0000)]
Revert "[clang] Report sanitizer blacklist as a dependency in cc1"
This reverts commit
03b84e4f6d0e1c04f22d69cc445f36e1f713beb4.
This breaks dfsan tests with a linking failure, in for example this build:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24312
Reverting this patch locally makes those tests succeed.
Jeremy Morse [Fri, 8 Nov 2019 11:33:11 +0000 (11:33 +0000)]
Revert "[compiler-rt] Fix tests after
03b84e4f6d0"
This reverts commit
bdeb2724f0aa9c518f94d998d24d8620a1e88727.
(Reverting
03b84e4f6d0, so this must come out as well)
Djordje Todorovic [Fri, 8 Nov 2019 10:19:58 +0000 (11:19 +0100)]
Reland: [TII] Use optional destination and source pair as a return value; NFC
Refactor usage of isCopyInstrImpl, isCopyInstr and isAddImmediate methods
to return optional machine operand pair of destination and source
registers.
Patch by Nikola Prica
Differential Revision: https://reviews.llvm.org/D69622