Simon Pilgrim [Sat, 31 Aug 2019 15:01:03 +0000 (15:01 +0000)]
Fix shadow variable warning. NFCI.
llvm-svn: 370585
Nandor Licker [Sat, 31 Aug 2019 15:00:38 +0000 (15:00 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.
Reviewers: Bigcheese, jfb, rsmith
Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64146
llvm-svn: 370584
Simon Pilgrim [Sat, 31 Aug 2019 14:18:26 +0000 (14:18 +0000)]
[X86ISelLowering] combineCMov - cleanup CMOV->LEA codegen. NFCI.
Only compute the diff once and we don't need the truncation code (assert the bitwidth is correct just to be safe).
llvm-svn: 370583
Simon Pilgrim [Sat, 31 Aug 2019 13:14:52 +0000 (13:14 +0000)]
[X86ISelLowering] LowerSELECT - remove duplicate value type. NFCI.
VT of SELECT result and selection ops will be the same.
llvm-svn: 370581
Simon Pilgrim [Sat, 31 Aug 2019 12:30:19 +0000 (12:30 +0000)]
Fix cppcheck shadow variable and variable scope warnings. NFCI.
llvm-svn: 370580
Amaury Sechet [Sat, 31 Aug 2019 11:40:02 +0000 (11:40 +0000)]
[DAGCombiner] Match (add X, X) as (shl X, 1) when detecting rotate.
Summary: The combiner transforms (shl X, 1) into (add X, X).
Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66882
llvm-svn: 370578
Fangrui Song [Sat, 31 Aug 2019 10:48:09 +0000 (10:48 +0000)]
[llvm-objcopy] Simplify alignToAddr with llvm::alignTo
llvm-svn: 370577
James Molloy [Sat, 31 Aug 2019 10:46:16 +0000 (10:46 +0000)]
[DAGCombiner] Don't create illegal narrow stores
Narrowing stores when the target doesn't support the narrow version
forces the target to expand into a load-modify-store sequence, which
is highly suboptimal. The information narrowing throws away (legality
of the inverse transform) is hard to re-analyze. If the target doesn't
support a store of the narrow type, don't narrow even in pre-legalize
mode.
No test as this is DAGCombiner and depends on target bits.
llvm-svn: 370576
Nikita Popov [Sat, 31 Aug 2019 09:58:50 +0000 (09:58 +0000)]
[LVI] Extract solveBlockValueExtractValue(); NFC
Extract this method in preparation for additional extractvalue
support.
llvm-svn: 370575
Nikita Popov [Sat, 31 Aug 2019 09:58:42 +0000 (09:58 +0000)]
[CVP] Add tests for simplified with.overflow + icmp; NFC
These tests are based on D19867.
llvm-svn: 370574
Nikita Popov [Sat, 31 Aug 2019 09:58:37 +0000 (09:58 +0000)]
[CVP] Generate simpler code for elided with.overflow intrinsics
Use a { iN undef, i1 false } struct as the base, and only insert
the first operand, instead of using { iN undef, i1 undef } as the
base and inserting both. This is the same as what we do in InstCombine.
Differential Revision: https://reviews.llvm.org/D67034
llvm-svn: 370573
Raphael Isemann [Sat, 31 Aug 2019 09:41:25 +0000 (09:41 +0000)]
[lldb] Unify target checking in CommandObject
Summary:
We currently have several CommandObjects that manually reimplement the checking for a selected target
or a target in the execution context (which is the selected target when they are invoked). This patch removes
all these checks and replaces them by setting the eCommandRequiresTarget flag that Pavel suggested. With
this flag we are doing the same check but without having to duplicate this code in all these CommandObjects.
I also added a `GetSelectedTarget()` variant of the `GetSelectedOrDummyTarget()` function to the
CommandObject that checks that the flag is set and then returns a reference to the target. I didn't rewrite
all the `target` variables from `Target *` to `Target &` in this patch as last time this change caused a lot of merge
conflicts in Swift and I would prefer having that in a separate NFC commit.
Reviewers: labath, clayborg
Reviewed By: labath, clayborg
Subscribers: clayborg, JDevlieghere, jingham, amccarth, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D66863
llvm-svn: 370571
Raphael Isemann [Sat, 31 Aug 2019 09:40:26 +0000 (09:40 +0000)]
[lldb][NFC] Remove unused prompt variable in TestMultilineCompletion.py
llvm-svn: 370570
Bjorn Pettersson [Sat, 31 Aug 2019 09:28:50 +0000 (09:28 +0000)]
[CodeGen] Refactor DAGTypeLegalizer::ExpandIntRes_MULFIX. NFC
Restructured the code a little bit in preparation for adding
UMULFIXSAT. I think it will be easier to understand the code
if not interleaving the codegen for signed/unsigned/saturated
cases that much.
llvm-svn: 370569
Bjorn Pettersson [Sat, 31 Aug 2019 09:01:16 +0000 (09:01 +0000)]
[LangRef] Update saturating examples for llvm.smul.fix.sat. NFC
Some saturation examples for llvm.smul.fix.sat were not showing
the correct result. I've adjusted the operands to make sure that
we actually trigger overflow in those examples.
llvm-svn: 370566
Wei Mi [Sat, 31 Aug 2019 03:17:49 +0000 (03:17 +0000)]
Fix some errors introduced by rL370563 which were not exposed on my local machine.
1. zlib::compress accept &size_t but the param is an uint64_t.
2. Some systems don't have zlib installed. Don't use compression by default.
llvm-svn: 370564
Wei Mi [Sat, 31 Aug 2019 02:27:26 +0000 (02:27 +0000)]
[SampleFDO] Add profile symbol list section to discriminate function being
cold versus function being newly added.
This is the second half of https://reviews.llvm.org/D66374.
Profile symbol list is the collection of function symbols showing up in
the binary which generates the current profile. It is used to discriminate
function being cold versus function being newly added. Profile symbol list
is only added for profile with ExtBinary format.
During profile use compilation, when profile-sample-accurate is enabled,
a function without profile will be regarded as cold only when it is
contained in that list.
Differential Revision: https://reviews.llvm.org/D66766
llvm-svn: 370563
Alex Lorenz [Sat, 31 Aug 2019 01:26:04 +0000 (01:26 +0000)]
Introduce a DirectoryEntryRef that stores both a reference and an
accessed name to the directory entry
This commit introduces a parallel API that returns a DirectoryEntryRef
to the FileManager, similar to the parallel FileEntryRef API. All
uses will have to be update in follow-up patches. The immediate use of the new API in this
patch fixes the issue where a file manager was reused in clang-scan-deps,
but reported an different file path whenever a framework lookup was done through a symlink.
Differential Revision: https://reviews.llvm.org/D67026
llvm-svn: 370562
David Blaikie [Sat, 31 Aug 2019 01:05:46 +0000 (01:05 +0000)]
llvm-dwarfdump: Cache CU low_pc when computing statistics.
llvm-svn: 370559
Richard Smith [Sat, 31 Aug 2019 01:00:37 +0000 (01:00 +0000)]
[c++20] Add support for designated direct-list-initialization syntax.
This completes the implementation of P0329R4.
llvm-svn: 370558
Thomas Lively [Sat, 31 Aug 2019 00:12:29 +0000 (00:12 +0000)]
[WebAssembly] Add SIMD QFMA/QFMS
Summary:
Adds clang builtins and LLVM intrinsics for these experimental
instructions. They are not implemented in engines yet, but that is ok
because the user must opt into using them by calling the builtins.
Reviewers: aheejin, dschuff
Reviewed By: aheejin
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D67020
llvm-svn: 370556
Richard Smith [Sat, 31 Aug 2019 00:05:50 +0000 (00:05 +0000)]
[c++20] Disallow template argument deduction from a braced-init-list
containing designators. The C++20 wording doesn't actually say what
happens in this case, but treating this as a non-deduced context seems
like the most natural behavior.
(We might want to consider deducing through array designators as an
extension in the future, but will need to be careful to deduce the array
bound properly if we do so. That's not permitted herein.)
llvm-svn: 370555
Sterling Augustine [Sat, 31 Aug 2019 00:00:34 +0000 (00:00 +0000)]
Revert "Add gdb pretty printers for a wide variety of libc++ data structures."
This reverts commit
d8c9f2f572fe06a34ccfc28ee9223b64d7d275d3.
llvm-svn: 370553
Jonas Devlieghere [Fri, 30 Aug 2019 23:54:13 +0000 (23:54 +0000)]
[test] Make sys.stdout compatible with both Python 2 & 3
This time's the charm.
llvm-svn: 370552
Sterling Augustine [Fri, 30 Aug 2019 23:43:34 +0000 (23:43 +0000)]
Add gdb pretty printers for a wide variety of libc++ data structures.
Summary: Also add a test suite.
Reviewers: EricWF
Subscribers: christof, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65609
Run a pep8 formatter.
Run pep8 formatter.
Convert to PEP8, address other comments from code review.
llvm-svn: 370551
Vlad Tsyrklevich [Fri, 30 Aug 2019 23:24:41 +0000 (23:24 +0000)]
Revert "[lld-link] implement -start-lib and -end-lib"
This reverts commit r370487 as it is causing ASan/MSan failures on
sanitizer-x86_64-linux-fast
llvm-svn: 370550
Jonas Devlieghere [Fri, 30 Aug 2019 23:16:02 +0000 (23:16 +0000)]
[lit] Only set DYLD_LIBRARY_PATH for shared builds
In r370135 I committed a temporary workaround for the sanitized bot to
not set (DY)LD_LIBRARY_PATH when (DY)LD_INSERT_LIBRARIES was set.
Setting (DY)LD_LIBRARY_PATH is only necessary for (standalone)
shared-library builds, so a better solution is to only set the
environment variable when necessary.
Differential revision: https://reviews.llvm.org/D67012
llvm-svn: 370549
Alina Sbirlea [Fri, 30 Aug 2019 23:02:53 +0000 (23:02 +0000)]
[MemorySSA] Rename all phi entries.
When renaming Phis incoming values, there may be multiple edges incoming
from the same block (switch). Rename all.
llvm-svn: 370548
Wei Mi [Fri, 30 Aug 2019 23:01:22 +0000 (23:01 +0000)]
[GVN] Verify value equality before doing phi translation for call instruction
This is an updated version of https://reviews.llvm.org/D66909 to fix PR42605.
Basically, current phi translatation translates an old value number to an new
value number for a call instruction based on the literal equality of call
expression, without verifying there is no clobber in between. This is incorrect.
To get a finegrain check, use MachineDependence analysis to do the job. However,
this is still not ideal. Although given a call instruction,
`MemoryDependenceResults::getCallDependencyFrom` returns identical call
instructions without clobber in between using MemDepResult with its DepType to
be `Def`. However, identical is too strict here and we want it to be relaxed a
little to consider phi-translation -- callee is the same, param operands can be
different. That means changing the semantic of `MemDepResult::Def` and I don't
know the potential impact.
So currently the patch is still conservative to only handle
MemDepResult::NonFuncLocal, which means the current call has no function local
clobber. If there is clobber, even if the clobber doesn't stand in between the
current call and the call with the new value, we won't do phi-translate.
Differential Revision: https://reviews.llvm.org/D67013
llvm-svn: 370547
Duncan P. N. Exon Smith [Fri, 30 Aug 2019 22:59:25 +0000 (22:59 +0000)]
ASTReader: Bypass overridden files when reading PCHs
If contents of a file that is part of a PCM are overridden when reading
it, but weren't overridden when the PCM was being built, the ASTReader
will emit an error. Now it creates a separate FileEntry for recovery,
bypassing the overridden content instead of discarding it. The
pre-existing testcase clang/test/PCH/remap-file-from-pch.cpp confirms
that the new recovery method works correctly.
This resolves a long-standing FIXME to avoid hypothetically invalidating
another precompiled module that's already using the overridden contents.
This also removes ContentCache-related API that would be unsafe to use
across `CompilerInstance`s in an implicit modules build. This helps to
unblock us sinking it from SourceManager into FileManager in the future,
which would allow us to delete `InMemoryModuleCache`.
https://reviews.llvm.org/D66710
llvm-svn: 370546
Jonas Devlieghere [Fri, 30 Aug 2019 22:53:38 +0000 (22:53 +0000)]
[test] Fix 'argument must be str, not bytes' for Python 3.
Use `sys.stdout.buffer` instead of `sys.stdout` in lldbpexpect.py.
llvm-svn: 370545
Richard Smith [Fri, 30 Aug 2019 22:52:55 +0000 (22:52 +0000)]
[c++20] Implement semantic restrictions for C++20 designated
initializers.
This has some interesting interactions with our existing extensions to
support C99 designated initializers as an extension in C++. Those are
resolved as follows:
* We continue to permit the full breadth of C99 designated initializers
in C++, with the exception that we disallow a partial overwrite of an
initializer with a non-trivially-destructible type. (Full overwrite
is OK, because we won't run the first initializer at all.)
* The C99 extensions are disallowed in SFINAE contexts and during
overload resolution, where they could change the meaning of valid
programs.
* C++20 disallows reordering of initializers. We only check for that for
the simple cases that the C++20 rules permit (designators of the form
'.field_name =' and continue to allow reordering in other cases).
It would be nice to improve this behavior in future.
* All C99 designated initializer extensions produce a warning by
default in C++20 mode. People are going to learn the C++ rules based
on what Clang diagnoses, so it's important we diagnose these properly
by default.
* In C++ <= 17, we apply the C++20 rules rather than the C99 rules, and
so still diagnose C99 extensions as described above. We continue to
accept designated C++20-compatible initializers in C++ <= 17 silently
by default (but naturally still reject under -pedantic-errors).
This is not a complete implementation of P0329R4. In particular, that
paper introduces new non-C99-compatible syntax { .field { init } }, and
we do not support that yet.
This is based on a previous patch by Don Hinton, though I've made
substantial changes when addressing the above interactions.
Differential Revision: https://reviews.llvm.org/D59754
llvm-svn: 370544
Reid Kleckner [Fri, 30 Aug 2019 22:40:51 +0000 (22:40 +0000)]
Fix SEH_NoReturn machine verifier error
llvm-svn: 370543
Reid Kleckner [Fri, 30 Aug 2019 22:25:55 +0000 (22:25 +0000)]
[MC] Avoid crashes from improperly nested or wrong target .seh_handlerdata directives
llvm-svn: 370540
Nandor Licker [Fri, 30 Aug 2019 21:32:00 +0000 (21:32 +0000)]
Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370531 (git commit
d4c1002e0bbbbab50f6891cdd2f5bd3a8f3a3584)
llvm-svn: 370535
Reid Kleckner [Fri, 30 Aug 2019 21:23:05 +0000 (21:23 +0000)]
[X86] Print register names in .seh_* directives
Also improve assembler parser register validation for .seh_ directives.
This requires moving X86-specific seh directive handling into the x86
backend, which addresses some assembler FIXMEs.
Differential Revision: https://reviews.llvm.org/D66625
llvm-svn: 370533
Nandor Licker [Fri, 30 Aug 2019 21:17:03 +0000 (21:17 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.
Reviewers: Bigcheese, jfb, rsmith
Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64146
llvm-svn: 370531
Sanjay Patel [Fri, 30 Aug 2019 20:51:51 +0000 (20:51 +0000)]
[x86] add tests for shift-logic-shift; NFC
llvm-svn: 370529
Sanjay Patel [Fri, 30 Aug 2019 20:48:43 +0000 (20:48 +0000)]
[AArch64] add tests for shift-logic-shift; NFC
llvm-svn: 370528
Daniel Sanders [Fri, 30 Aug 2019 20:47:02 +0000 (20:47 +0000)]
Make add_new_check.py's insertion of registerCheck<> match the sort order
Summary:
Following on from review comments in D65919 about the ordering
of the registerCheck<> calls. Sort based on the check name which might
be on the line after the registerCheck<>
Reviewers: aaron.ballman
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66505
llvm-svn: 370527
Jonas Devlieghere [Fri, 30 Aug 2019 20:46:55 +0000 (20:46 +0000)]
[test] Make sure PROMPT is a string
Currently tests using expect_prompt are failing on the Python 3 bot with
an error saying "argument must be str, not bytes". I don't have a Python
3 build handy, but I suspect this might fix that.
llvm-svn: 370526
Reid Kleckner [Fri, 30 Aug 2019 20:46:39 +0000 (20:46 +0000)]
[Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn
Users have complained llvm.trap produce two ud2 instructions on Win64,
one for the trap, and one for unreachable. This change fixes that.
TrapUnreachable was added and enabled for Win64 in r206684 (April 2014)
to avoid poorly understood issues with the Windows unwinder.
There seem to be two major things in play:
- the unwinder
- C++ EH, _CxxFrameHandler3 & co
The unwinder disassembles forward from the return address to scan for
epilogues. Inserting a ud2 had the effect of stopping the unwinder, and
ensuring that it ran the EH personality function for the current frame.
However, it's not clear what the unwinder does when the return address
happens to be the last address of one function and the first address of
the next function.
The Visual C++ EH personality, _CxxFrameHandler3, needs to figure out
what the current EH state number is. It does this by consulting the
ip2state table, which maps from PC to state number. This seems to go
wrong when the return address is the last PC of the function or catch
funclet.
I'm not sure precisely which system is involved here, but in order to
address these real or hypothetical problems, I believe it is enough to
insert int3 after a call site if it would otherwise be the last
instruction in a function or funclet. I was able to reproduce some
similar problems locally by arranging for a noreturn call to appear at
the end of a catch block immediately before an unrelated function, and I
confirmed that the problems go away when an extra trailing int3
instruction is added.
MSVC inserts int3 after every noreturn function call, but I believe it's
only necessary to do it if the call would be the last instruction. This
change inserts a pseudo instruction that expands to int3 if it is in the
last basic block of a function or funclet. I did what I could to run the
Microsoft compiler EH tests, and the ones I was able to run showed no
behavior difference before or after this change.
Differential Revision: https://reviews.llvm.org/D66980
llvm-svn: 370525
Puyan Lotfi [Fri, 30 Aug 2019 20:25:46 +0000 (20:25 +0000)]
[IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510.
llvm-svn: 370522
Sanjay Patel [Fri, 30 Aug 2019 20:15:01 +0000 (20:15 +0000)]
[Thumb2] tighten CHECK lines in test; NFC
The sequence between the function call and the asm start
may change without affecting what this test is looking for,
but we should have a better idea about what that sequence
looks like.
llvm-svn: 370518
Puyan Lotfi [Fri, 30 Aug 2019 20:09:55 +0000 (20:09 +0000)]
[IFS][NFC] llvm-ifs: Fixing build bot error due to commit conflicts.
r370510 and r370504
Again only on gcc.
llvm-svn: 370517
Nico Weber [Fri, 30 Aug 2019 20:06:44 +0000 (20:06 +0000)]
gn build: Merge r370512
llvm-svn: 370516
Craig Topper [Fri, 30 Aug 2019 20:04:23 +0000 (20:04 +0000)]
[X86] Fix mul test cases in avx512-broadcast-unfold.ll to not get canonicalized to fadd. Remove the fsub test cases which were also testing fadd.
Not sure how to prevent an fsub by constant getting turned into an fadd by negative constant.
llvm-svn: 370515
Daniel Sanders [Fri, 30 Aug 2019 20:01:59 +0000 (20:01 +0000)]
[clang-tidy] Add llvm-prefer-register-over-unsigned to clang-tidy
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).
Reviewers: arsenm, bogner
Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, mgorny, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D65919
llvm-svn: 370512
Puyan Lotfi [Fri, 30 Aug 2019 19:54:46 +0000 (19:54 +0000)]
[IFS][NFC] llvm-ifs: Fixing build errors for bots using GCC.
gcc produces the error:
error: specialization of
‘template<class T, class Enable> struct llvm::yaml::ScalarTraits’ in
different namespace
For all specializations outside of llvm::yaml. So I added llvm::yaml to these
specializations to fix the errors on the bots building with gcc (/usr/bin/c++).
llvm-svn: 370510
Sam Clegg [Fri, 30 Aug 2019 19:50:59 +0000 (19:50 +0000)]
[lld][WebAssembly] Fix spurious signature mismatch warnings
Summary:
This a follow up on: https://reviews.llvm.org/D62153
Handle the case where there are multiple object files that contain
undefined references to the same function. We only generate a function
variant if the existing symbol is directly called.
See: https://github.com/emscripten-core/emscripten/issues/8995
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67015
llvm-svn: 370509
James Molloy [Fri, 30 Aug 2019 19:50:49 +0000 (19:50 +0000)]
[DFAPacketizer] Allow namespacing of automata per-itinerary
The Hexagon itineraries are cunningly crafted such that functional units between
itineraries do not clash. Because all itineraries are bundled into the same DFA,
a functional unit index clash would cause an incorrect DFA to be generated.
A workaround for this is to ensure all itineraries declare the universe of all
possible functional units, but this isn't ideal for three reasons:
1) We only have a limited number of FUs we can encode in the packetizer, and
using the universe causes us to hit the limit without care.
2) Silent codegen faults are bad, and careful triage of the FU list shouldn't
be required.
3) Smooshing all itineraries into the same automaton allows combinations of
instruction classes that cannot exist, which bloats the table.
A simple solution is to allow "namespacing" packetizers.
Differential Revision: https://reviews.llvm.org/D66940
llvm-svn: 370508
Craig Topper [Fri, 30 Aug 2019 19:42:48 +0000 (19:42 +0000)]
[X86] Regenerate the test cases added in r370506.
Something weird happened with the v2i64/v2f64 test cases which
don't use broadcast. So they should already be hoisted, but
weren't in the version I submitted in r370506. This fixes that.
Not sure if something changed or I screwed up.
llvm-svn: 370507
Craig Topper [Fri, 30 Aug 2019 19:26:06 +0000 (19:26 +0000)]
[X86] Add test caes for opportunities for machine LICM to unfold broadcasted constant pool loads.
MachineLICM is able to unfold loads to move an invariant load out
a loop, but X86 infrastructure currently lacks the ability to do
this when avx512 embedded broadcasting is used.
This test adds examples for the basic float point operations,
add, mul, and, or, and xor.
llvm-svn: 370506
Jinsong Ji [Fri, 30 Aug 2019 19:24:25 +0000 (19:24 +0000)]
[PowerPC][NFC] Avoid checking non-relevant .cfi instructions
Summary:
This is brought up in
https://reviews.llvm.org/D64662?id=209923#inline-599490
CFI information are non-relevant to quite some testcases,
we should get rid of checking them when its unecessary.
This patch avoid generating cfi info in testcases that are not
testing prolog/epilog or exception handling.
Reviewers: kbarton, hfinkel, nemanjai, #powerpc
Reviewed By: hfinkel
Subscribers: MaskRay, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67016
llvm-svn: 370505
Michael Liao [Fri, 30 Aug 2019 19:23:28 +0000 (19:23 +0000)]
Fix compilation warnings. NFC.
llvm-svn: 370504
Raphael Isemann [Fri, 30 Aug 2019 19:19:25 +0000 (19:19 +0000)]
[lldb][NFC] More tests for invalid register command invocations
llvm-svn: 370503
Eric Fiselier [Fri, 30 Aug 2019 19:01:03 +0000 (19:01 +0000)]
Make `vector` unconditionally move elements when exceptions are disabled.
Summary:
`std::vector<T>` is free choose between using copy or move operations when it needs to resize. The standard only candidates that the correct exception safety guarantees are provided. When exceptions are disabled these guarantees are trivially satisfied. Meaning vector is free to optimize it's implementation by moving instead of copying.
This patch makes `std::vector` unconditionally move elements when exceptions are disabled.
This optimization is conforming according to the current standard wording.
There are concerns that moving in `-fno-noexceptions`mode will be a surprise to users. For example, a user may be surprised to find their code is slower with exceptions enabled than it is disabled. I'm sympathetic to this surprised, but I don't think it should block this optimization.
Reviewers: mclow.lists, ldionne, rsmith
Reviewed By: ldionne
Subscribers: zoecarver, christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D62228
llvm-svn: 370502
Nico Weber [Fri, 30 Aug 2019 18:55:11 +0000 (18:55 +0000)]
gn build: Merge r370500
llvm-svn: 370501
James Molloy [Fri, 30 Aug 2019 18:49:50 +0000 (18:49 +0000)]
[MachinePipeliner] Separate schedule emission, NFC
This is the first stage in refactoring the pipeliner and making it more
accessible for backends to override and control. This separates the logic and
state required to *emit* a scheudule from the logic that *computes* and
validates a schedule.
This will enable (a) new schedule emitters and (b) new modulo scheduling
implementations to coexist.
NFC.
Differential Revision: https://reviews.llvm.org/D67006
llvm-svn: 370500
Puyan Lotfi [Fri, 30 Aug 2019 18:26:05 +0000 (18:26 +0000)]
[llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool.
This tool merges interface stub files to produce a merged interface stub file
or a stub library. Currently it for stub library generation it can produce an
ELF .so stub file, or a TBD file (experimental). It will be used by the clang
-emit-interface-stubs compilation pipeline to merge and assemble the per-CU
stub files into a stub library.
The new IFS format is as follows:
--- !experimental-ifs-v1
IfsVersion: 1.0
Triple: <llvm triple>
ObjectFileFormat: <ELF | TBD>
Symbols:
_ZSymbolName: { Type: <type>, etc... }
...
Differential Revision: https://reviews.llvm.org/D66405
llvm-svn: 370499
Simon Pilgrim [Fri, 30 Aug 2019 18:19:02 +0000 (18:19 +0000)]
[DAGCombine] ReduceLoadWidth - remove duplicate SDLoc. NFCI.
SDLoc(N0) and SDLoc(cast<LoadSDNode>(N0)) should be equivalent.
llvm-svn: 370498
Simon Pilgrim [Fri, 30 Aug 2019 17:58:55 +0000 (17:58 +0000)]
[TargetLowering] SimplifyDemandedBits ADD/SUB/MUL - correctly inherit SDNodeFlags from the original node.
Just disable NSW/NUW flags. This matches what we're already doing for the other situations for these nodes, it was just missed for the demanded constant case.
Noticed by inspection - confirmed in offline discussion with @spatel. I've checked we have test coverage in the x86 extract-bits.ll and extract-lowbits.ll tests
llvm-svn: 370497
Matt Arsenault [Fri, 30 Aug 2019 17:41:58 +0000 (17:41 +0000)]
GlobalISel: Fix missing pass dependency
llvm-svn: 370496
Craig Topper [Fri, 30 Aug 2019 17:35:08 +0000 (17:35 +0000)]
[X86] Pass v32i16/v64i8 in zmm registers on KNL target.
gcc and icc pass these types in zmm registers in zmm registers.
This patch implements a quick hack to override the register
type before calling convention handling to one that is legal.
Longer term we might want to do something similar to 256-bit
integer registers on AVX1 where we just split all the operations.
Fixes PR42957
Differential Revision: https://reviews.llvm.org/D66708
llvm-svn: 370495
Craig Topper [Fri, 30 Aug 2019 17:34:29 +0000 (17:34 +0000)]
[ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName
Missed these when I hadded the enum entries
llvm-svn: 370494
Alex Lorenz [Fri, 30 Aug 2019 17:34:22 +0000 (17:34 +0000)]
[clang-scan-deps] NFC, remove outdated implementation comment
There's no need to purge symlinked entries in the FileManager,
as the new FileEntryRef API allows us to compute dependencies more
accurately when the FileManager is reused.
llvm-svn: 370493
Nico Weber [Fri, 30 Aug 2019 17:30:08 +0000 (17:30 +0000)]
gn build: Merge r370490
llvm-svn: 370492
Martin Storsjo [Fri, 30 Aug 2019 17:26:54 +0000 (17:26 +0000)]
[LLD] [COFF] Add a missing REQUIRES line to a recently added test. NFC.
This should fix failing buildbots like
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/7180.
llvm-svn: 370491
Evgeniy Stepanov [Fri, 30 Aug 2019 17:23:02 +0000 (17:23 +0000)]
MemTag: unchecked load/store optimization.
Summary:
MTE allows memory access to bypass tag check iff the address argument
is [SP, #imm]. This change takes advantage of this to demote uses of
tagged addresses to regular FrameIndex operands, reducing register
pressure in large functions.
MO_TAGGED target flag is used to signal that the FrameIndex operand
refers to memory that might be tagged, and needs to be handled with
care. Such operand must be lowered to [SP, #imm] directly, without a
scratch register.
The transformation pass attempts to predict when the offset will be
out of range and disable the optimization.
AArch64RegisterInfo::eliminateFrameIndex has an escape hatch in case
this prediction has been wrong, but it is quite inefficient and should
be avoided.
Reviewers: pcc, vitalybuka, ostannard
Subscribers: mgorny, javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66457
llvm-svn: 370490
Simon Pilgrim [Fri, 30 Aug 2019 17:21:20 +0000 (17:21 +0000)]
[DAGCombine] visitVSELECT - remove equivalent getValueType() call. NFCI.
llvm-svn: 370489
Duncan P. N. Exon Smith [Fri, 30 Aug 2019 16:56:26 +0000 (16:56 +0000)]
FileManager: Remove ShouldCloseOpenFile argument from getBufferForFile, NFC
Remove this dead code. We always close it.
llvm-svn: 370488
Bob Haarman [Fri, 30 Aug 2019 16:50:10 +0000 (16:50 +0000)]
[lld-link] implement -start-lib and -end-lib
Summary:
This implements -start-lib and -end-lib flags for lld-link, analogous
to the similarly named options in ld.lld. Object files after
-start-lib are included in the link only when needed to resolve
undefined symbols. The -end-lib flag goes back to the normal behavior
of always including object files in the link. This mimics the
semantics of static libraries, but without needing to actually create
the archive file.
Reviewers: ruiu, smeenai, MaskRay
Reviewed By: ruiu, MaskRay
Subscribers: akhuang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66848
llvm-svn: 370487
Whitney Tsang [Fri, 30 Aug 2019 16:41:35 +0000 (16:41 +0000)]
[INSTRUCTIONS] Add support of const for getLoadStorePointerOperand() and
getLoadStorePointerOperand().
Reviewer: hsaito, sebpop, reames, hfinkel, mkuper, bogner, haicheng,
arsenm, lattner, chandlerc, grosser, rengolin
Reviewed By: reames
Subscribers: wdng, llvm-commits, bmahjour
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66595
llvm-svn: 370486
Johannes Doerfert [Fri, 30 Aug 2019 16:35:10 +0000 (16:35 +0000)]
[Attributor] Fix: do not pretend to preserve the CFG
llvm-svn: 370485
Craig Topper [Fri, 30 Aug 2019 16:05:57 +0000 (16:05 +0000)]
[X86] Merge X86InstrInfo::loadRegFromAddr/storeRegToAddr into their only call site.
I'm looking at unfolding broadcast loads on AVX512 which will
require refactoring this code to select broadcast opcodes instead
of regular load/stores in some cases. Merging them to avoid
further complicating their interfaces.
llvm-svn: 370484
Jonas Devlieghere [Fri, 30 Aug 2019 15:56:14 +0000 (15:56 +0000)]
[lit] Fix my earlier bogus fix to not set DYLD_LIBRARY_PATH with Asan.
My follow-up commit to mess with DYLD_LIBRARY_PATH was bogus for two
reasons:
- The condition was inverted.
- We were checking the OS's environment, instead of the config's.
Two wrongs don't make a right, but the second mistake meant that the
sanitizer bot passed.
llvm-svn: 370483
Johan Vikstrom [Fri, 30 Aug 2019 15:47:27 +0000 (15:47 +0000)]
[clangd] Add highlighting for macro expansions.
Summary: https://github.com/clangd/clangd/issues/134
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66995
llvm-svn: 370482
Nandor Licker [Fri, 30 Aug 2019 15:41:45 +0000 (15:41 +0000)]
Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370476 (git commit
a5590950549719d0d9ea69ed164b0c8c0f4e02e6)
llvm-svn: 370481
Johannes Doerfert [Fri, 30 Aug 2019 15:24:52 +0000 (15:24 +0000)]
[Attributor] Use existing function information for the call site
Summary:
Instead of recomputing information for call sites we now use the
function information directly. This is always valid and once we have
call site specific information we can improve here.
This patch also bootstraps attributes that are created on-demand through
an initial update call. Information that is known will then directly be
available in the new attribute without causing an iteration delay.
The tests show how this improves the iteration count.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66781
llvm-svn: 370480
Johannes Doerfert [Fri, 30 Aug 2019 15:22:28 +0000 (15:22 +0000)]
[Attributor] Manifest load/store alignment generally
Summary:
Any pointer could have load/store users not only floating ones so we
move the manifest logic for alignment into the AAAlignImpl class.
Reviewers: uenoku, sstefan1
Subscribers: hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66922
llvm-svn: 370479
Simon Pilgrim [Fri, 30 Aug 2019 15:17:37 +0000 (15:17 +0000)]
[DAGCombine] visitVSELECT - remove duplicate getOperand calls. NFCI.
llvm-svn: 370478
Nandor Licker [Fri, 30 Aug 2019 15:02:09 +0000 (15:02 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.
Reviewers: Bigcheese, jfb, rsmith
Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64146
llvm-svn: 370476
Piotr Sobczak [Fri, 30 Aug 2019 14:20:04 +0000 (14:20 +0000)]
[InstCombine][AMDGPU] Simplify tbuffer loads
Summary: Add missing tbuffer loads intrinsics in SimplifyDemandedVectorElts.
Reviewers: arsenm, nhaehnle
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66926
llvm-svn: 370475
Sid Manning [Fri, 30 Aug 2019 14:12:04 +0000 (14:12 +0000)]
[llvm-nm] Small fix to Exected<StringRef>
Differential Revision: https://reviews.llvm.org/D66976
llvm-svn: 370474
Johan Vikstrom [Fri, 30 Aug 2019 14:07:05 +0000 (14:07 +0000)]
[clangd] Added highlighting for structured bindings.
Summary: Structured bindings are in a BindingDecl. The decl the declRefExpr points to are the BindingDecls. So this adds an additional if statement in the addToken function to highlight them.
Reviewers: hokein, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66738
llvm-svn: 370473
George Rimar [Fri, 30 Aug 2019 13:39:22 +0000 (13:39 +0000)]
[yaml2obj][obj2yaml] - Use a single "Other" field instead of "Other", "Visibility" and "StOther".
Currenly we can encode the 'st_other' field of symbol using 3 fields.
'Visibility' is used to encode STV_* values.
'Other' is used to encode everything except the visibility, but it can't handle arbitrary values.
'StOther' is used to encode arbitrary values when 'Visibility'/'Other' are not helpfull enough.
'st_other' field is used to encode symbol visibility and platform-dependent
flags and values. Problem to encode it is that it consists of Visibility part (STV_* values)
which are enumeration values and the Other part, which is different and inconsistent.
For MIPS the Other part contains flags for all STO_MIPS_* values except STO_MIPS_MIPS16.
(Like comment in ELFDumper says: "Someones in their infinite wisdom decided to make
STO_MIPS_MIPS16 flag overlapped with other ST_MIPS_xxx flags."...)
And for PPC64 the Other part might actually encode any value.
This patch implements custom logic for handling the st_other and removes
'Visibility' and 'StOther' fields.
Here is an example of a new YAML style this patch allows:
- Name: foo
Other: [ 0x4 ]
- Name: bar
Other: [ STV_PROTECTED, 4 ]
- Name: zed
Other: [ STV_PROTECTED, STO_MIPS_OPTIONAL, 0xf8 ]
Differential revision: https://reviews.llvm.org/D66886
llvm-svn: 370472
Simon Pilgrim [Fri, 30 Aug 2019 13:30:37 +0000 (13:30 +0000)]
[DAGCombine] visitVSELECT - use getShiftAmountTy for shift amounts.
llvm-svn: 370471
Simon Pilgrim [Fri, 30 Aug 2019 12:22:06 +0000 (12:22 +0000)]
[DAGCombine] visitMULHS - use getScalarValueSizeInBits() to make safe for vector types.
This is hidden behind a (scalar-only) isOneConstant(N1) check at the moment, but once we get around to adding vector support we need to ensure we're dealing with the scalar bitwidth, not the total.
llvm-svn: 370468
Simon Atanasyan [Fri, 30 Aug 2019 12:15:12 +0000 (12:15 +0000)]
[mips] Merge common checkings under the same check prefix. NFC
llvm-svn: 370467
Luis Marques [Fri, 30 Aug 2019 12:11:47 +0000 (12:11 +0000)]
[RISCV] Fix a couple of tests' CHECKs
llvm-svn: 370466
Haojian Wu [Fri, 30 Aug 2019 12:09:31 +0000 (12:09 +0000)]
Remove an extra ";", NFC.
llvm-svn: 370465
Amaury Sechet [Fri, 30 Aug 2019 11:35:28 +0000 (11:35 +0000)]
[X86] Add tests for rotate matching. NFC
llvm-svn: 370464
Bjorn Pettersson [Fri, 30 Aug 2019 11:23:10 +0000 (11:23 +0000)]
[CodeGen] Introduce MachineBasicBlock::replacePhiUsesWith helper and use it. NFC
Summary:
Found a couple of places in the code where all the PHI nodes
of a MBB is updated, replacing references to one MBB by
reference to another MBB instead.
This patch simply refactors the code to use a common helper
(MachineBasicBlock::replacePhiUsesWith) for such PHI node
updates.
Reviewers: t.p.northover, arsenm, uabelho
Subscribers: wdng, hiraditya, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66750
llvm-svn: 370463
Pavel Labath [Fri, 30 Aug 2019 11:02:58 +0000 (11:02 +0000)]
[dotest] Finish removing -q
One usage of this option remained, and caused dotest to error out if one
happened to pass the -v flag.
llvm-svn: 370462
Gabor Marton [Fri, 30 Aug 2019 10:55:41 +0000 (10:55 +0000)]
[ASTImporter] Do not look up lambda classes
Summary:
Consider this code:
```
void f() {
auto L0 = [](){};
auto L1 = [](){};
}
```
First we import `L0` then `L1`. Currently we end up having only one
CXXRecordDecl for the two different lambdas. And that is a problem if
the body of their op() is different. This happens because when we import
`L1` then lookup finds the existing `L0` and since they are structurally
equivalent we just map the imported L0 to be the counterpart of L1.
We have the same problem in this case:
```
template <typename F0, typename F1>
void f(F0 L0 = [](){}, F1 L1 = [](){}) {}
```
In StructuralEquivalenceContext we could distinquish lambdas only by
their source location in these cases. But we the lambdas are actually
structrually equivalent they differn only by the source location.
Thus, the solution is to disable lookup completely if the decl in
the "from" context is a lambda.
However, that could have other problems: what if the lambda is defined
in a header file and included in several TUs? I think we'd have as many
duplicates as many includes we have. I think we could live with that,
because the lambda classes are TU local anyway, we cannot just access
them from another TU.
Reviewers: a_sidorin, a.sidorin, shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66348
llvm-svn: 370461
Simon Pilgrim [Fri, 30 Aug 2019 10:42:14 +0000 (10:42 +0000)]
[DAGCombine] visitMULHS/visitMULHU - isBuildVectorAllZeros doesn't mean node is all zeros
Return a proper zero vector, just in case some elements are undef.
Noticed by inspection after dealing with a similar issue in PR43159.
llvm-svn: 370460
Simon Pilgrim [Fri, 30 Aug 2019 10:25:52 +0000 (10:25 +0000)]
Fix Wdocumentation warning. NFCI.
llvm-svn: 370459
Chris Jackson [Fri, 30 Aug 2019 10:17:16 +0000 (10:17 +0000)]
[llvm-objcopy] Allow the visibility of symbols created by --binary and
--add-symbol to be specified with --new-symbol-visibility
llvm-svn: 370458
Balazs Keri [Fri, 30 Aug 2019 10:12:14 +0000 (10:12 +0000)]
[ASTImporter] Propagate errors during import of overridden methods.
Summary:
If importing overridden methods fails for a method it can be seen
incorrectly as non-virtual. To avoid this inconsistency the method
is marked with import error to avoid later use of it.
Reviewers: martong, a.sidorin, shafik, a_sidorin
Reviewed By: martong, shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66933
llvm-svn: 370457
Hideto Ueno [Fri, 30 Aug 2019 10:00:32 +0000 (10:00 +0000)]
[Attributor] Implement AANoAliasCallSiteArgument initialization
Summary: This patch adds an appropriate `initialize` method for `AANoAliasCallSiteArgument`.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66927
llvm-svn: 370456